update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
20
electron/node_modules/@electron/asar/LICENSE.md
generated
vendored
Normal file
20
electron/node_modules/@electron/asar/LICENSE.md
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
Copyright (c) 2014 GitHub Inc.
|
||||
|
||||
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.
|
||||
208
electron/node_modules/@electron/asar/README.md
generated
vendored
Normal file
208
electron/node_modules/@electron/asar/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
# @electron/asar - Electron Archive
|
||||
|
||||
[](https://github.com/electron/asar/actions/workflows/test.yml)
|
||||
[](https://npmjs.org/package/@electron/asar)
|
||||
|
||||
Asar is a simple extensive archive format, it works like `tar` that concatenates
|
||||
all files together without compression, while having random access support.
|
||||
|
||||
## Features
|
||||
|
||||
* Support random access
|
||||
* Use JSON to store files' information
|
||||
* Very easy to write a parser
|
||||
|
||||
## Command line utility
|
||||
|
||||
### Install
|
||||
|
||||
This module requires Node 10 or later.
|
||||
|
||||
```bash
|
||||
$ npm install --engine-strict @electron/asar
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
$ asar --help
|
||||
|
||||
Usage: asar [options] [command]
|
||||
|
||||
Commands:
|
||||
|
||||
pack|p <dir> <output>
|
||||
create asar archive
|
||||
|
||||
list|l <archive>
|
||||
list files of asar archive
|
||||
|
||||
extract-file|ef <archive> <filename>
|
||||
extract one file from archive
|
||||
|
||||
extract|e <archive> <dest>
|
||||
extract archive
|
||||
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-V, --version output the version number
|
||||
|
||||
```
|
||||
|
||||
#### Excluding multiple resources from being packed
|
||||
|
||||
Given:
|
||||
```
|
||||
app
|
||||
(a) ├── x1
|
||||
(b) ├── x2
|
||||
(c) ├── y3
|
||||
(d) │ ├── x1
|
||||
(e) │ └── z1
|
||||
(f) │ └── x2
|
||||
(g) └── z4
|
||||
(h) └── w1
|
||||
```
|
||||
|
||||
Exclude: a, b
|
||||
```bash
|
||||
$ asar pack app app.asar --unpack-dir "{x1,x2}"
|
||||
```
|
||||
|
||||
Exclude: a, b, d, f
|
||||
```bash
|
||||
$ asar pack app app.asar --unpack-dir "**/{x1,x2}"
|
||||
```
|
||||
|
||||
Exclude: a, b, d, f, h
|
||||
```bash
|
||||
$ asar pack app app.asar --unpack-dir "{**/x1,**/x2,z4/w1}"
|
||||
```
|
||||
|
||||
## Using programmatically
|
||||
|
||||
### Example
|
||||
|
||||
```javascript
|
||||
const asar = require('@electron/asar');
|
||||
|
||||
const src = 'some/path/';
|
||||
const dest = 'name.asar';
|
||||
|
||||
await asar.createPackage(src, dest);
|
||||
console.log('done.');
|
||||
```
|
||||
|
||||
Please note that there is currently **no** error handling provided!
|
||||
|
||||
### Transform
|
||||
You can pass in a `transform` option, that is a function, which either returns
|
||||
nothing, or a `stream.Transform`. The latter will be used on files that will be
|
||||
in the `.asar` file to transform them (e.g. compress).
|
||||
|
||||
```javascript
|
||||
const asar = require('@electron/asar');
|
||||
|
||||
const src = 'some/path/';
|
||||
const dest = 'name.asar';
|
||||
|
||||
function transform (filename) {
|
||||
return new CustomTransformStream()
|
||||
}
|
||||
|
||||
await asar.createPackageWithOptions(src, dest, { transform: transform });
|
||||
console.log('done.');
|
||||
```
|
||||
|
||||
## Format
|
||||
|
||||
Asar uses [Pickle][pickle] to safely serialize binary value to file.
|
||||
|
||||
The format of asar is very flat:
|
||||
|
||||
```
|
||||
| UInt32: header_size | String: header | Bytes: file1 | ... | Bytes: file42 |
|
||||
```
|
||||
|
||||
The `header_size` and `header` are serialized with [Pickle][pickle] class, and
|
||||
`header_size`'s [Pickle][pickle] object is 8 bytes.
|
||||
|
||||
The `header` is a JSON string, and the `header_size` is the size of `header`'s
|
||||
`Pickle` object.
|
||||
|
||||
Structure of `header` is something like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"files": {
|
||||
"tmp": {
|
||||
"files": {}
|
||||
},
|
||||
"usr" : {
|
||||
"files": {
|
||||
"bin": {
|
||||
"files": {
|
||||
"ls": {
|
||||
"offset": "0",
|
||||
"size": 100,
|
||||
"executable": true,
|
||||
"integrity": {
|
||||
"algorithm": "SHA256",
|
||||
"hash": "...",
|
||||
"blockSize": 1024,
|
||||
"blocks": ["...", "..."]
|
||||
}
|
||||
},
|
||||
"cd": {
|
||||
"offset": "100",
|
||||
"size": 100,
|
||||
"executable": true,
|
||||
"integrity": {
|
||||
"algorithm": "SHA256",
|
||||
"hash": "...",
|
||||
"blockSize": 1024,
|
||||
"blocks": ["...", "..."]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"etc": {
|
||||
"files": {
|
||||
"hosts": {
|
||||
"offset": "200",
|
||||
"size": 32,
|
||||
"integrity": {
|
||||
"algorithm": "SHA256",
|
||||
"hash": "...",
|
||||
"blockSize": 1024,
|
||||
"blocks": ["...", "..."]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`offset` and `size` records the information to read the file from archive, the
|
||||
`offset` starts from 0 so you have to manually add the size of `header_size` and
|
||||
`header` to the `offset` to get the real offset of the file.
|
||||
|
||||
`offset` is a UINT64 number represented in string, because there is no way to
|
||||
precisely represent UINT64 in JavaScript `Number`. `size` is a JavaScript
|
||||
`Number` that is no larger than `Number.MAX_SAFE_INTEGER`, which has a value of
|
||||
`9007199254740991` and is about 8PB in size. We didn't store `size` in UINT64
|
||||
because file size in Node.js is represented as `Number` and it is not safe to
|
||||
convert `Number` to UINT64.
|
||||
|
||||
`integrity` is an object consisting of a few keys:
|
||||
* A hashing `algorithm`, currently only `SHA256` is supported.
|
||||
* A hex encoded `hash` value representing the hash of the entire file.
|
||||
* An array of hex encoded hashes for the `blocks` of the file. i.e. for a blockSize of 4KB this array contains the hash of every block if you split the file into N 4KB blocks.
|
||||
* A integer value `blockSize` representing the size in bytes of each block in the `blocks` hashes above
|
||||
|
||||
[pickle]: https://chromium.googlesource.com/chromium/src/+/main/base/pickle.h
|
||||
82
electron/node_modules/@electron/asar/bin/asar.js
generated
vendored
Executable file
82
electron/node_modules/@electron/asar/bin/asar.js
generated
vendored
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var packageJSON = require('../package.json')
|
||||
var splitVersion = function (version) { return version.split('.').map(function (part) { return Number(part) }) }
|
||||
var requiredNodeVersion = splitVersion(packageJSON.engines.node.slice(2))
|
||||
var actualNodeVersion = splitVersion(process.versions.node)
|
||||
|
||||
if (actualNodeVersion[0] < requiredNodeVersion[0] || (actualNodeVersion[0] === requiredNodeVersion[0] && actualNodeVersion[1] < requiredNodeVersion[1])) {
|
||||
console.error('CANNOT RUN WITH NODE ' + process.versions.node)
|
||||
console.error('asar requires Node ' + packageJSON.engines.node + '.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// Not consts so that this file can load in Node < 4.0
|
||||
var asar = require('../lib/asar')
|
||||
var program = require('commander')
|
||||
|
||||
program.version('v' + packageJSON.version)
|
||||
.description('Manipulate asar archive files')
|
||||
|
||||
program.command('pack <dir> <output>')
|
||||
.alias('p')
|
||||
.description('create asar archive')
|
||||
.option('--ordering <file path>', 'path to a text file for ordering contents')
|
||||
.option('--unpack <expression>', 'do not pack files matching glob <expression>')
|
||||
.option('--unpack-dir <expression>', 'do not pack dirs matching glob <expression> or starting with literal <expression>')
|
||||
.option('--exclude-hidden', 'exclude hidden files')
|
||||
.action(function (dir, output, options) {
|
||||
options = {
|
||||
unpack: options.unpack,
|
||||
unpackDir: options.unpackDir,
|
||||
ordering: options.ordering,
|
||||
version: options.sv,
|
||||
arch: options.sa,
|
||||
builddir: options.sb,
|
||||
dot: !options.excludeHidden
|
||||
}
|
||||
asar.createPackageWithOptions(dir, output, options).catch(error => {
|
||||
console.error(error)
|
||||
process.exit(1)
|
||||
})
|
||||
})
|
||||
|
||||
program.command('list <archive>')
|
||||
.alias('l')
|
||||
.description('list files of asar archive')
|
||||
.option('-i, --is-pack', 'each file in the asar is pack or unpack')
|
||||
.action(function (archive, options) {
|
||||
options = {
|
||||
isPack: options.isPack
|
||||
}
|
||||
var files = asar.listPackage(archive, options)
|
||||
for (var i in files) {
|
||||
console.log(files[i])
|
||||
}
|
||||
})
|
||||
|
||||
program.command('extract-file <archive> <filename>')
|
||||
.alias('ef')
|
||||
.description('extract one file from archive')
|
||||
.action(function (archive, filename) {
|
||||
require('fs').writeFileSync(require('path').basename(filename),
|
||||
asar.extractFile(archive, filename))
|
||||
})
|
||||
|
||||
program.command('extract <archive> <dest>')
|
||||
.alias('e')
|
||||
.description('extract archive')
|
||||
.action(function (archive, dest) {
|
||||
asar.extractAll(archive, dest)
|
||||
})
|
||||
|
||||
program.command('*')
|
||||
.action(function (_cmd, args) {
|
||||
console.log('asar: \'%s\' is not an asar command. See \'asar --help\'.', args[0])
|
||||
})
|
||||
|
||||
program.parse(process.argv)
|
||||
|
||||
if (program.args.length === 0) {
|
||||
program.help()
|
||||
}
|
||||
96
electron/node_modules/@electron/asar/lib/asar.d.ts
generated
vendored
Normal file
96
electron/node_modules/@electron/asar/lib/asar.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
import { FilesystemDirectoryEntry, FilesystemEntry, FilesystemLinkEntry } from './filesystem';
|
||||
import * as disk from './disk';
|
||||
import { CrawledFileType } from './crawlfs';
|
||||
import { IOptions } from './types/glob';
|
||||
export declare function createPackage(src: string, dest: string): Promise<NodeJS.WritableStream>;
|
||||
export type CreateOptions = {
|
||||
dot?: boolean;
|
||||
globOptions?: IOptions;
|
||||
/**
|
||||
* Path to a file containing the list of relative filepaths relative to `src` and the specific order they should be inserted into the asar.
|
||||
* Formats allowed below:
|
||||
* filepath
|
||||
* : filepath
|
||||
* <anything>:filepath
|
||||
*/
|
||||
ordering?: string;
|
||||
pattern?: string;
|
||||
transform?: (filePath: string) => NodeJS.ReadWriteStream | void;
|
||||
unpack?: string;
|
||||
unpackDir?: string;
|
||||
};
|
||||
export declare function createPackageWithOptions(src: string, dest: string, options: CreateOptions): Promise<NodeJS.WritableStream>;
|
||||
/**
|
||||
* Create an ASAR archive from a list of filenames.
|
||||
*
|
||||
* @param src - Base path. All files are relative to this.
|
||||
* @param dest - Archive filename (& path).
|
||||
* @param filenames - List of filenames relative to src.
|
||||
* @param [metadata] - Object with filenames as keys and {type='directory|file|link', stat: fs.stat} as values. (Optional)
|
||||
* @param [options] - Options passed to `createPackageWithOptions`.
|
||||
*/
|
||||
export declare function createPackageFromFiles(src: string, dest: string, filenames: string[], metadata?: disk.InputMetadata, options?: CreateOptions): Promise<NodeJS.WritableStream>;
|
||||
export type AsarStream = {
|
||||
/**
|
||||
Relative path to the file or directory from within the archive
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
Function that returns a read stream for a file.
|
||||
Note: this is called multiple times per "file", so a new NodeJS.ReadableStream needs to be created each time
|
||||
*/
|
||||
streamGenerator: () => NodeJS.ReadableStream;
|
||||
/**
|
||||
Whether the file/link should be unpacked
|
||||
*/
|
||||
unpacked: boolean;
|
||||
stat: CrawledFileType['stat'];
|
||||
};
|
||||
export type AsarDirectory = Pick<AsarStream, 'path' | 'unpacked'> & {
|
||||
type: 'directory';
|
||||
};
|
||||
export type AsarSymlinkStream = AsarStream & {
|
||||
type: 'link';
|
||||
symlink: string;
|
||||
};
|
||||
export type AsarFileStream = AsarStream & {
|
||||
type: 'file';
|
||||
};
|
||||
export type AsarStreamType = AsarDirectory | AsarFileStream | AsarSymlinkStream;
|
||||
/**
|
||||
* Create an ASAR archive from a list of streams.
|
||||
*
|
||||
* @param dest - Archive filename (& path).
|
||||
* @param streams - List of streams to be piped in-memory into asar filesystem. Insertion order is preserved.
|
||||
*/
|
||||
export declare function createPackageFromStreams(dest: string, streams: AsarStreamType[]): Promise<import("fs").WriteStream>;
|
||||
export declare function statFile(archivePath: string, filename: string, followLinks?: boolean): FilesystemEntry;
|
||||
export declare function getRawHeader(archivePath: string): disk.ArchiveHeader;
|
||||
export interface ListOptions {
|
||||
isPack: boolean;
|
||||
}
|
||||
export declare function listPackage(archivePath: string, options: ListOptions): string[];
|
||||
export declare function extractFile(archivePath: string, filename: string, followLinks?: boolean): Buffer;
|
||||
export declare function extractAll(archivePath: string, dest: string): void;
|
||||
export declare function uncache(archivePath: string): boolean;
|
||||
export declare function uncacheAll(): void;
|
||||
export { EntryMetadata } from './filesystem';
|
||||
export { InputMetadata, DirectoryRecord, FileRecord, ArchiveHeader } from './disk';
|
||||
export type InputMetadataType = 'directory' | 'file' | 'link';
|
||||
export type DirectoryMetadata = FilesystemDirectoryEntry;
|
||||
export type FileMetadata = FilesystemEntry;
|
||||
export type LinkMetadata = FilesystemLinkEntry;
|
||||
declare const _default: {
|
||||
createPackage: typeof createPackage;
|
||||
createPackageWithOptions: typeof createPackageWithOptions;
|
||||
createPackageFromFiles: typeof createPackageFromFiles;
|
||||
createPackageFromStreams: typeof createPackageFromStreams;
|
||||
statFile: typeof statFile;
|
||||
getRawHeader: typeof getRawHeader;
|
||||
listPackage: typeof listPackage;
|
||||
extractFile: typeof extractFile;
|
||||
extractAll: typeof extractAll;
|
||||
uncache: typeof uncache;
|
||||
uncacheAll: typeof uncacheAll;
|
||||
};
|
||||
export default _default;
|
||||
337
electron/node_modules/@electron/asar/lib/asar.js
generated
vendored
Normal file
337
electron/node_modules/@electron/asar/lib/asar.js
generated
vendored
Normal file
|
|
@ -0,0 +1,337 @@
|
|||
"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;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createPackage = createPackage;
|
||||
exports.createPackageWithOptions = createPackageWithOptions;
|
||||
exports.createPackageFromFiles = createPackageFromFiles;
|
||||
exports.createPackageFromStreams = createPackageFromStreams;
|
||||
exports.statFile = statFile;
|
||||
exports.getRawHeader = getRawHeader;
|
||||
exports.listPackage = listPackage;
|
||||
exports.extractFile = extractFile;
|
||||
exports.extractAll = extractAll;
|
||||
exports.uncache = uncache;
|
||||
exports.uncacheAll = uncacheAll;
|
||||
const path = __importStar(require("path"));
|
||||
const minimatch_1 = __importDefault(require("minimatch"));
|
||||
const wrapped_fs_1 = __importDefault(require("./wrapped-fs"));
|
||||
const filesystem_1 = require("./filesystem");
|
||||
const disk = __importStar(require("./disk"));
|
||||
const crawlfs_1 = require("./crawlfs");
|
||||
/**
|
||||
* Whether a directory should be excluded from packing due to the `--unpack-dir" option.
|
||||
*
|
||||
* @param dirPath - directory path to check
|
||||
* @param pattern - literal prefix [for backward compatibility] or glob pattern
|
||||
* @param unpackDirs - Array of directory paths previously marked as unpacked
|
||||
*/
|
||||
function isUnpackedDir(dirPath, pattern, unpackDirs) {
|
||||
if (dirPath.startsWith(pattern) || (0, minimatch_1.default)(dirPath, pattern)) {
|
||||
if (!unpackDirs.includes(dirPath)) {
|
||||
unpackDirs.push(dirPath);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return unpackDirs.some((unpackDir) => dirPath.startsWith(unpackDir) && !path.relative(unpackDir, dirPath).startsWith('..'));
|
||||
}
|
||||
}
|
||||
async function createPackage(src, dest) {
|
||||
return createPackageWithOptions(src, dest, {});
|
||||
}
|
||||
async function createPackageWithOptions(src, dest, options) {
|
||||
const globOptions = options.globOptions ? options.globOptions : {};
|
||||
globOptions.dot = options.dot === undefined ? true : options.dot;
|
||||
const pattern = src + (options.pattern ? options.pattern : '/**/*');
|
||||
const [filenames, metadata] = await (0, crawlfs_1.crawl)(pattern, globOptions);
|
||||
return createPackageFromFiles(src, dest, filenames, metadata, options);
|
||||
}
|
||||
/**
|
||||
* Create an ASAR archive from a list of filenames.
|
||||
*
|
||||
* @param src - Base path. All files are relative to this.
|
||||
* @param dest - Archive filename (& path).
|
||||
* @param filenames - List of filenames relative to src.
|
||||
* @param [metadata] - Object with filenames as keys and {type='directory|file|link', stat: fs.stat} as values. (Optional)
|
||||
* @param [options] - Options passed to `createPackageWithOptions`.
|
||||
*/
|
||||
async function createPackageFromFiles(src, dest, filenames, metadata = {}, options = {}) {
|
||||
src = path.normalize(src);
|
||||
dest = path.normalize(dest);
|
||||
filenames = filenames.map(function (filename) {
|
||||
return path.normalize(filename);
|
||||
});
|
||||
const filesystem = new filesystem_1.Filesystem(src);
|
||||
const files = [];
|
||||
const links = [];
|
||||
const unpackDirs = [];
|
||||
let filenamesSorted = [];
|
||||
if (options.ordering) {
|
||||
const orderingFiles = (await wrapped_fs_1.default.readFile(options.ordering))
|
||||
.toString()
|
||||
.split('\n')
|
||||
.map((line) => {
|
||||
if (line.includes(':')) {
|
||||
line = line.split(':').pop();
|
||||
}
|
||||
line = line.trim();
|
||||
if (line.startsWith('/')) {
|
||||
line = line.slice(1);
|
||||
}
|
||||
return line;
|
||||
});
|
||||
const ordering = [];
|
||||
for (const file of orderingFiles) {
|
||||
const pathComponents = file.split(path.sep);
|
||||
let str = src;
|
||||
for (const pathComponent of pathComponents) {
|
||||
str = path.join(str, pathComponent);
|
||||
ordering.push(str);
|
||||
}
|
||||
}
|
||||
let missing = 0;
|
||||
const total = filenames.length;
|
||||
for (const file of ordering) {
|
||||
if (!filenamesSorted.includes(file) && filenames.includes(file)) {
|
||||
filenamesSorted.push(file);
|
||||
}
|
||||
}
|
||||
for (const file of filenames) {
|
||||
if (!filenamesSorted.includes(file)) {
|
||||
filenamesSorted.push(file);
|
||||
missing += 1;
|
||||
}
|
||||
}
|
||||
console.log(`Ordering file has ${((total - missing) / total) * 100}% coverage.`);
|
||||
}
|
||||
else {
|
||||
filenamesSorted = filenames;
|
||||
}
|
||||
const handleFile = async function (filename) {
|
||||
if (!metadata[filename]) {
|
||||
const fileType = await (0, crawlfs_1.determineFileType)(filename);
|
||||
if (!fileType) {
|
||||
throw new Error('Unknown file type for file: ' + filename);
|
||||
}
|
||||
metadata[filename] = fileType;
|
||||
}
|
||||
const file = metadata[filename];
|
||||
const shouldUnpackPath = function (relativePath, unpack, unpackDir) {
|
||||
let shouldUnpack = false;
|
||||
if (unpack) {
|
||||
shouldUnpack = (0, minimatch_1.default)(filename, unpack, { matchBase: true });
|
||||
}
|
||||
if (!shouldUnpack && unpackDir) {
|
||||
shouldUnpack = isUnpackedDir(relativePath, unpackDir, unpackDirs);
|
||||
}
|
||||
return shouldUnpack;
|
||||
};
|
||||
let shouldUnpack;
|
||||
switch (file.type) {
|
||||
case 'directory':
|
||||
shouldUnpack = shouldUnpackPath(path.relative(src, filename), undefined, options.unpackDir);
|
||||
filesystem.insertDirectory(filename, shouldUnpack);
|
||||
break;
|
||||
case 'file':
|
||||
shouldUnpack = shouldUnpackPath(path.relative(src, path.dirname(filename)), options.unpack, options.unpackDir);
|
||||
files.push({ filename, unpack: shouldUnpack });
|
||||
return filesystem.insertFile(filename, () => wrapped_fs_1.default.createReadStream(filename), shouldUnpack, file, options);
|
||||
case 'link':
|
||||
shouldUnpack = shouldUnpackPath(path.relative(src, filename), options.unpack, options.unpackDir);
|
||||
links.push({ filename, unpack: shouldUnpack });
|
||||
filesystem.insertLink(filename, shouldUnpack);
|
||||
break;
|
||||
}
|
||||
return Promise.resolve();
|
||||
};
|
||||
const insertsDone = async function () {
|
||||
await wrapped_fs_1.default.mkdirp(path.dirname(dest));
|
||||
return disk.writeFilesystem(dest, filesystem, { files, links }, metadata);
|
||||
};
|
||||
const names = filenamesSorted.slice();
|
||||
const next = async function (name) {
|
||||
if (!name) {
|
||||
return insertsDone();
|
||||
}
|
||||
await handleFile(name);
|
||||
return next(names.shift());
|
||||
};
|
||||
return next(names.shift());
|
||||
}
|
||||
/**
|
||||
* Create an ASAR archive from a list of streams.
|
||||
*
|
||||
* @param dest - Archive filename (& path).
|
||||
* @param streams - List of streams to be piped in-memory into asar filesystem. Insertion order is preserved.
|
||||
*/
|
||||
async function createPackageFromStreams(dest, streams) {
|
||||
// We use an ambiguous root `src` since we're piping directly from a stream and the `filePath` for the stream is already relative to the src/root
|
||||
const src = '.';
|
||||
const filesystem = new filesystem_1.Filesystem(src);
|
||||
const files = [];
|
||||
const links = [];
|
||||
const handleFile = async function (stream) {
|
||||
const { path: destinationPath, type } = stream;
|
||||
const filename = path.normalize(destinationPath);
|
||||
switch (type) {
|
||||
case 'directory':
|
||||
filesystem.insertDirectory(filename, stream.unpacked);
|
||||
break;
|
||||
case 'file':
|
||||
files.push({
|
||||
filename,
|
||||
streamGenerator: stream.streamGenerator,
|
||||
link: undefined,
|
||||
mode: stream.stat.mode,
|
||||
unpack: stream.unpacked,
|
||||
});
|
||||
return filesystem.insertFile(filename, stream.streamGenerator, stream.unpacked, {
|
||||
type: 'file',
|
||||
stat: stream.stat,
|
||||
});
|
||||
case 'link':
|
||||
links.push({
|
||||
filename,
|
||||
streamGenerator: stream.streamGenerator,
|
||||
link: stream.symlink,
|
||||
mode: stream.stat.mode,
|
||||
unpack: stream.unpacked,
|
||||
});
|
||||
filesystem.insertLink(filename, stream.unpacked, path.dirname(filename), stream.symlink, src);
|
||||
break;
|
||||
}
|
||||
return Promise.resolve();
|
||||
};
|
||||
const insertsDone = async function () {
|
||||
await wrapped_fs_1.default.mkdirp(path.dirname(dest));
|
||||
return disk.streamFilesystem(dest, filesystem, { files, links });
|
||||
};
|
||||
const streamQueue = streams.slice();
|
||||
const next = async function (stream) {
|
||||
if (!stream) {
|
||||
return insertsDone();
|
||||
}
|
||||
await handleFile(stream);
|
||||
return next(streamQueue.shift());
|
||||
};
|
||||
return next(streamQueue.shift());
|
||||
}
|
||||
function statFile(archivePath, filename, followLinks = true) {
|
||||
const filesystem = disk.readFilesystemSync(archivePath);
|
||||
return filesystem.getFile(filename, followLinks);
|
||||
}
|
||||
function getRawHeader(archivePath) {
|
||||
return disk.readArchiveHeaderSync(archivePath);
|
||||
}
|
||||
function listPackage(archivePath, options) {
|
||||
return disk.readFilesystemSync(archivePath).listFiles(options);
|
||||
}
|
||||
function extractFile(archivePath, filename, followLinks = true) {
|
||||
const filesystem = disk.readFilesystemSync(archivePath);
|
||||
const fileInfo = filesystem.getFile(filename, followLinks);
|
||||
if ('link' in fileInfo || 'files' in fileInfo) {
|
||||
throw new Error('Expected to find file at: ' + filename + ' but found a directory or link');
|
||||
}
|
||||
return disk.readFileSync(filesystem, filename, fileInfo);
|
||||
}
|
||||
function extractAll(archivePath, dest) {
|
||||
const filesystem = disk.readFilesystemSync(archivePath);
|
||||
const filenames = filesystem.listFiles();
|
||||
// under windows just extract links as regular files
|
||||
const followLinks = process.platform === 'win32';
|
||||
// create destination directory
|
||||
wrapped_fs_1.default.mkdirpSync(dest);
|
||||
const extractionErrors = [];
|
||||
for (const fullPath of filenames) {
|
||||
// Remove leading slash
|
||||
const filename = fullPath.substr(1);
|
||||
const destFilename = path.join(dest, filename);
|
||||
const file = filesystem.getFile(filename, followLinks);
|
||||
if (path.relative(dest, destFilename).startsWith('..')) {
|
||||
throw new Error(`${fullPath}: file "${destFilename}" writes out of the package`);
|
||||
}
|
||||
if ('files' in file) {
|
||||
// it's a directory, create it and continue with the next entry
|
||||
wrapped_fs_1.default.mkdirpSync(destFilename);
|
||||
}
|
||||
else if ('link' in file) {
|
||||
// it's a symlink, create a symlink
|
||||
const linkSrcPath = path.dirname(path.join(dest, file.link));
|
||||
const linkDestPath = path.dirname(destFilename);
|
||||
const relativePath = path.relative(linkDestPath, linkSrcPath);
|
||||
// try to delete output file, because we can't overwrite a link
|
||||
try {
|
||||
wrapped_fs_1.default.unlinkSync(destFilename);
|
||||
}
|
||||
catch (_a) { }
|
||||
const linkTo = path.join(relativePath, path.basename(file.link));
|
||||
if (path.relative(dest, linkSrcPath).startsWith('..')) {
|
||||
throw new Error(`${fullPath}: file "${file.link}" links out of the package to "${linkSrcPath}"`);
|
||||
}
|
||||
wrapped_fs_1.default.symlinkSync(linkTo, destFilename);
|
||||
}
|
||||
else {
|
||||
// it's a file, try to extract it
|
||||
try {
|
||||
const content = disk.readFileSync(filesystem, filename, file);
|
||||
wrapped_fs_1.default.writeFileSync(destFilename, content);
|
||||
if (file.executable) {
|
||||
wrapped_fs_1.default.chmodSync(destFilename, '755');
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
extractionErrors.push(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (extractionErrors.length) {
|
||||
throw new Error('Unable to extract some files:\n\n' +
|
||||
extractionErrors.map((error) => error.stack).join('\n\n'));
|
||||
}
|
||||
}
|
||||
function uncache(archivePath) {
|
||||
return disk.uncacheFilesystem(archivePath);
|
||||
}
|
||||
function uncacheAll() {
|
||||
disk.uncacheAll();
|
||||
}
|
||||
// Export everything in default, too
|
||||
exports.default = {
|
||||
createPackage,
|
||||
createPackageWithOptions,
|
||||
createPackageFromFiles,
|
||||
createPackageFromStreams,
|
||||
statFile,
|
||||
getRawHeader,
|
||||
listPackage,
|
||||
extractFile,
|
||||
extractAll,
|
||||
uncache,
|
||||
uncacheAll,
|
||||
};
|
||||
//# sourceMappingURL=asar.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/asar.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/asar.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
electron/node_modules/@electron/asar/lib/crawlfs.d.ts
generated
vendored
Normal file
12
electron/node_modules/@electron/asar/lib/crawlfs.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { Stats } from 'fs';
|
||||
import { IOptions } from './types/glob';
|
||||
export type CrawledFileType = {
|
||||
type: 'file' | 'directory' | 'link';
|
||||
stat: Pick<Stats, 'mode' | 'size'>;
|
||||
transformed?: {
|
||||
path: string;
|
||||
stat: Stats;
|
||||
};
|
||||
};
|
||||
export declare function determineFileType(filename: string): Promise<CrawledFileType | null>;
|
||||
export declare function crawl(dir: string, options: IOptions): Promise<readonly [string[], Record<string, CrawledFileType>]>;
|
||||
79
electron/node_modules/@electron/asar/lib/crawlfs.js
generated
vendored
Normal file
79
electron/node_modules/@electron/asar/lib/crawlfs.js
generated
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
"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;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.determineFileType = determineFileType;
|
||||
exports.crawl = crawl;
|
||||
const util_1 = require("util");
|
||||
const glob_1 = require("glob");
|
||||
const wrapped_fs_1 = __importDefault(require("./wrapped-fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const glob = (0, util_1.promisify)(glob_1.glob);
|
||||
async function determineFileType(filename) {
|
||||
const stat = await wrapped_fs_1.default.lstat(filename);
|
||||
if (stat.isFile()) {
|
||||
return { type: 'file', stat };
|
||||
}
|
||||
else if (stat.isDirectory()) {
|
||||
return { type: 'directory', stat };
|
||||
}
|
||||
else if (stat.isSymbolicLink()) {
|
||||
return { type: 'link', stat };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async function crawl(dir, options) {
|
||||
const metadata = {};
|
||||
const crawled = await glob(dir, options);
|
||||
const results = await Promise.all(crawled.map(async (filename) => [filename, await determineFileType(filename)]));
|
||||
const links = [];
|
||||
const filenames = results
|
||||
.map(([filename, type]) => {
|
||||
if (type) {
|
||||
metadata[filename] = type;
|
||||
if (type.type === 'link')
|
||||
links.push(filename);
|
||||
}
|
||||
return filename;
|
||||
})
|
||||
.filter((filename) => {
|
||||
// Newer glob can return files inside symlinked directories, to avoid
|
||||
// those appearing in archives we need to manually exclude theme here
|
||||
const exactLinkIndex = links.findIndex((link) => filename === link);
|
||||
return links.every((link, index) => {
|
||||
if (index === exactLinkIndex) {
|
||||
return true;
|
||||
}
|
||||
const isFileWithinSymlinkDir = filename.startsWith(link);
|
||||
// symlink may point outside the directory: https://github.com/electron/asar/issues/303
|
||||
const relativePath = path.relative(link, path.dirname(filename));
|
||||
return !isFileWithinSymlinkDir || relativePath.startsWith('..');
|
||||
});
|
||||
});
|
||||
return [filenames, metadata];
|
||||
}
|
||||
//# sourceMappingURL=crawlfs.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/crawlfs.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/crawlfs.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"crawlfs.js","sourceRoot":"","sources":["../src/crawlfs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,8CAUC;AAED,sBA8BC;AA7DD,+BAAiC;AACjC,+BAAqC;AAErC,8DAA8B;AAE9B,2CAA6B;AAG7B,MAAM,IAAI,GAAG,IAAA,gBAAS,EAAC,WAAK,CAAC,CAAC;AAWvB,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IACtD,MAAM,IAAI,GAAG,MAAM,oBAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtC,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAClB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChC,CAAC;SAAM,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IACrC,CAAC;SAAM,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;QACjC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,KAAK,UAAU,KAAK,CAAC,GAAW,EAAE,OAAiB;IACxD,MAAM,QAAQ,GAAoC,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAU,CAAC,CACxF,CAAC;IACF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,OAAO;SACtB,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;QACxB,IAAI,IAAI,EAAE,CAAC;YACT,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;YAC1B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;gBAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE;QACnB,qEAAqE;QACrE,qEAAqE;QACrE,MAAM,cAAc,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;QACpE,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACjC,IAAI,KAAK,KAAK,cAAc,EAAE,CAAC;gBAC7B,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,sBAAsB,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACzD,uFAAuF;YACvF,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;YACjE,OAAO,CAAC,sBAAsB,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACL,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC;AACxC,CAAC"}
|
||||
44
electron/node_modules/@electron/asar/lib/disk.d.ts
generated
vendored
Normal file
44
electron/node_modules/@electron/asar/lib/disk.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { Filesystem, FilesystemFileEntry } from './filesystem';
|
||||
import { CrawledFileType } from './crawlfs';
|
||||
import { Stats } from 'fs';
|
||||
export type InputMetadata = {
|
||||
[property: string]: CrawledFileType;
|
||||
};
|
||||
export type BasicFilesArray = {
|
||||
filename: string;
|
||||
unpack: boolean;
|
||||
}[];
|
||||
export type BasicStreamArray = {
|
||||
filename: string;
|
||||
streamGenerator: () => NodeJS.ReadableStream;
|
||||
mode: Stats['mode'];
|
||||
unpack: boolean;
|
||||
link: string | undefined;
|
||||
}[];
|
||||
export type FilesystemFilesAndLinks<T extends BasicFilesArray | BasicStreamArray> = {
|
||||
files: T;
|
||||
links: T;
|
||||
};
|
||||
export declare function writeFilesystem(dest: string, filesystem: Filesystem, lists: FilesystemFilesAndLinks<BasicFilesArray>, metadata: InputMetadata): Promise<NodeJS.WritableStream>;
|
||||
export declare function streamFilesystem(dest: string, filesystem: Filesystem, lists: FilesystemFilesAndLinks<BasicStreamArray>): Promise<import("fs").WriteStream>;
|
||||
export interface FileRecord extends FilesystemFileEntry {
|
||||
integrity: {
|
||||
hash: string;
|
||||
algorithm: 'SHA256';
|
||||
blocks: string[];
|
||||
blockSize: number;
|
||||
};
|
||||
}
|
||||
export type DirectoryRecord = {
|
||||
files: Record<string, DirectoryRecord | FileRecord>;
|
||||
};
|
||||
export type ArchiveHeader = {
|
||||
header: DirectoryRecord;
|
||||
headerString: string;
|
||||
headerSize: number;
|
||||
};
|
||||
export declare function readArchiveHeaderSync(archivePath: string): ArchiveHeader;
|
||||
export declare function readFilesystemSync(archivePath: string): Filesystem;
|
||||
export declare function uncacheFilesystem(archivePath: string): boolean;
|
||||
export declare function uncacheAll(): void;
|
||||
export declare function readFileSync(filesystem: Filesystem, filename: string, info: FilesystemFileEntry): Buffer;
|
||||
219
electron/node_modules/@electron/asar/lib/disk.js
generated
vendored
Normal file
219
electron/node_modules/@electron/asar/lib/disk.js
generated
vendored
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
"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;
|
||||
};
|
||||
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
||||
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
||||
var m = o[Symbol.asyncIterator], i;
|
||||
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
||||
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
||||
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.writeFilesystem = writeFilesystem;
|
||||
exports.streamFilesystem = streamFilesystem;
|
||||
exports.readArchiveHeaderSync = readArchiveHeaderSync;
|
||||
exports.readFilesystemSync = readFilesystemSync;
|
||||
exports.uncacheFilesystem = uncacheFilesystem;
|
||||
exports.uncacheAll = uncacheAll;
|
||||
exports.readFileSync = readFileSync;
|
||||
const path = __importStar(require("path"));
|
||||
const wrapped_fs_1 = __importDefault(require("./wrapped-fs"));
|
||||
const pickle_1 = require("./pickle");
|
||||
const filesystem_1 = require("./filesystem");
|
||||
const util_1 = require("util");
|
||||
const stream = __importStar(require("stream"));
|
||||
const pipeline = (0, util_1.promisify)(stream.pipeline);
|
||||
let filesystemCache = Object.create(null);
|
||||
async function copyFile(dest, src, filename) {
|
||||
const srcFile = path.join(src, filename);
|
||||
const targetFile = path.join(dest, filename);
|
||||
const [content, stats] = await Promise.all([
|
||||
wrapped_fs_1.default.readFile(srcFile),
|
||||
wrapped_fs_1.default.stat(srcFile),
|
||||
wrapped_fs_1.default.mkdirp(path.dirname(targetFile)),
|
||||
]);
|
||||
return wrapped_fs_1.default.writeFile(targetFile, content, { mode: stats.mode });
|
||||
}
|
||||
async function streamTransformedFile(stream, outStream) {
|
||||
return new Promise((resolve, reject) => {
|
||||
stream.pipe(outStream, { end: false });
|
||||
stream.on('error', reject);
|
||||
stream.on('end', () => resolve());
|
||||
});
|
||||
}
|
||||
const writeFileListToStream = async function (dest, filesystem, out, lists, metadata) {
|
||||
const { files, links } = lists;
|
||||
for (const file of files) {
|
||||
if (file.unpack) {
|
||||
// the file should not be packed into archive
|
||||
const filename = path.relative(filesystem.getRootPath(), file.filename);
|
||||
await copyFile(`${dest}.unpacked`, filesystem.getRootPath(), filename);
|
||||
}
|
||||
else {
|
||||
const transformed = metadata[file.filename].transformed;
|
||||
const stream = wrapped_fs_1.default.createReadStream(transformed ? transformed.path : file.filename);
|
||||
await streamTransformedFile(stream, out);
|
||||
}
|
||||
}
|
||||
for (const file of links.filter((f) => f.unpack)) {
|
||||
// the symlink needs to be recreated outside in .unpacked
|
||||
const filename = path.relative(filesystem.getRootPath(), file.filename);
|
||||
const link = await wrapped_fs_1.default.readlink(file.filename);
|
||||
await createSymlink(dest, filename, link);
|
||||
}
|
||||
return out.end();
|
||||
};
|
||||
async function writeFilesystem(dest, filesystem, lists, metadata) {
|
||||
const out = await createFilesystemWriteStream(filesystem, dest);
|
||||
return writeFileListToStream(dest, filesystem, out, lists, metadata);
|
||||
}
|
||||
async function streamFilesystem(dest, filesystem, lists) {
|
||||
var _a, e_1, _b, _c;
|
||||
const out = await createFilesystemWriteStream(filesystem, dest);
|
||||
const { files, links } = lists;
|
||||
try {
|
||||
for (var _d = true, files_1 = __asyncValues(files), files_1_1; files_1_1 = await files_1.next(), _a = files_1_1.done, !_a; _d = true) {
|
||||
_c = files_1_1.value;
|
||||
_d = false;
|
||||
const file = _c;
|
||||
// the file should not be packed into archive
|
||||
if (file.unpack) {
|
||||
const targetFile = path.join(`${dest}.unpacked`, file.filename);
|
||||
await wrapped_fs_1.default.mkdirp(path.dirname(targetFile));
|
||||
const writeStream = wrapped_fs_1.default.createWriteStream(targetFile, { mode: file.mode });
|
||||
await pipeline(file.streamGenerator(), writeStream);
|
||||
}
|
||||
else {
|
||||
await streamTransformedFile(file.streamGenerator(), out);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
||||
finally {
|
||||
try {
|
||||
if (!_d && !_a && (_b = files_1.return)) await _b.call(files_1);
|
||||
}
|
||||
finally { if (e_1) throw e_1.error; }
|
||||
}
|
||||
for (const file of links.filter((f) => f.unpack && f.link)) {
|
||||
// the symlink needs to be recreated outside in .unpacked
|
||||
await createSymlink(dest, file.filename, file.link);
|
||||
}
|
||||
return out.end();
|
||||
}
|
||||
function readArchiveHeaderSync(archivePath) {
|
||||
const fd = wrapped_fs_1.default.openSync(archivePath, 'r');
|
||||
let size;
|
||||
let headerBuf;
|
||||
try {
|
||||
const sizeBuf = Buffer.alloc(8);
|
||||
if (wrapped_fs_1.default.readSync(fd, sizeBuf, 0, 8, null) !== 8) {
|
||||
throw new Error('Unable to read header size');
|
||||
}
|
||||
const sizePickle = pickle_1.Pickle.createFromBuffer(sizeBuf);
|
||||
size = sizePickle.createIterator().readUInt32();
|
||||
headerBuf = Buffer.alloc(size);
|
||||
if (wrapped_fs_1.default.readSync(fd, headerBuf, 0, size, null) !== size) {
|
||||
throw new Error('Unable to read header');
|
||||
}
|
||||
}
|
||||
finally {
|
||||
wrapped_fs_1.default.closeSync(fd);
|
||||
}
|
||||
const headerPickle = pickle_1.Pickle.createFromBuffer(headerBuf);
|
||||
const header = headerPickle.createIterator().readString();
|
||||
return { headerString: header, header: JSON.parse(header), headerSize: size };
|
||||
}
|
||||
function readFilesystemSync(archivePath) {
|
||||
if (!filesystemCache[archivePath]) {
|
||||
const header = readArchiveHeaderSync(archivePath);
|
||||
const filesystem = new filesystem_1.Filesystem(archivePath);
|
||||
filesystem.setHeader(header.header, header.headerSize);
|
||||
filesystemCache[archivePath] = filesystem;
|
||||
}
|
||||
return filesystemCache[archivePath];
|
||||
}
|
||||
function uncacheFilesystem(archivePath) {
|
||||
if (filesystemCache[archivePath]) {
|
||||
filesystemCache[archivePath] = undefined;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function uncacheAll() {
|
||||
filesystemCache = {};
|
||||
}
|
||||
function readFileSync(filesystem, filename, info) {
|
||||
let buffer = Buffer.alloc(info.size);
|
||||
if (info.size <= 0) {
|
||||
return buffer;
|
||||
}
|
||||
if (info.unpacked) {
|
||||
// it's an unpacked file, copy it.
|
||||
buffer = wrapped_fs_1.default.readFileSync(path.join(`${filesystem.getRootPath()}.unpacked`, filename));
|
||||
}
|
||||
else {
|
||||
// Node throws an exception when reading 0 bytes into a 0-size buffer,
|
||||
// so we short-circuit the read in this case.
|
||||
const fd = wrapped_fs_1.default.openSync(filesystem.getRootPath(), 'r');
|
||||
try {
|
||||
const offset = 8 + filesystem.getHeaderSize() + parseInt(info.offset);
|
||||
wrapped_fs_1.default.readSync(fd, buffer, 0, info.size, offset);
|
||||
}
|
||||
finally {
|
||||
wrapped_fs_1.default.closeSync(fd);
|
||||
}
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
async function createFilesystemWriteStream(filesystem, dest) {
|
||||
const headerPickle = pickle_1.Pickle.createEmpty();
|
||||
headerPickle.writeString(JSON.stringify(filesystem.getHeader()));
|
||||
const headerBuf = headerPickle.toBuffer();
|
||||
const sizePickle = pickle_1.Pickle.createEmpty();
|
||||
sizePickle.writeUInt32(headerBuf.length);
|
||||
const sizeBuf = sizePickle.toBuffer();
|
||||
const out = wrapped_fs_1.default.createWriteStream(dest);
|
||||
await new Promise((resolve, reject) => {
|
||||
out.on('error', reject);
|
||||
out.write(sizeBuf);
|
||||
return out.write(headerBuf, () => resolve());
|
||||
});
|
||||
return out;
|
||||
}
|
||||
async function createSymlink(dest, filepath, link) {
|
||||
// if symlink is within subdirectories, then we need to recreate dir structure
|
||||
await wrapped_fs_1.default.mkdirp(path.join(`${dest}.unpacked`, path.dirname(filepath)));
|
||||
// create symlink within unpacked dir
|
||||
await wrapped_fs_1.default.symlink(link, path.join(`${dest}.unpacked`, filepath)).catch(async (error) => {
|
||||
if (error.code === 'EPERM' && error.syscall === 'symlink') {
|
||||
throw new Error('Could not create symlinks for unpacked assets. On Windows, consider activating Developer Mode to allow non-admin users to create symlinks by following the instructions at https://docs.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development.');
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=disk.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/disk.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/disk.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
44
electron/node_modules/@electron/asar/lib/filesystem.d.ts
generated
vendored
Normal file
44
electron/node_modules/@electron/asar/lib/filesystem.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { FileIntegrity } from './integrity';
|
||||
import { CrawledFileType } from './crawlfs';
|
||||
export type EntryMetadata = {
|
||||
unpacked?: boolean;
|
||||
};
|
||||
export type FilesystemDirectoryEntry = {
|
||||
files: Record<string, FilesystemEntry>;
|
||||
} & EntryMetadata;
|
||||
export type FilesystemFileEntry = {
|
||||
unpacked: boolean;
|
||||
executable: boolean;
|
||||
offset: string;
|
||||
size: number;
|
||||
integrity: FileIntegrity;
|
||||
} & EntryMetadata;
|
||||
export type FilesystemLinkEntry = {
|
||||
link: string;
|
||||
} & EntryMetadata;
|
||||
export type FilesystemEntry = FilesystemDirectoryEntry | FilesystemFileEntry | FilesystemLinkEntry;
|
||||
export declare class Filesystem {
|
||||
private src;
|
||||
private header;
|
||||
private headerSize;
|
||||
private offset;
|
||||
constructor(src: string);
|
||||
getRootPath(): string;
|
||||
getHeader(): FilesystemEntry;
|
||||
getHeaderSize(): number;
|
||||
setHeader(header: FilesystemEntry, headerSize: number): void;
|
||||
searchNodeFromDirectory(p: string): FilesystemEntry;
|
||||
searchNodeFromPath(p: string): FilesystemEntry;
|
||||
insertDirectory(p: string, shouldUnpack: boolean): Record<string, FilesystemEntry>;
|
||||
insertFile(p: string, streamGenerator: () => NodeJS.ReadableStream, shouldUnpack: boolean, file: CrawledFileType, options?: {
|
||||
transform?: (filePath: string) => NodeJS.ReadWriteStream | void;
|
||||
}): Promise<void>;
|
||||
insertLink(p: string, shouldUnpack: boolean, parentPath?: string, symlink?: string, // /var/tmp => /private/var
|
||||
src?: string): string;
|
||||
private resolveLink;
|
||||
listFiles(options?: {
|
||||
isPack: boolean;
|
||||
}): string[];
|
||||
getNode(p: string, followLinks?: boolean): FilesystemEntry;
|
||||
getFile(p: string, followLinks?: boolean): FilesystemEntry;
|
||||
}
|
||||
199
electron/node_modules/@electron/asar/lib/filesystem.js
generated
vendored
Normal file
199
electron/node_modules/@electron/asar/lib/filesystem.js
generated
vendored
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
"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;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Filesystem = void 0;
|
||||
const os = __importStar(require("os"));
|
||||
const path = __importStar(require("path"));
|
||||
const util_1 = require("util");
|
||||
const stream = __importStar(require("stream"));
|
||||
const integrity_1 = require("./integrity");
|
||||
const wrapped_fs_1 = __importDefault(require("./wrapped-fs"));
|
||||
const UINT32_MAX = 2 ** 32 - 1;
|
||||
const pipeline = (0, util_1.promisify)(stream.pipeline);
|
||||
class Filesystem {
|
||||
constructor(src) {
|
||||
this.src = path.resolve(src);
|
||||
this.header = { files: Object.create(null) };
|
||||
this.headerSize = 0;
|
||||
this.offset = BigInt(0);
|
||||
}
|
||||
getRootPath() {
|
||||
return this.src;
|
||||
}
|
||||
getHeader() {
|
||||
return this.header;
|
||||
}
|
||||
getHeaderSize() {
|
||||
return this.headerSize;
|
||||
}
|
||||
setHeader(header, headerSize) {
|
||||
this.header = header;
|
||||
this.headerSize = headerSize;
|
||||
}
|
||||
searchNodeFromDirectory(p) {
|
||||
let json = this.header;
|
||||
const dirs = p.split(path.sep);
|
||||
for (const dir of dirs) {
|
||||
if (dir !== '.') {
|
||||
if ('files' in json) {
|
||||
if (!json.files[dir]) {
|
||||
json.files[dir] = { files: Object.create(null) };
|
||||
}
|
||||
json = json.files[dir];
|
||||
}
|
||||
else {
|
||||
throw new Error('Unexpected directory state while traversing: ' + p);
|
||||
}
|
||||
}
|
||||
}
|
||||
return json;
|
||||
}
|
||||
searchNodeFromPath(p) {
|
||||
p = path.relative(this.src, p);
|
||||
if (!p) {
|
||||
return this.header;
|
||||
}
|
||||
const name = path.basename(p);
|
||||
const node = this.searchNodeFromDirectory(path.dirname(p));
|
||||
if (!node.files) {
|
||||
node.files = Object.create(null);
|
||||
}
|
||||
if (!node.files[name]) {
|
||||
node.files[name] = Object.create(null);
|
||||
}
|
||||
return node.files[name];
|
||||
}
|
||||
insertDirectory(p, shouldUnpack) {
|
||||
const node = this.searchNodeFromPath(p);
|
||||
if (shouldUnpack) {
|
||||
node.unpacked = shouldUnpack;
|
||||
}
|
||||
node.files = node.files || Object.create(null);
|
||||
return node.files;
|
||||
}
|
||||
async insertFile(p, streamGenerator, shouldUnpack, file, options = {}) {
|
||||
const dirNode = this.searchNodeFromPath(path.dirname(p));
|
||||
const node = this.searchNodeFromPath(p);
|
||||
if (shouldUnpack || dirNode.unpacked) {
|
||||
node.size = file.stat.size;
|
||||
node.unpacked = true;
|
||||
node.integrity = await (0, integrity_1.getFileIntegrity)(streamGenerator());
|
||||
return Promise.resolve();
|
||||
}
|
||||
let size;
|
||||
const transformed = options.transform && options.transform(p);
|
||||
if (transformed) {
|
||||
const tmpdir = await wrapped_fs_1.default.mkdtemp(path.join(os.tmpdir(), 'asar-'));
|
||||
const tmpfile = path.join(tmpdir, path.basename(p));
|
||||
const out = wrapped_fs_1.default.createWriteStream(tmpfile);
|
||||
await pipeline(streamGenerator(), transformed, out);
|
||||
file.transformed = {
|
||||
path: tmpfile,
|
||||
stat: await wrapped_fs_1.default.lstat(tmpfile),
|
||||
};
|
||||
size = file.transformed.stat.size;
|
||||
}
|
||||
else {
|
||||
size = file.stat.size;
|
||||
}
|
||||
// JavaScript cannot precisely present integers >= UINT32_MAX.
|
||||
if (size > UINT32_MAX) {
|
||||
throw new Error(`${p}: file size can not be larger than 4.2GB`);
|
||||
}
|
||||
node.size = size;
|
||||
node.offset = this.offset.toString();
|
||||
node.integrity = await (0, integrity_1.getFileIntegrity)(streamGenerator());
|
||||
if (process.platform !== 'win32' && file.stat.mode & 0o100) {
|
||||
node.executable = true;
|
||||
}
|
||||
this.offset += BigInt(size);
|
||||
}
|
||||
insertLink(p, shouldUnpack, parentPath = wrapped_fs_1.default.realpathSync(path.dirname(p)), symlink = wrapped_fs_1.default.readlinkSync(p), // /var/tmp => /private/var
|
||||
src = wrapped_fs_1.default.realpathSync(this.src)) {
|
||||
const link = this.resolveLink(src, parentPath, symlink);
|
||||
if (link.startsWith('..')) {
|
||||
throw new Error(`${p}: file "${link}" links out of the package`);
|
||||
}
|
||||
const node = this.searchNodeFromPath(p);
|
||||
const dirNode = this.searchNodeFromPath(path.dirname(p));
|
||||
if (shouldUnpack || dirNode.unpacked) {
|
||||
node.unpacked = true;
|
||||
}
|
||||
node.link = link;
|
||||
return link;
|
||||
}
|
||||
resolveLink(src, parentPath, symlink) {
|
||||
const target = path.join(parentPath, symlink);
|
||||
const link = path.relative(src, target);
|
||||
return link;
|
||||
}
|
||||
listFiles(options) {
|
||||
const files = [];
|
||||
const fillFilesFromMetadata = function (basePath, metadata) {
|
||||
if (!('files' in metadata)) {
|
||||
return;
|
||||
}
|
||||
for (const [childPath, childMetadata] of Object.entries(metadata.files)) {
|
||||
const fullPath = path.join(basePath, childPath);
|
||||
const packState = 'unpacked' in childMetadata && childMetadata.unpacked ? 'unpack' : 'pack ';
|
||||
files.push(options && options.isPack ? `${packState} : ${fullPath}` : fullPath);
|
||||
fillFilesFromMetadata(fullPath, childMetadata);
|
||||
}
|
||||
};
|
||||
fillFilesFromMetadata('/', this.header);
|
||||
return files;
|
||||
}
|
||||
getNode(p, followLinks = true) {
|
||||
const node = this.searchNodeFromDirectory(path.dirname(p));
|
||||
const name = path.basename(p);
|
||||
if ('link' in node && followLinks) {
|
||||
return this.getNode(path.join(node.link, name));
|
||||
}
|
||||
if (name) {
|
||||
return node.files[name];
|
||||
}
|
||||
else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
getFile(p, followLinks = true) {
|
||||
const info = this.getNode(p, followLinks);
|
||||
if (!info) {
|
||||
throw new Error(`"${p}" was not found in this archive`);
|
||||
}
|
||||
// if followLinks is false we don't resolve symlinks
|
||||
if ('link' in info && followLinks) {
|
||||
return this.getFile(info.link, followLinks);
|
||||
}
|
||||
else {
|
||||
return info;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Filesystem = Filesystem;
|
||||
//# sourceMappingURL=filesystem.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/filesystem.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/filesystem.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
7
electron/node_modules/@electron/asar/lib/integrity.d.ts
generated
vendored
Normal file
7
electron/node_modules/@electron/asar/lib/integrity.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export type FileIntegrity = {
|
||||
algorithm: 'SHA256';
|
||||
hash: string;
|
||||
blockSize: number;
|
||||
blocks: string[];
|
||||
};
|
||||
export declare function getFileIntegrity(inputFileStream: NodeJS.ReadableStream): Promise<FileIntegrity>;
|
||||
75
electron/node_modules/@electron/asar/lib/integrity.js
generated
vendored
Normal file
75
electron/node_modules/@electron/asar/lib/integrity.js
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
"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.getFileIntegrity = getFileIntegrity;
|
||||
const crypto = __importStar(require("crypto"));
|
||||
const stream = __importStar(require("stream"));
|
||||
const util_1 = require("util");
|
||||
const ALGORITHM = 'SHA256';
|
||||
// 4MB default block size
|
||||
const BLOCK_SIZE = 4 * 1024 * 1024;
|
||||
const pipeline = (0, util_1.promisify)(stream.pipeline);
|
||||
function hashBlock(block) {
|
||||
return crypto.createHash(ALGORITHM).update(block).digest('hex');
|
||||
}
|
||||
async function getFileIntegrity(inputFileStream) {
|
||||
const fileHash = crypto.createHash(ALGORITHM);
|
||||
const blockHashes = [];
|
||||
let currentBlockSize = 0;
|
||||
let currentBlock = [];
|
||||
await pipeline(inputFileStream, new stream.PassThrough({
|
||||
decodeStrings: false,
|
||||
transform(_chunk, encoding, callback) {
|
||||
fileHash.update(_chunk);
|
||||
function handleChunk(chunk) {
|
||||
const diffToSlice = Math.min(BLOCK_SIZE - currentBlockSize, chunk.byteLength);
|
||||
currentBlockSize += diffToSlice;
|
||||
currentBlock.push(chunk.slice(0, diffToSlice));
|
||||
if (currentBlockSize === BLOCK_SIZE) {
|
||||
blockHashes.push(hashBlock(Buffer.concat(currentBlock)));
|
||||
currentBlock = [];
|
||||
currentBlockSize = 0;
|
||||
}
|
||||
if (diffToSlice < chunk.byteLength) {
|
||||
handleChunk(chunk.slice(diffToSlice));
|
||||
}
|
||||
}
|
||||
handleChunk(_chunk);
|
||||
callback();
|
||||
},
|
||||
flush(callback) {
|
||||
blockHashes.push(hashBlock(Buffer.concat(currentBlock)));
|
||||
currentBlock = [];
|
||||
callback();
|
||||
},
|
||||
}));
|
||||
return {
|
||||
algorithm: ALGORITHM,
|
||||
hash: fileHash.digest('hex'),
|
||||
blockSize: BLOCK_SIZE,
|
||||
blocks: blockHashes,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=integrity.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/integrity.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/integrity.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"integrity.js","sourceRoot":"","sources":["../src/integrity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,4CA8CC;AApED,+CAAiC;AAEjC,+CAAiC;AACjC,+BAAiC;AAEjC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,yBAAyB;AACzB,MAAM,UAAU,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnC,MAAM,QAAQ,GAAG,IAAA,gBAAS,EAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAE5C,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC;AASM,KAAK,UAAU,gBAAgB,CACpC,eAAsC;IAEtC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAE9C,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,IAAI,YAAY,GAAa,EAAE,CAAC;IAEhC,MAAM,QAAQ,CACZ,eAAe,EACf,IAAI,MAAM,CAAC,WAAW,CAAC;QACrB,aAAa,EAAE,KAAK;QACpB,SAAS,CAAC,MAAc,EAAE,QAAQ,EAAE,QAAQ;YAC1C,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAExB,SAAS,WAAW,CAAC,KAAa;gBAChC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,gBAAgB,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;gBAC9E,gBAAgB,IAAI,WAAW,CAAC;gBAChC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;gBAC/C,IAAI,gBAAgB,KAAK,UAAU,EAAE,CAAC;oBACpC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;oBACzD,YAAY,GAAG,EAAE,CAAC;oBAClB,gBAAgB,GAAG,CAAC,CAAC;gBACvB,CAAC;gBACD,IAAI,WAAW,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;oBACnC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;YACD,WAAW,CAAC,MAAM,CAAC,CAAC;YACpB,QAAQ,EAAE,CAAC;QACb,CAAC;QACD,KAAK,CAAC,QAAQ;YACZ,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACzD,YAAY,GAAG,EAAE,CAAC;YAClB,QAAQ,EAAE,CAAC;QACb,CAAC;KACF,CAAC,CACH,CAAC;IAEF,OAAO;QACL,SAAS,EAAE,SAAS;QACpB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC;QAC5B,SAAS,EAAE,UAAU;QACrB,MAAM,EAAE,WAAW;KACpB,CAAC;AACJ,CAAC"}
|
||||
46
electron/node_modules/@electron/asar/lib/pickle.d.ts
generated
vendored
Normal file
46
electron/node_modules/@electron/asar/lib/pickle.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
declare class PickleIterator {
|
||||
private payload;
|
||||
private payloadOffset;
|
||||
private readIndex;
|
||||
private endIndex;
|
||||
constructor(pickle: Pickle);
|
||||
readBool(): boolean;
|
||||
readInt(): number;
|
||||
readUInt32(): number;
|
||||
readInt64(): bigint;
|
||||
readUInt64(): bigint;
|
||||
readFloat(): number;
|
||||
readDouble(): number;
|
||||
readString(): string;
|
||||
readBytes(length: number): Buffer;
|
||||
readBytes<R, F extends (...args: any[]) => R>(length: number, method: F): R;
|
||||
getReadPayloadOffsetAndAdvance(length: number): number;
|
||||
advance(size: number): void;
|
||||
}
|
||||
export declare class Pickle {
|
||||
private header;
|
||||
private headerSize;
|
||||
private capacityAfterHeader;
|
||||
private writeOffset;
|
||||
private constructor();
|
||||
static createEmpty(): Pickle;
|
||||
static createFromBuffer(buffer: Buffer): Pickle;
|
||||
getHeader(): Buffer;
|
||||
getHeaderSize(): number;
|
||||
createIterator(): PickleIterator;
|
||||
toBuffer(): Buffer;
|
||||
writeBool(value: boolean): boolean;
|
||||
writeInt(value: number): boolean;
|
||||
writeUInt32(value: number): boolean;
|
||||
writeInt64(value: number): boolean;
|
||||
writeUInt64(value: number): boolean;
|
||||
writeFloat(value: number): boolean;
|
||||
writeDouble(value: number): boolean;
|
||||
writeString(value: string): boolean;
|
||||
setPayloadSize(payloadSize: number): number;
|
||||
getPayloadSize(): number;
|
||||
writeBytes(data: string, length: number, method?: undefined): boolean;
|
||||
writeBytes(data: number | BigInt, length: number, method: Function): boolean;
|
||||
resize(newCapacity: number): void;
|
||||
}
|
||||
export {};
|
||||
199
electron/node_modules/@electron/asar/lib/pickle.js
generated
vendored
Normal file
199
electron/node_modules/@electron/asar/lib/pickle.js
generated
vendored
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Pickle = void 0;
|
||||
// sizeof(T).
|
||||
const SIZE_INT32 = 4;
|
||||
const SIZE_UINT32 = 4;
|
||||
const SIZE_INT64 = 8;
|
||||
const SIZE_UINT64 = 8;
|
||||
const SIZE_FLOAT = 4;
|
||||
const SIZE_DOUBLE = 8;
|
||||
// The allocation granularity of the payload.
|
||||
const PAYLOAD_UNIT = 64;
|
||||
// Largest JS number.
|
||||
const CAPACITY_READ_ONLY = 9007199254740992;
|
||||
// Aligns 'i' by rounding it up to the next multiple of 'alignment'.
|
||||
const alignInt = function (i, alignment) {
|
||||
return i + ((alignment - (i % alignment)) % alignment);
|
||||
};
|
||||
// PickleIterator reads data from a Pickle. The Pickle object must remain valid
|
||||
// while the PickleIterator object is in use.
|
||||
class PickleIterator {
|
||||
constructor(pickle) {
|
||||
this.payload = pickle.getHeader();
|
||||
this.payloadOffset = pickle.getHeaderSize();
|
||||
this.readIndex = 0;
|
||||
this.endIndex = pickle.getPayloadSize();
|
||||
}
|
||||
readBool() {
|
||||
return this.readInt() !== 0;
|
||||
}
|
||||
readInt() {
|
||||
return this.readBytes(SIZE_INT32, Buffer.prototype.readInt32LE);
|
||||
}
|
||||
readUInt32() {
|
||||
return this.readBytes(SIZE_UINT32, Buffer.prototype.readUInt32LE);
|
||||
}
|
||||
readInt64() {
|
||||
return this.readBytes(SIZE_INT64, Buffer.prototype.readBigInt64LE);
|
||||
}
|
||||
readUInt64() {
|
||||
return this.readBytes(SIZE_UINT64, Buffer.prototype.readBigUInt64LE);
|
||||
}
|
||||
readFloat() {
|
||||
return this.readBytes(SIZE_FLOAT, Buffer.prototype.readFloatLE);
|
||||
}
|
||||
readDouble() {
|
||||
return this.readBytes(SIZE_DOUBLE, Buffer.prototype.readDoubleLE);
|
||||
}
|
||||
readString() {
|
||||
return this.readBytes(this.readInt()).toString();
|
||||
}
|
||||
readBytes(length, method) {
|
||||
const readPayloadOffset = this.getReadPayloadOffsetAndAdvance(length);
|
||||
if (method != null) {
|
||||
return method.call(this.payload, readPayloadOffset, length);
|
||||
}
|
||||
else {
|
||||
return this.payload.slice(readPayloadOffset, readPayloadOffset + length);
|
||||
}
|
||||
}
|
||||
getReadPayloadOffsetAndAdvance(length) {
|
||||
if (length > this.endIndex - this.readIndex) {
|
||||
this.readIndex = this.endIndex;
|
||||
throw new Error('Failed to read data with length of ' + length);
|
||||
}
|
||||
const readPayloadOffset = this.payloadOffset + this.readIndex;
|
||||
this.advance(length);
|
||||
return readPayloadOffset;
|
||||
}
|
||||
advance(size) {
|
||||
const alignedSize = alignInt(size, SIZE_UINT32);
|
||||
if (this.endIndex - this.readIndex < alignedSize) {
|
||||
this.readIndex = this.endIndex;
|
||||
}
|
||||
else {
|
||||
this.readIndex += alignedSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
// This class provides facilities for basic binary value packing and unpacking.
|
||||
//
|
||||
// The Pickle class supports appending primitive values (ints, strings, etc.)
|
||||
// to a pickle instance. The Pickle instance grows its internal memory buffer
|
||||
// dynamically to hold the sequence of primitive values. The internal memory
|
||||
// buffer is exposed as the "data" of the Pickle. This "data" can be passed
|
||||
// to a Pickle object to initialize it for reading.
|
||||
//
|
||||
// When reading from a Pickle object, it is important for the consumer to know
|
||||
// what value types to read and in what order to read them as the Pickle does
|
||||
// not keep track of the type of data written to it.
|
||||
//
|
||||
// The Pickle's data has a header which contains the size of the Pickle's
|
||||
// payload. It can optionally support additional space in the header. That
|
||||
// space is controlled by the header_size parameter passed to the Pickle
|
||||
// constructor.
|
||||
class Pickle {
|
||||
constructor(buffer) {
|
||||
if (buffer) {
|
||||
this.header = buffer;
|
||||
this.headerSize = buffer.length - this.getPayloadSize();
|
||||
this.capacityAfterHeader = CAPACITY_READ_ONLY;
|
||||
this.writeOffset = 0;
|
||||
if (this.headerSize > buffer.length) {
|
||||
this.headerSize = 0;
|
||||
}
|
||||
if (this.headerSize !== alignInt(this.headerSize, SIZE_UINT32)) {
|
||||
this.headerSize = 0;
|
||||
}
|
||||
if (this.headerSize === 0) {
|
||||
this.header = Buffer.alloc(0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.header = Buffer.alloc(0);
|
||||
this.headerSize = SIZE_UINT32;
|
||||
this.capacityAfterHeader = 0;
|
||||
this.writeOffset = 0;
|
||||
this.resize(PAYLOAD_UNIT);
|
||||
this.setPayloadSize(0);
|
||||
}
|
||||
}
|
||||
static createEmpty() {
|
||||
return new Pickle();
|
||||
}
|
||||
static createFromBuffer(buffer) {
|
||||
return new Pickle(buffer);
|
||||
}
|
||||
getHeader() {
|
||||
return this.header;
|
||||
}
|
||||
getHeaderSize() {
|
||||
return this.headerSize;
|
||||
}
|
||||
createIterator() {
|
||||
return new PickleIterator(this);
|
||||
}
|
||||
toBuffer() {
|
||||
return this.header.slice(0, this.headerSize + this.getPayloadSize());
|
||||
}
|
||||
writeBool(value) {
|
||||
return this.writeInt(value ? 1 : 0);
|
||||
}
|
||||
writeInt(value) {
|
||||
return this.writeBytes(value, SIZE_INT32, Buffer.prototype.writeInt32LE);
|
||||
}
|
||||
writeUInt32(value) {
|
||||
return this.writeBytes(value, SIZE_UINT32, Buffer.prototype.writeUInt32LE);
|
||||
}
|
||||
writeInt64(value) {
|
||||
return this.writeBytes(BigInt(value), SIZE_INT64, Buffer.prototype.writeBigInt64LE);
|
||||
}
|
||||
writeUInt64(value) {
|
||||
return this.writeBytes(BigInt(value), SIZE_UINT64, Buffer.prototype.writeBigUInt64LE);
|
||||
}
|
||||
writeFloat(value) {
|
||||
return this.writeBytes(value, SIZE_FLOAT, Buffer.prototype.writeFloatLE);
|
||||
}
|
||||
writeDouble(value) {
|
||||
return this.writeBytes(value, SIZE_DOUBLE, Buffer.prototype.writeDoubleLE);
|
||||
}
|
||||
writeString(value) {
|
||||
const length = Buffer.byteLength(value, 'utf8');
|
||||
if (!this.writeInt(length)) {
|
||||
return false;
|
||||
}
|
||||
return this.writeBytes(value, length);
|
||||
}
|
||||
setPayloadSize(payloadSize) {
|
||||
return this.header.writeUInt32LE(payloadSize, 0);
|
||||
}
|
||||
getPayloadSize() {
|
||||
return this.header.readUInt32LE(0);
|
||||
}
|
||||
writeBytes(data, length, method) {
|
||||
const dataLength = alignInt(length, SIZE_UINT32);
|
||||
const newSize = this.writeOffset + dataLength;
|
||||
if (newSize > this.capacityAfterHeader) {
|
||||
this.resize(Math.max(this.capacityAfterHeader * 2, newSize));
|
||||
}
|
||||
if (method) {
|
||||
method.call(this.header, data, this.headerSize + this.writeOffset);
|
||||
}
|
||||
else {
|
||||
this.header.write(data, this.headerSize + this.writeOffset, length);
|
||||
}
|
||||
const endOffset = this.headerSize + this.writeOffset + length;
|
||||
this.header.fill(0, endOffset, endOffset + dataLength - length);
|
||||
this.setPayloadSize(newSize);
|
||||
this.writeOffset = newSize;
|
||||
return true;
|
||||
}
|
||||
resize(newCapacity) {
|
||||
newCapacity = alignInt(newCapacity, PAYLOAD_UNIT);
|
||||
this.header = Buffer.concat([this.header, Buffer.alloc(newCapacity)]);
|
||||
this.capacityAfterHeader = newCapacity;
|
||||
}
|
||||
}
|
||||
exports.Pickle = Pickle;
|
||||
//# sourceMappingURL=pickle.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/pickle.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/pickle.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
157
electron/node_modules/@electron/asar/lib/types/glob.d.ts
generated
vendored
Normal file
157
electron/node_modules/@electron/asar/lib/types/glob.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
/**
|
||||
* TODO(erikian): remove this file once we upgrade to the latest `glob` version.
|
||||
* https://github.com/electron/asar/pull/332#issuecomment-2435407933
|
||||
*/
|
||||
interface IMinimatchOptions {
|
||||
/**
|
||||
* Dump a ton of stuff to stderr.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
debug?: boolean | undefined;
|
||||
/**
|
||||
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
nobrace?: boolean | undefined;
|
||||
/**
|
||||
* Disable `**` matching against multiple folder names.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
noglobstar?: boolean | undefined;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
dot?: boolean | undefined;
|
||||
/**
|
||||
* Disable "extglob" style patterns like `+(a|b)`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
noext?: boolean | undefined;
|
||||
/**
|
||||
* Perform a case-insensitive match.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
nocase?: boolean | undefined;
|
||||
/**
|
||||
* When a match is not found by `minimatch.match`,
|
||||
* return a list containing the pattern itself if this option is set.
|
||||
* Otherwise, an empty list is returned if there are no matches.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
nonull?: boolean | undefined;
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
matchBase?: boolean | undefined;
|
||||
/**
|
||||
* Suppress the behavior of treating `#` at the start of a pattern as a comment.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
nocomment?: boolean | undefined;
|
||||
/**
|
||||
* Suppress the behavior of treating a leading `!` character as negation.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
nonegate?: boolean | undefined;
|
||||
/**
|
||||
* Returns from negate expressions the same as if they were not negated.
|
||||
* (Ie, true on a hit, false on a miss.)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
flipNegate?: boolean | undefined;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @default false
|
||||
*
|
||||
* @example
|
||||
* import minimatch = require("minimatch");
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
partial?: boolean;
|
||||
/**
|
||||
* Use `\\` as a path separator _only_, and _never_ as an escape
|
||||
* character. If set, all `\\` characters are replaced with `/` in
|
||||
* the pattern. Note that this makes it **impossible** to match
|
||||
* against paths containing literal glob pattern characters, but
|
||||
* allows matching with patterns constructed using `path.join()` and
|
||||
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
* behavior of earlier versions on Windows. Please use with
|
||||
* caution, and be mindful of the caveat about Windows paths
|
||||
*
|
||||
* For legacy reasons, this is also set if
|
||||
* `options.allowWindowsEscape` is set to the exact value `false`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
windowsPathsNoEscape?: boolean;
|
||||
}
|
||||
export interface IOptions extends IMinimatchOptions {
|
||||
cwd?: string | undefined;
|
||||
root?: string | undefined;
|
||||
dot?: boolean | undefined;
|
||||
nomount?: boolean | undefined;
|
||||
mark?: boolean | undefined;
|
||||
nosort?: boolean | undefined;
|
||||
stat?: boolean | undefined;
|
||||
silent?: boolean | undefined;
|
||||
strict?: boolean | undefined;
|
||||
cache?: {
|
||||
[path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string>;
|
||||
} | undefined;
|
||||
statCache?: {
|
||||
[path: string]: false | {
|
||||
isDirectory(): boolean;
|
||||
} | undefined;
|
||||
} | undefined;
|
||||
symlinks?: {
|
||||
[path: string]: boolean | undefined;
|
||||
} | undefined;
|
||||
realpathCache?: {
|
||||
[path: string]: string;
|
||||
} | undefined;
|
||||
sync?: boolean | undefined;
|
||||
nounique?: boolean | undefined;
|
||||
nonull?: boolean | undefined;
|
||||
debug?: boolean | undefined;
|
||||
nobrace?: boolean | undefined;
|
||||
noglobstar?: boolean | undefined;
|
||||
noext?: boolean | undefined;
|
||||
nocase?: boolean | undefined;
|
||||
matchBase?: any;
|
||||
nodir?: boolean | undefined;
|
||||
ignore?: string | ReadonlyArray<string> | undefined;
|
||||
follow?: boolean | undefined;
|
||||
realpath?: boolean | undefined;
|
||||
nonegate?: boolean | undefined;
|
||||
nocomment?: boolean | undefined;
|
||||
absolute?: boolean | undefined;
|
||||
allowWindowsEscape?: boolean | undefined;
|
||||
fs?: typeof import('fs');
|
||||
}
|
||||
export {};
|
||||
3
electron/node_modules/@electron/asar/lib/types/glob.js
generated
vendored
Normal file
3
electron/node_modules/@electron/asar/lib/types/glob.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=glob.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/types/glob.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/types/glob.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/types/glob.ts"],"names":[],"mappings":""}
|
||||
13
electron/node_modules/@electron/asar/lib/wrapped-fs.d.ts
generated
vendored
Normal file
13
electron/node_modules/@electron/asar/lib/wrapped-fs.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
type AsarFS = typeof import('fs') & {
|
||||
mkdirp(dir: string): Promise<void>;
|
||||
mkdirpSync(dir: string): void;
|
||||
lstat: (typeof import('fs'))['promises']['lstat'];
|
||||
mkdtemp: (typeof import('fs'))['promises']['mkdtemp'];
|
||||
readFile: (typeof import('fs'))['promises']['readFile'];
|
||||
stat: (typeof import('fs'))['promises']['stat'];
|
||||
writeFile: (typeof import('fs'))['promises']['writeFile'];
|
||||
symlink: (typeof import('fs'))['promises']['symlink'];
|
||||
readlink: (typeof import('fs'))['promises']['readlink'];
|
||||
};
|
||||
declare const promisified: AsarFS;
|
||||
export default promisified;
|
||||
26
electron/node_modules/@electron/asar/lib/wrapped-fs.js
generated
vendored
Normal file
26
electron/node_modules/@electron/asar/lib/wrapped-fs.js
generated
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = 'electron' in process.versions ? require('original-fs') : require('fs');
|
||||
const promisifiedMethods = [
|
||||
'lstat',
|
||||
'mkdtemp',
|
||||
'readFile',
|
||||
'stat',
|
||||
'writeFile',
|
||||
'symlink',
|
||||
'readlink',
|
||||
];
|
||||
const promisified = {};
|
||||
for (const method of Object.keys(fs)) {
|
||||
if (promisifiedMethods.includes(method)) {
|
||||
promisified[method] = fs.promises[method];
|
||||
}
|
||||
else {
|
||||
promisified[method] = fs[method];
|
||||
}
|
||||
}
|
||||
// To make it more like fs-extra
|
||||
promisified.mkdirp = (dir) => fs.promises.mkdir(dir, { recursive: true });
|
||||
promisified.mkdirpSync = (dir) => fs.mkdirSync(dir, { recursive: true });
|
||||
exports.default = promisified;
|
||||
//# sourceMappingURL=wrapped-fs.js.map
|
||||
1
electron/node_modules/@electron/asar/lib/wrapped-fs.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/lib/wrapped-fs.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"wrapped-fs.js","sourceRoot":"","sources":["../src/wrapped-fs.ts"],"names":[],"mappings":";;AAAA,MAAM,EAAE,GAAG,UAAU,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnF,MAAM,kBAAkB,GAAG;IACzB,OAAO;IACP,SAAS;IACT,UAAU;IACV,MAAM;IACN,WAAW;IACX,SAAS;IACT,UAAU;CACX,CAAC;AAcF,MAAM,WAAW,GAAG,EAAY,CAAC;AAEjC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;IACrC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,WAAmB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;SAAM,CAAC;QACL,WAAmB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC;AACD,gCAAgC;AAChC,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAC1E,WAAW,CAAC,UAAU,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAEzE,kBAAe,WAAW,CAAC"}
|
||||
2
electron/node_modules/@electron/asar/node_modules/balanced-match/.github/FUNDING.yml
generated
vendored
Normal file
2
electron/node_modules/@electron/asar/node_modules/balanced-match/.github/FUNDING.yml
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
tidelift: "npm/balanced-match"
|
||||
patreon: juliangruber
|
||||
21
electron/node_modules/@electron/asar/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
21
electron/node_modules/@electron/asar/node_modules/balanced-match/LICENSE.md
generated
vendored
Normal file
|
|
@ -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.
|
||||
97
electron/node_modules/@electron/asar/node_modules/balanced-match/README.md
generated
vendored
Normal file
97
electron/node_modules/@electron/asar/node_modules/balanced-match/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
# balanced-match
|
||||
|
||||
Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
|
||||
|
||||
[](http://travis-ci.org/juliangruber/balanced-match)
|
||||
[](https://www.npmjs.org/package/balanced-match)
|
||||
|
||||
[](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: `[ <a index>, <b index> ]`.
|
||||
|
||||
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.
|
||||
62
electron/node_modules/@electron/asar/node_modules/balanced-match/index.js
generated
vendored
Normal file
62
electron/node_modules/@electron/asar/node_modules/balanced-match/index.js
generated
vendored
Normal file
|
|
@ -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;
|
||||
}
|
||||
48
electron/node_modules/@electron/asar/node_modules/balanced-match/package.json
generated
vendored
Normal file
48
electron/node_modules/@electron/asar/node_modules/balanced-match/package.json
generated
vendored
Normal file
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
757
electron/node_modules/@electron/asar/node_modules/brace-expansion/.tap/coverage/8b906b8c-e21f-40b5-8c0d-214d8c2682c5.json
generated
vendored
Normal file
757
electron/node_modules/@electron/asar/node_modules/brace-expansion/.tap/coverage/8b906b8c-e21f-40b5-8c0d-214d8c2682c5.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
719
electron/node_modules/@electron/asar/node_modules/brace-expansion/.tap/processinfo/8b906b8c-e21f-40b5-8c0d-214d8c2682c5.json
generated
vendored
Normal file
719
electron/node_modules/@electron/asar/node_modules/brace-expansion/.tap/processinfo/8b906b8c-e21f-40b5-8c0d-214d8c2682c5.json
generated
vendored
Normal file
|
|
@ -0,0 +1,719 @@
|
|||
{
|
||||
"date": "2026-07-04T09:15:24.678Z",
|
||||
"argv": [
|
||||
"/usr/local/bin/node",
|
||||
"/workspace/test/index.js"
|
||||
],
|
||||
"execArgv": [
|
||||
"--import=file:///workspace/node_modules/@tapjs/typescript/dist/esm/import.mjs",
|
||||
"--import=file:///workspace/node_modules/@tapjs/mock/dist/esm/import.mjs",
|
||||
"--enable-source-maps",
|
||||
"--import=file:///workspace/node_modules/@tapjs/processinfo/dist/esm/import.mjs"
|
||||
],
|
||||
"NODE_OPTIONS": "\"--import=file:///workspace/node_modules/@tapjs/processinfo/dist/esm/import.mjs\"",
|
||||
"cwd": "/workspace",
|
||||
"pid": 814,
|
||||
"ppid": 803,
|
||||
"parent": null,
|
||||
"uuid": "8b906b8c-e21f-40b5-8c0d-214d8c2682c5",
|
||||
"files": [
|
||||
"/workspace/test/index.js",
|
||||
"/workspace/node_modules/@tapjs/typescript/dist/esm/import.mjs",
|
||||
"/workspace/node_modules/@isaacs/ts-node-temp-fork-for-pr-2009/import.mjs",
|
||||
"/workspace/node_modules/@isaacs/ts-node-temp-fork-for-pr-2009/import-loader.mjs",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/import.mjs",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/mock-service.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/base.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/counts.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/extra-from-error.js",
|
||||
"/workspace/node_modules/resolve-import/dist/esm/resolve-import-sync.min.js",
|
||||
"/workspace/node_modules/resolve-import/dist/esm/is-relative-require.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/resolve-mock-entry-point.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/export-line.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/service-key.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/munge-mocks.js",
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/lists.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/main-script.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/minimal.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/normalize-message-extra.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/parse-test-args.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/proc.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/tap-file.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/spawn.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/stdin.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/use-sync-hooks.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/waiter.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/tap-dir.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/test-base.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/tap.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/worker.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/test-point.js",
|
||||
"/workspace/node_modules/async-hook-domain/dist/mjs/index.js",
|
||||
"/workspace/node_modules/minipass/dist/esm/index.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/diags.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/message-from-error.js",
|
||||
"/workspace/node_modules/resolve-import/dist/esm/is-windows.js",
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/call-site-like.js",
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/require-resolve.js",
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/throw-to-parser.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/esc.js",
|
||||
"/workspace/node_modules/@tapjs/test/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/implicit-end-sigil.js",
|
||||
"/workspace/node_modules/is-actual-promise/dist/esm/index.js",
|
||||
"/workspace/node_modules/trivial-deferred/dist/mjs/index.js",
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/index.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/final-results.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/plan.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/line-type.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/parse-directive.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/result.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/statics.js",
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/clean-yaml-object.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/escape.js",
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/parse.js",
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/child_process.js",
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/process-info-node.js",
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/json-file.js",
|
||||
"/workspace/node_modules/@tapjs/test/test-built/dist/esm/index.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/final-plan.js",
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/parse.js",
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/stringify.js",
|
||||
"/workspace/node_modules/@tapjs/test/dist/esm/default-plugins.js",
|
||||
"/workspace/node_modules/tap-parser/dist/esm/brace-patterns.js",
|
||||
"/workspace/node_modules/diff/libesm/index.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/spawn-opts.js",
|
||||
"/workspace/node_modules/@tapjs/after/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/after-each/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/asserts/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/before/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/before-each/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/chdir/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/filter/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/fixture/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/intercept/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/spawn/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/stdin/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/typescript/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/worker/dist/esm/index.js",
|
||||
"/workspace/node_modules/jackspeak/dist/esm/index.js",
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/types/index.js",
|
||||
"/workspace/node_modules/diff/libesm/patch/parse.js",
|
||||
"/workspace/node_modules/diff/libesm/patch/reverse.js",
|
||||
"/workspace/node_modules/diff/libesm/patch/create.js",
|
||||
"/workspace/node_modules/diff/libesm/convert/dmp.js",
|
||||
"/workspace/node_modules/diff/libesm/convert/xml.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/base.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/character.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/word.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/line.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/sentence.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/css.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/array.js",
|
||||
"/workspace/node_modules/diff/libesm/diff/json.js",
|
||||
"/workspace/node_modules/diff/libesm/patch/apply.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/format.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/has-strict.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/has.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/match-strict.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/match-only.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/match-only-strict.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/match.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/strict.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/styles.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/same.js",
|
||||
"/workspace/node_modules/function-loop/dist/mjs/index.js",
|
||||
"/workspace/node_modules/@tapjs/asserts/dist/esm/normalize-throws-args.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/fixture/dist/esm/fixture.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/serialize.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/mock-require.js",
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/clean-cwd.js",
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/provider.js",
|
||||
"/workspace/node_modules/@isaacs/cliui/dist/esm/index.min.js",
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/types/date.js",
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/types/timestamp.js",
|
||||
"/workspace/node_modules/diff/libesm/util/string.js",
|
||||
"/workspace/node_modules/diff/libesm/util/distance-iterator.js",
|
||||
"/workspace/node_modules/diff/libesm/patch/line-endings.js",
|
||||
"/workspace/node_modules/diff/libesm/util/params.js",
|
||||
"/workspace/node_modules/tcompare/dist/esm/react-element-to-jsx-string.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/opt-arg.js",
|
||||
"/workspace/node_modules/glob/dist/esm/index.min.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/path-arg.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-manual.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-move-remove.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-native.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-posix.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-windows.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/use-native.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/index.js",
|
||||
"/workspace/node_modules/walk-up-path/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/index.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/comment.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/on-add.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/print-messages.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/stdio.js",
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/require.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-map.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/mkdirp-manual.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/opts-arg.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/mkdirp-native.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/default-tmp.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/path-arg.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/use-native.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/ignore-enoent.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/readdir-or-error.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/fix-eperm.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/error.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/retry-busy.js",
|
||||
"/workspace/node_modules/rimraf/dist/esm/fs.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/test-stream-serialize.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/serialize.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/deserialize.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/test-stream-deserialize.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-nested-location.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/loc-from-at.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/constants.js",
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/messages.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-results.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-point-message-data.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-message-data.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-point-results.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/loc-from-callsite.js",
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/find-made.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/result-to-error.js",
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/pretty-diff.js",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/loader.mjs",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/hooks.mjs",
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/mock-service-client.js",
|
||||
"/workspace/node_modules/tap/dist/esm/index.js",
|
||||
"/workspace/dist/esm/index.js",
|
||||
"/workspace/node_modules/tap/dist/esm/main.js",
|
||||
"/workspace/node_modules/balanced-match/dist/esm/index.js"
|
||||
],
|
||||
"sources": {
|
||||
"/workspace/node_modules/@tapjs/typescript/dist/esm/import.mjs": [
|
||||
"/workspace/node_modules/@tapjs/typescript/src/import.mts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/import.mjs": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/import.mts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/mock-service.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/mock-service.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/base.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/base.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/counts.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/counts.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/extra-from-error.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/extra-from-error.ts"
|
||||
],
|
||||
"/workspace/node_modules/resolve-import/dist/esm/resolve-import-sync.min.js": [
|
||||
"/workspace/node_modules/resolve-import/src/resolve-import-sync.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-import-async.ts",
|
||||
"/workspace/node_modules/resolve-import/src/file-exists.ts",
|
||||
"/workspace/node_modules/resolve-import/src/is-windows.ts",
|
||||
"/workspace/node_modules/resolve-import/src/is-relative-require.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-dependency-export.ts",
|
||||
"/workspace/node_modules/resolve-import/src/find-dep-package.ts",
|
||||
"/workspace/node_modules/resolve-import/node_modules/walk-up-path/src/index.ts",
|
||||
"/workspace/node_modules/resolve-import/src/read-json.ts",
|
||||
"/workspace/node_modules/resolve-import/src/read-pkg.ts",
|
||||
"/workspace/node_modules/resolve-import/src/find-star-match.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-conditional-value.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-export.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-dependency-export-sync.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-package-import.ts",
|
||||
"/workspace/node_modules/resolve-import/src/resolve-package-import-sync.ts",
|
||||
"/workspace/node_modules/resolve-import/src/to-file-url.ts",
|
||||
"/workspace/node_modules/resolve-import/src/to-path.ts",
|
||||
"/workspace/node_modules/resolve-import/src/errors.ts"
|
||||
],
|
||||
"/workspace/node_modules/resolve-import/dist/esm/is-relative-require.js": [
|
||||
"/workspace/node_modules/resolve-import/src/is-relative-require.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/resolve-mock-entry-point.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/resolve-mock-entry-point.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/export-line.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/export-line.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/service-key.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/service-key.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/munge-mocks.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/munge-mocks.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/stack/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/lists.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/lists.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/main-script.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/main-script.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/minimal.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/minimal.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/normalize-message-extra.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/normalize-message-extra.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/parse-test-args.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/parse-test-args.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/proc.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/proc.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/tap-file.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/tap-file.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/spawn.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/spawn.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/stdin.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/stdin.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/use-sync-hooks.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/use-sync-hooks.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/waiter.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/waiter.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/tap-dir.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/tap-dir.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/test-base.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/test-base.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/tap.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/tap.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/worker.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/worker.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/test-point.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/test-point.ts"
|
||||
],
|
||||
"/workspace/node_modules/async-hook-domain/dist/mjs/index.js": [
|
||||
"/workspace/node_modules/async-hook-domain/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/minipass/dist/esm/index.js": [
|
||||
"/workspace/node_modules/minipass/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/index.js": [
|
||||
"/workspace/node_modules/tap-parser/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/diags.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/diags.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/message-from-error.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/message-from-error.ts"
|
||||
],
|
||||
"/workspace/node_modules/resolve-import/dist/esm/is-windows.js": [
|
||||
"/workspace/node_modules/resolve-import/src/is-windows.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/call-site-like.js": [
|
||||
"/workspace/node_modules/@tapjs/stack/src/call-site-like.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/require-resolve.js": [
|
||||
"/workspace/node_modules/@tapjs/stack/src/require-resolve.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/processinfo/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/throw-to-parser.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/throw-to-parser.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/esc.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/esc.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/test/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/test/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/implicit-end-sigil.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/implicit-end-sigil.ts"
|
||||
],
|
||||
"/workspace/node_modules/is-actual-promise/dist/esm/index.js": [
|
||||
"/workspace/node_modules/is-actual-promise/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/trivial-deferred/dist/mjs/index.js": [
|
||||
"/workspace/node_modules/trivial-deferred/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/index.js": [
|
||||
"/workspace/node_modules/tap-yaml/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/final-results.js": [
|
||||
"/workspace/node_modules/tap-parser/src/final-results.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/plan.js": [
|
||||
"/workspace/node_modules/tap-parser/src/plan.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/line-type.js": [
|
||||
"/workspace/node_modules/tap-parser/src/line-type.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/parse-directive.js": [
|
||||
"/workspace/node_modules/tap-parser/src/parse-directive.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/result.js": [
|
||||
"/workspace/node_modules/tap-parser/src/result.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/statics.js": [
|
||||
"/workspace/node_modules/tap-parser/src/statics.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/core/dist/esm/clean-yaml-object.js": [
|
||||
"/workspace/node_modules/@tapjs/core/src/clean-yaml-object.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/escape.js": [
|
||||
"/workspace/node_modules/tap-parser/src/escape.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/stack/dist/esm/parse.js": [
|
||||
"/workspace/node_modules/@tapjs/stack/src/parse.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/child_process.js": [
|
||||
"/workspace/node_modules/@tapjs/processinfo/src/child_process.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/process-info-node.js": [
|
||||
"/workspace/node_modules/@tapjs/processinfo/src/process-info-node.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/json-file.js": [
|
||||
"/workspace/node_modules/@tapjs/processinfo/src/json-file.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/test/test-built/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/test/test-built/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/final-plan.js": [
|
||||
"/workspace/node_modules/tap-parser/src/final-plan.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/parse.js": [
|
||||
"/workspace/node_modules/tap-yaml/src/parse.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/stringify.js": [
|
||||
"/workspace/node_modules/tap-yaml/src/stringify.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/test/dist/esm/default-plugins.js": [
|
||||
"/workspace/node_modules/@tapjs/test/src/default-plugins.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-parser/dist/esm/brace-patterns.js": [
|
||||
"/workspace/node_modules/tap-parser/src/brace-patterns.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/index.js": [
|
||||
"/workspace/node_modules/tcompare/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/processinfo/dist/esm/spawn-opts.js": [
|
||||
"/workspace/node_modules/@tapjs/processinfo/src/spawn-opts.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/after/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/after/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/after-each/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/after-each/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/asserts/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/asserts/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/before/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/before/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/before-each/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/before-each/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/chdir/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/chdir/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/filter/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/filter/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/fixture/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/fixture/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/intercept/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/intercept/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/snapshot/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/spawn/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/spawn/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/stdin/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/stdin/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/typescript/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/typescript/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/worker/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/worker/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/jackspeak/dist/esm/index.js": [
|
||||
"/workspace/node_modules/jackspeak/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/types/index.js": [
|
||||
"/workspace/node_modules/tap-yaml/src/types/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/format.js": [
|
||||
"/workspace/node_modules/tcompare/src/format.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/has-strict.js": [
|
||||
"/workspace/node_modules/tcompare/src/has-strict.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/has.js": [
|
||||
"/workspace/node_modules/tcompare/src/has.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/match-strict.js": [
|
||||
"/workspace/node_modules/tcompare/src/match-strict.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/match-only.js": [
|
||||
"/workspace/node_modules/tcompare/src/match-only.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/match-only-strict.js": [
|
||||
"/workspace/node_modules/tcompare/src/match-only-strict.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/match.js": [
|
||||
"/workspace/node_modules/tcompare/src/match.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/strict.js": [
|
||||
"/workspace/node_modules/tcompare/src/strict.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/styles.js": [
|
||||
"/workspace/node_modules/tcompare/src/styles.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/same.js": [
|
||||
"/workspace/node_modules/tcompare/src/same.ts"
|
||||
],
|
||||
"/workspace/node_modules/function-loop/dist/mjs/index.js": [
|
||||
"/workspace/node_modules/function-loop/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/asserts/dist/esm/normalize-throws-args.js": [
|
||||
"/workspace/node_modules/@tapjs/asserts/src/normalize-throws-args.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/index.js": [
|
||||
"/workspace/node_modules/rimraf/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/fixture/dist/esm/fixture.js": [
|
||||
"/workspace/node_modules/@tapjs/fixture/src/fixture.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/serialize.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/serialize.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/mock/dist/esm/mock-require.js": [
|
||||
"/workspace/node_modules/@tapjs/mock/src/mock-require.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/clean-cwd.js": [
|
||||
"/workspace/node_modules/@tapjs/snapshot/src/clean-cwd.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/provider.js": [
|
||||
"/workspace/node_modules/@tapjs/snapshot/src/provider.ts"
|
||||
],
|
||||
"/workspace/node_modules/@isaacs/cliui/dist/esm/index.min.js": [
|
||||
"/workspace/node_modules/@isaacs/cliui/src/ansi-regex/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/strip-ansi/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/eastasianwidth/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/emoji-regex/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/string-width/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/ansi-styles/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/wrap-ansi/index.ts",
|
||||
"/workspace/node_modules/@isaacs/cliui/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/types/date.js": [
|
||||
"/workspace/node_modules/tap-yaml/src/types/date.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap-yaml/dist/esm/types/timestamp.js": [
|
||||
"/workspace/node_modules/tap-yaml/src/types/timestamp.ts"
|
||||
],
|
||||
"/workspace/node_modules/tcompare/dist/esm/react-element-to-jsx-string.js": [
|
||||
"/workspace/node_modules/tcompare/src/react-element-to-jsx-string.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/opt-arg.js": [
|
||||
"/workspace/node_modules/rimraf/src/opt-arg.ts"
|
||||
],
|
||||
"/workspace/node_modules/glob/dist/esm/index.min.js": [
|
||||
"/workspace/node_modules/glob/node_modules/balanced-match/src/index.ts",
|
||||
"/workspace/node_modules/glob/node_modules/brace-expansion/src/index.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minimatch/src/assert-valid-pattern.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minimatch/src/brace-expressions.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minimatch/src/unescape.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minimatch/src/ast.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minimatch/src/escape.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minimatch/src/index.ts",
|
||||
"/workspace/node_modules/glob/src/glob.ts",
|
||||
"/workspace/node_modules/glob/node_modules/lru-cache/src/index.ts",
|
||||
"/workspace/node_modules/glob/node_modules/path-scurry/src/index.ts",
|
||||
"/workspace/node_modules/glob/node_modules/minipass/src/index.ts",
|
||||
"/workspace/node_modules/glob/src/pattern.ts",
|
||||
"/workspace/node_modules/glob/src/ignore.ts",
|
||||
"/workspace/node_modules/glob/src/processor.ts",
|
||||
"/workspace/node_modules/glob/src/walker.ts",
|
||||
"/workspace/node_modules/glob/src/has-magic.ts",
|
||||
"/workspace/node_modules/glob/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/path-arg.js": [
|
||||
"/workspace/node_modules/rimraf/src/path-arg.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-manual.js": [
|
||||
"/workspace/node_modules/rimraf/src/rimraf-manual.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-move-remove.js": [
|
||||
"/workspace/node_modules/rimraf/src/rimraf-move-remove.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-native.js": [
|
||||
"/workspace/node_modules/rimraf/src/rimraf-native.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-posix.js": [
|
||||
"/workspace/node_modules/rimraf/src/rimraf-posix.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/rimraf-windows.js": [
|
||||
"/workspace/node_modules/rimraf/src/rimraf-windows.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/use-native.js": [
|
||||
"/workspace/node_modules/rimraf/src/use-native.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/index.js": [
|
||||
"/workspace/node_modules/mkdirp/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/walk-up-path/dist/esm/index.js": [
|
||||
"/workspace/node_modules/walk-up-path/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/index.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/comment.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/comment.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/on-add.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/on-add.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/print-messages.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/print-messages.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/stdio.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/stdio.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/snapshot/dist/esm/require.js": [
|
||||
"/workspace/node_modules/@tapjs/snapshot/src/require.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-map.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/test-map.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/mkdirp-manual.js": [
|
||||
"/workspace/node_modules/mkdirp/src/mkdirp-manual.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/opts-arg.js": [
|
||||
"/workspace/node_modules/mkdirp/src/opts-arg.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/mkdirp-native.js": [
|
||||
"/workspace/node_modules/mkdirp/src/mkdirp-native.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/default-tmp.js": [
|
||||
"/workspace/node_modules/rimraf/src/default-tmp.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/path-arg.js": [
|
||||
"/workspace/node_modules/mkdirp/src/path-arg.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/use-native.js": [
|
||||
"/workspace/node_modules/mkdirp/src/use-native.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/ignore-enoent.js": [
|
||||
"/workspace/node_modules/rimraf/src/ignore-enoent.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/readdir-or-error.js": [
|
||||
"/workspace/node_modules/rimraf/src/readdir-or-error.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/fix-eperm.js": [
|
||||
"/workspace/node_modules/rimraf/src/fix-eperm.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/error.js": [
|
||||
"/workspace/node_modules/rimraf/src/error.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/retry-busy.js": [
|
||||
"/workspace/node_modules/rimraf/src/retry-busy.ts"
|
||||
],
|
||||
"/workspace/node_modules/rimraf/dist/esm/fs.js": [
|
||||
"/workspace/node_modules/rimraf/src/fs.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/test-stream-serialize.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/test-stream-serialize.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/serialize.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/serialize.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/deserialize.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/deserialize.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/test-stream-deserialize.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/test-stream-deserialize.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-nested-location.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/test-nested-location.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/loc-from-at.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/loc-from-at.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/constants.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/constants.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/error-serdes/dist/esm/messages.js": [
|
||||
"/workspace/node_modules/@tapjs/error-serdes/src/messages.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-results.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/test-results.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-point-message-data.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/test-point-message-data.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-message-data.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/test-message-data.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/test-point-results.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/test-point-results.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/loc-from-callsite.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/loc-from-callsite.ts"
|
||||
],
|
||||
"/workspace/node_modules/mkdirp/dist/mjs/find-made.js": [
|
||||
"/workspace/node_modules/mkdirp/src/find-made.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/result-to-error.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/result-to-error.ts"
|
||||
],
|
||||
"/workspace/node_modules/@tapjs/node-serialize/dist/esm/pretty-diff.js": [
|
||||
"/workspace/node_modules/@tapjs/node-serialize/src/pretty-diff.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap/dist/esm/index.js": [
|
||||
"/workspace/node_modules/tap/src/index.ts"
|
||||
],
|
||||
"/workspace/dist/esm/index.js": [
|
||||
"/workspace/src/index.ts"
|
||||
],
|
||||
"/workspace/node_modules/tap/dist/esm/main.js": [
|
||||
"/workspace/node_modules/tap/src/main.ts"
|
||||
],
|
||||
"/workspace/node_modules/balanced-match/dist/esm/index.js": [
|
||||
"/workspace/node_modules/balanced-match/src/index.ts"
|
||||
]
|
||||
},
|
||||
"root": "8b906b8c-e21f-40b5-8c0d-214d8c2682c5",
|
||||
"externalID": "test/index.js",
|
||||
"code": 0,
|
||||
"signal": null,
|
||||
"runtime": 2740.9173339999998
|
||||
}
|
||||
107
electron/node_modules/@electron/asar/node_modules/brace-expansion/ADVISORY-CVE-2026-14257.md
generated
vendored
Normal file
107
electron/node_modules/@electron/asar/node_modules/brace-expansion/ADVISORY-CVE-2026-14257.md
generated
vendored
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
# DoS via unbounded expansion length — out-of-memory process crash
|
||||
|
||||
- **CVE:** CVE-2026-14257
|
||||
- **Package:** brace-expansion (npm)
|
||||
- **Reporter:** @bnbdr
|
||||
- **Severity (proposed):** High — `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H` (7.5)
|
||||
- **Weakness:** CWE-770 (Allocation of Resources Without Limits or Throttling) / CWE-400 (Uncontrolled Resource Consumption)
|
||||
- **Affected:** all versions up to and including `5.0.7` (the `1.x`, `2.x`, `3.x` and `4.x` lines share the same combine logic and are expected to be affected)
|
||||
|
||||
### Summary
|
||||
|
||||
`expand()` bounds the *number* of results it produces (the `max` option,
|
||||
`100_000` by default) but not their *length*. By chaining many brace groups,
|
||||
an attacker keeps the result count under `max` while making every result grow
|
||||
with the number of groups. Building `max` long results — plus the intermediate
|
||||
arrays combined at each brace group — exhausts memory and crashes the Node
|
||||
process with an **uncatchable** out-of-memory error. `try/catch` around
|
||||
`expand()` does not help: the fatal error terminates the process.
|
||||
|
||||
A ~7.5 KB input (`'{a,b}'.repeat(1500)`) is enough to crash a default Node
|
||||
process.
|
||||
|
||||
### Details
|
||||
|
||||
For `N` chained brace groups such as `'{a,b}'.repeat(N)`:
|
||||
|
||||
- the result count is `2^N`, immediately capped at `max` (`100_000`), so the
|
||||
`max` protection appears to hold, but
|
||||
- each result is `N` characters long, so the total output size is
|
||||
`max × N` characters, which grows without bound in `N`.
|
||||
|
||||
`expand_` combines each brace set with the fully-expanded tail:
|
||||
|
||||
```js
|
||||
const post = m.post.length ? expand_(m.post, max, false) : ['']
|
||||
...
|
||||
for (let j = 0; j < N.length; j++) {
|
||||
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
||||
const expansion = pre + N[j] + post[k] // grows one group longer per level
|
||||
...
|
||||
expansions.push(expansion)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The loop guard `expansions.length < max` limits how many strings are built, but
|
||||
nothing limits how long they get. Each recursion level materializes another
|
||||
array of up to `max` strings, one character longer than the level below, and —
|
||||
because V8 represents `pre + N[j] + post[k]` as a cons-string (rope) that
|
||||
references `post[k]` — those intermediate strings stay reachable through the
|
||||
whole chain. Memory therefore scales with `max × N`.
|
||||
|
||||
Measured on `5.0.7` (`'{a,b}'.repeat(N)`, default `max`):
|
||||
|
||||
| groups (N) | input bytes | result count | peak RSS |
|
||||
|---|---|---|---|
|
||||
| 20 | 100 | 100,000 | ~80 MB |
|
||||
| 50 | 250 | 100,000 | ~214 MB |
|
||||
| 100 | 500 | 100,000 | ~409 MB |
|
||||
| 300 | 1,500 | 100,000 | ~1,148 MB |
|
||||
| 1500 | 7,500 | — | **OOM crash** |
|
||||
|
||||
### Proof of concept
|
||||
|
||||
```js
|
||||
const { expand } = require('brace-expansion')
|
||||
|
||||
// ~7.5 KB input — crashes the process with a fatal, uncatchable OOM:
|
||||
// FATAL ERROR: ... JavaScript heap out of memory
|
||||
try {
|
||||
expand('{a,b}'.repeat(1500))
|
||||
} catch (e) {
|
||||
// never reached — the process is already dead
|
||||
}
|
||||
```
|
||||
|
||||
### Impact
|
||||
|
||||
Any application that passes attacker-influenced strings to
|
||||
`brace-expansion.expand()` — directly, or transitively via `minimatch` / `glob`
|
||||
brace patterns — can be crashed by a small request. Because the failure is a
|
||||
fatal V8 out-of-memory error rather than a thrown exception, it cannot be caught
|
||||
and it takes down the whole worker/process, denying service.
|
||||
|
||||
### Remediation
|
||||
|
||||
Upgrade to a patched release. The fix bounds the total number of characters a
|
||||
single `expand()` call may accumulate (`EXPANSION_MAX_LENGTH`, default
|
||||
`4_000_000`, configurable via a new `maxLength` option), applied inside the
|
||||
output-building loops so intermediate arrays are bounded too. Once the limit is
|
||||
reached, output is truncated — consistent with how `max` already truncates —
|
||||
instead of growing without bound. The limit sits well above any realistic
|
||||
expansion (100,000 results hitting `max` measure ~1M characters), so legitimate
|
||||
input is unaffected.
|
||||
|
||||
After the fix, `'{a,b}'.repeat(1500)` returns a bounded, truncated result in
|
||||
~0.7 s using ~340 MB and never crashes, including under a constrained 512 MB
|
||||
heap.
|
||||
|
||||
The fix bounds memory but the algorithm still rebuilds intermediate arrays at
|
||||
each level (roughly `O(N × maxLength)` work on this input class). A streaming
|
||||
rewrite that produces output in `O(total output size)` can be a non-urgent
|
||||
follow-up.
|
||||
|
||||
If immediate upgrade isn't possible, avoid passing untrusted input to
|
||||
`expand()` / glob brace patterns, or pass a small explicit `max` **and**
|
||||
`maxLength`.
|
||||
21
electron/node_modules/@electron/asar/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
21
electron/node_modules/@electron/asar/node_modules/brace-expansion/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
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.
|
||||
129
electron/node_modules/@electron/asar/node_modules/brace-expansion/README.md
generated
vendored
Normal file
129
electron/node_modules/@electron/asar/node_modules/brace-expansion/README.md
generated
vendored
Normal file
|
|
@ -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.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](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.
|
||||
8
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.d.ts
generated
vendored
Normal file
8
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export declare const EXPANSION_MAX = 100000;
|
||||
export declare const EXPANSION_MAX_LENGTH = 4000000;
|
||||
export type BraceExpansionOptions = {
|
||||
max?: number;
|
||||
maxLength?: number;
|
||||
};
|
||||
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.d.ts.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}
|
||||
263
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.js
generated
vendored
Normal file
263
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,263 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0;
|
||||
exports.expand = expand;
|
||||
const balanced_match_1 = require("balanced-match");
|
||||
const escSlash = '\0SLASH' + Math.random() + '\0';
|
||||
const escOpen = '\0OPEN' + Math.random() + '\0';
|
||||
const escClose = '\0CLOSE' + Math.random() + '\0';
|
||||
const escComma = '\0COMMA' + Math.random() + '\0';
|
||||
const escPeriod = '\0PERIOD' + Math.random() + '\0';
|
||||
const escSlashPattern = new RegExp(escSlash, 'g');
|
||||
const escOpenPattern = new RegExp(escOpen, 'g');
|
||||
const escClosePattern = new RegExp(escClose, 'g');
|
||||
const escCommaPattern = new RegExp(escComma, 'g');
|
||||
const escPeriodPattern = new RegExp(escPeriod, 'g');
|
||||
const slashPattern = /\\\\/g;
|
||||
const openPattern = /\\{/g;
|
||||
const closePattern = /\\}/g;
|
||||
const commaPattern = /\\,/g;
|
||||
const periodPattern = /\\\./g;
|
||||
exports.EXPANSION_MAX = 100_000;
|
||||
// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
|
||||
// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
|
||||
// truncated to 100k results - while making every result ~1500 characters
|
||||
// long. The result set, and the intermediate arrays built while combining
|
||||
// brace sets, then grow large enough to exhaust memory and crash the process
|
||||
// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
|
||||
// characters the accumulator may hold at any point, so memory stays flat no
|
||||
// matter how many brace groups are chained. The limit sits well above any
|
||||
// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
|
||||
// characters) so legitimate input is unaffected.
|
||||
exports.EXPANSION_MAX_LENGTH = 4_000_000;
|
||||
function numeric(str) {
|
||||
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
||||
}
|
||||
function escapeBraces(str) {
|
||||
return str
|
||||
.replace(slashPattern, escSlash)
|
||||
.replace(openPattern, escOpen)
|
||||
.replace(closePattern, escClose)
|
||||
.replace(commaPattern, escComma)
|
||||
.replace(periodPattern, escPeriod);
|
||||
}
|
||||
function unescapeBraces(str) {
|
||||
return str
|
||||
.replace(escSlashPattern, '\\')
|
||||
.replace(escOpenPattern, '{')
|
||||
.replace(escClosePattern, '}')
|
||||
.replace(escCommaPattern, ',')
|
||||
.replace(escPeriodPattern, '.');
|
||||
}
|
||||
/**
|
||||
* 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 [''];
|
||||
}
|
||||
const parts = [];
|
||||
const m = (0, balanced_match_1.balanced)('{', '}', str);
|
||||
if (!m) {
|
||||
return str.split(',');
|
||||
}
|
||||
const { pre, body, post } = m;
|
||||
const p = pre.split(',');
|
||||
p[p.length - 1] += '{' + body + '}';
|
||||
const 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 expand(str, options = {}) {
|
||||
if (!str) {
|
||||
return [];
|
||||
}
|
||||
const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options;
|
||||
// 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.slice(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.slice(2);
|
||||
}
|
||||
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
||||
}
|
||||
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;
|
||||
}
|
||||
// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
|
||||
// number of results at `max` and the total number of characters at `maxLength`.
|
||||
// This is the one place output grows, so bounding it here keeps the single
|
||||
// accumulator - and therefore memory - flat regardless of how many brace groups
|
||||
// are combined (CVE-2026-14257).
|
||||
function combine(acc, pre, values, max, maxLength, dropEmpties) {
|
||||
const out = [];
|
||||
let length = 0;
|
||||
for (let a = 0; a < acc.length; a++) {
|
||||
for (let v = 0; v < values.length; v++) {
|
||||
if (out.length >= max)
|
||||
return out;
|
||||
const expansion = acc[a] + pre + values[v];
|
||||
// Bash drops empty results at the top level. Skip them before they count
|
||||
// against `max`, so `max` bounds the number of *kept* results.
|
||||
if (dropEmpties && !expansion)
|
||||
continue;
|
||||
if (length + expansion.length > maxLength)
|
||||
return out;
|
||||
out.push(expansion);
|
||||
length += expansion.length;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
|
||||
// sequence body.
|
||||
function expandSequence(body, isAlphaSequence, max) {
|
||||
const n = body.split(/\.\./);
|
||||
const N = [];
|
||||
// A sequence body always splits into two or three parts, but the compiler
|
||||
// can't know that.
|
||||
/* c8 ignore start */
|
||||
if (n[0] === undefined || n[1] === undefined) {
|
||||
return N;
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const x = numeric(n[0]);
|
||||
const y = numeric(n[1]);
|
||||
const width = Math.max(n[0].length, n[1].length);
|
||||
let incr = n.length === 3 && n[2] !== undefined ?
|
||||
Math.max(Math.abs(numeric(n[2])), 1)
|
||||
: 1;
|
||||
let test = lte;
|
||||
const reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
const pad = n.some(isPadded);
|
||||
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
||||
let c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\') {
|
||||
c = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
const need = width - c.length;
|
||||
if (need > 0) {
|
||||
const z = new Array(need + 1).join('0');
|
||||
if (i < 0) {
|
||||
c = '-' + z + c.slice(1);
|
||||
}
|
||||
else {
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
return N;
|
||||
}
|
||||
function expand_(str, max, maxLength, isTop) {
|
||||
// Consume the string's top-level brace groups left to right, threading a
|
||||
// running set of combined prefixes (`acc`). Expanding the tail iteratively -
|
||||
// rather than recursing on `m.post` once per group - keeps the native stack
|
||||
// depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
|
||||
// longer overflow the stack, and leaves a single accumulator whose size
|
||||
// `maxLength` bounds directly (CVE-2026-14257).
|
||||
let acc = [''];
|
||||
// Bash drops empty results, but only when the *first* top-level group is a
|
||||
// comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
|
||||
// is on the final strings, so it is applied to whichever `combine` produces
|
||||
// them (the one with no brace set left in the tail).
|
||||
let dropEmpties = false;
|
||||
let firstGroup = true;
|
||||
for (;;) {
|
||||
const m = (0, balanced_match_1.balanced)('{', '}', str);
|
||||
// No brace set left: the rest of the string is literal.
|
||||
if (!m) {
|
||||
return combine(acc, str, [''], max, maxLength, dropEmpties);
|
||||
}
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
const pre = m.pre;
|
||||
if (/\$$/.test(pre)) {
|
||||
acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);
|
||||
firstGroup = false;
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
continue;
|
||||
}
|
||||
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isSequence = isNumericSequence || isAlphaSequence;
|
||||
const isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
isTop = true;
|
||||
continue;
|
||||
}
|
||||
// Nothing here expands, so the whole remaining string is literal.
|
||||
return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);
|
||||
}
|
||||
if (firstGroup) {
|
||||
dropEmpties = isTop && !isSequence;
|
||||
firstGroup = false;
|
||||
}
|
||||
let values;
|
||||
if (isSequence) {
|
||||
values = expandSequence(m.body, isAlphaSequence, max);
|
||||
}
|
||||
else {
|
||||
let n = parseCommaParts(m.body);
|
||||
if (n.length === 1 && n[0] !== undefined) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand_(n[0], max, maxLength, false).map(embrace);
|
||||
//XXX is this necessary? Can't seem to hit it in tests.
|
||||
/* c8 ignore start */
|
||||
if (n.length === 1) {
|
||||
acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
continue;
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
values = [];
|
||||
for (let j = 0; j < n.length; j++) {
|
||||
values.push.apply(values, expand_(n[j], max, maxLength, false));
|
||||
}
|
||||
}
|
||||
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
}
|
||||
return acc;
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/package.json
generated
vendored
Normal file
3
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/commonjs/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
8
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.d.ts
generated
vendored
Normal file
8
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export declare const EXPANSION_MAX = 100000;
|
||||
export declare const EXPANSION_MAX_LENGTH = 4000000;
|
||||
export type BraceExpansionOptions = {
|
||||
max?: number;
|
||||
maxLength?: number;
|
||||
};
|
||||
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.d.ts.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}
|
||||
259
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.js
generated
vendored
Normal file
259
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
import { balanced } from 'balanced-match';
|
||||
const escSlash = '\0SLASH' + Math.random() + '\0';
|
||||
const escOpen = '\0OPEN' + Math.random() + '\0';
|
||||
const escClose = '\0CLOSE' + Math.random() + '\0';
|
||||
const escComma = '\0COMMA' + Math.random() + '\0';
|
||||
const escPeriod = '\0PERIOD' + Math.random() + '\0';
|
||||
const escSlashPattern = new RegExp(escSlash, 'g');
|
||||
const escOpenPattern = new RegExp(escOpen, 'g');
|
||||
const escClosePattern = new RegExp(escClose, 'g');
|
||||
const escCommaPattern = new RegExp(escComma, 'g');
|
||||
const escPeriodPattern = new RegExp(escPeriod, 'g');
|
||||
const slashPattern = /\\\\/g;
|
||||
const openPattern = /\\{/g;
|
||||
const closePattern = /\\}/g;
|
||||
const commaPattern = /\\,/g;
|
||||
const periodPattern = /\\\./g;
|
||||
export const EXPANSION_MAX = 100_000;
|
||||
// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
|
||||
// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
|
||||
// truncated to 100k results - while making every result ~1500 characters
|
||||
// long. The result set, and the intermediate arrays built while combining
|
||||
// brace sets, then grow large enough to exhaust memory and crash the process
|
||||
// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
|
||||
// characters the accumulator may hold at any point, so memory stays flat no
|
||||
// matter how many brace groups are chained. The limit sits well above any
|
||||
// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
|
||||
// characters) so legitimate input is unaffected.
|
||||
export const EXPANSION_MAX_LENGTH = 4_000_000;
|
||||
function numeric(str) {
|
||||
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
||||
}
|
||||
function escapeBraces(str) {
|
||||
return str
|
||||
.replace(slashPattern, escSlash)
|
||||
.replace(openPattern, escOpen)
|
||||
.replace(closePattern, escClose)
|
||||
.replace(commaPattern, escComma)
|
||||
.replace(periodPattern, escPeriod);
|
||||
}
|
||||
function unescapeBraces(str) {
|
||||
return str
|
||||
.replace(escSlashPattern, '\\')
|
||||
.replace(escOpenPattern, '{')
|
||||
.replace(escClosePattern, '}')
|
||||
.replace(escCommaPattern, ',')
|
||||
.replace(escPeriodPattern, '.');
|
||||
}
|
||||
/**
|
||||
* 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 [''];
|
||||
}
|
||||
const parts = [];
|
||||
const m = balanced('{', '}', str);
|
||||
if (!m) {
|
||||
return str.split(',');
|
||||
}
|
||||
const { pre, body, post } = m;
|
||||
const p = pre.split(',');
|
||||
p[p.length - 1] += '{' + body + '}';
|
||||
const postParts = parseCommaParts(post);
|
||||
if (post.length) {
|
||||
;
|
||||
p[p.length - 1] += postParts.shift();
|
||||
p.push.apply(p, postParts);
|
||||
}
|
||||
parts.push.apply(parts, p);
|
||||
return parts;
|
||||
}
|
||||
export function expand(str, options = {}) {
|
||||
if (!str) {
|
||||
return [];
|
||||
}
|
||||
const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
|
||||
// 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.slice(0, 2) === '{}') {
|
||||
str = '\\{\\}' + str.slice(2);
|
||||
}
|
||||
return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
||||
}
|
||||
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;
|
||||
}
|
||||
// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
|
||||
// number of results at `max` and the total number of characters at `maxLength`.
|
||||
// This is the one place output grows, so bounding it here keeps the single
|
||||
// accumulator - and therefore memory - flat regardless of how many brace groups
|
||||
// are combined (CVE-2026-14257).
|
||||
function combine(acc, pre, values, max, maxLength, dropEmpties) {
|
||||
const out = [];
|
||||
let length = 0;
|
||||
for (let a = 0; a < acc.length; a++) {
|
||||
for (let v = 0; v < values.length; v++) {
|
||||
if (out.length >= max)
|
||||
return out;
|
||||
const expansion = acc[a] + pre + values[v];
|
||||
// Bash drops empty results at the top level. Skip them before they count
|
||||
// against `max`, so `max` bounds the number of *kept* results.
|
||||
if (dropEmpties && !expansion)
|
||||
continue;
|
||||
if (length + expansion.length > maxLength)
|
||||
return out;
|
||||
out.push(expansion);
|
||||
length += expansion.length;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
|
||||
// sequence body.
|
||||
function expandSequence(body, isAlphaSequence, max) {
|
||||
const n = body.split(/\.\./);
|
||||
const N = [];
|
||||
// A sequence body always splits into two or three parts, but the compiler
|
||||
// can't know that.
|
||||
/* c8 ignore start */
|
||||
if (n[0] === undefined || n[1] === undefined) {
|
||||
return N;
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
const x = numeric(n[0]);
|
||||
const y = numeric(n[1]);
|
||||
const width = Math.max(n[0].length, n[1].length);
|
||||
let incr = n.length === 3 && n[2] !== undefined ?
|
||||
Math.max(Math.abs(numeric(n[2])), 1)
|
||||
: 1;
|
||||
let test = lte;
|
||||
const reverse = y < x;
|
||||
if (reverse) {
|
||||
incr *= -1;
|
||||
test = gte;
|
||||
}
|
||||
const pad = n.some(isPadded);
|
||||
for (let i = x; test(i, y) && N.length < max; i += incr) {
|
||||
let c;
|
||||
if (isAlphaSequence) {
|
||||
c = String.fromCharCode(i);
|
||||
if (c === '\\') {
|
||||
c = '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
c = String(i);
|
||||
if (pad) {
|
||||
const need = width - c.length;
|
||||
if (need > 0) {
|
||||
const z = new Array(need + 1).join('0');
|
||||
if (i < 0) {
|
||||
c = '-' + z + c.slice(1);
|
||||
}
|
||||
else {
|
||||
c = z + c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
N.push(c);
|
||||
}
|
||||
return N;
|
||||
}
|
||||
function expand_(str, max, maxLength, isTop) {
|
||||
// Consume the string's top-level brace groups left to right, threading a
|
||||
// running set of combined prefixes (`acc`). Expanding the tail iteratively -
|
||||
// rather than recursing on `m.post` once per group - keeps the native stack
|
||||
// depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
|
||||
// longer overflow the stack, and leaves a single accumulator whose size
|
||||
// `maxLength` bounds directly (CVE-2026-14257).
|
||||
let acc = [''];
|
||||
// Bash drops empty results, but only when the *first* top-level group is a
|
||||
// comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
|
||||
// is on the final strings, so it is applied to whichever `combine` produces
|
||||
// them (the one with no brace set left in the tail).
|
||||
let dropEmpties = false;
|
||||
let firstGroup = true;
|
||||
for (;;) {
|
||||
const m = balanced('{', '}', str);
|
||||
// No brace set left: the rest of the string is literal.
|
||||
if (!m) {
|
||||
return combine(acc, str, [''], max, maxLength, dropEmpties);
|
||||
}
|
||||
// no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
const pre = m.pre;
|
||||
if (/\$$/.test(pre)) {
|
||||
acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);
|
||||
firstGroup = false;
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
continue;
|
||||
}
|
||||
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
const isSequence = isNumericSequence || isAlphaSequence;
|
||||
const isOptions = m.body.indexOf(',') >= 0;
|
||||
if (!isSequence && !isOptions) {
|
||||
// {a},b}
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
isTop = true;
|
||||
continue;
|
||||
}
|
||||
// Nothing here expands, so the whole remaining string is literal.
|
||||
return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);
|
||||
}
|
||||
if (firstGroup) {
|
||||
dropEmpties = isTop && !isSequence;
|
||||
firstGroup = false;
|
||||
}
|
||||
let values;
|
||||
if (isSequence) {
|
||||
values = expandSequence(m.body, isAlphaSequence, max);
|
||||
}
|
||||
else {
|
||||
let n = parseCommaParts(m.body);
|
||||
if (n.length === 1 && n[0] !== undefined) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
n = expand_(n[0], max, maxLength, false).map(embrace);
|
||||
//XXX is this necessary? Can't seem to hit it in tests.
|
||||
/* c8 ignore start */
|
||||
if (n.length === 1) {
|
||||
acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
continue;
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
values = [];
|
||||
for (let j = 0; j < n.length; j++) {
|
||||
values.push.apply(values, expand_(n[j], max, maxLength, false));
|
||||
}
|
||||
}
|
||||
acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
|
||||
if (!m.post.length)
|
||||
break;
|
||||
str = m.post;
|
||||
}
|
||||
return acc;
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.js.map
generated
vendored
Normal file
1
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/package.json
generated
vendored
Normal file
3
electron/node_modules/@electron/asar/node_modules/brace-expansion/dist/esm/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "module"
|
||||
}
|
||||
209
electron/node_modules/@electron/asar/node_modules/brace-expansion/index.js
generated
vendored
Normal file
209
electron/node_modules/@electron/asar/node_modules/brace-expansion/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
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, options) {
|
||||
if (!str)
|
||||
return [];
|
||||
|
||||
options = options || {};
|
||||
var max = options.max == null ? Infinity : options.max;
|
||||
|
||||
// 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), max, 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, max, isTop) {
|
||||
var expansions = [];
|
||||
|
||||
// The `{a},b}` rewrite below restarts expansion on a rewritten string with
|
||||
// the same `max` and `isTop = true`. Loop instead of recursing so a long run
|
||||
// of non-expanding `{}` groups can't exhaust the call stack.
|
||||
for (;;) {
|
||||
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;
|
||||
isTop = true
|
||||
continue
|
||||
}
|
||||
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], max, false).map(embrace);
|
||||
if (n.length === 1) {
|
||||
var post = m.post.length
|
||||
? expand(m.post, max, 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, max, 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.max(Math.abs(numeric(n[2])), 1)
|
||||
: 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) && N.length < max; 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, max, false) });
|
||||
}
|
||||
|
||||
for (var j = 0; j < N.length; j++) {
|
||||
for (var k = 0; k < post.length && expansions.length < max; k++) {
|
||||
var expansion = pre + N[j] + post[k];
|
||||
if (!isTop || isSequence || expansion)
|
||||
expansions.push(expansion);
|
||||
}
|
||||
}
|
||||
|
||||
return expansions;
|
||||
}
|
||||
}
|
||||
50
electron/node_modules/@electron/asar/node_modules/brace-expansion/package.json
generated
vendored
Normal file
50
electron/node_modules/@electron/asar/node_modules/brace-expansion/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"name": "brace-expansion",
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
"version": "1.1.16",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
385
electron/node_modules/@electron/asar/node_modules/commander/CHANGELOG.md
generated
vendored
Normal file
385
electron/node_modules/@electron/asar/node_modules/commander/CHANGELOG.md
generated
vendored
Normal file
|
|
@ -0,0 +1,385 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). (Format adopted after v3.0.0.)
|
||||
|
||||
<!-- markdownlint-disable MD024 -->
|
||||
|
||||
## [5.1.0] (2020-04-25)
|
||||
|
||||
### Added
|
||||
|
||||
- support for multiple command aliases, the first of which is shown in the auto-generated help ([#531], [#1236])
|
||||
- configuration support in `addCommand()` for `hidden` and `isDefault` ([#1232])
|
||||
|
||||
### Fixed
|
||||
|
||||
- omit masked help flags from the displayed help ([#645], [#1247])
|
||||
- remove old short help flag when change help flags using `helpOption` ([#1248])
|
||||
|
||||
### Changed
|
||||
|
||||
- remove use of `arguments` to improve auto-generated help in editors ([#1235])
|
||||
- rename `.command()` configuration `noHelp` to `hidden` (but not remove old support) ([#1232])
|
||||
- improvements to documentation
|
||||
- update dependencies
|
||||
- update tested versions of node
|
||||
- eliminate lint errors in TypeScript ([#1208])
|
||||
|
||||
## [5.0.0] (2020-03-14)
|
||||
|
||||
### Added
|
||||
|
||||
* support for nested commands with action-handlers ([#1] [#764] [#1149])
|
||||
* `.addCommand()` for adding a separately configured command ([#764] [#1149])
|
||||
* allow a non-executable to be set as the default command ([#742] [#1149])
|
||||
* implicit help command when there are subcommands (previously only if executables) ([#1149])
|
||||
* customise implicit help command with `.addHelpCommand()` ([#1149])
|
||||
* display error message for unknown subcommand, by default ([#432] [#1088] [#1149])
|
||||
* display help for missing subcommand, by default ([#1088] [#1149])
|
||||
* combined short options as single argument may include boolean flags and value flag and value (e.g. `-a -b -p 80` can be written as `-abp80`) ([#1145])
|
||||
* `.parseOption()` includes short flag and long flag expansions ([#1145])
|
||||
* `.helpInformation()` returns help text as a string, previously a private routine ([#1169])
|
||||
* `.parse()` implicitly uses `process.argv` if arguments not specified ([#1172])
|
||||
* optionally specify where `.parse()` arguments "from", if not following node conventions ([#512] [#1172])
|
||||
* suggest help option along with unknown command error ([#1179])
|
||||
* TypeScript definition for `commands` property of `Command` ([#1184])
|
||||
* export `program` property ([#1195])
|
||||
* `createCommand` factory method to simplify subclassing ([#1191])
|
||||
|
||||
### Fixed
|
||||
|
||||
* preserve argument order in subcommands ([#508] [#962] [#1138])
|
||||
* do not emit `command:*` for executable subcommands ([#809] [#1149])
|
||||
* action handler called whether or not there are non-option arguments ([#1062] [#1149])
|
||||
* combining option short flag and value in single argument now works for subcommands ([#1145])
|
||||
* only add implicit help command when it will not conflict with other uses of argument ([#1153] [#1149])
|
||||
* implicit help command works with command aliases ([#948] [#1149])
|
||||
* options are validated whether or not there is an action handler ([#1149])
|
||||
|
||||
### Changed
|
||||
|
||||
* *Breaking* `.args` contains command arguments with just recognised options removed ([#1032] [#1138])
|
||||
* *Breaking* display error if required argument for command is missing ([#995] [#1149])
|
||||
* tighten TypeScript definition of custom option processing function passed to `.option()` ([#1119])
|
||||
* *Breaking* `.allowUnknownOption()` ([#802] [#1138])
|
||||
* unknown options included in arguments passed to command action handler
|
||||
* unknown options included in `.args`
|
||||
* only recognised option short flags and long flags are expanded (e.g. `-ab` or `--foo=bar`) ([#1145])
|
||||
* *Breaking* `.parseOptions()` ([#1138])
|
||||
* `args` in returned result renamed `operands` and does not include anything after first unknown option
|
||||
* `unknown` in returned result has arguments after first unknown option including operands, not just options and values
|
||||
* *Breaking* `.on('command:*', callback)` and other command events passed (changed) results from `.parseOptions`, i.e. operands and unknown ([#1138])
|
||||
* refactor Option from prototype to class ([#1133])
|
||||
* refactor Command from prototype to class ([#1159])
|
||||
* changes to error handling ([#1165])
|
||||
* throw for author error, not just display message
|
||||
* preflight for variadic error
|
||||
* add tips to missing subcommand executable
|
||||
* TypeScript fluent return types changed to be more subclass friendly, return `this` rather than `Command` ([#1180])
|
||||
* `.parseAsync` returns `Promise<this>` to be consistent with `.parse()` ([#1180])
|
||||
* update dependencies
|
||||
|
||||
### Removed
|
||||
|
||||
* removed EventEmitter from TypeScript definition for Command, eliminating implicit peer dependency on `@types/node` ([#1146])
|
||||
* removed private function `normalize` (the functionality has been integrated into `parseOptions`) ([#1145])
|
||||
* `parseExpectedArgs` is now private ([#1149])
|
||||
|
||||
### Migration Tips
|
||||
|
||||
If you use `.on('command:*')` or more complicated tests to detect an unrecognised subcommand, you may be able to delete the code and rely on the default behaviour.
|
||||
|
||||
If you use `program.args` or more complicated tests to detect a missing subcommand, you may be able to delete the code and rely on the default behaviour.
|
||||
|
||||
If you use `.command('*')` to add a default command, you may be be able to switch to `isDefault:true` with a named command.
|
||||
|
||||
## [5.0.0-4] (2020-03-03)
|
||||
|
||||
(Released in 5.0.0)
|
||||
|
||||
## [5.0.0-3] (2020-02-20)
|
||||
|
||||
(Released in 5.0.0)
|
||||
|
||||
## [5.0.0-2] (2020-02-10)
|
||||
|
||||
(Released in 5.0.0)
|
||||
|
||||
## [5.0.0-1] (2020-02-08)
|
||||
|
||||
(Released in 5.0.0)
|
||||
|
||||
## [5.0.0-0] (2020-02-02)
|
||||
|
||||
(Released in 5.0.0)
|
||||
|
||||
## [4.1.1] (2020-02-02)
|
||||
|
||||
### Fixed
|
||||
|
||||
* TypeScript definition for `.action()` should include Promise for async ([#1157])
|
||||
|
||||
## [4.1.0] (2020-01-06)
|
||||
|
||||
### Added
|
||||
|
||||
* two routines to change how option values are handled, and eliminate name clashes with command properties ([#933] [#1102])
|
||||
* see storeOptionsAsProperties and passCommandToAction in README
|
||||
* `.parseAsync` to use instead of `.parse` if supply async action handlers ([#806] [#1118])
|
||||
|
||||
### Fixed
|
||||
|
||||
* Remove trailing blanks from wrapped help text ([#1096])
|
||||
|
||||
### Changed
|
||||
|
||||
* update dependencies
|
||||
* extend security coverage for Commander 2.x to 2020-02-03
|
||||
* improvements to README
|
||||
* improvements to TypeScript definition documentation
|
||||
* move old versions out of main CHANGELOG
|
||||
* removed explicit use of `ts-node` in tests
|
||||
|
||||
## [4.0.1] (2019-11-12)
|
||||
|
||||
### Fixed
|
||||
|
||||
* display help when requested, even if there are missing required options ([#1091])
|
||||
|
||||
## [4.0.0] (2019-11-02)
|
||||
|
||||
### Added
|
||||
|
||||
* automatically wrap and indent help descriptions for options and commands ([#1051])
|
||||
* `.exitOverride()` allows override of calls to `process.exit` for additional error handling and to keep program running ([#1040])
|
||||
* support for declaring required options with `.requiredOptions()` ([#1071])
|
||||
* GitHub Actions support ([#1027])
|
||||
* translation links in README
|
||||
|
||||
### Changed
|
||||
|
||||
* dev: switch tests from Sinon+Should to Jest with major rewrite of tests ([#1035])
|
||||
* call default subcommand even when there are unknown options ([#1047])
|
||||
* *Breaking* Commander is only officially supported on Node 8 and above, and requires Node 6 ([#1053])
|
||||
|
||||
### Fixed
|
||||
|
||||
* *Breaking* keep command object out of program.args when action handler called ([#1048])
|
||||
* also, action handler now passed array of unknown arguments
|
||||
* complain about unknown options when program argument supplied and action handler ([#1049])
|
||||
* this changes parameters to `command:*` event to include unknown arguments
|
||||
* removed deprecated `customFds` option from call to `child_process.spawn` ([#1052])
|
||||
* rework TypeScript declarations to bring all types into imported namespace ([#1081])
|
||||
|
||||
### Migration Tips
|
||||
|
||||
#### Testing for no arguments
|
||||
|
||||
If you were previously using code like:
|
||||
|
||||
```js
|
||||
if (!program.args.length) ...
|
||||
```
|
||||
|
||||
a partial replacement is:
|
||||
|
||||
```js
|
||||
if (program.rawArgs.length < 3) ...
|
||||
```
|
||||
|
||||
## [4.0.0-1] Prerelease (2019-10-08)
|
||||
|
||||
(Released in 4.0.0)
|
||||
|
||||
## [4.0.0-0] Prerelease (2019-10-01)
|
||||
|
||||
(Released in 4.0.0)
|
||||
|
||||
## [2.20.1] (2019-09-29)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Improve tracking of executable subcommands.
|
||||
|
||||
### Changed
|
||||
|
||||
* update development dependencies
|
||||
|
||||
## [3.0.2] (2019-09-27)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Improve tracking of executable subcommands.
|
||||
|
||||
### Changed
|
||||
|
||||
* update development dependencies
|
||||
|
||||
## [3.0.1] (2019-08-30)
|
||||
|
||||
### Added
|
||||
|
||||
* .name and .usage to README ([#1010])
|
||||
* Table of Contents to README ([#1010])
|
||||
* TypeScript definition for `executableFile` in CommandOptions ([#1028])
|
||||
|
||||
### Changed
|
||||
|
||||
* consistently use `const` rather than `var` in README ([#1026])
|
||||
|
||||
### Fixed
|
||||
|
||||
* help for sub commands with custom executableFile ([#1018])
|
||||
|
||||
## [3.0.0] / 2019-08-08
|
||||
|
||||
* Add option to specify executable file name ([#999])
|
||||
* e.g. `.command('clone', 'clone description', { executableFile: 'myClone' })`
|
||||
* Change docs for `.command` to contrast action handler vs git-style executable. ([#938] [#990])
|
||||
* **Breaking** Change TypeScript to use overloaded function for `.command`. ([#938] [#990])
|
||||
* Change to use straight quotes around strings in error messages (like 'this' instead of `this') ([#915])
|
||||
* Add TypeScript "reference types" for node ([#974])
|
||||
* Add support for hyphen as an option argument in subcommands ([#697])
|
||||
* Add support for a short option flag and its value to be concatenated for action handler subcommands ([#599])
|
||||
* e.g. `-p 80` can also be supplied as `-p80`
|
||||
* Add executable arguments to spawn in win32, for git-style executables ([#611])
|
||||
* e.g. `node --harmony myCommand.js clone`
|
||||
* Add parent command as prefix of subcommand in help ([#980])
|
||||
* Add optional custom description to `.version` ([#963])
|
||||
* e.g. `program.version('0.0.1', '-v, --vers', 'output the current version')`
|
||||
* Add `.helpOption(flags, description)` routine to customise help flags and description ([#963])
|
||||
* e.g. `.helpOption('-e, --HELP', 'read more information')`
|
||||
* Fix behavior of --no-* options ([#795])
|
||||
* can now define both `--foo` and `--no-foo`
|
||||
* **Breaking** custom event listeners: `--no-foo` on cli now emits `option:no-foo` (previously `option:foo`)
|
||||
* **Breaking** default value: defining `--no-foo` after defining `--foo` leaves the default value unchanged (previously set it to false)
|
||||
* allow boolean default value, such as from environment ([#987])
|
||||
* Increment inspector port for spawned subcommands ([#991])
|
||||
* e.g. `node --inspect myCommand.js clone`
|
||||
|
||||
### Migration Tips
|
||||
|
||||
The custom event for a negated option like `--no-foo` is `option:no-foo` (previously `option:foo`).
|
||||
|
||||
```js
|
||||
program
|
||||
.option('--no-foo')
|
||||
.on('option:no-foo', () => {
|
||||
console.log('removing foo');
|
||||
});
|
||||
```
|
||||
|
||||
When using TypeScript, adding a command does not allow an explicit `undefined` for an unwanted executable description (e.g
|
||||
for a command with an action handler).
|
||||
|
||||
```js
|
||||
program
|
||||
.command('action1', undefined, { noHelp: true }) // No longer valid
|
||||
.command('action2', { noHelp: true }) // Correct
|
||||
```
|
||||
|
||||
## 3.0.0-0 Prerelease / 2019-07-28
|
||||
|
||||
(Released as 3.0.0)
|
||||
|
||||
## Older versions
|
||||
|
||||
* [2.x](./changelogs/CHANGELOG-2.md)
|
||||
* [1.x](./changelogs/CHANGELOG-1.md)
|
||||
* [0.x](./changelogs/CHANGELOG-0.md)
|
||||
|
||||
[#1]: https://github.com/tj/commander.js/issues/1
|
||||
[#432]: https://github.com/tj/commander.js/issues/432
|
||||
[#508]: https://github.com/tj/commander.js/issues/508
|
||||
[#512]: https://github.com/tj/commander.js/issues/512
|
||||
[#531]: https://github.com/tj/commander.js/issues/531
|
||||
[#599]: https://github.com/tj/commander.js/issues/599
|
||||
[#611]: https://github.com/tj/commander.js/issues/611
|
||||
[#645]: https://github.com/tj/commander.js/issues/645
|
||||
[#697]: https://github.com/tj/commander.js/issues/697
|
||||
[#742]: https://github.com/tj/commander.js/issues/742
|
||||
[#764]: https://github.com/tj/commander.js/issues/764
|
||||
[#795]: https://github.com/tj/commander.js/issues/795
|
||||
[#802]: https://github.com/tj/commander.js/issues/802
|
||||
[#806]: https://github.com/tj/commander.js/issues/806
|
||||
[#809]: https://github.com/tj/commander.js/issues/809
|
||||
[#915]: https://github.com/tj/commander.js/issues/915
|
||||
[#938]: https://github.com/tj/commander.js/issues/938
|
||||
[#948]: https://github.com/tj/commander.js/issues/948
|
||||
[#962]: https://github.com/tj/commander.js/issues/962
|
||||
[#963]: https://github.com/tj/commander.js/issues/963
|
||||
[#974]: https://github.com/tj/commander.js/issues/974
|
||||
[#980]: https://github.com/tj/commander.js/issues/980
|
||||
[#987]: https://github.com/tj/commander.js/issues/987
|
||||
[#990]: https://github.com/tj/commander.js/issues/990
|
||||
[#991]: https://github.com/tj/commander.js/issues/991
|
||||
[#993]: https://github.com/tj/commander.js/issues/993
|
||||
[#995]: https://github.com/tj/commander.js/issues/995
|
||||
[#999]: https://github.com/tj/commander.js/issues/999
|
||||
[#1010]: https://github.com/tj/commander.js/pull/1010
|
||||
[#1018]: https://github.com/tj/commander.js/pull/1018
|
||||
[#1026]: https://github.com/tj/commander.js/pull/1026
|
||||
[#1027]: https://github.com/tj/commander.js/pull/1027
|
||||
[#1028]: https://github.com/tj/commander.js/pull/1028
|
||||
[#1032]: https://github.com/tj/commander.js/issues/1032
|
||||
[#1035]: https://github.com/tj/commander.js/pull/1035
|
||||
[#1040]: https://github.com/tj/commander.js/pull/1040
|
||||
[#1047]: https://github.com/tj/commander.js/pull/1047
|
||||
[#1048]: https://github.com/tj/commander.js/pull/1048
|
||||
[#1049]: https://github.com/tj/commander.js/pull/1049
|
||||
[#1051]: https://github.com/tj/commander.js/pull/1051
|
||||
[#1052]: https://github.com/tj/commander.js/pull/1052
|
||||
[#1053]: https://github.com/tj/commander.js/pull/1053
|
||||
[#1062]: https://github.com/tj/commander.js/pull/1062
|
||||
[#1071]: https://github.com/tj/commander.js/pull/1071
|
||||
[#1081]: https://github.com/tj/commander.js/pull/1081
|
||||
[#1088]: https://github.com/tj/commander.js/issues/1088
|
||||
[#1091]: https://github.com/tj/commander.js/pull/1091
|
||||
[#1096]: https://github.com/tj/commander.js/pull/1096
|
||||
[#1102]: https://github.com/tj/commander.js/pull/1102
|
||||
[#1118]: https://github.com/tj/commander.js/pull/1118
|
||||
[#1119]: https://github.com/tj/commander.js/pull/1119
|
||||
[#1133]: https://github.com/tj/commander.js/pull/1133
|
||||
[#1138]: https://github.com/tj/commander.js/pull/1138
|
||||
[#1145]: https://github.com/tj/commander.js/pull/1145
|
||||
[#1146]: https://github.com/tj/commander.js/pull/1146
|
||||
[#1149]: https://github.com/tj/commander.js/pull/1149
|
||||
[#1153]: https://github.com/tj/commander.js/issues/1153
|
||||
[#1157]: https://github.com/tj/commander.js/pull/1157
|
||||
[#1159]: https://github.com/tj/commander.js/pull/1159
|
||||
[#1165]: https://github.com/tj/commander.js/pull/1165
|
||||
[#1169]: https://github.com/tj/commander.js/pull/1169
|
||||
[#1172]: https://github.com/tj/commander.js/pull/1172
|
||||
[#1179]: https://github.com/tj/commander.js/pull/1179
|
||||
[#1180]: https://github.com/tj/commander.js/pull/1180
|
||||
[#1184]: https://github.com/tj/commander.js/pull/1184
|
||||
[#1191]: https://github.com/tj/commander.js/pull/1191
|
||||
[#1195]: https://github.com/tj/commander.js/pull/1195
|
||||
[#1208]: https://github.com/tj/commander.js/pull/1208
|
||||
[#1232]: https://github.com/tj/commander.js/pull/1232
|
||||
[#1235]: https://github.com/tj/commander.js/pull/1235
|
||||
[#1236]: https://github.com/tj/commander.js/pull/1236
|
||||
[#1247]: https://github.com/tj/commander.js/pull/1247
|
||||
[#1248]: https://github.com/tj/commander.js/pull/1248
|
||||
|
||||
[Unreleased]: https://github.com/tj/commander.js/compare/master...develop
|
||||
[5.1.0]: https://github.com/tj/commander.js/compare/v5.0.0..v5.1.0
|
||||
[5.0.0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0
|
||||
[5.0.0-4]: https://github.com/tj/commander.js/compare/v5.0.0-3..v5.0.0-4
|
||||
[5.0.0-3]: https://github.com/tj/commander.js/compare/v5.0.0-2..v5.0.0-3
|
||||
[5.0.0-2]: https://github.com/tj/commander.js/compare/v5.0.0-1..v5.0.0-2
|
||||
[5.0.0-1]: https://github.com/tj/commander.js/compare/v5.0.0-0..v5.0.0-1
|
||||
[5.0.0-0]: https://github.com/tj/commander.js/compare/v4.1.1..v5.0.0-0
|
||||
[4.1.1]: https://github.com/tj/commander.js/compare/v4.1.0..v4.1.1
|
||||
[4.1.0]: https://github.com/tj/commander.js/compare/v4.0.1..v4.1.0
|
||||
[4.0.1]: https://github.com/tj/commander.js/compare/v4.0.0..v4.0.1
|
||||
[4.0.0]: https://github.com/tj/commander.js/compare/v3.0.2..v4.0.0
|
||||
[4.0.0-1]: https://github.com/tj/commander.js/compare/v4.0.0-0..v4.0.0-1
|
||||
[4.0.0-0]: https://github.com/tj/commander.js/compare/v3.0.2...v4.0.0-0
|
||||
[3.0.2]: https://github.com/tj/commander.js/compare/v3.0.1...v3.0.2
|
||||
[3.0.1]: https://github.com/tj/commander.js/compare/v3.0.0...v3.0.1
|
||||
[3.0.0]: https://github.com/tj/commander.js/compare/v2.20.1...v3.0.0
|
||||
[2.20.1]: https://github.com/tj/commander.js/compare/v2.20.0...v2.20.1
|
||||
22
electron/node_modules/@electron/asar/node_modules/commander/LICENSE
generated
vendored
Normal file
22
electron/node_modules/@electron/asar/node_modules/commander/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
(The MIT License)
|
||||
|
||||
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
||||
737
electron/node_modules/@electron/asar/node_modules/commander/Readme.md
generated
vendored
Normal file
737
electron/node_modules/@electron/asar/node_modules/commander/Readme.md
generated
vendored
Normal file
|
|
@ -0,0 +1,737 @@
|
|||
# Commander.js
|
||||
|
||||
[](http://travis-ci.org/tj/commander.js)
|
||||
[](https://www.npmjs.org/package/commander)
|
||||
[](https://npmcharts.com/compare/commander?minimal=true)
|
||||
[](https://packagephobia.now.sh/result?p=commander)
|
||||
|
||||
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/commander-rb/commander).
|
||||
|
||||
Read this in other languages: English | [简体中文](./Readme_zh-CN.md)
|
||||
|
||||
- [Commander.js](#commanderjs)
|
||||
- [Installation](#installation)
|
||||
- [Declaring _program_ variable](#declaring-program-variable)
|
||||
- [Options](#options)
|
||||
- [Common option types, boolean and value](#common-option-types-boolean-and-value)
|
||||
- [Default option value](#default-option-value)
|
||||
- [Other option types, negatable boolean and flag|value](#other-option-types-negatable-boolean-and-flagvalue)
|
||||
- [Custom option processing](#custom-option-processing)
|
||||
- [Required option](#required-option)
|
||||
- [Version option](#version-option)
|
||||
- [Commands](#commands)
|
||||
- [Specify the argument syntax](#specify-the-argument-syntax)
|
||||
- [Action handler (sub)commands](#action-handler-subcommands)
|
||||
- [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands)
|
||||
- [Automated help](#automated-help)
|
||||
- [Custom help](#custom-help)
|
||||
- [.usage and .name](#usage-and-name)
|
||||
- [.help(cb)](#helpcb)
|
||||
- [.outputHelp(cb)](#outputhelpcb)
|
||||
- [.helpInformation()](#helpinformation)
|
||||
- [.helpOption(flags, description)](#helpoptionflags-description)
|
||||
- [.addHelpCommand()](#addhelpcommand)
|
||||
- [Custom event listeners](#custom-event-listeners)
|
||||
- [Bits and pieces](#bits-and-pieces)
|
||||
- [.parse() and .parseAsync()](#parse-and-parseasync)
|
||||
- [Avoiding option name clashes](#avoiding-option-name-clashes)
|
||||
- [TypeScript](#typescript)
|
||||
- [createCommand()](#createcommand)
|
||||
- [Node options such as `--harmony`](#node-options-such-as---harmony)
|
||||
- [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands)
|
||||
- [Override exit handling](#override-exit-handling)
|
||||
- [Examples](#examples)
|
||||
- [License](#license)
|
||||
- [Support](#support)
|
||||
- [Commander for enterprise](#commander-for-enterprise)
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install commander
|
||||
```
|
||||
|
||||
## Declaring _program_ variable
|
||||
|
||||
Commander exports a global object which is convenient for quick programs.
|
||||
This is used in the examples in this README for brevity.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
program.version('0.0.1');
|
||||
```
|
||||
|
||||
For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.
|
||||
|
||||
```js
|
||||
const { Command } = require('commander');
|
||||
const program = new Command();
|
||||
program.version('0.0.1');
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|').
|
||||
|
||||
The options can be accessed as properties on the Command object. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes).
|
||||
|
||||
Multiple short flags may optionally be combined in a single argument following the dash: boolean flags, the last flag may take a value, and the value.
|
||||
For example `-a -b -p 80` may be written as `-ab -p80` or even `-abp80`.
|
||||
|
||||
You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted.
|
||||
This is particularly useful for passing options through to another
|
||||
command, like: `do -- git --version`.
|
||||
|
||||
Options on the command line are not positional, and can be specified before or after other command arguments.
|
||||
|
||||
### Common option types, boolean and value
|
||||
|
||||
The two most used option types are a boolean flag, and an option which takes a value (declared using angle brackets). Both are `undefined` unless specified on command line.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('-d, --debug', 'output extra debugging')
|
||||
.option('-s, --small', 'small pizza size')
|
||||
.option('-p, --pizza-type <type>', 'flavour of pizza');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (program.debug) console.log(program.opts());
|
||||
console.log('pizza details:');
|
||||
if (program.small) console.log('- small pizza size');
|
||||
if (program.pizzaType) console.log(`- ${program.pizzaType}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options -d
|
||||
{ debug: true, small: undefined, pizzaType: undefined }
|
||||
pizza details:
|
||||
$ pizza-options -p
|
||||
error: option '-p, --pizza-type <type>' argument missing
|
||||
$ pizza-options -ds -p vegetarian
|
||||
{ debug: true, small: true, pizzaType: 'vegetarian' }
|
||||
pizza details:
|
||||
- small pizza size
|
||||
- vegetarian
|
||||
$ pizza-options --pizza-type=cheese
|
||||
pizza details:
|
||||
- cheese
|
||||
```
|
||||
|
||||
`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array.
|
||||
|
||||
### Default option value
|
||||
|
||||
You can specify a default value for an option which takes a value.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('-c, --cheese <type>', 'add the specified type of cheese', 'blue');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
console.log(`cheese: ${program.cheese}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options
|
||||
cheese: blue
|
||||
$ pizza-options --cheese stilton
|
||||
cheese: stilton
|
||||
```
|
||||
|
||||
### Other option types, negatable boolean and flag|value
|
||||
|
||||
You can specify a boolean option long name with a leading `no-` to set the option value to false when used.
|
||||
Defined alone this also makes the option true by default.
|
||||
|
||||
If you define `--foo` first, adding `--no-foo` does not change the default value from what it would
|
||||
otherwise be. You can specify a default boolean value for a boolean flag and it can be overridden on command line.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('--no-sauce', 'Remove sauce')
|
||||
.option('--cheese <flavour>', 'cheese flavour', 'mozzarella')
|
||||
.option('--no-cheese', 'plain with no cheese')
|
||||
.parse(process.argv);
|
||||
|
||||
const sauceStr = program.sauce ? 'sauce' : 'no sauce';
|
||||
const cheeseStr = (program.cheese === false) ? 'no cheese' : `${program.cheese} cheese`;
|
||||
console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options
|
||||
You ordered a pizza with sauce and mozzarella cheese
|
||||
$ pizza-options --sauce
|
||||
error: unknown option '--sauce'
|
||||
$ pizza-options --cheese=blue
|
||||
You ordered a pizza with sauce and blue cheese
|
||||
$ pizza-options --no-sauce --no-cheese
|
||||
You ordered a pizza with no sauce and no cheese
|
||||
```
|
||||
|
||||
You can specify an option which functions as a flag but may also take a value (declared using square brackets).
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.option('-c, --cheese [type]', 'Add cheese with optional type');
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (program.cheese === undefined) console.log('no cheese');
|
||||
else if (program.cheese === true) console.log('add cheese');
|
||||
else console.log(`add cheese type ${program.cheese}`);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza-options
|
||||
no cheese
|
||||
$ pizza-options --cheese
|
||||
add cheese
|
||||
$ pizza-options --cheese mozzarella
|
||||
add cheese type mozzarella
|
||||
```
|
||||
|
||||
### Custom option processing
|
||||
|
||||
You may specify a function to do custom processing of option values. The callback function receives two parameters, the user specified value and the
|
||||
previous value for the option. It returns the new value for the option.
|
||||
|
||||
This allows you to coerce the option value to the desired type, or accumulate values, or do entirely custom processing.
|
||||
|
||||
You can optionally specify the default/starting value for the option after the function.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
function myParseInt(value, dummyPrevious) {
|
||||
// parseInt takes a string and an optional radix
|
||||
return parseInt(value);
|
||||
}
|
||||
|
||||
function increaseVerbosity(dummyValue, previous) {
|
||||
return previous + 1;
|
||||
}
|
||||
|
||||
function collect(value, previous) {
|
||||
return previous.concat([value]);
|
||||
}
|
||||
|
||||
function commaSeparatedList(value, dummyPrevious) {
|
||||
return value.split(',');
|
||||
}
|
||||
|
||||
program
|
||||
.option('-f, --float <number>', 'float argument', parseFloat)
|
||||
.option('-i, --integer <number>', 'integer argument', myParseInt)
|
||||
.option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0)
|
||||
.option('-c, --collect <value>', 'repeatable value', collect, [])
|
||||
.option('-l, --list <items>', 'comma separated list', commaSeparatedList)
|
||||
;
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (program.float !== undefined) console.log(`float: ${program.float}`);
|
||||
if (program.integer !== undefined) console.log(`integer: ${program.integer}`);
|
||||
if (program.verbose > 0) console.log(`verbosity: ${program.verbose}`);
|
||||
if (program.collect.length > 0) console.log(program.collect);
|
||||
if (program.list !== undefined) console.log(program.list);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ custom -f 1e2
|
||||
float: 100
|
||||
$ custom --integer 2
|
||||
integer: 2
|
||||
$ custom -v -v -v
|
||||
verbose: 3
|
||||
$ custom -c a -c b -c c
|
||||
[ 'a', 'b', 'c' ]
|
||||
$ custom --list x,y,z
|
||||
[ 'x', 'y', 'z' ]
|
||||
```
|
||||
|
||||
### Required option
|
||||
|
||||
You may specify a required (mandatory) option using `.requiredOption`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.requiredOption('-c, --cheese <type>', 'pizza must have cheese');
|
||||
|
||||
program.parse(process.argv);
|
||||
```
|
||||
|
||||
```bash
|
||||
$ pizza
|
||||
error: required option '-c, --cheese <type>' not specified
|
||||
```
|
||||
|
||||
### Version option
|
||||
|
||||
The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.
|
||||
|
||||
```js
|
||||
program.version('0.0.1');
|
||||
```
|
||||
|
||||
```bash
|
||||
$ ./examples/pizza -V
|
||||
0.0.1
|
||||
```
|
||||
|
||||
You may change the flags and description by passing additional parameters to the `version` method, using
|
||||
the same syntax for flags as the `option` method. The version flags can be named anything, but a long name is required.
|
||||
|
||||
```js
|
||||
program.version('0.0.1', '-v, --vers', 'output the current version');
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)).
|
||||
|
||||
In the first parameter to `.command()` you specify the command name and any command arguments. The arguments may be `<required>` or `[optional]`, and the last argument may also be `variadic...`.
|
||||
|
||||
You can use `.addCommand()` to add an already configured subcommand to the program.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
// Command implemented using action handler (description is supplied separately to `.command`)
|
||||
// Returns new command for configuring.
|
||||
program
|
||||
.command('clone <source> [destination]')
|
||||
.description('clone a repository into a newly created directory')
|
||||
.action((source, destination) => {
|
||||
console.log('clone command called');
|
||||
});
|
||||
|
||||
// Command implemented using stand-alone executable file (description is second parameter to `.command`)
|
||||
// Returns `this` for adding more commands.
|
||||
program
|
||||
.command('start <service>', 'start named service')
|
||||
.command('stop [service]', 'stop named service, or all if no name supplied');
|
||||
|
||||
// Command prepared separately.
|
||||
// Returns `this` for adding more commands.
|
||||
program
|
||||
.addCommand(build.makeBuildCommand());
|
||||
```
|
||||
|
||||
Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `true` for `opts.hidden` will remove the command from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified ([example](./examples/defaultCommand.js)).
|
||||
|
||||
### Specify the argument syntax
|
||||
|
||||
You use `.arguments` to specify the arguments for the top-level command, and for subcommands they are usually included in the `.command` call. Angled brackets (e.g. `<required>`) indicate required input. Square brackets (e.g. `[optional]`) indicate optional input.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.arguments('<cmd> [env]')
|
||||
.action(function (cmd, env) {
|
||||
cmdValue = cmd;
|
||||
envValue = env;
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
if (typeof cmdValue === 'undefined') {
|
||||
console.error('no command given!');
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('command:', cmdValue);
|
||||
console.log('environment:', envValue || "no environment given");
|
||||
```
|
||||
|
||||
The last argument of a command can be variadic, and only the last argument. To make an argument variadic you
|
||||
append `...` to the argument name. For example:
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.command('rmdir <dir> [otherDirs...]')
|
||||
.action(function (dir, otherDirs) {
|
||||
console.log('rmdir %s', dir);
|
||||
if (otherDirs) {
|
||||
otherDirs.forEach(function (oDir) {
|
||||
console.log('rmdir %s', oDir);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
```
|
||||
|
||||
The variadic argument is passed to the action handler as an array.
|
||||
|
||||
### Action handler (sub)commands
|
||||
|
||||
You can add options to a command that uses an action handler.
|
||||
The action handler gets passed a parameter for each argument you declared, and one additional argument which is the
|
||||
command object itself. This command argument has the values for the command-specific options added as properties.
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.command('rm <dir>')
|
||||
.option('-r, --recursive', 'Remove recursively')
|
||||
.action(function (dir, cmdObj) {
|
||||
console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : ''))
|
||||
})
|
||||
|
||||
program.parse(process.argv)
|
||||
```
|
||||
|
||||
You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`.
|
||||
|
||||
```js
|
||||
async function run() { /* code goes here */ }
|
||||
|
||||
async function main() {
|
||||
program
|
||||
.command('run')
|
||||
.action(run);
|
||||
await program.parseAsync(process.argv);
|
||||
}
|
||||
```
|
||||
|
||||
A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error.
|
||||
|
||||
### Stand-alone executable (sub)commands
|
||||
|
||||
When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for subcommands.
|
||||
Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.
|
||||
You can specify a custom name with the `executableFile` configuration option.
|
||||
|
||||
You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.
|
||||
|
||||
```js
|
||||
// file: ./examples/pm
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.command('install [name]', 'install one or more packages')
|
||||
.command('search [query]', 'search with optional query')
|
||||
.command('update', 'update installed packages', {executableFile: 'myUpdateSubCommand'})
|
||||
.command('list', 'list packages installed', {isDefault: true})
|
||||
.parse(process.argv);
|
||||
```
|
||||
|
||||
If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.
|
||||
|
||||
## Automated help
|
||||
|
||||
The help information is auto-generated based on the information commander already knows about your program. The default
|
||||
help option is `-h,--help`. ([example](./examples/pizza))
|
||||
|
||||
```bash
|
||||
$ node ./examples/pizza --help
|
||||
Usage: pizza [options]
|
||||
|
||||
An application for pizzas ordering
|
||||
|
||||
Options:
|
||||
-V, --version output the version number
|
||||
-p, --peppers Add peppers
|
||||
-c, --cheese <type> Add the specified type of cheese (default: "marble")
|
||||
-C, --no-cheese You do not want any cheese
|
||||
-h, --help display help for command
|
||||
```
|
||||
|
||||
A `help` command is added by default if your command has subcommands. It can be used alone, or with a subcommand name to show
|
||||
further help for the subcommand. These are effectively the same if the `shell` program has implicit help:
|
||||
|
||||
```bash
|
||||
shell help
|
||||
shell --help
|
||||
|
||||
shell help spawn
|
||||
shell spawn --help
|
||||
```
|
||||
|
||||
### Custom help
|
||||
|
||||
You can display extra information by listening for "--help". ([example](./examples/custom-help))
|
||||
|
||||
```js
|
||||
program
|
||||
.option('-f, --foo', 'enable some foo');
|
||||
|
||||
// must be before .parse()
|
||||
program.on('--help', () => {
|
||||
console.log('');
|
||||
console.log('Example call:');
|
||||
console.log(' $ custom-help --help');
|
||||
});
|
||||
```
|
||||
|
||||
Yields the following help output:
|
||||
|
||||
```Text
|
||||
Usage: custom-help [options]
|
||||
|
||||
Options:
|
||||
-f, --foo enable some foo
|
||||
-h, --help display help for command
|
||||
|
||||
Example call:
|
||||
$ custom-help --help
|
||||
```
|
||||
|
||||
### .usage and .name
|
||||
|
||||
These allow you to customise the usage description in the first line of the help. The name is otherwise
|
||||
deduced from the (full) program arguments. Given:
|
||||
|
||||
```js
|
||||
program
|
||||
.name("my-command")
|
||||
.usage("[global options] command")
|
||||
```
|
||||
|
||||
The help will start with:
|
||||
|
||||
```Text
|
||||
Usage: my-command [global options] command
|
||||
```
|
||||
|
||||
### .help(cb)
|
||||
|
||||
Output help information and exit immediately. Optional callback cb allows post-processing of help text before it is displayed.
|
||||
|
||||
### .outputHelp(cb)
|
||||
|
||||
Output help information without exiting.
|
||||
Optional callback cb allows post-processing of help text before it is displayed.
|
||||
|
||||
### .helpInformation()
|
||||
|
||||
Get the command help information as a string for processing or displaying yourself. (The text does not include the custom help
|
||||
from `--help` listeners.)
|
||||
|
||||
### .helpOption(flags, description)
|
||||
|
||||
Override the default help flags and description.
|
||||
|
||||
```js
|
||||
program
|
||||
.helpOption('-e, --HELP', 'read more information');
|
||||
```
|
||||
|
||||
### .addHelpCommand()
|
||||
|
||||
You can explicitly turn on or off the implicit help command with `.addHelpCommand()` and `.addHelpCommand(false)`.
|
||||
|
||||
You can both turn on and customise the help command by supplying the name and description:
|
||||
|
||||
```js
|
||||
program.addHelpCommand('assist [command]', 'show assistance');
|
||||
```
|
||||
|
||||
## Custom event listeners
|
||||
|
||||
You can execute custom actions by listening to command and option events.
|
||||
|
||||
```js
|
||||
program.on('option:verbose', function () {
|
||||
process.env.VERBOSE = this.verbose;
|
||||
});
|
||||
|
||||
program.on('command:*', function (operands) {
|
||||
console.error(`error: unknown command '${operands[0]}'`);
|
||||
const availableCommands = program.commands.map(cmd => cmd.name());
|
||||
mySuggestBestMatch(operands[0], availableCommands);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
```
|
||||
|
||||
## Bits and pieces
|
||||
|
||||
### .parse() and .parseAsync()
|
||||
|
||||
The first argument to `.parse` is the array of strings to parse. You may omit the parameter to implicitly use `process.argv`.
|
||||
|
||||
If the arguments follow different conventions than node you can pass a `from` option in the second parameter:
|
||||
|
||||
- 'node': default, `argv[0]` is the application and `argv[1]` is the script being run, with user parameters after that
|
||||
- 'electron': `argv[1]` varies depending on whether the electron application is packaged
|
||||
- 'user': all of the arguments from the user
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
program.parse(process.argv); // Explicit, node conventions
|
||||
program.parse(); // Implicit, and auto-detect electron
|
||||
program.parse(['-f', 'filename'], { from: 'user' });
|
||||
```
|
||||
|
||||
### Avoiding option name clashes
|
||||
|
||||
The original and default behaviour is that the option values are stored
|
||||
as properties on the program, and the action handler is passed a
|
||||
command object with the options values stored as properties.
|
||||
This is very convenient to code, but the downside is possible clashes with
|
||||
existing properties of Command.
|
||||
|
||||
There are two new routines to change the behaviour, and the default behaviour may change in the future:
|
||||
|
||||
- `storeOptionsAsProperties`: whether to store option values as properties on command object, or store separately (specify false) and access using `.opts()`
|
||||
- `passCommandToAction`: whether to pass command to action handler,
|
||||
or just the options (specify false)
|
||||
|
||||
([example](./examples/storeOptionsAsProperties-action.js))
|
||||
|
||||
```js
|
||||
program
|
||||
.storeOptionsAsProperties(false)
|
||||
.passCommandToAction(false);
|
||||
|
||||
program
|
||||
.name('my-program-name')
|
||||
.option('-n,--name <name>');
|
||||
|
||||
program
|
||||
.command('show')
|
||||
.option('-a,--action <action>')
|
||||
.action((options) => {
|
||||
console.log(options.action);
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
const programOptions = program.opts();
|
||||
console.log(programOptions.name);
|
||||
```
|
||||
|
||||
### TypeScript
|
||||
|
||||
The Commander package includes its TypeScript Definition file.
|
||||
|
||||
If you use `ts-node` and stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.
|
||||
|
||||
```bash
|
||||
node -r ts-node/register pm.ts
|
||||
```
|
||||
|
||||
### createCommand()
|
||||
|
||||
This factory function creates a new command. It is exported and may be used instead of using `new`, like:
|
||||
|
||||
```js
|
||||
const { createCommand } = require('commander');
|
||||
const program = createCommand();
|
||||
```
|
||||
|
||||
`createCommand` is also a method of the Command object, and creates a new command rather than a subcommand. This gets used internally
|
||||
when creating subcommands using `.command()`, and you may override it to
|
||||
customise the new subcommand (examples using [subclass](./examples/custom-command-class.js) and [function](./examples/custom-command-function.js)).
|
||||
|
||||
### Node options such as `--harmony`
|
||||
|
||||
You can enable `--harmony` option in two ways:
|
||||
|
||||
- Use `#! /usr/bin/env node --harmony` in the subcommands scripts. (Note Windows does not support this pattern.)
|
||||
- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning subcommand process.
|
||||
|
||||
### Debugging stand-alone executable subcommands
|
||||
|
||||
An executable subcommand is launched as a separate child process.
|
||||
|
||||
If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al,
|
||||
the inspector port is incremented by 1 for the spawned subcommand.
|
||||
|
||||
If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.
|
||||
|
||||
### Override exit handling
|
||||
|
||||
By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
|
||||
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.
|
||||
|
||||
The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help
|
||||
is not affected by the override which is called after the display.
|
||||
|
||||
``` js
|
||||
program.exitOverride();
|
||||
|
||||
try {
|
||||
program.parse(process.argv);
|
||||
} catch (err) {
|
||||
// custom processing...
|
||||
}
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
```js
|
||||
const { program } = require('commander');
|
||||
|
||||
program
|
||||
.version('0.1.0')
|
||||
.option('-C, --chdir <path>', 'change the working directory')
|
||||
.option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
|
||||
.option('-T, --no-tests', 'ignore test hook');
|
||||
|
||||
program
|
||||
.command('setup [env]')
|
||||
.description('run setup commands for all envs')
|
||||
.option("-s, --setup_mode [mode]", "Which setup mode to use")
|
||||
.action(function(env, options){
|
||||
const mode = options.setup_mode || "normal";
|
||||
env = env || 'all';
|
||||
console.log('setup for %s env(s) with %s mode', env, mode);
|
||||
});
|
||||
|
||||
program
|
||||
.command('exec <cmd>')
|
||||
.alias('ex')
|
||||
.description('execute the given remote cmd')
|
||||
.option("-e, --exec_mode <mode>", "Which exec mode to use")
|
||||
.action(function(cmd, options){
|
||||
console.log('exec "%s" using %s mode', cmd, options.exec_mode);
|
||||
}).on('--help', function() {
|
||||
console.log('');
|
||||
console.log('Examples:');
|
||||
console.log('');
|
||||
console.log(' $ deploy exec sequential');
|
||||
console.log(' $ deploy exec async');
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
```
|
||||
|
||||
More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/tj/commander.js/blob/master/LICENSE)
|
||||
|
||||
## Support
|
||||
|
||||
Commander 5.x is fully supported on Long Term Support versions of Node, and is likely to work with Node 6 but not tested.
|
||||
(For versions of Node below Node 6, use Commander 3.x or 2.x.)
|
||||
|
||||
The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.
|
||||
|
||||
### Commander for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of Commander 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-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
1756
electron/node_modules/@electron/asar/node_modules/commander/index.js
generated
vendored
Normal file
1756
electron/node_modules/@electron/asar/node_modules/commander/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
48
electron/node_modules/@electron/asar/node_modules/commander/package.json
generated
vendored
Normal file
48
electron/node_modules/@electron/asar/node_modules/commander/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "commander",
|
||||
"version": "5.1.0",
|
||||
"description": "the complete solution for node.js command-line programs",
|
||||
"keywords": [
|
||||
"commander",
|
||||
"command",
|
||||
"option",
|
||||
"parser",
|
||||
"cli",
|
||||
"argument",
|
||||
"args",
|
||||
"argv"
|
||||
],
|
||||
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/tj/commander.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint index.js \"tests/**/*.js\"",
|
||||
"typescript-lint": "eslint typings/*.ts",
|
||||
"test": "jest && npm run test-typings",
|
||||
"test-typings": "tsc -p tsconfig.json"
|
||||
},
|
||||
"main": "index",
|
||||
"files": [
|
||||
"index.js",
|
||||
"typings/index.d.ts"
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^25.2.1",
|
||||
"@types/node": "^12.12.36",
|
||||
"@typescript-eslint/eslint-plugin": "^2.29.0",
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-config-standard-with-typescript": "^15.0.1",
|
||||
"eslint-plugin-jest": "^23.8.2",
|
||||
"jest": "^25.4.0",
|
||||
"standard": "^14.3.3",
|
||||
"typescript": "^3.7.5"
|
||||
},
|
||||
"typings": "typings/index.d.ts",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
}
|
||||
386
electron/node_modules/@electron/asar/node_modules/commander/typings/index.d.ts
generated
vendored
Normal file
386
electron/node_modules/@electron/asar/node_modules/commander/typings/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,386 @@
|
|||
// Type definitions for commander
|
||||
// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
|
||||
|
||||
declare namespace commander {
|
||||
|
||||
interface CommanderError extends Error {
|
||||
code: string;
|
||||
exitCode: number;
|
||||
message: string;
|
||||
nestedError?: string;
|
||||
}
|
||||
type CommanderErrorConstructor = new (exitCode: number, code: string, message: string) => CommanderError;
|
||||
|
||||
interface Option {
|
||||
flags: string;
|
||||
required: boolean; // A value must be supplied when the option is specified.
|
||||
optional: boolean; // A value is optional when the option is specified.
|
||||
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
|
||||
bool: boolean;
|
||||
short?: string;
|
||||
long: string;
|
||||
description: string;
|
||||
}
|
||||
type OptionConstructor = new (flags: string, description?: string) => Option;
|
||||
|
||||
interface ParseOptions {
|
||||
from: 'node' | 'electron' | 'user';
|
||||
}
|
||||
|
||||
interface Command {
|
||||
[key: string]: any; // options as properties
|
||||
|
||||
args: string[];
|
||||
|
||||
commands: Command[];
|
||||
|
||||
/**
|
||||
* Set the program version to `str`.
|
||||
*
|
||||
* This method auto-registers the "-V, --version" flag
|
||||
* which will print the version number when passed.
|
||||
*
|
||||
* You can optionally supply the flags and description to override the defaults.
|
||||
*/
|
||||
version(str: string, flags?: string, description?: string): this;
|
||||
|
||||
/**
|
||||
* Define a command, implemented using an action handler.
|
||||
*
|
||||
* @remarks
|
||||
* The command description is supplied using `.description`, not as a parameter to `.command`.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program
|
||||
* .command('clone <source> [destination]')
|
||||
* .description('clone a repository into a newly created directory')
|
||||
* .action((source, destination) => {
|
||||
* console.log('clone command called');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
||||
* @param opts - configuration options
|
||||
* @returns new command
|
||||
*/
|
||||
command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
|
||||
/**
|
||||
* Define a command, implemented in a separate executable file.
|
||||
*
|
||||
* @remarks
|
||||
* The command description is supplied as the second parameter to `.command`.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* program
|
||||
* .command('start <service>', 'start named service')
|
||||
* .command('stop [service]', 'stop named serice, or all if no name supplied');
|
||||
* ```
|
||||
*
|
||||
* @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
|
||||
* @param description - description of executable command
|
||||
* @param opts - configuration options
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
command(nameAndArgs: string, description: string, opts?: commander.ExecutableCommandOptions): this;
|
||||
|
||||
/**
|
||||
* Factory routine to create a new unattached command.
|
||||
*
|
||||
* See .command() for creating an attached subcommand, which uses this routine to
|
||||
* create the command. You can override createCommand to customise subcommands.
|
||||
*/
|
||||
createCommand(name?: string): Command;
|
||||
|
||||
/**
|
||||
* Add a prepared subcommand.
|
||||
*
|
||||
* See .command() for creating an attached subcommand which inherits settings from its parent.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
addCommand(cmd: Command, opts?: CommandOptions): this;
|
||||
|
||||
/**
|
||||
* Define argument syntax for command.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
arguments(desc: string): this;
|
||||
|
||||
/**
|
||||
* Register callback to use as replacement for calling process.exit.
|
||||
*/
|
||||
exitOverride(callback?: (err: CommanderError) => never|void): this;
|
||||
|
||||
/**
|
||||
* Register callback `fn` for the command.
|
||||
*
|
||||
* @example
|
||||
* program
|
||||
* .command('help')
|
||||
* .description('display verbose help')
|
||||
* .action(function() {
|
||||
* // output help here
|
||||
* });
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
action(fn: (...args: any[]) => void | Promise<void>): this;
|
||||
|
||||
/**
|
||||
* Define option with `flags`, `description` and optional
|
||||
* coercion `fn`.
|
||||
*
|
||||
* The `flags` string should contain both the short and long flags,
|
||||
* separated by comma, a pipe or space. The following are all valid
|
||||
* all will output this way when `--help` is used.
|
||||
*
|
||||
* "-p, --pepper"
|
||||
* "-p|--pepper"
|
||||
* "-p --pepper"
|
||||
*
|
||||
* @example
|
||||
* // simple boolean defaulting to false
|
||||
* program.option('-p, --pepper', 'add pepper');
|
||||
*
|
||||
* --pepper
|
||||
* program.pepper
|
||||
* // => Boolean
|
||||
*
|
||||
* // simple boolean defaulting to true
|
||||
* program.option('-C, --no-cheese', 'remove cheese');
|
||||
*
|
||||
* program.cheese
|
||||
* // => true
|
||||
*
|
||||
* --no-cheese
|
||||
* program.cheese
|
||||
* // => false
|
||||
*
|
||||
* // required argument
|
||||
* program.option('-C, --chdir <path>', 'change the working directory');
|
||||
*
|
||||
* --chdir /tmp
|
||||
* program.chdir
|
||||
* // => "/tmp"
|
||||
*
|
||||
* // optional argument
|
||||
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
option(flags: string, description?: string, defaultValue?: string | boolean): this;
|
||||
option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this;
|
||||
option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
|
||||
/**
|
||||
* Define a required option, which must have a value after parsing. This usually means
|
||||
* the option must be specified on the command line. (Otherwise the same as .option().)
|
||||
*
|
||||
* The `flags` string should contain both the short and long flags, separated by comma, a pipe or space.
|
||||
*/
|
||||
requiredOption(flags: string, description?: string, defaultValue?: string | boolean): this;
|
||||
requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this;
|
||||
requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
|
||||
|
||||
/**
|
||||
* Whether to store option values as properties on command object,
|
||||
* or store separately (specify false). In both cases the option values can be accessed using .opts().
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
storeOptionsAsProperties(value?: boolean): this;
|
||||
|
||||
/**
|
||||
* Whether to pass command to action handler,
|
||||
* or just the options (specify false).
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
passCommandToAction(value?: boolean): this;
|
||||
|
||||
/**
|
||||
* Allow unknown options on the command line.
|
||||
*
|
||||
* @param [arg] if `true` or omitted, no error will be thrown for unknown options.
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
allowUnknownOption(arg?: boolean): this;
|
||||
|
||||
/**
|
||||
* Parse `argv`, setting options and invoking commands when defined.
|
||||
*
|
||||
* The default expectation is that the arguments are from node and have the application as argv[0]
|
||||
* and the script being run in argv[1], with user parameters after that.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* program.parse(process.argv);
|
||||
* program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
|
||||
* program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
parse(argv?: string[], options?: ParseOptions): this;
|
||||
|
||||
/**
|
||||
* Parse `argv`, setting options and invoking commands when defined.
|
||||
*
|
||||
* Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
|
||||
*
|
||||
* The default expectation is that the arguments are from node and have the application as argv[0]
|
||||
* and the script being run in argv[1], with user parameters after that.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* program.parseAsync(process.argv);
|
||||
* program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
|
||||
* program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
|
||||
*
|
||||
* @returns Promise
|
||||
*/
|
||||
parseAsync(argv?: string[], options?: ParseOptions): Promise<this>;
|
||||
|
||||
/**
|
||||
* Parse options from `argv` removing known options,
|
||||
* and return argv split into operands and unknown arguments.
|
||||
*
|
||||
* @example
|
||||
* argv => operands, unknown
|
||||
* --known kkk op => [op], []
|
||||
* op --known kkk => [op], []
|
||||
* sub --unknown uuu op => [sub], [--unknown uuu op]
|
||||
* sub -- --unknown uuu op => [sub --unknown uuu op], []
|
||||
*/
|
||||
parseOptions(argv: string[]): commander.ParseOptionsResult;
|
||||
|
||||
/**
|
||||
* Return an object containing options as key-value pairs
|
||||
*/
|
||||
opts(): { [key: string]: any };
|
||||
|
||||
/**
|
||||
* Set the description.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
description(str: string, argsDescription?: {[argName: string]: string}): this;
|
||||
/**
|
||||
* Get the description.
|
||||
*/
|
||||
description(): string;
|
||||
|
||||
/**
|
||||
* Set an alias for the command.
|
||||
*
|
||||
* You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
alias(alias: string): this;
|
||||
/**
|
||||
* Get alias for the command.
|
||||
*/
|
||||
alias(): string;
|
||||
|
||||
/**
|
||||
* Set aliases for the command.
|
||||
*
|
||||
* Only the first alias is shown in the auto-generated help.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
aliases(aliases: string[]): this;
|
||||
/**
|
||||
* Get aliases for the command.
|
||||
*/
|
||||
aliases(): string[];
|
||||
|
||||
/**
|
||||
* Set the command usage.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
usage(str: string): this;
|
||||
/**
|
||||
* Get the command usage.
|
||||
*/
|
||||
usage(): string;
|
||||
|
||||
/**
|
||||
* Set the name of the command.
|
||||
*
|
||||
* @returns `this` command for chaining
|
||||
*/
|
||||
name(str: string): this;
|
||||
/**
|
||||
* Get the name of the command.
|
||||
*/
|
||||
name(): string;
|
||||
|
||||
/**
|
||||
* Output help information for this command.
|
||||
*
|
||||
* When listener(s) are available for the helpLongFlag
|
||||
* those callbacks are invoked.
|
||||
*/
|
||||
outputHelp(cb?: (str: string) => string): void;
|
||||
|
||||
/**
|
||||
* Return command help documentation.
|
||||
*/
|
||||
helpInformation(): string;
|
||||
|
||||
/**
|
||||
* You can pass in flags and a description to override the help
|
||||
* flags and help description for your command.
|
||||
*/
|
||||
helpOption(flags?: string, description?: string): this;
|
||||
|
||||
/**
|
||||
* Output help information and exit.
|
||||
*/
|
||||
help(cb?: (str: string) => string): never;
|
||||
|
||||
/**
|
||||
* Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
|
||||
*
|
||||
* @example
|
||||
* program
|
||||
* .on('--help', () -> {
|
||||
* console.log('See web site for more information.');
|
||||
* });
|
||||
*/
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
type CommandConstructor = new (name?: string) => Command;
|
||||
|
||||
interface CommandOptions {
|
||||
noHelp?: boolean; // old name for hidden
|
||||
hidden?: boolean;
|
||||
isDefault?: boolean;
|
||||
}
|
||||
interface ExecutableCommandOptions extends CommandOptions {
|
||||
executableFile?: string;
|
||||
}
|
||||
|
||||
interface ParseOptionsResult {
|
||||
operands: string[];
|
||||
unknown: string[];
|
||||
}
|
||||
|
||||
interface CommanderStatic extends Command {
|
||||
program: Command;
|
||||
Command: CommandConstructor;
|
||||
Option: OptionConstructor;
|
||||
CommanderError: CommanderErrorConstructor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Declaring namespace AND global
|
||||
// eslint-disable-next-line no-redeclare
|
||||
declare const commander: commander.CommanderStatic;
|
||||
export = commander;
|
||||
15
electron/node_modules/@electron/asar/node_modules/minimatch/LICENSE
generated
vendored
Normal file
15
electron/node_modules/@electron/asar/node_modules/minimatch/LICENSE
generated
vendored
Normal file
|
|
@ -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.
|
||||
267
electron/node_modules/@electron/asar/node_modules/minimatch/README.md
generated
vendored
Normal file
267
electron/node_modules/@electron/asar/node_modules/minimatch/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
# minimatch
|
||||
|
||||
A minimal matching utility.
|
||||
|
||||
[](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.
|
||||
|
||||
## Important Security Consideration!
|
||||
|
||||
> [!WARNING]
|
||||
> This library uses JavaScript regular expressions. Please read
|
||||
> the following warning carefully, and be thoughtful about what
|
||||
> you provide to this library in production systems.
|
||||
|
||||
_Any_ library in JavaScript that deals with matching string
|
||||
patterns using regular expressions will be subject to
|
||||
[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)
|
||||
if the pattern is generated using untrusted input.
|
||||
|
||||
Efforts have been made to mitigate risk as much as is feasible in
|
||||
such a library, providing maximum recursion depths and so forth,
|
||||
but these measures can only ultimately protect against accidents,
|
||||
not malice. A dedicated attacker can _always_ find patterns that
|
||||
cannot be defended against by a bash-compatible glob pattern
|
||||
matching system that uses JavaScript regular expressions.
|
||||
|
||||
To be extremely clear:
|
||||
|
||||
> [!WARNING]
|
||||
> **If you create a system where you take user input, and use
|
||||
> that input as the source of a Regular Expression pattern, in
|
||||
> this or any extant glob matcher in JavaScript, you will be
|
||||
> pwned.**
|
||||
|
||||
A future version of this library _may_ use a different matching
|
||||
algorithm which does not exhibit backtracking problems. If and
|
||||
when that happens, it will likely be a sweeping change, and those
|
||||
improvements will **not** be backported to legacy versions.
|
||||
|
||||
In the near term, it is not reasonable to continue to play
|
||||
whack-a-mole with security advisories, and so any future ReDoS
|
||||
reports will be considered "working as intended", and resolved
|
||||
entirely by this warning.
|
||||
|
||||
## 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.
|
||||
1005
electron/node_modules/@electron/asar/node_modules/minimatch/minimatch.js
generated
vendored
Normal file
1005
electron/node_modules/@electron/asar/node_modules/minimatch/minimatch.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
33
electron/node_modules/@electron/asar/node_modules/minimatch/package.json
generated
vendored
Normal file
33
electron/node_modules/@electron/asar/node_modules/minimatch/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
|
||||
"name": "minimatch",
|
||||
"description": "a glob matcher in javascript",
|
||||
"version": "3.1.5",
|
||||
"publishConfig": {
|
||||
"tag": "legacy-v3"
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
60
electron/node_modules/@electron/asar/package.json
generated
vendored
Normal file
60
electron/node_modules/@electron/asar/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"name": "@electron/asar",
|
||||
"description": "Creating Electron app packages",
|
||||
"version": "3.4.1",
|
||||
"main": "./lib/asar.js",
|
||||
"types": "./lib/asar.d.ts",
|
||||
"bin": {
|
||||
"asar": "./bin/asar.js"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"lib"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10.12.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/electron/asar",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/electron/asar.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/electron/asar/issues"
|
||||
},
|
||||
"publishConfig": {
|
||||
"provenance": true
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"mocha": "xvfb-maybe electron-mocha && mocha",
|
||||
"mocha:update": "mocha --update",
|
||||
"mocha:watch": "mocha --watch",
|
||||
"test": "yarn lint && yarn mocha",
|
||||
"lint": "yarn prettier:check",
|
||||
"prettier": "prettier \"src/**/*.ts\" \"test/**/*.js\" \"*.js\"",
|
||||
"prettier:check": "yarn prettier --check",
|
||||
"prettier:write": "yarn prettier --write",
|
||||
"prepare": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "^5.0.0",
|
||||
"glob": "^7.1.6",
|
||||
"minimatch": "^3.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/minimatch": "^3.0.5",
|
||||
"@types/node": "^12.0.0",
|
||||
"chai": "^4.5.0",
|
||||
"electron": "^22.0.0",
|
||||
"electron-mocha": "^13.0.1",
|
||||
"lodash": "^4.17.15",
|
||||
"mocha": "^10.1.0",
|
||||
"mocha-chai-jest-snapshot": "^1.1.6",
|
||||
"prettier": "^3.3.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^5.5.4",
|
||||
"xvfb-maybe": "^0.2.1"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue