new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
Copyright (c) 2011 Alexander Shtuchkin
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"execa","version":"7.0.0","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"lib/command.js":{"checkedAt":1678883670649,"integrity":"sha512-nGuiC39bpPxWjoFj9COAZTKWdN1NgNp1eV5qiJg7L7z761Q0UmgtznwMvmkgIA1St/ivc8riJBn6NVLs3Hr2qw==","mode":420,"size":1098},"index.js":{"checkedAt":1678883670649,"integrity":"sha512-tC41anuV8gA/9CNE5viS2heHlrDg/Cjl+aFDnHlqaTEj0jh01P5U9UH8HJ87Pm9Noj6azrwtcPi9vEvrw4ZHNQ==","mode":420,"size":6619},"lib/error.js":{"checkedAt":1678883670649,"integrity":"sha512-8k6aQH2vEohgSVzgqctpLgjhGrVVgp//Gih5CdmTjzn1ejP7y9j3JUvtIsW5KMDLyTcSvHGyc/T/024ilLZBgw==","mode":420,"size":2129},"lib/kill.js":{"checkedAt":1678883670654,"integrity":"sha512-1BvuzN2RPVpMM818TY/xIbAPY0gKEHqER+LevwtnN3Gyu9p8IwWk5x+7gdzFhbD1jhBDUijWAK6TCnaRIr8rIw==","mode":420,"size":2983},"lib/promise.js":{"checkedAt":1678883670654,"integrity":"sha512-SJP0bfuv/SIENOvbcTVqu66PI0/6UX99H3PP7bQJqRt9Q920Z5YAAIoM3pA72tT2sY4jmrmN9Q7n2zhuXwg+xw==","mode":420,"size":1127},"lib/stream.js":{"checkedAt":1678883670654,"integrity":"sha512-yku0aRP3bLnZjgWNX6g3KQr0JtQ8g+4SRaYWObEN2s4yqn8VvrQ0R5hR9lM4aShYk+scifGVJUAsq0bIlaVZ7Q==","mode":420,"size":2236},"lib/stdio.js":{"checkedAt":1678883670654,"integrity":"sha512-AVJVyV1IPIY6tXRb6ILc3Gztw4zn7oB1eMFHBns4jY+u5f0uQR58FfU00EcEO9lpgtuod9gxxRlnXnMrgA//hA==","mode":420,"size":1157},"package.json":{"checkedAt":1678883670654,"integrity":"sha512-oF2fwLicB8VtzgfKuze1tMRofT/K6UOWX6ZuN/3ylAzBZvlaLOfZmM0GMkNtbcwWo1EKvEloq5tAQcaGvf28gg==","mode":420,"size":1520},"readme.md":{"checkedAt":1678883670656,"integrity":"sha512-QHs/vJDoQ84S3hW72Dgwe768nZNBrB4Pl/VwD+2TYDxWl3w1Z4vdfRQ+F/I9tGJ1jFI4S1yn9+94XKgtrrXjBw==","mode":420,"size":19898},"index.d.ts":{"checkedAt":1678883670659,"integrity":"sha512-kPH7mFcSF7h3G23wvj2cS/KnGoPUSgyzbtWFfT5hCfJVqpm9aZO85HjlbLkB58Ss3YLOuPDOH38QJA4ft4L0aQ==","mode":420,"size":18261}}}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,33 @@
|
||||
import { OperatorFunction } from '../types';
|
||||
/**
|
||||
* Collects all source emissions and emits them as an array when the source completes.
|
||||
*
|
||||
* <span class="informal">Get all values inside an array when the source completes</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `toArray` will wait until the source Observable completes before emitting
|
||||
* the array containing all emissions. When the source Observable errors no
|
||||
* array will be emitted.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take, toArray } from 'rxjs';
|
||||
*
|
||||
* const source = interval(1000);
|
||||
* const example = source.pipe(
|
||||
* take(10),
|
||||
* toArray()
|
||||
* );
|
||||
*
|
||||
* example.subscribe(value => console.log(value));
|
||||
*
|
||||
* // output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||
* ```
|
||||
*
|
||||
* @return A function that returns an Observable that emits an array of items
|
||||
* emitted by the source Observable when source completes.
|
||||
*/
|
||||
export declare function toArray<T>(): OperatorFunction<T, T[]>;
|
||||
//# sourceMappingURL=toArray.d.ts.map
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "is-path-inside",
|
||||
"version": "3.0.3",
|
||||
"description": "Check if a path is inside another path",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/is-path-inside",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"path",
|
||||
"inside",
|
||||
"folder",
|
||||
"directory",
|
||||
"dir",
|
||||
"file",
|
||||
"resolve"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^2.1.0",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function (T, a) {
|
||||
var obj = {};
|
||||
|
||||
a((new T([[obj, "foo"]])).get(obj), "foo");
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
declare module 'emoji-regex/RGI_Emoji' {
|
||||
function emojiRegex(): RegExp;
|
||||
|
||||
export = emojiRegex;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var DefinePropertyOrThrow = require('./DefinePropertyOrThrow');
|
||||
var HasOwnProperty = require('./HasOwnProperty');
|
||||
var IsExtensible = require('./IsExtensible');
|
||||
var IsNonNegativeInteger = require('./IsNonNegativeInteger');
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-setfunctionlength
|
||||
|
||||
module.exports = function SetFunctionLength(F, length) {
|
||||
if (typeof F !== 'function' || !IsExtensible(F) || HasOwnProperty(F, 'length')) {
|
||||
throw new $TypeError('Assertion failed: `F` must be an extensible function and lack an own `length` property');
|
||||
}
|
||||
if (Type(length) !== 'Number') {
|
||||
throw new $TypeError('Assertion failed: `length` must be a Number');
|
||||
}
|
||||
if (!IsNonNegativeInteger(length)) {
|
||||
throw new $TypeError('Assertion failed: `length` must be an integer >= 0');
|
||||
}
|
||||
return DefinePropertyOrThrow(F, 'length', {
|
||||
'[[Configurable]]': true,
|
||||
'[[Enumerable]]': false,
|
||||
'[[Value]]': length,
|
||||
'[[Writable]]': false
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
declare class BrowserslistError extends Error {
|
||||
constructor(message: any)
|
||||
name: 'BrowserslistError'
|
||||
browserslist: true
|
||||
}
|
||||
|
||||
export = BrowserslistError
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"has-bigints","version":"1.0.2","files":{".eslintrc":{"checkedAt":1678883671576,"integrity":"sha512-4+yheARSL/pPQeg25245ejEKIOgmGjgRW2fotkREQVMDnQQZj7Rw9FvimX0senKxW9R3GgLHQbPLwHLqbvQy6Q==","mode":420,"size":43},".nycrc":{"checkedAt":1678883669555,"integrity":"sha512-2vm1RFz8Ajl/OYrfoCWPJIm3Bpnf7Gyn5bha/lZx/cq+We3uMy9xj15XeP6x4wF3jf/pO7KMHAkU9mllm605xg==","mode":420,"size":139},"LICENSE":{"checkedAt":1678883671533,"integrity":"sha512-d2fjYr50p8QKjqC0qhH5nWv3sgAsKHHicw91kVzLPCZ54cpPIRw8zJk+nn45Y6q/yJ/T/xdxK77zBLuAvFgmVg==","mode":420,"size":1071},"index.js":{"checkedAt":1678883673404,"integrity":"sha512-UZPgblsFpl/+kk/cy8cnvwJsYiyh35YwbPP/7aW3u+qLsMUgMOyQURwucbOcpHOK+lbvBO5ctWKqCtZl1Sr+Ug==","mode":420,"size":347},"test/index.js":{"checkedAt":1678883673404,"integrity":"sha512-7sN3T6eCRwn5u5Rd/MGo9MB6U0QNRvCOmXNrcjNB4fycAxDQsJ/aX88SeCgEUXeXP2sm2X9Bm4G3B6ZGMUB3cA==","mode":420,"size":1002},"package.json":{"checkedAt":1678883673404,"integrity":"sha512-hV5gWSFoSWIzqPwHM2mdKPAGfJVo5Kp3mttCDx0VnhCD7KtiwFjlBNx+HleO4/aIgjRJHh0e7ZqJs6rHzX2w1A==","mode":420,"size":1499},"CHANGELOG.md":{"checkedAt":1678883673404,"integrity":"sha512-23FuSYLVZDHqzLnKzJb5TeKm9LmpvMj+qCUGmxOPZN2vSbGy8loLoRtzpFrNXwrVfZRyHNDXMRZeH/oQw2r1OA==","mode":420,"size":6360},"README.md":{"checkedAt":1678883673404,"integrity":"sha512-qEG/BRXfGU0iEl+to+OQom9P+g7Svp1M1h2GsyNW3PPt6bovBOQr/cDjMBAc+tDEVvhgftsUv5v2SBy1YfK15w==","mode":420,"size":1729},".github/FUNDING.yml":{"checkedAt":1678883673405,"integrity":"sha512-ISE1RevksY3xb8IFXPGShIY+NP62IPOX3bioO+0xo7Chds8eQylIxmkxxjrIlql1bkHSydV2szF8GBmm77QiEg==","mode":420,"size":582}}}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "ansi-regex",
|
||||
"version": "5.0.1",
|
||||
"description": "Regular expression for matching ANSI escape codes",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-regex",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"view-supported": "node fixtures/view-codes.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"command-line",
|
||||
"text",
|
||||
"regex",
|
||||
"regexp",
|
||||
"re",
|
||||
"match",
|
||||
"test",
|
||||
"find",
|
||||
"pattern"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "^2.4.0",
|
||||
"tsd": "^0.9.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
Create a deep version of another object type where property values are recursively replaced into a given value type.
|
||||
|
||||
Use-cases:
|
||||
- Form validation: Define how each field should be validated.
|
||||
- Form settings: Define configuration for input fields.
|
||||
- Parsing: Define types that specify special behavior for specific fields.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {Schema} from 'type-fest';
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
name: {
|
||||
firstname: string;
|
||||
lastname: string;
|
||||
};
|
||||
created: Date;
|
||||
active: boolean;
|
||||
passwordHash: string;
|
||||
}
|
||||
|
||||
type UserMask = Schema<User, 'mask' | 'hide' | 'show'>;
|
||||
|
||||
const userMaskSettings: UserMask = {
|
||||
id: 'show',
|
||||
name: {
|
||||
firstname: 'show',
|
||||
lastname: 'mask',
|
||||
},
|
||||
phoneNumbers: 'mask',
|
||||
created: 'show',
|
||||
active: 'show',
|
||||
passwordHash: 'hide',
|
||||
}
|
||||
```
|
||||
|
||||
@category Object
|
||||
*/
|
||||
export type Schema<ObjectType, ValueType> = ObjectType extends string
|
||||
? ValueType
|
||||
: ObjectType extends Map<unknown, unknown>
|
||||
? ValueType
|
||||
: ObjectType extends Set<unknown>
|
||||
? ValueType
|
||||
: ObjectType extends ReadonlyMap<unknown, unknown>
|
||||
? ValueType
|
||||
: ObjectType extends ReadonlySet<unknown>
|
||||
? ValueType
|
||||
: ObjectType extends readonly unknown[]
|
||||
? ValueType
|
||||
: ObjectType extends unknown[]
|
||||
? ValueType
|
||||
: ObjectType extends (...arguments: unknown[]) => unknown
|
||||
? ValueType
|
||||
: ObjectType extends Date
|
||||
? ValueType
|
||||
: ObjectType extends Function
|
||||
? ValueType
|
||||
: ObjectType extends RegExp
|
||||
? ValueType
|
||||
: ObjectType extends object
|
||||
? SchemaObject<ObjectType, ValueType>
|
||||
: ValueType;
|
||||
|
||||
/**
|
||||
Same as `Schema`, but accepts only `object`s as inputs. Internal helper for `Schema`.
|
||||
*/
|
||||
type SchemaObject<ObjectType extends object, K> = {
|
||||
[KeyType in keyof ObjectType]: Schema<ObjectType[KeyType], K> | K;
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "data-uri-to-buffer",
|
||||
"version": "3.0.1",
|
||||
"description": "Generate a Buffer instance from a Data URI string",
|
||||
"main": "dist/src/index.js",
|
||||
"types": "dist/src/index.d.ts",
|
||||
"files": [
|
||||
"dist/src"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "mocha --reporter spec dist/test/*.js",
|
||||
"test-lint": "eslint src --ext .js,.ts",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/TooTallNate/node-data-uri-to-buffer.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"keywords": [
|
||||
"data",
|
||||
"uri",
|
||||
"datauri",
|
||||
"data-uri",
|
||||
"buffer",
|
||||
"convert",
|
||||
"rfc2397",
|
||||
"2397"
|
||||
],
|
||||
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/TooTallNate/node-data-uri-to-buffer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/TooTallNate/node-data-uri-to-buffer",
|
||||
"devDependencies": {
|
||||
"@types/es6-promisify": "^5.0.0",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "^10.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "1.6.0",
|
||||
"@typescript-eslint/parser": "1.1.0",
|
||||
"eslint": "5.16.0",
|
||||
"eslint-config-airbnb": "17.1.0",
|
||||
"eslint-config-prettier": "4.1.0",
|
||||
"eslint-import-resolver-typescript": "1.1.1",
|
||||
"eslint-plugin-import": "2.16.0",
|
||||
"eslint-plugin-jsx-a11y": "6.2.1",
|
||||
"eslint-plugin-react": "7.12.4",
|
||||
"mocha": "^6.2.0",
|
||||
"typescript": "^3.5.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { SchedulerLike } from '../types';
|
||||
/**
|
||||
* @deprecated Use `from(Object.entries(obj))` instead. Will be removed in v8.
|
||||
*/
|
||||
export declare function pairs<T>(arr: readonly T[], scheduler?: SchedulerLike): Observable<[string, T]>;
|
||||
/**
|
||||
* @deprecated Use `from(Object.entries(obj))` instead. Will be removed in v8.
|
||||
*/
|
||||
export declare function pairs<O extends Record<string, unknown>>(obj: O, scheduler?: SchedulerLike): Observable<[keyof O, O[keyof O]]>;
|
||||
/**
|
||||
* @deprecated Use `from(Object.entries(obj))` instead. Will be removed in v8.
|
||||
*/
|
||||
export declare function pairs<T>(iterable: Iterable<T>, scheduler?: SchedulerLike): Observable<[string, T]>;
|
||||
/**
|
||||
* @deprecated Use `from(Object.entries(obj))` instead. Will be removed in v8.
|
||||
*/
|
||||
export declare function pairs(n: number | bigint | boolean | ((...args: any[]) => any) | symbol, scheduler?: SchedulerLike): Observable<[never, never]>;
|
||||
//# sourceMappingURL=pairs.d.ts.map
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"browserslist","version":"4.21.5","files":{"browser.js":{"checkedAt":1678883673376,"integrity":"sha512-n4ugxQvDQV8zp3L2SzOy4B7LQxL/aJkSmWqpsfz9w1kH5PY4Vz03K+cVMuNXpDbyMEsAK1PbtrQKwjZeaMLs5w==","mode":420,"size":1092},"LICENSE":{"checkedAt":1678883673376,"integrity":"sha512-Raflz5KmAUGw9dAUGxBwDPV0ySHb6JSlDNzIY6mO5xPEEAavPsYHfvjKFFSuRFm8PbOlDJhipjTFu4dv3hfbnA==","mode":420,"size":1118},"error.js":{"checkedAt":1678883673376,"integrity":"sha512-eM5bCMkbyNv85gmZB4fBn+oEKkZ6PjzIPUwsD2EENjePQjdNd3fGa22/SG9aaOITfJg/Dv9ZZwg/aJ6zF/k/6g==","mode":420,"size":299},"cli.js":{"checkedAt":1678883673376,"integrity":"sha512-zBoUhCRt+17rjIAgLVTDEVaHordLsAX4wo5/AdiX/h9Jzso71xDfSp05wBTohvx/LpexQr+NVCqMlKOrhlqpHw==","mode":493,"size":4135},"index.js":{"checkedAt":1678883673380,"integrity":"sha512-igG6xhlHDzdy79+qHQM2DJgnpnwlNoNXE53F1QrKkCW379cH7xiWAlw6YChIVcpE5z/RXyAlK/K2dkNjIg5OXQ==","mode":420,"size":32989},"parse.js":{"checkedAt":1678883673382,"integrity":"sha512-pwgC1GsdrTsk25DaZ+CptiClBPpXV7iDwJOKqbtsSrose5g+A79J8r7iM0QEm+fRHT1NttBndAJ1LpUGfwnUnw==","mode":420,"size":1789},"node.js":{"checkedAt":1678883673382,"integrity":"sha512-E+W30oXBHPwKWRErsFpR1micDy+oeyaKFenPKlUCfj92o3TBVobQvKBJShnaclAk+TmfSdAjFscX5ONPUJtpNg==","mode":420,"size":11353},"package.json":{"checkedAt":1678883673382,"integrity":"sha512-dhsnDIbW1c4aFcBkxMPX3ZduMTeTqFcMQRpUdlBXmv5XVGKJ7Iu5bSbEqBqiXsU1IcU7utuw6knyGEGVdvfq0Q==","mode":420,"size":985},"README.md":{"checkedAt":1678883673382,"integrity":"sha512-GSn+/kGbtYLmavfVLu/DAnDEO90pkseUsxtkH/vUhv/4YWfXZEmFoYWublaUPy9WIY/6d9rm2EHcys4aV8+eAg==","mode":420,"size":2927},"error.d.ts":{"checkedAt":1678883673382,"integrity":"sha512-tSP37G4+NgmRdRil9O9QyP39O9F4ch3Az+ysTR+WotGTOC8L2menH30xBv5OpUauwxPs9+rxO4higfsZ3BpzUA==","mode":420,"size":155},"index.d.ts":{"checkedAt":1678883673384,"integrity":"sha512-jgLWDFUN8ESk8ACkimmRWe5HfovjCEh0K8K+UG1iMnPVNvhLNDKCvyUuhBm7+9k06BYWvjGOHbTGufPIh/RLNQ==","mode":420,"size":4413}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC"}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "arg",
|
||||
"version": "5.0.2",
|
||||
"description": "Unopinionated, no-frills CLI argument parser",
|
||||
"main": "index.js",
|
||||
"types": "index.d.ts",
|
||||
"repository": "vercel/arg",
|
||||
"author": "Josh Junon <junon@wavetilt.com>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "WARN_EXIT=1 jest --coverage -w 2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.1.1",
|
||||
"jest": "^27.0.6",
|
||||
"prettier": "^2.3.2"
|
||||
},
|
||||
"prettier": {
|
||||
"arrowParens": "always",
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"trailingComma": "none"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.blake2s = exports.compress = exports.IV = void 0;
|
||||
const _blake2_js_1 = require("./_blake2.js");
|
||||
const _u64_js_1 = require("./_u64.js");
|
||||
const utils_js_1 = require("./utils.js");
|
||||
// Initial state:
|
||||
// first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19)
|
||||
// same as SHA-256
|
||||
// prettier-ignore
|
||||
exports.IV = new Uint32Array([
|
||||
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
|
||||
]);
|
||||
// Mixing function G splitted in two halfs
|
||||
function G1(a, b, c, d, x) {
|
||||
a = (a + b + x) | 0;
|
||||
d = (0, utils_js_1.rotr)(d ^ a, 16);
|
||||
c = (c + d) | 0;
|
||||
b = (0, utils_js_1.rotr)(b ^ c, 12);
|
||||
return { a, b, c, d };
|
||||
}
|
||||
function G2(a, b, c, d, x) {
|
||||
a = (a + b + x) | 0;
|
||||
d = (0, utils_js_1.rotr)(d ^ a, 8);
|
||||
c = (c + d) | 0;
|
||||
b = (0, utils_js_1.rotr)(b ^ c, 7);
|
||||
return { a, b, c, d };
|
||||
}
|
||||
// prettier-ignore
|
||||
function compress(s, offset, msg, rounds, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15) {
|
||||
let j = 0;
|
||||
for (let i = 0; i < rounds; i++) {
|
||||
({ a: v0, b: v4, c: v8, d: v12 } = G1(v0, v4, v8, v12, msg[offset + s[j++]]));
|
||||
({ a: v0, b: v4, c: v8, d: v12 } = G2(v0, v4, v8, v12, msg[offset + s[j++]]));
|
||||
({ a: v1, b: v5, c: v9, d: v13 } = G1(v1, v5, v9, v13, msg[offset + s[j++]]));
|
||||
({ a: v1, b: v5, c: v9, d: v13 } = G2(v1, v5, v9, v13, msg[offset + s[j++]]));
|
||||
({ a: v2, b: v6, c: v10, d: v14 } = G1(v2, v6, v10, v14, msg[offset + s[j++]]));
|
||||
({ a: v2, b: v6, c: v10, d: v14 } = G2(v2, v6, v10, v14, msg[offset + s[j++]]));
|
||||
({ a: v3, b: v7, c: v11, d: v15 } = G1(v3, v7, v11, v15, msg[offset + s[j++]]));
|
||||
({ a: v3, b: v7, c: v11, d: v15 } = G2(v3, v7, v11, v15, msg[offset + s[j++]]));
|
||||
({ a: v0, b: v5, c: v10, d: v15 } = G1(v0, v5, v10, v15, msg[offset + s[j++]]));
|
||||
({ a: v0, b: v5, c: v10, d: v15 } = G2(v0, v5, v10, v15, msg[offset + s[j++]]));
|
||||
({ a: v1, b: v6, c: v11, d: v12 } = G1(v1, v6, v11, v12, msg[offset + s[j++]]));
|
||||
({ a: v1, b: v6, c: v11, d: v12 } = G2(v1, v6, v11, v12, msg[offset + s[j++]]));
|
||||
({ a: v2, b: v7, c: v8, d: v13 } = G1(v2, v7, v8, v13, msg[offset + s[j++]]));
|
||||
({ a: v2, b: v7, c: v8, d: v13 } = G2(v2, v7, v8, v13, msg[offset + s[j++]]));
|
||||
({ a: v3, b: v4, c: v9, d: v14 } = G1(v3, v4, v9, v14, msg[offset + s[j++]]));
|
||||
({ a: v3, b: v4, c: v9, d: v14 } = G2(v3, v4, v9, v14, msg[offset + s[j++]]));
|
||||
}
|
||||
return { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 };
|
||||
}
|
||||
exports.compress = compress;
|
||||
class BLAKE2s extends _blake2_js_1.BLAKE2 {
|
||||
constructor(opts = {}) {
|
||||
super(64, opts.dkLen === undefined ? 32 : opts.dkLen, opts, 32, 8, 8);
|
||||
// Internal state, same as SHA-256
|
||||
this.v0 = exports.IV[0] | 0;
|
||||
this.v1 = exports.IV[1] | 0;
|
||||
this.v2 = exports.IV[2] | 0;
|
||||
this.v3 = exports.IV[3] | 0;
|
||||
this.v4 = exports.IV[4] | 0;
|
||||
this.v5 = exports.IV[5] | 0;
|
||||
this.v6 = exports.IV[6] | 0;
|
||||
this.v7 = exports.IV[7] | 0;
|
||||
const keyLength = opts.key ? opts.key.length : 0;
|
||||
this.v0 ^= this.outputLen | (keyLength << 8) | (0x01 << 16) | (0x01 << 24);
|
||||
if (opts.salt) {
|
||||
const salt = (0, utils_js_1.u32)((0, utils_js_1.toBytes)(opts.salt));
|
||||
this.v4 ^= salt[0];
|
||||
this.v5 ^= salt[1];
|
||||
}
|
||||
if (opts.personalization) {
|
||||
const pers = (0, utils_js_1.u32)((0, utils_js_1.toBytes)(opts.personalization));
|
||||
this.v6 ^= pers[0];
|
||||
this.v7 ^= pers[1];
|
||||
}
|
||||
if (opts.key) {
|
||||
// Pad to blockLen and update
|
||||
const tmp = new Uint8Array(this.blockLen);
|
||||
tmp.set((0, utils_js_1.toBytes)(opts.key));
|
||||
this.update(tmp);
|
||||
}
|
||||
}
|
||||
get() {
|
||||
const { v0, v1, v2, v3, v4, v5, v6, v7 } = this;
|
||||
return [v0, v1, v2, v3, v4, v5, v6, v7];
|
||||
}
|
||||
// prettier-ignore
|
||||
set(v0, v1, v2, v3, v4, v5, v6, v7) {
|
||||
this.v0 = v0 | 0;
|
||||
this.v1 = v1 | 0;
|
||||
this.v2 = v2 | 0;
|
||||
this.v3 = v3 | 0;
|
||||
this.v4 = v4 | 0;
|
||||
this.v5 = v5 | 0;
|
||||
this.v6 = v6 | 0;
|
||||
this.v7 = v7 | 0;
|
||||
}
|
||||
compress(msg, offset, isLast) {
|
||||
const { h, l } = _u64_js_1.default.fromBig(BigInt(this.length));
|
||||
// prettier-ignore
|
||||
const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } = compress(_blake2_js_1.SIGMA, offset, msg, 10, this.v0, this.v1, this.v2, this.v3, this.v4, this.v5, this.v6, this.v7, exports.IV[0], exports.IV[1], exports.IV[2], exports.IV[3], l ^ exports.IV[4], h ^ exports.IV[5], isLast ? ~exports.IV[6] : exports.IV[6], exports.IV[7]);
|
||||
this.v0 ^= v0 ^ v8;
|
||||
this.v1 ^= v1 ^ v9;
|
||||
this.v2 ^= v2 ^ v10;
|
||||
this.v3 ^= v3 ^ v11;
|
||||
this.v4 ^= v4 ^ v12;
|
||||
this.v5 ^= v5 ^ v13;
|
||||
this.v6 ^= v6 ^ v14;
|
||||
this.v7 ^= v7 ^ v15;
|
||||
}
|
||||
destroy() {
|
||||
this.destroyed = true;
|
||||
this.buffer32.fill(0);
|
||||
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* BLAKE2s - optimized for 32-bit platforms. JS doesn't have uint64, so it's faster than BLAKE2b.
|
||||
* @param msg - message that would be hashed
|
||||
* @param opts - dkLen, key, salt, personalization
|
||||
*/
|
||||
exports.blake2s = (0, utils_js_1.wrapConstructorWithOpts)((opts) => new BLAKE2s(opts));
|
||||
//# sourceMappingURL=blake2s.js.map
|
||||
@@ -0,0 +1,795 @@
|
||||
# fast-glob
|
||||
|
||||
> It's a very fast and efficient [glob][glob_definition] library for [Node.js][node_js].
|
||||
|
||||
This package provides methods for traversing the file system and returning pathnames that matched a defined set of a specified pattern according to the rules used by the Unix Bash shell with some simplifications, meanwhile results are returned in **arbitrary order**. Quick, simple, effective.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
<details>
|
||||
<summary><strong>Details</strong></summary>
|
||||
|
||||
* [Highlights](#highlights)
|
||||
* [Donation](#donation)
|
||||
* [Old and modern mode](#old-and-modern-mode)
|
||||
* [Pattern syntax](#pattern-syntax)
|
||||
* [Basic syntax](#basic-syntax)
|
||||
* [Advanced syntax](#advanced-syntax)
|
||||
* [Installation](#installation)
|
||||
* [API](#api)
|
||||
* [Asynchronous](#asynchronous)
|
||||
* [Synchronous](#synchronous)
|
||||
* [Stream](#stream)
|
||||
* [patterns](#patterns)
|
||||
* [[options]](#options)
|
||||
* [Helpers](#helpers)
|
||||
* [generateTasks](#generatetaskspatterns-options)
|
||||
* [isDynamicPattern](#isdynamicpatternpattern-options)
|
||||
* [escapePath](#escapepathpattern)
|
||||
* [Options](#options-3)
|
||||
* [Common](#common)
|
||||
* [concurrency](#concurrency)
|
||||
* [cwd](#cwd)
|
||||
* [deep](#deep)
|
||||
* [followSymbolicLinks](#followsymboliclinks)
|
||||
* [fs](#fs)
|
||||
* [ignore](#ignore)
|
||||
* [suppressErrors](#suppresserrors)
|
||||
* [throwErrorOnBrokenSymbolicLink](#throwerroronbrokensymboliclink)
|
||||
* [Output control](#output-control)
|
||||
* [absolute](#absolute)
|
||||
* [markDirectories](#markdirectories)
|
||||
* [objectMode](#objectmode)
|
||||
* [onlyDirectories](#onlydirectories)
|
||||
* [onlyFiles](#onlyfiles)
|
||||
* [stats](#stats)
|
||||
* [unique](#unique)
|
||||
* [Matching control](#matching-control)
|
||||
* [braceExpansion](#braceexpansion)
|
||||
* [caseSensitiveMatch](#casesensitivematch)
|
||||
* [dot](#dot)
|
||||
* [extglob](#extglob)
|
||||
* [globstar](#globstar)
|
||||
* [baseNameMatch](#basenamematch)
|
||||
* [FAQ](#faq)
|
||||
* [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern)
|
||||
* [How to write patterns on Windows?](#how-to-write-patterns-on-windows)
|
||||
* [Why are parentheses match wrong?](#why-are-parentheses-match-wrong)
|
||||
* [How to exclude directory from reading?](#how-to-exclude-directory-from-reading)
|
||||
* [How to use UNC path?](#how-to-use-unc-path)
|
||||
* [Compatible with `node-glob`?](#compatible-with-node-glob)
|
||||
* [Benchmarks](#benchmarks)
|
||||
* [Server](#server)
|
||||
* [Nettop](#nettop)
|
||||
* [Changelog](#changelog)
|
||||
* [License](#license)
|
||||
|
||||
</details>
|
||||
|
||||
## Highlights
|
||||
|
||||
* Fast. Probably the fastest.
|
||||
* Supports multiple and negative patterns.
|
||||
* Synchronous, Promise and Stream API.
|
||||
* Object mode. Can return more than just strings.
|
||||
* Error-tolerant.
|
||||
|
||||
## Donation
|
||||
|
||||
Do you like this project? Support it by donating, creating an issue or pull request.
|
||||
|
||||
[][paypal_mrmlnc]
|
||||
|
||||
## Old and modern mode
|
||||
|
||||
This package works in two modes, depending on the environment in which it is used.
|
||||
|
||||
* **Old mode**. Node.js below 10.10 or when the [`stats`](#stats) option is *enabled*.
|
||||
* **Modern mode**. Node.js 10.10+ and the [`stats`](#stats) option is *disabled*.
|
||||
|
||||
The modern mode is faster. Learn more about the [internal mechanism][nodelib_fs_scandir_old_and_modern_modern].
|
||||
|
||||
## Pattern syntax
|
||||
|
||||
> :warning: Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters.
|
||||
|
||||
There is more than one form of syntax: basic and advanced. Below is a brief overview of the supported features. Also pay attention to our [FAQ](#faq).
|
||||
|
||||
> :book: This package uses a [`micromatch`][micromatch] as a library for pattern matching.
|
||||
|
||||
### Basic syntax
|
||||
|
||||
* An asterisk (`*`) — matches everything except slashes (path separators), hidden files (names starting with `.`).
|
||||
* A double star or globstar (`**`) — matches zero or more directories.
|
||||
* Question mark (`?`) – matches any single character except slashes (path separators).
|
||||
* Sequence (`[seq]`) — matches any character in sequence.
|
||||
|
||||
> :book: A few additional words about the [basic matching behavior][picomatch_matching_behavior].
|
||||
|
||||
Some examples:
|
||||
|
||||
* `src/**/*.js` — matches all files in the `src` directory (any level of nesting) that have the `.js` extension.
|
||||
* `src/*.??` — matches all files in the `src` directory (only first level of nesting) that have a two-character extension.
|
||||
* `file-[01].js` — matches files: `file-0.js`, `file-1.js`.
|
||||
|
||||
### Advanced syntax
|
||||
|
||||
* [Escapes characters][micromatch_backslashes] (`\\`) — matching special characters (`$^*+?()[]`) as literals.
|
||||
* [POSIX character classes][picomatch_posix_brackets] (`[[:digit:]]`).
|
||||
* [Extended globs][micromatch_extglobs] (`?(pattern-list)`).
|
||||
* [Bash style brace expansions][micromatch_braces] (`{}`).
|
||||
* [Regexp character classes][micromatch_regex_character_classes] (`[1-5]`).
|
||||
* [Regex groups][regular_expressions_brackets] (`(a|b)`).
|
||||
|
||||
> :book: A few additional words about the [advanced matching behavior][micromatch_extended_globbing].
|
||||
|
||||
Some examples:
|
||||
|
||||
* `src/**/*.{css,scss}` — matches all files in the `src` directory (any level of nesting) that have the `.css` or `.scss` extension.
|
||||
* `file-[[:digit:]].js` — matches files: `file-0.js`, `file-1.js`, …, `file-9.js`.
|
||||
* `file-{1..3}.js` — matches files: `file-1.js`, `file-2.js`, `file-3.js`.
|
||||
* `file-(1|2)` — matches files: `file-1.js`, `file-2.js`.
|
||||
|
||||
## Installation
|
||||
|
||||
```console
|
||||
npm install fast-glob
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Asynchronous
|
||||
|
||||
```js
|
||||
fg(patterns, [options])
|
||||
```
|
||||
|
||||
Returns a `Promise` with an array of matching entries.
|
||||
|
||||
```js
|
||||
const fg = require('fast-glob');
|
||||
|
||||
const entries = await fg(['.editorconfig', '**/index.js'], { dot: true });
|
||||
|
||||
// ['.editorconfig', 'services/index.js']
|
||||
```
|
||||
|
||||
### Synchronous
|
||||
|
||||
```js
|
||||
fg.sync(patterns, [options])
|
||||
```
|
||||
|
||||
Returns an array of matching entries.
|
||||
|
||||
```js
|
||||
const fg = require('fast-glob');
|
||||
|
||||
const entries = fg.sync(['.editorconfig', '**/index.js'], { dot: true });
|
||||
|
||||
// ['.editorconfig', 'services/index.js']
|
||||
```
|
||||
|
||||
### Stream
|
||||
|
||||
```js
|
||||
fg.stream(patterns, [options])
|
||||
```
|
||||
|
||||
Returns a [`ReadableStream`][node_js_stream_readable_streams] when the `data` event will be emitted with matching entry.
|
||||
|
||||
```js
|
||||
const fg = require('fast-glob');
|
||||
|
||||
const stream = fg.stream(['.editorconfig', '**/index.js'], { dot: true });
|
||||
|
||||
for await (const entry of stream) {
|
||||
// .editorconfig
|
||||
// services/index.js
|
||||
}
|
||||
```
|
||||
|
||||
#### patterns
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | string[]`
|
||||
|
||||
Any correct pattern(s).
|
||||
|
||||
> :1234: [Pattern syntax](#pattern-syntax)
|
||||
>
|
||||
> :warning: This package does not respect the order of patterns. First, all the negative patterns are applied, and only then the positive patterns. If you want to get a certain order of records, use sorting or split calls.
|
||||
|
||||
#### [options]
|
||||
|
||||
* Required: `false`
|
||||
* Type: [`Options`](#options-3)
|
||||
|
||||
See [Options](#options-3) section.
|
||||
|
||||
### Helpers
|
||||
|
||||
#### `generateTasks(patterns, [options])`
|
||||
|
||||
Returns the internal representation of patterns ([`Task`](./src/managers/tasks.ts) is a combining patterns by base directory).
|
||||
|
||||
```js
|
||||
fg.generateTasks('*');
|
||||
|
||||
[{
|
||||
base: '.', // Parent directory for all patterns inside this task
|
||||
dynamic: true, // Dynamic or static patterns are in this task
|
||||
patterns: ['*'],
|
||||
positive: ['*'],
|
||||
negative: []
|
||||
}]
|
||||
```
|
||||
|
||||
##### patterns
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string | string[]`
|
||||
|
||||
Any correct pattern(s).
|
||||
|
||||
##### [options]
|
||||
|
||||
* Required: `false`
|
||||
* Type: [`Options`](#options-3)
|
||||
|
||||
See [Options](#options-3) section.
|
||||
|
||||
#### `isDynamicPattern(pattern, [options])`
|
||||
|
||||
Returns `true` if the passed pattern is a dynamic pattern.
|
||||
|
||||
> :1234: [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern)
|
||||
|
||||
```js
|
||||
fg.isDynamicPattern('*'); // true
|
||||
fg.isDynamicPattern('abc'); // false
|
||||
```
|
||||
|
||||
##### pattern
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string`
|
||||
|
||||
Any correct pattern.
|
||||
|
||||
##### [options]
|
||||
|
||||
* Required: `false`
|
||||
* Type: [`Options`](#options-3)
|
||||
|
||||
See [Options](#options-3) section.
|
||||
|
||||
#### `escapePath(pattern)`
|
||||
|
||||
Returns a path with escaped special characters (`*?|(){}[]`, `!` at the beginning of line, `@+!` before the opening parenthesis).
|
||||
|
||||
```js
|
||||
fg.escapePath('!abc'); // \\!abc
|
||||
fg.escapePath('C:/Program Files (x86)'); // C:/Program Files \\(x86\\)
|
||||
```
|
||||
|
||||
##### pattern
|
||||
|
||||
* Required: `true`
|
||||
* Type: `string`
|
||||
|
||||
Any string, for example, a path to a file.
|
||||
|
||||
## Options
|
||||
|
||||
### Common options
|
||||
|
||||
#### concurrency
|
||||
|
||||
* Type: `number`
|
||||
* Default: `os.cpus().length`
|
||||
|
||||
Specifies the maximum number of concurrent requests from a reader to read directories.
|
||||
|
||||
> :book: The higher the number, the higher the performance and load on the file system. If you want to read in quiet mode, set the value to a comfortable number or `1`.
|
||||
|
||||
#### cwd
|
||||
|
||||
* Type: `string`
|
||||
* Default: `process.cwd()`
|
||||
|
||||
The current working directory in which to search.
|
||||
|
||||
#### deep
|
||||
|
||||
* Type: `number`
|
||||
* Default: `Infinity`
|
||||
|
||||
Specifies the maximum depth of a read directory relative to the start directory.
|
||||
|
||||
For example, you have the following tree:
|
||||
|
||||
```js
|
||||
dir/
|
||||
└── one/ // 1
|
||||
└── two/ // 2
|
||||
└── file.js // 3
|
||||
```
|
||||
|
||||
```js
|
||||
// With base directory
|
||||
fg.sync('dir/**', { onlyFiles: false, deep: 1 }); // ['dir/one']
|
||||
fg.sync('dir/**', { onlyFiles: false, deep: 2 }); // ['dir/one', 'dir/one/two']
|
||||
|
||||
// With cwd option
|
||||
fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 1 }); // ['one']
|
||||
fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 2 }); // ['one', 'one/two']
|
||||
```
|
||||
|
||||
> :book: If you specify a pattern with some base directory, this directory will not participate in the calculation of the depth of the found directories. Think of it as a [`cwd`](#cwd) option.
|
||||
|
||||
#### followSymbolicLinks
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Indicates whether to traverse descendants of symbolic link directories when expanding `**` patterns.
|
||||
|
||||
> :book: Note that this option does not affect the base directory of the pattern. For example, if `./a` is a symlink to directory `./b` and you specified `['./a**', './b/**']` patterns, then directory `./a` will still be read.
|
||||
|
||||
> :book: If the [`stats`](#stats) option is specified, the information about the symbolic link (`fs.lstat`) will be replaced with information about the entry (`fs.stat`) behind it.
|
||||
|
||||
#### fs
|
||||
|
||||
* Type: `FileSystemAdapter`
|
||||
* Default: `fs.*`
|
||||
|
||||
Custom implementation of methods for working with the file system.
|
||||
|
||||
```ts
|
||||
export interface FileSystemAdapter {
|
||||
lstat?: typeof fs.lstat;
|
||||
stat?: typeof fs.stat;
|
||||
lstatSync?: typeof fs.lstatSync;
|
||||
statSync?: typeof fs.statSync;
|
||||
readdir?: typeof fs.readdir;
|
||||
readdirSync?: typeof fs.readdirSync;
|
||||
}
|
||||
```
|
||||
|
||||
#### ignore
|
||||
|
||||
* Type: `string[]`
|
||||
* Default: `[]`
|
||||
|
||||
An array of glob patterns to exclude matches. This is an alternative way to use negative patterns.
|
||||
|
||||
```js
|
||||
dir/
|
||||
├── package-lock.json
|
||||
└── package.json
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync(['*.json', '!package-lock.json']); // ['package.json']
|
||||
fg.sync('*.json', { ignore: ['package-lock.json'] }); // ['package.json']
|
||||
```
|
||||
|
||||
#### suppressErrors
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
By default this package suppress only `ENOENT` errors. Set to `true` to suppress any error.
|
||||
|
||||
> :book: Can be useful when the directory has entries with a special level of access.
|
||||
|
||||
#### throwErrorOnBrokenSymbolicLink
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.
|
||||
|
||||
> :book: This option has no effect on errors when reading the symbolic link directory.
|
||||
|
||||
### Output control
|
||||
|
||||
#### absolute
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Return the absolute path for entries.
|
||||
|
||||
```js
|
||||
fg.sync('*.js', { absolute: false }); // ['index.js']
|
||||
fg.sync('*.js', { absolute: true }); // ['/home/user/index.js']
|
||||
```
|
||||
|
||||
> :book: This option is required if you want to use negative patterns with absolute path, for example, `!${__dirname}/*.js`.
|
||||
|
||||
#### markDirectories
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Mark the directory path with the final slash.
|
||||
|
||||
```js
|
||||
fg.sync('*', { onlyFiles: false, markDirectories: false }); // ['index.js', 'controllers']
|
||||
fg.sync('*', { onlyFiles: false, markDirectories: true }); // ['index.js', 'controllers/']
|
||||
```
|
||||
|
||||
#### objectMode
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Returns objects (instead of strings) describing entries.
|
||||
|
||||
```js
|
||||
fg.sync('*', { objectMode: false }); // ['src/index.js']
|
||||
fg.sync('*', { objectMode: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: <fs.Dirent> }]
|
||||
```
|
||||
|
||||
The object has the following fields:
|
||||
|
||||
* name (`string`) — the last part of the path (basename)
|
||||
* path (`string`) — full path relative to the pattern base directory
|
||||
* dirent ([`fs.Dirent`][node_js_fs_class_fs_dirent]) — instance of `fs.Dirent`
|
||||
|
||||
> :book: An object is an internal representation of entry, so getting it does not affect performance.
|
||||
|
||||
#### onlyDirectories
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Return only directories.
|
||||
|
||||
```js
|
||||
fg.sync('*', { onlyDirectories: false }); // ['index.js', 'src']
|
||||
fg.sync('*', { onlyDirectories: true }); // ['src']
|
||||
```
|
||||
|
||||
> :book: If `true`, the [`onlyFiles`](#onlyfiles) option is automatically `false`.
|
||||
|
||||
#### onlyFiles
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Return only files.
|
||||
|
||||
```js
|
||||
fg.sync('*', { onlyFiles: false }); // ['index.js', 'src']
|
||||
fg.sync('*', { onlyFiles: true }); // ['index.js']
|
||||
```
|
||||
|
||||
#### stats
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Enables an [object mode](#objectmode) with an additional field:
|
||||
|
||||
* stats ([`fs.Stats`][node_js_fs_class_fs_stats]) — instance of `fs.Stats`
|
||||
|
||||
```js
|
||||
fg.sync('*', { stats: false }); // ['src/index.js']
|
||||
fg.sync('*', { stats: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: <fs.Dirent>, stats: <fs.Stats> }]
|
||||
```
|
||||
|
||||
> :book: Returns `fs.stat` instead of `fs.lstat` for symbolic links when the [`followSymbolicLinks`](#followsymboliclinks) option is specified.
|
||||
>
|
||||
> :warning: Unlike [object mode](#objectmode) this mode requires additional calls to the file system. On average, this mode is slower at least twice. See [old and modern mode](#old-and-modern-mode) for more details.
|
||||
|
||||
#### unique
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Ensures that the returned entries are unique.
|
||||
|
||||
```js
|
||||
fg.sync(['*.json', 'package.json'], { unique: false }); // ['package.json', 'package.json']
|
||||
fg.sync(['*.json', 'package.json'], { unique: true }); // ['package.json']
|
||||
```
|
||||
|
||||
If `true` and similar entries are found, the result is the first found.
|
||||
|
||||
### Matching control
|
||||
|
||||
#### braceExpansion
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Enables Bash-like brace expansion.
|
||||
|
||||
> :1234: [Syntax description][bash_hackers_syntax_expansion_brace] or more [detailed description][micromatch_braces].
|
||||
|
||||
```js
|
||||
dir/
|
||||
├── abd
|
||||
├── acd
|
||||
└── a{b,c}d
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync('a{b,c}d', { braceExpansion: false }); // ['a{b,c}d']
|
||||
fg.sync('a{b,c}d', { braceExpansion: true }); // ['abd', 'acd']
|
||||
```
|
||||
|
||||
#### caseSensitiveMatch
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Enables a [case-sensitive][wikipedia_case_sensitivity] mode for matching files.
|
||||
|
||||
```js
|
||||
dir/
|
||||
├── file.txt
|
||||
└── File.txt
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync('file.txt', { caseSensitiveMatch: false }); // ['file.txt', 'File.txt']
|
||||
fg.sync('file.txt', { caseSensitiveMatch: true }); // ['file.txt']
|
||||
```
|
||||
|
||||
#### dot
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
Allow patterns to match entries that begin with a period (`.`).
|
||||
|
||||
> :book: Note that an explicit dot in a portion of the pattern will always match dot files.
|
||||
|
||||
```js
|
||||
dir/
|
||||
├── .editorconfig
|
||||
└── package.json
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync('*', { dot: false }); // ['package.json']
|
||||
fg.sync('*', { dot: true }); // ['.editorconfig', 'package.json']
|
||||
```
|
||||
|
||||
#### extglob
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Enables Bash-like `extglob` functionality.
|
||||
|
||||
> :1234: [Syntax description][micromatch_extglobs].
|
||||
|
||||
```js
|
||||
dir/
|
||||
├── README.md
|
||||
└── package.json
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync('*.+(json|md)', { extglob: false }); // []
|
||||
fg.sync('*.+(json|md)', { extglob: true }); // ['README.md', 'package.json']
|
||||
```
|
||||
|
||||
#### globstar
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `true`
|
||||
|
||||
Enables recursively repeats a pattern containing `**`. If `false`, `**` behaves exactly like `*`.
|
||||
|
||||
```js
|
||||
dir/
|
||||
└── a
|
||||
└── b
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync('**', { onlyFiles: false, globstar: false }); // ['a']
|
||||
fg.sync('**', { onlyFiles: false, globstar: true }); // ['a', 'a/b']
|
||||
```
|
||||
|
||||
#### baseNameMatch
|
||||
|
||||
* Type: `boolean`
|
||||
* Default: `false`
|
||||
|
||||
If set to `true`, then patterns without slashes will be matched against the basename of the path if it contains slashes.
|
||||
|
||||
```js
|
||||
dir/
|
||||
└── one/
|
||||
└── file.md
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync('*.md', { baseNameMatch: false }); // []
|
||||
fg.sync('*.md', { baseNameMatch: true }); // ['one/file.md']
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
## What is a static or dynamic pattern?
|
||||
|
||||
All patterns can be divided into two types:
|
||||
|
||||
* **static**. A pattern is considered static if it can be used to get an entry on the file system without using matching mechanisms. For example, the `file.js` pattern is a static pattern because we can just verify that it exists on the file system.
|
||||
* **dynamic**. A pattern is considered dynamic if it cannot be used directly to find occurrences without using a matching mechanisms. For example, the `*` pattern is a dynamic pattern because we cannot use this pattern directly.
|
||||
|
||||
A pattern is considered dynamic if it contains the following characters (`…` — any characters or their absence) or options:
|
||||
|
||||
* The [`caseSensitiveMatch`](#casesensitivematch) option is disabled
|
||||
* `\\` (the escape character)
|
||||
* `*`, `?`, `!` (at the beginning of line)
|
||||
* `[…]`
|
||||
* `(…|…)`
|
||||
* `@(…)`, `!(…)`, `*(…)`, `?(…)`, `+(…)` (respects the [`extglob`](#extglob) option)
|
||||
* `{…,…}`, `{…..…}` (respects the [`braceExpansion`](#braceexpansion) option)
|
||||
|
||||
## How to write patterns on Windows?
|
||||
|
||||
Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. With the [`cwd`](#cwd) option use a convenient format.
|
||||
|
||||
**Bad**
|
||||
|
||||
```ts
|
||||
[
|
||||
'directory\\*',
|
||||
path.join(process.cwd(), '**')
|
||||
]
|
||||
```
|
||||
|
||||
**Good**
|
||||
|
||||
```ts
|
||||
[
|
||||
'directory/*',
|
||||
path.join(process.cwd(), '**').replace(/\\/g, '/')
|
||||
]
|
||||
```
|
||||
|
||||
> :book: Use the [`normalize-path`][npm_normalize_path] or the [`unixify`][npm_unixify] package to convert Windows-style path to a Unix-style path.
|
||||
|
||||
Read more about [matching with backslashes][micromatch_backslashes].
|
||||
|
||||
## Why are parentheses match wrong?
|
||||
|
||||
```js
|
||||
dir/
|
||||
└── (special-*file).txt
|
||||
```
|
||||
|
||||
```js
|
||||
fg.sync(['(special-*file).txt']) // []
|
||||
```
|
||||
|
||||
Refers to Bash. You need to escape special characters:
|
||||
|
||||
```js
|
||||
fg.sync(['\\(special-*file\\).txt']) // ['(special-*file).txt']
|
||||
```
|
||||
|
||||
Read more about [matching special characters as literals][picomatch_matching_special_characters_as_literals].
|
||||
|
||||
## How to exclude directory from reading?
|
||||
|
||||
You can use a negative pattern like this: `!**/node_modules` or `!**/node_modules/**`. Also you can use [`ignore`](#ignore) option. Just look at the example below.
|
||||
|
||||
```js
|
||||
first/
|
||||
├── file.md
|
||||
└── second/
|
||||
└── file.txt
|
||||
```
|
||||
|
||||
If you don't want to read the `second` directory, you must write the following pattern: `!**/second` or `!**/second/**`.
|
||||
|
||||
```js
|
||||
fg.sync(['**/*.md', '!**/second']); // ['first/file.md']
|
||||
fg.sync(['**/*.md'], { ignore: ['**/second/**'] }); // ['first/file.md']
|
||||
```
|
||||
|
||||
> :warning: When you write `!**/second/**/*` it means that the directory will be **read**, but all the entries will not be included in the results.
|
||||
|
||||
You have to understand that if you write the pattern to exclude directories, then the directory will not be read under any circumstances.
|
||||
|
||||
## How to use UNC path?
|
||||
|
||||
You cannot use [Uniform Naming Convention (UNC)][unc_path] paths as patterns (due to syntax), but you can use them as [`cwd`](#cwd) directory.
|
||||
|
||||
```ts
|
||||
fg.sync('*', { cwd: '\\\\?\\C:\\Python27' /* or //?/C:/Python27 */ });
|
||||
fg.sync('Python27/*', { cwd: '\\\\?\\C:\\' /* or //?/C:/ */ });
|
||||
```
|
||||
|
||||
## Compatible with `node-glob`?
|
||||
|
||||
| node-glob | fast-glob |
|
||||
| :----------: | :-------: |
|
||||
| `cwd` | [`cwd`](#cwd) |
|
||||
| `root` | – |
|
||||
| `dot` | [`dot`](#dot) |
|
||||
| `nomount` | – |
|
||||
| `mark` | [`markDirectories`](#markdirectories) |
|
||||
| `nosort` | – |
|
||||
| `nounique` | [`unique`](#unique) |
|
||||
| `nobrace` | [`braceExpansion`](#braceexpansion) |
|
||||
| `noglobstar` | [`globstar`](#globstar) |
|
||||
| `noext` | [`extglob`](#extglob) |
|
||||
| `nocase` | [`caseSensitiveMatch`](#casesensitivematch) |
|
||||
| `matchBase` | [`baseNameMatch`](#basenamematch) |
|
||||
| `nodir` | [`onlyFiles`](#onlyfiles) |
|
||||
| `ignore` | [`ignore`](#ignore) |
|
||||
| `follow` | [`followSymbolicLinks`](#followsymboliclinks) |
|
||||
| `realpath` | – |
|
||||
| `absolute` | [`absolute`](#absolute) |
|
||||
|
||||
## Benchmarks
|
||||
|
||||
### Server
|
||||
|
||||
Link: [Vultr Bare Metal][vultr_pricing_baremetal]
|
||||
|
||||
* Processor: E3-1270v6 (8 CPU)
|
||||
* RAM: 32GB
|
||||
* Disk: SSD ([Intel DC S3520 SSDSC2BB240G7][intel_ssd])
|
||||
|
||||
You can see results [here][github_gist_benchmark_server] for latest release.
|
||||
|
||||
### Nettop
|
||||
|
||||
Link: [Zotac bi323][zotac_bi323]
|
||||
|
||||
* Processor: Intel N3150 (4 CPU)
|
||||
* RAM: 8GB
|
||||
* Disk: SSD ([Silicon Power SP060GBSS3S55S25][silicon_power_ssd])
|
||||
|
||||
You can see results [here][github_gist_benchmark_nettop] for latest release.
|
||||
|
||||
## Changelog
|
||||
|
||||
See the [Releases section of our GitHub project][github_releases] for changelog for each release version.
|
||||
|
||||
## License
|
||||
|
||||
This software is released under the terms of the MIT license.
|
||||
|
||||
[bash_hackers_syntax_expansion_brace]: https://wiki.bash-hackers.org/syntax/expansion/brace
|
||||
[github_gist_benchmark_nettop]: https://gist.github.com/mrmlnc/f06246b197f53c356895fa35355a367c#file-fg-benchmark-nettop-product-txt
|
||||
[github_gist_benchmark_server]: https://gist.github.com/mrmlnc/f06246b197f53c356895fa35355a367c#file-fg-benchmark-server-product-txt
|
||||
[github_releases]: https://github.com/mrmlnc/fast-glob/releases
|
||||
[glob_definition]: https://en.wikipedia.org/wiki/Glob_(programming)
|
||||
[glob_linux_man]: http://man7.org/linux/man-pages/man3/glob.3.html
|
||||
[intel_ssd]: https://ark.intel.com/content/www/us/en/ark/products/93012/intel-ssd-dc-s3520-series-240gb-2-5in-sata-6gb-s-3d1-mlc.html
|
||||
[micromatch_backslashes]: https://github.com/micromatch/micromatch#backslashes
|
||||
[micromatch_braces]: https://github.com/micromatch/braces
|
||||
[micromatch_extended_globbing]: https://github.com/micromatch/micromatch#extended-globbing
|
||||
[micromatch_extglobs]: https://github.com/micromatch/micromatch#extglobs
|
||||
[micromatch_regex_character_classes]: https://github.com/micromatch/micromatch#regex-character-classes
|
||||
[micromatch]: https://github.com/micromatch/micromatch
|
||||
[node_js_fs_class_fs_dirent]: https://nodejs.org/api/fs.html#fs_class_fs_dirent
|
||||
[node_js_fs_class_fs_stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats
|
||||
[node_js_stream_readable_streams]: https://nodejs.org/api/stream.html#stream_readable_streams
|
||||
[node_js]: https://nodejs.org/en
|
||||
[nodelib_fs_scandir_old_and_modern_modern]: https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode
|
||||
[npm_normalize_path]: https://www.npmjs.com/package/normalize-path
|
||||
[npm_unixify]: https://www.npmjs.com/package/unixify
|
||||
[paypal_mrmlnc]:https://paypal.me/mrmlnc
|
||||
[picomatch_matching_behavior]: https://github.com/micromatch/picomatch#matching-behavior-vs-bash
|
||||
[picomatch_matching_special_characters_as_literals]: https://github.com/micromatch/picomatch#matching-special-characters-as-literals
|
||||
[picomatch_posix_brackets]: https://github.com/micromatch/picomatch#posix-brackets
|
||||
[regular_expressions_brackets]: https://www.regular-expressions.info/brackets.html
|
||||
[silicon_power_ssd]: https://www.silicon-power.com/web/product-1
|
||||
[unc_path]: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/62e862f4-2a51-452e-8eeb-dc4ff5ee33cc
|
||||
[vultr_pricing_baremetal]: https://www.vultr.com/pricing/baremetal
|
||||
[wikipedia_case_sensitivity]: https://en.wikipedia.org/wiki/Case_sensitivity
|
||||
[zotac_bi323]: https://www.zotac.com/ee/product/mini_pcs/zbox-bi323
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"yargs-parser","version":"21.1.1","files":{"build/index.cjs":{"checkedAt":1678883669375,"integrity":"sha512-R2WH/V2c8ueJbVh7miVI1WUfJu8f6gJ3Q41tFxkvdv+L396M5Cksb/ETgnZ4DzMchhBTs34rAHKf18b58MsSJg==","mode":420,"size":42891},"browser.js":{"checkedAt":1678883669375,"integrity":"sha512-rhNCfaGOAHQijN6nrA4SJu7eMl3KbmUScRG3ukZJKjOFZZJpwdeeD4IvKkFa/LfDZS3XLxqV6ya64r4BmhhlUA==","mode":420,"size":1016},"build/lib/index.js":{"checkedAt":1678883669375,"integrity":"sha512-gIy4PSCC+xPEc1IdKZKc9HLOGSTkVNlmfSyX6FtyfA/Vws5EEEzBDbJqoEbqnCnfMoHhwgJh/d8C7mnl7h1Qpw==","mode":420,"size":2508},"build/lib/string-utils.js":{"checkedAt":1678883669376,"integrity":"sha512-pzTucZdZAXQLltn56eTq5MbsbN5kDCqu6zsIb/is1/EzwGOOeGxiVL0hF8WLv2MCd5d6kkLlMXFdtFEfBFuWgQ==","mode":420,"size":2084},"build/lib/tokenize-arg-string.js":{"checkedAt":1678883669376,"integrity":"sha512-qxR/K+kYoVDhENZxq9op9SSXQixIdsyiHobgdbKBw/yJESp8Yp5l+TB4aYUWpk5GqFwpTQvEZBqLRo/QC5zFdw==","mode":420,"size":1092},"build/lib/yargs-parser-types.js":{"checkedAt":1678883669376,"integrity":"sha512-1jjk4I++yNtfDGtnOnsAj4+BtxMSA6QMNe3tFEj83sUUSJKuIJ0tkFpFDXHWooy70upAXcJje8vK0WFALELmFg==","mode":420,"size":425},"build/lib/yargs-parser.js":{"checkedAt":1678883669378,"integrity":"sha512-FhSTVyC+SiSMCrwScVX6a/Bqzh801w0eFNZ3TdjgCxw4+nk4vUjxM719kB/GqAcPEXTOiqkRoyBuXGg6ORETQA==","mode":420,"size":46827},"package.json":{"checkedAt":1678883669378,"integrity":"sha512-smUd2Dq1aI4pABqQKi0OFnOjx3vLN71J6Ea2Nuuav2qLN91K0m3CDzmSXMN81aLR7NQKtBrSxIKEdH2KXNAy9g==","mode":420,"size":2518},"CHANGELOG.md":{"checkedAt":1678883669379,"integrity":"sha512-aMFsDrxA2PJ/CQ4gRsbe7+5OtFVSaREcuEqDpWTkzr5vAO1UWfiXdk1msauU+i7ys7tzr5Yd2pjKbI0Bsmi6uA==","mode":420,"size":16462},"LICENSE.txt":{"checkedAt":1678883669381,"integrity":"sha512-EToPsaeTn1m/hKKaWONJhwqjvIWvra5CjWMax+yCWLrIN1/jFSLwPkhN68ViQwYDuut9KCVnGRQKJuxayn6RBA==","mode":420,"size":731},"README.md":{"checkedAt":1678883669381,"integrity":"sha512-vsRTUCi4oOvBIN0DwUGltZkHk/d+kVWEJ4Xlu/OAGtJSoS1kI+h8+Ah5DGGOclcbWpug5mmlz2AVZ6BKyfIDIA==","mode":420,"size":11916}}}
|
||||
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
/* globals lockdown */
|
||||
|
||||
// requiring ses exposes "lockdown" on the global
|
||||
require('ses');
|
||||
|
||||
// lockdown freezes the primordials
|
||||
lockdown({ errorTaming: 'unsafe' });
|
||||
|
||||
// initialize the module
|
||||
require('./');
|
||||
@@ -0,0 +1,8 @@
|
||||
import { NumberFormatInternal, NumberFormatOptions } from '../types/number';
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-setnumberformatunitoptions
|
||||
*/
|
||||
export declare function SetNumberFormatUnitOptions(nf: Intl.NumberFormat, options: NumberFormatOptions | undefined, { getInternalSlots, }: {
|
||||
getInternalSlots(nf: Intl.NumberFormat): NumberFormatInternal;
|
||||
}): void;
|
||||
//# sourceMappingURL=SetNumberFormatUnitOptions.d.ts.map
|
||||
@@ -0,0 +1,30 @@
|
||||
var baseGet = require('./_baseGet');
|
||||
|
||||
/**
|
||||
* The opposite of `_.property`; this method creates a function that returns
|
||||
* the value at a given path of `object`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category Util
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Function} Returns the new accessor function.
|
||||
* @example
|
||||
*
|
||||
* var array = [0, 1, 2],
|
||||
* object = { 'a': array, 'b': array, 'c': array };
|
||||
*
|
||||
* _.map(['a[2]', 'c[0]'], _.propertyOf(object));
|
||||
* // => [2, 0]
|
||||
*
|
||||
* _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
|
||||
* // => [2, 0]
|
||||
*/
|
||||
function propertyOf(object) {
|
||||
return function(path) {
|
||||
return object == null ? undefined : baseGet(object, path);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = propertyOf;
|
||||
@@ -0,0 +1,98 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RunnerTeamService = void 0;
|
||||
const request_1 = require("../core/request");
|
||||
class RunnerTeamService {
|
||||
/**
|
||||
* Get all
|
||||
* Lists all teams. <br> This includes their parent organization and contact (if existing/associated).
|
||||
* @result ResponseRunnerTeam
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerTeamControllerGetAll() {
|
||||
const result = await (0, request_1.request)({
|
||||
method: 'GET',
|
||||
path: `/api/teams`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Post
|
||||
* Create a new organsisation. <br> Please remember to provide it's parent group's id.
|
||||
* @param requestBody CreateRunnerTeam
|
||||
* @result ResponseRunnerTeam
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerTeamControllerPost(requestBody) {
|
||||
const result = await (0, request_1.request)({
|
||||
method: 'POST',
|
||||
path: `/api/teams`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get one
|
||||
* Lists all information about the team whose id got provided.
|
||||
* @param id
|
||||
* @result ResponseRunnerTeam
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerTeamControllerGetOne(id) {
|
||||
const result = await (0, request_1.request)({
|
||||
method: 'GET',
|
||||
path: `/api/teams/${id}`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Put
|
||||
* Update the team whose id you provided. <br> Please remember that ids can't be changed.
|
||||
* @param id
|
||||
* @param requestBody UpdateRunnerTeam
|
||||
* @result ResponseRunnerTeam
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerTeamControllerPut(id, requestBody) {
|
||||
const result = await (0, request_1.request)({
|
||||
method: 'PUT',
|
||||
path: `/api/teams/${id}`,
|
||||
body: requestBody,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Remove
|
||||
* Delete the team whose id you provided. <br> If the team still has runners associated this will fail. <br> To delete the team with all associated runners set the force QueryParam to true (cascading deletion might take a while). <br> This won't delete the associated contact.<br> If no team with this id exists it will just return 204(no content).
|
||||
* @param id
|
||||
* @param force
|
||||
* @result ResponseRunnerTeam
|
||||
* @result ResponseEmpty
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerTeamControllerRemove(id, force) {
|
||||
const result = await (0, request_1.request)({
|
||||
method: 'DELETE',
|
||||
path: `/api/teams/${id}`,
|
||||
query: {
|
||||
'force': force,
|
||||
},
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
/**
|
||||
* Get runners
|
||||
* Lists all runners from this team. <br> This includes the runner's group and distance ran.
|
||||
* @param id
|
||||
* @result ResponseRunner
|
||||
* @throws ApiError
|
||||
*/
|
||||
static async runnerTeamControllerGetRunners(id) {
|
||||
const result = await (0, request_1.request)({
|
||||
method: 'GET',
|
||||
path: `/api/teams/${id}/runners`,
|
||||
});
|
||||
return result.body;
|
||||
}
|
||||
}
|
||||
exports.RunnerTeamService = RunnerTeamService;
|
||||
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isAlpha;
|
||||
exports.locales = void 0;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var _alpha = require("./alpha");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function isAlpha(_str) {
|
||||
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'en-US';
|
||||
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
||||
(0, _assertString.default)(_str);
|
||||
var str = _str;
|
||||
var ignore = options.ignore;
|
||||
|
||||
if (ignore) {
|
||||
if (ignore instanceof RegExp) {
|
||||
str = str.replace(ignore, '');
|
||||
} else if (typeof ignore === 'string') {
|
||||
str = str.replace(new RegExp("[".concat(ignore.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g, '\\$&'), "]"), 'g'), ''); // escape regex for ignore
|
||||
} else {
|
||||
throw new Error('ignore should be instance of a String or RegExp');
|
||||
}
|
||||
}
|
||||
|
||||
if (locale in _alpha.alpha) {
|
||||
return _alpha.alpha[locale].test(str);
|
||||
}
|
||||
|
||||
throw new Error("Invalid locale '".concat(locale, "'"));
|
||||
}
|
||||
|
||||
var locales = Object.keys(_alpha.alpha);
|
||||
exports.locales = locales;
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Some “list” response that can be paginated have a different response structure
|
||||
*
|
||||
* They have a `total_count` key in the response (search also has `incomplete_results`,
|
||||
* /installation/repositories also has `repository_selection`), as well as a key with
|
||||
* the list of the items which name varies from endpoint to endpoint.
|
||||
*
|
||||
* Octokit normalizes these responses so that paginated results are always returned following
|
||||
* the same structure. One challenge is that if the list response has only one page, no Link
|
||||
* header is provided, so this header alone is not sufficient to check wether a response is
|
||||
* paginated or not.
|
||||
*
|
||||
* We check if a "total_count" key is present in the response data, but also make sure that
|
||||
* a "url" property is not, as the "Get the combined status for a specific ref" endpoint would
|
||||
* otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
|
||||
*/
|
||||
import { OctokitResponse } from "./types";
|
||||
export declare function normalizePaginatedListResponse(response: OctokitResponse<any>): OctokitResponse<any>;
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var raw = String.raw, test;
|
||||
if (typeof raw !== "function") return false;
|
||||
test = ["foo\nbar", "marko\n"];
|
||||
test.raw = ["foo\\nbar", "marko\\n"];
|
||||
return raw(test, "INSE\nRT") === "foo\\nbarINSE\nRTmarko\\n";
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}
|
||||
@@ -0,0 +1,12 @@
|
||||
import semver from 'semver';
|
||||
|
||||
export default function semverDiff(versionA, versionB) {
|
||||
versionA = semver.parse(versionA);
|
||||
versionB = semver.parse(versionB);
|
||||
|
||||
if (semver.compareBuild(versionA, versionB) >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return semver.diff(versionA, versionB) || 'build';
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
# acorn-node
|
||||
|
||||
[Acorn](https://github.com/acornjs/acorn) preloaded with plugins for syntax parity with recent Node versions.
|
||||
|
||||
It also includes versions of the plugins compiled with [Bublé](https://github.com/rich-harris/buble), so they can be run on old Node versions (0.6 and up).
|
||||
|
||||
[![npm][npm-image]][npm-url]
|
||||
[![travis][travis-image]][travis-url]
|
||||
[![standard][standard-image]][standard-url]
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/acorn-node.svg?style=flat-square
|
||||
[npm-url]: https://www.npmjs.com/package/acorn-node
|
||||
[travis-image]: https://img.shields.io/travis/browserify/acorn-node/master.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/browserify/acorn-node
|
||||
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
|
||||
[standard-url]: http://npm.im/standard
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
npm install acorn-node
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var acorn = require('acorn-node')
|
||||
```
|
||||
|
||||
The API is the same as [acorn](https://github.com/acornjs/acorn), but the following syntax features are enabled by default:
|
||||
|
||||
- Bigint syntax `10n`
|
||||
- Numeric separators syntax `10_000`
|
||||
- Public and private class instance fields
|
||||
- Public and private class static fields
|
||||
- Dynamic `import()`
|
||||
- The `import.meta` property
|
||||
- `export * as ns from` syntax
|
||||
|
||||
And the following options have different defaults from acorn, to match Node modules:
|
||||
|
||||
- `ecmaVersion: 2019`
|
||||
- `allowHashBang: true`
|
||||
- `allowReturnOutsideFunction: true`
|
||||
|
||||
```js
|
||||
var walk = require('acorn-node/walk')
|
||||
```
|
||||
|
||||
The Acorn syntax tree walker. Comes preconfigured for the syntax plugins if necessary.
|
||||
See the [acorn documentation](https://github.com/acornjs/acorn#distwalkjs) for details.
|
||||
|
||||
## License
|
||||
|
||||
The files in the repo root and the ./test folder are licensed as [Apache-2.0](LICENSE.md).
|
||||
|
||||
The files in lib/ are generated from other packages:
|
||||
|
||||
- lib/bigint: [acorn-bigint](https://github.com/acornjs/acorn-bigint]), MIT
|
||||
- lib/class-private-elements: [acorn-class-private-elements](https://github.com/acornjs/acorn-class-private-elements), MIT
|
||||
- lib/dynamic-import: [acorn-dynamic-import](https://github.com/acornjs/acorn-dynamic-import), MIT
|
||||
- lib/export-ns-from: [acorn-export-ns-from](https://github.com/acornjs/acorn-export-ns-from), MIT
|
||||
- lib/import-meta: [acorn-import-meta](https://github.com/acornjs/acorn-import-meta), MIT
|
||||
- lib/numeric-separator: [acorn-numeric-separator](https://github.com/acornjs/acorn-numeric-separator]), MIT
|
||||
- lib/static-class-features: [acorn-static-class-features](https://github.com/acornjs/acorn-static-class-features), MIT
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"name":"vite","version":"2.1.5","files":{"CHANGELOG.md":{"checkedAt":1678883669614,"integrity":"sha512-3/Jn162MKxj0PFvAX6omUlexUMTA6vOwDh0hedW+5nlnUrJUHtzUZX+q2hVARI1phf1shnOLZRLVPEZhHE1a8g==","mode":420,"size":96609},"LICENSE.md":{"checkedAt":1678883669619,"integrity":"sha512-Afc4Idx7Vi6Gv+sMGC49EypAfz3BY5bqAe9XRQFKL6+lLHILZkmbmYkHU4OSy1cetecc2BvyEm6jR1qt93mlsw==","mode":420,"size":212726},"README.md":{"checkedAt":1678883669619,"integrity":"sha512-5LM7x13W/lrVr+GIl8D8qLaMPeNgYwxF5aBnyAo9/5SlTqg3foJw/1L2XgcxDoJrWFFTGuKUjpJ1zYZ/W99PMw==","mode":420,"size":1163},"client.d.ts":{"checkedAt":1678883669619,"integrity":"sha512-nmq62BQm76vvkKo9cIuaOkPe+E5rjgjON5MDHRYILESp8Mxl/t/MUDSQECUwN+U4On6OLMwO0djDMCSCUgqfiQ==","mode":420,"size":3725},"package.json":{"checkedAt":1678883669619,"integrity":"sha512-JHO1ltfY1szbuAtNAHjVPpHvNffHaiTZ/iGuJ60v9EEnIgocYMCaeAjkACo5QmV2sWwvtueGS3ePxvkasasHPA==","mode":420,"size":3901},"bin/openChrome.applescript":{"checkedAt":1678883669619,"integrity":"sha512-cyPu+jnC4/WniforkP2DC9tyJsrE4QCU21Ab8+JtQXJ9hop/kXmPxzo/PFiMdoUA81qEILi+EPSmLKRvEAXp2Q==","mode":420,"size":2356},"bin/vite.js":{"checkedAt":1678883669619,"integrity":"sha512-/kZ0PFKw0DVzUBla2oLvoxEJm63BUOz7sq5bUW/IUceX7KtG0CllGO0yX8U1xI7rQnFqzSq5xv1rT9wCiD92Lw==","mode":493,"size":1476},"dist/client/client.js":{"checkedAt":1678883669619,"integrity":"sha512-zGL8ztQwyO7Akd4RfoZaDe2PePLP9ufMW3TyZh42kAsGWYMDOgzveIztvR+IravbxK10iPgLXYyyu01ySUJZ3Q==","mode":420,"size":16968},"dist/client/env.js":{"checkedAt":1678883669619,"integrity":"sha512-OX6tZGznZodnlL2EL2LS6clACF5KyM/Tb1a1FPfJXDmVv3ruEAWNu0aZOsRCx7/IXL0fkrvk3n1ZBxezZutyCg==","mode":420,"size":743},"dist/node/cli.js":{"checkedAt":1678883669621,"integrity":"sha512-+SIogdkImjFuE4lorcwzr35Zz30CBhSBD6Nm5FhgyVG2y/pszS3tbZccdM8ITZeyi7HSegvhpbup/r2T/c9UOA==","mode":420,"size":246723},"dist/node/index.d.ts":{"checkedAt":1678883669621,"integrity":"sha512-Nq1VJl5/fa+d1g8YWJAh9QKP98xLvDk8FibSOnTdapQn+r4syM9mZ9Q7D0gIKjP1FbNTIJMZ7YIStiZYXfN6gQ==","mode":420,"size":78397},"dist/node/index.js":{"checkedAt":1678883669621,"integrity":"sha512-3Gi71abQEqytF4oxvYWmuCrtbDHGsLEjYR4pOKeUeQ4TPNiPmyqVa0D4ns96wxQnrJXUNFncnmxUGRXEQDGIEg==","mode":420,"size":1171},"dist/node/terser.js":{"checkedAt":1678883669630,"integrity":"sha512-efrda7wwtcqkU0rDAa2+ajo7IThvVFtk8CPMgdBIfcgKNZ7coboraDknm2E4CPPV5CRG/9nt0XJh/J+u8MFE9A==","mode":420,"size":1176142},"dist/node/chunks/dep-35e49b3e.js":{"checkedAt":1678883669635,"integrity":"sha512-tYKltJLjRmksFngAcaTn3H39SKj0tBU7aK3i1TlsCQzgh4hX6eYOb7PFH/58xJhyKyBEXPH22YioxSL3TiRMbA==","mode":420,"size":869069},"dist/node/chunks/dep-4a7bdf2c.js":{"checkedAt":1678883669637,"integrity":"sha512-yYxg/VarwQbV5XtX2yCCO1BCaRnXab6V/X3DCss+hFhXagO6Yb4FYpC9TtYynBzDYj0+FtksMNyvql68eqoNpw==","mode":420,"size":251878},"dist/node/chunks/dep-66eb515d.js":{"checkedAt":1678883669651,"integrity":"sha512-Z1+Kmte/uTAIV1gYB/m5bVf5GsyKaY8Eq0FEHFjYWUQ2RTI4Zhfs7yoYE0Uh5slxN+ISHpjmTKK0dWtUx+cjLg==","mode":420,"size":2120085},"dist/node/chunks/dep-685e7ba2.js":{"checkedAt":1678883669651,"integrity":"sha512-n4gM/IL+B0GwcBp/eat228UqgRwRK1Iww5PJ0EX8MwEYsI1lEk7GFLsq+fgxUZneavBf9/SAXev/mLrAO2iYfg==","mode":420,"size":12018},"dist/node/chunks/dep-7af56b09.js":{"checkedAt":1678883669654,"integrity":"sha512-/tqqHGoUOy0t5Zec7MixmCZZUR9JvMrvKq5LJoyd+22X/XgiGOBfV8xYHkJOWKzLxyZwSj95DGblVZhAC5XxeQ==","mode":420,"size":312893},"dist/node/chunks/dep-b8a69f7c.js":{"checkedAt":1678883669654,"integrity":"sha512-GyQBH9mc1C7hQvW35XENl3J2kBS5MruChe3KypEL8Vn1Ym2aomUQO+0S/LTiNysGZlKnvQtX4aRyaLY4tCh3Zg==","mode":420,"size":18382},"dist/node/chunks/dep-ea87ce95.js":{"checkedAt":1678883669656,"integrity":"sha512-34ldhgwwziEcLJnI7OhtdxHIztf8lM4LVK88wtw7Wmws0hAicoEZopPDkhE6eph5hbsUzj8Cv2EclBVpVUwdYA==","mode":420,"size":309450}}}
|
||||
@@ -0,0 +1,288 @@
|
||||
#!/usr/bin/env node
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var color = require('cli-color');
|
||||
var sade = require('sade');
|
||||
var glob = require('tiny-glob');
|
||||
var compiler = require('svelte/compiler');
|
||||
var estreeWalker = require('estree-walker');
|
||||
|
||||
/* eslint-disable no-multi-assign */
|
||||
/* eslint-disable no-return-assign */
|
||||
const isNumberString = (n) => !Number.isNaN(parseInt(n, 10));
|
||||
function deepSet(obj, path, value) {
|
||||
const parts = path.replace(/\[(\w+)\]/gi, '.$1').split('.');
|
||||
return parts.reduce((ref, part, i) => {
|
||||
if (part in ref)
|
||||
return (ref = ref[part]);
|
||||
if (i < parts.length - 1) {
|
||||
if (isNumberString(parts[i + 1])) {
|
||||
return (ref = ref[part] = []);
|
||||
}
|
||||
return (ref = ref[part] = {});
|
||||
}
|
||||
return (ref[part] = value);
|
||||
}, obj);
|
||||
}
|
||||
|
||||
function getObjFromExpression(exprNode) {
|
||||
return exprNode.properties.reduce((acc, prop) => {
|
||||
if (prop.type === 'SpreadElement')
|
||||
return acc;
|
||||
// we only want primitives
|
||||
if (prop.value.type === 'Literal' &&
|
||||
prop.value.value !== Object(prop.value.value)) {
|
||||
const key = prop.key.name;
|
||||
acc[key] = prop.value.value;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function delve(obj, fullKey) {
|
||||
if (fullKey == null)
|
||||
return undefined;
|
||||
if (fullKey in obj) {
|
||||
return obj[fullKey];
|
||||
}
|
||||
const keys = fullKey.split('.');
|
||||
let result = obj;
|
||||
for (let p = 0; p < keys.length; p++) {
|
||||
if (typeof result === 'object') {
|
||||
if (p > 0) {
|
||||
const partialKey = keys.slice(p, keys.length).join('.');
|
||||
if (partialKey in result) {
|
||||
result = result[partialKey];
|
||||
break;
|
||||
}
|
||||
}
|
||||
result = result[keys[p]];
|
||||
}
|
||||
else {
|
||||
result = undefined;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
const LIB_NAME = 'svelte-i18n';
|
||||
const DEFINE_MESSAGES_METHOD_NAME = 'defineMessages';
|
||||
const FORMAT_METHOD_NAMES = new Set(['format', '_', 't']);
|
||||
function isFormatCall(node, imports) {
|
||||
if (node.type !== 'CallExpression')
|
||||
return false;
|
||||
let identifier;
|
||||
if (node.callee.type === 'Identifier') {
|
||||
identifier = node.callee;
|
||||
}
|
||||
if (!identifier || identifier.type !== 'Identifier') {
|
||||
return false;
|
||||
}
|
||||
const methodName = identifier.name.slice(1);
|
||||
return imports.has(methodName);
|
||||
}
|
||||
function isMessagesDefinitionCall(node, methodName) {
|
||||
if (node.type !== 'CallExpression')
|
||||
return false;
|
||||
return (node.callee &&
|
||||
node.callee.type === 'Identifier' &&
|
||||
node.callee.name === methodName);
|
||||
}
|
||||
function getLibImportDeclarations(ast) {
|
||||
var _a, _b, _c, _d;
|
||||
const bodyElements = [
|
||||
...((_b = (_a = ast.instance) === null || _a === void 0 ? void 0 : _a.content.body) !== null && _b !== void 0 ? _b : []),
|
||||
...((_d = (_c = ast.module) === null || _c === void 0 ? void 0 : _c.content.body) !== null && _d !== void 0 ? _d : []),
|
||||
];
|
||||
return bodyElements.filter((node) => node.type === 'ImportDeclaration' && node.source.value === LIB_NAME);
|
||||
}
|
||||
function getDefineMessagesSpecifier(decl) {
|
||||
return decl.specifiers.find((spec) => 'imported' in spec && spec.imported.name === DEFINE_MESSAGES_METHOD_NAME);
|
||||
}
|
||||
function getFormatSpecifiers(decl) {
|
||||
return decl.specifiers.filter((spec) => 'imported' in spec && FORMAT_METHOD_NAMES.has(spec.imported.name));
|
||||
}
|
||||
function collectFormatCalls(ast) {
|
||||
const importDecls = getLibImportDeclarations(ast);
|
||||
if (importDecls.length === 0)
|
||||
return [];
|
||||
const imports = new Set(importDecls.flatMap((decl) => getFormatSpecifiers(decl).map((n) => n.local.name)));
|
||||
if (imports.size === 0)
|
||||
return [];
|
||||
const calls = [];
|
||||
function enter(node) {
|
||||
if (isFormatCall(node, imports)) {
|
||||
calls.push(node);
|
||||
this.skip();
|
||||
}
|
||||
}
|
||||
// @ts-expect-error - https://github.com/Rich-Harris/estree-walker/issues/28
|
||||
estreeWalker.walk(ast.instance, { enter });
|
||||
// @ts-expect-error - https://github.com/Rich-Harris/estree-walker/issues/28
|
||||
estreeWalker.walk(ast.html, { enter });
|
||||
return calls;
|
||||
}
|
||||
// walk(ast: import("estree").BaseNode, { enter, leave }: {
|
||||
// enter?: (this: {
|
||||
// skip: () => void;
|
||||
// remove: () => void;
|
||||
// replace: (node: import("estree").BaseNode) => void;
|
||||
// }, node: import("estree").BaseNode, parent: import("estree").BaseNode, key: string, index: number) => void;
|
||||
function collectMessageDefinitions(ast) {
|
||||
const definitions = [];
|
||||
const defineImportDecl = getLibImportDeclarations(ast).find(getDefineMessagesSpecifier);
|
||||
if (defineImportDecl == null)
|
||||
return [];
|
||||
const defineMethodName = getDefineMessagesSpecifier(defineImportDecl).local.name;
|
||||
const nodeStepInstructions = {
|
||||
enter(node) {
|
||||
if (isMessagesDefinitionCall(node, defineMethodName) === false)
|
||||
return;
|
||||
const [arg] = node.arguments;
|
||||
if (arg.type === 'ObjectExpression') {
|
||||
definitions.push(arg);
|
||||
this.skip();
|
||||
}
|
||||
},
|
||||
};
|
||||
// @ts-expect-error - https://github.com/Rich-Harris/estree-walker/issues/28
|
||||
estreeWalker.walk(ast.instance, nodeStepInstructions);
|
||||
// @ts-expect-error - https://github.com/Rich-Harris/estree-walker/issues/28
|
||||
estreeWalker.walk(ast.module, nodeStepInstructions);
|
||||
return definitions.flatMap((definitionDict) => definitionDict.properties.map((propNode) => {
|
||||
if (propNode.type !== 'Property') {
|
||||
throw new Error(`Found invalid '${propNode.type}' at L${propNode.loc.start.line}:${propNode.loc.start.column}`);
|
||||
}
|
||||
return propNode.value;
|
||||
}));
|
||||
}
|
||||
function collectMessages(markup) {
|
||||
const ast = compiler.parse(markup);
|
||||
const calls = collectFormatCalls(ast);
|
||||
const definitions = collectMessageDefinitions(ast);
|
||||
return [
|
||||
...definitions.map((definition) => getObjFromExpression(definition)),
|
||||
...calls.map((call) => {
|
||||
const [pathNode, options] = call.arguments;
|
||||
let messageObj;
|
||||
if (pathNode.type === 'ObjectExpression') {
|
||||
// _({ ...opts })
|
||||
messageObj = getObjFromExpression(pathNode);
|
||||
}
|
||||
else {
|
||||
const node = pathNode;
|
||||
const id = node.value;
|
||||
if (options && options.type === 'ObjectExpression') {
|
||||
// _(id, { ...opts })
|
||||
messageObj = getObjFromExpression(options);
|
||||
messageObj.id = id;
|
||||
}
|
||||
else {
|
||||
// _(id)
|
||||
messageObj = { id };
|
||||
}
|
||||
}
|
||||
if ((messageObj === null || messageObj === void 0 ? void 0 : messageObj.id) == null)
|
||||
return null;
|
||||
return messageObj;
|
||||
}),
|
||||
].filter(Boolean);
|
||||
}
|
||||
function extractMessages(markup, { accumulator = {}, shallow = false, } = {}) {
|
||||
collectMessages(markup).forEach((messageObj) => {
|
||||
let defaultValue = messageObj.default;
|
||||
if (typeof defaultValue === 'undefined') {
|
||||
defaultValue = '';
|
||||
}
|
||||
if (shallow) {
|
||||
if (messageObj.id in accumulator)
|
||||
return;
|
||||
accumulator[messageObj.id] = defaultValue;
|
||||
}
|
||||
else {
|
||||
if (typeof delve(accumulator, messageObj.id) !== 'undefined')
|
||||
return;
|
||||
deepSet(accumulator, messageObj.id, defaultValue);
|
||||
}
|
||||
});
|
||||
return accumulator;
|
||||
}
|
||||
|
||||
const { readFile, writeFile, mkdir, access, stat } = fs.promises;
|
||||
const fileExists = (path) => access(path)
|
||||
.then(() => true)
|
||||
.catch(() => false);
|
||||
const isDirectory = (path) => stat(path).then((stats) => stats.isDirectory());
|
||||
function isSvelteError(error, code) {
|
||||
return (typeof error === 'object' &&
|
||||
error != null &&
|
||||
'message' in error &&
|
||||
'code' in error &&
|
||||
(code == null || error.code === code));
|
||||
}
|
||||
const program = sade('svelte-i18n');
|
||||
program
|
||||
.command('extract <glob> [output]')
|
||||
.describe('extract all message definitions from files to a json')
|
||||
.option('-s, --shallow', 'extract to a shallow dictionary (ids with dots interpreted as strings, not paths)', false)
|
||||
.option('--overwrite', 'overwrite the content of the output file instead of just appending new properties', false)
|
||||
.option('-c, --config <dir>', 'path to the "svelte.config.js" file', `${process.cwd()}/svelte.config.js`)
|
||||
.action(async (globStr, output, { shallow, overwrite, config }) => {
|
||||
const filesToExtract = (await glob(globStr)).filter((file) => file.match(/\.html|svelte$/i));
|
||||
const isConfigDir = await isDirectory(config);
|
||||
const resolvedConfigPath = path.resolve(config, isConfigDir ? 'svelte.config.js' : '');
|
||||
if (isConfigDir) {
|
||||
console.warn(color.yellow(`Warning: -c/--config should point to the svelte.config file, not to a directory.\nUsing "${resolvedConfigPath}".`));
|
||||
}
|
||||
const svelteConfig = await import(resolvedConfigPath)
|
||||
.then((mod) => mod.default || mod)
|
||||
.catch(() => null);
|
||||
let accumulator = {};
|
||||
if (output != null && overwrite === false && (await fileExists(output))) {
|
||||
accumulator = await readFile(output)
|
||||
.then((file) => JSON.parse(file.toString()))
|
||||
.catch((e) => {
|
||||
console.warn(e);
|
||||
accumulator = {};
|
||||
});
|
||||
}
|
||||
for await (const filePath of filesToExtract) {
|
||||
try {
|
||||
const buffer = await readFile(filePath);
|
||||
let content = buffer.toString();
|
||||
if (svelteConfig === null || svelteConfig === void 0 ? void 0 : svelteConfig.preprocess) {
|
||||
const processed = await compiler.preprocess(content, svelteConfig.preprocess, {
|
||||
filename: filePath,
|
||||
});
|
||||
content = processed.code;
|
||||
}
|
||||
extractMessages(content, { accumulator, shallow });
|
||||
}
|
||||
catch (e) {
|
||||
if (isSvelteError(e, 'parse-error') &&
|
||||
e.message.includes('Unexpected token')) {
|
||||
const msg = [
|
||||
`Error: unexpected token detected in "${filePath}"`,
|
||||
svelteConfig == null &&
|
||||
`A svelte config is needed if the Svelte files use preprocessors. Tried to load "${resolvedConfigPath}".`,
|
||||
svelteConfig != null &&
|
||||
`A svelte config was detected at "${resolvedConfigPath}". Make sure the preprocess step is correctly configured."`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('\n');
|
||||
console.error(color.red(msg));
|
||||
process.exit(1);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
const jsonDictionary = JSON.stringify(accumulator, null, ' ');
|
||||
if (output == null)
|
||||
return console.log(jsonDictionary);
|
||||
await mkdir(path.dirname(output), { recursive: true });
|
||||
await writeFile(output, jsonDictionary);
|
||||
});
|
||||
program.parse(process.argv);
|
||||
@@ -0,0 +1,84 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for CSVError.test.ts</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="prettify.css" />
|
||||
<link rel="stylesheet" href="base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="index.html">All files</a> CSVError.test.ts
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>1/1</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line high'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-yes">1x</span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span>
|
||||
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import CSVError from "./CSVError";
|
||||
import assert from "assert";
|
||||
describe("CSVError",()=>{
|
||||
it ("should toString()",()=>{
|
||||
})
|
||||
})</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Thu May 17 2018 01:25:26 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="sorter.js"></script>
|
||||
<script src="block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,5 @@
|
||||
function rebaseFrom(rebaseOption) {
|
||||
return undefined === rebaseOption ? true : !!rebaseOption;
|
||||
}
|
||||
|
||||
module.exports = rebaseFrom;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D CC","132":"E F A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","132":"C K L G M N O"},C:{"1":"CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","132":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB EC FC"},D:{"1":"vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","132":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB"},E:{"1":"sB 6B 7B 8B 9B OC","2":"I v HC zB","132":"J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B"},F:{"1":"OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F PC QC RC SC","16":"B qB AC","132":"0 1 2 3 4 5 6 7 8 9 C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB TC rB"},G:{"1":"sB 6B 7B 8B 9B","16":"zB UC BC","132":"E VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B"},H:{"2":"oC"},I:{"1":"f","16":"pC qC","132":"tB I rC sC BC tC uC"},J:{"132":"D A"},K:{"1":"h","132":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"132":"A B"},O:{"1":"vC"},P:{"132":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:5,C:"scrollIntoView"};
|
||||
@@ -0,0 +1,19 @@
|
||||
var basePickBy = require('./_basePickBy'),
|
||||
hasIn = require('./hasIn');
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pick` without support for individual
|
||||
* property identifiers.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The source object.
|
||||
* @param {string[]} paths The property paths to pick.
|
||||
* @returns {Object} Returns the new object.
|
||||
*/
|
||||
function basePick(object, paths) {
|
||||
return basePickBy(object, paths, function(value, path) {
|
||||
return hasIn(object, path);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = basePick;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"errorContext.d.ts","sourceRoot":"","sources":["../../../../src/internal/util/errorContext.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,IAAI,QAmB1C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,QAKpC"}
|
||||
@@ -0,0 +1,41 @@
|
||||
var baseIsEqual = require('./_baseIsEqual');
|
||||
|
||||
/**
|
||||
* This method is like `_.isEqual` except that it accepts `customizer` which
|
||||
* is invoked to compare values. If `customizer` returns `undefined`, comparisons
|
||||
* are handled by the method instead. The `customizer` is invoked with up to
|
||||
* six arguments: (objValue, othValue [, index|key, object, other, stack]).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to compare.
|
||||
* @param {*} other The other value to compare.
|
||||
* @param {Function} [customizer] The function to customize comparisons.
|
||||
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
||||
* @example
|
||||
*
|
||||
* function isGreeting(value) {
|
||||
* return /^h(?:i|ello)$/.test(value);
|
||||
* }
|
||||
*
|
||||
* function customizer(objValue, othValue) {
|
||||
* if (isGreeting(objValue) && isGreeting(othValue)) {
|
||||
* return true;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* var array = ['hello', 'goodbye'];
|
||||
* var other = ['hi', 'goodbye'];
|
||||
*
|
||||
* _.isEqualWith(array, other, customizer);
|
||||
* // => true
|
||||
*/
|
||||
function isEqualWith(value, other, customizer) {
|
||||
customizer = typeof customizer == 'function' ? customizer : undefined;
|
||||
var result = customizer ? customizer(value, other) : undefined;
|
||||
return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
|
||||
}
|
||||
|
||||
module.exports = isEqualWith;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { JSONHydrator } from './postcss.js'
|
||||
|
||||
declare const fromJSON: JSONHydrator
|
||||
|
||||
export default fromJSON
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[10082] = (function(){ var d = "ˇˇ\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"HotObservable.d.ts","sourceRoot":"","sources":["../../../../src/internal/testing/HotObservable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAGrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAI9D,qBAAa,aAAa,CAAC,CAAC,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAE,YAAW,oBAAoB;IAQ3D,QAAQ,EAAE,WAAW,EAAE;IAPnC,aAAa,EAAE,eAAe,EAAE,CAAM;IAC7C,SAAS,EAAE,SAAS,CAAC;IAErB,kBAAkB,EAAE,MAAM,MAAM,CAAC;IAEjC,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;gBAE3B,QAAQ,EAAE,WAAW,EAAE,EAAE,SAAS,EAAE,SAAS;IAmBhE,KAAK;CAcN"}
|
||||
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
PipelineProcessor,
|
||||
PipelineProcessorProps,
|
||||
ProcessorType,
|
||||
} from '../processor';
|
||||
import { ServerStorageOptions } from '../../storage/server';
|
||||
interface ServerInitiatorProps extends PipelineProcessorProps {
|
||||
serverStorageOptions: ServerStorageOptions;
|
||||
}
|
||||
declare class ServerInitiator extends PipelineProcessor<
|
||||
ServerStorageOptions,
|
||||
ServerInitiatorProps
|
||||
> {
|
||||
get type(): ProcessorType;
|
||||
_process(): ServerStorageOptions;
|
||||
}
|
||||
export default ServerInitiator;
|
||||
@@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var hasToStringTag = require('has-tostringtag/shams')();
|
||||
var has;
|
||||
var $exec;
|
||||
var isRegexMarker;
|
||||
var badStringifier;
|
||||
|
||||
if (hasToStringTag) {
|
||||
has = callBound('Object.prototype.hasOwnProperty');
|
||||
$exec = callBound('RegExp.prototype.exec');
|
||||
isRegexMarker = {};
|
||||
|
||||
var throwRegexMarker = function () {
|
||||
throw isRegexMarker;
|
||||
};
|
||||
badStringifier = {
|
||||
toString: throwRegexMarker,
|
||||
valueOf: throwRegexMarker
|
||||
};
|
||||
|
||||
if (typeof Symbol.toPrimitive === 'symbol') {
|
||||
badStringifier[Symbol.toPrimitive] = throwRegexMarker;
|
||||
}
|
||||
}
|
||||
|
||||
var $toString = callBound('Object.prototype.toString');
|
||||
var gOPD = Object.getOwnPropertyDescriptor;
|
||||
var regexClass = '[object RegExp]';
|
||||
|
||||
module.exports = hasToStringTag
|
||||
// eslint-disable-next-line consistent-return
|
||||
? function isRegex(value) {
|
||||
if (!value || typeof value !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
var descriptor = gOPD(value, 'lastIndex');
|
||||
var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
|
||||
if (!hasLastIndexDataProperty) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$exec(value, badStringifier);
|
||||
} catch (e) {
|
||||
return e === isRegexMarker;
|
||||
}
|
||||
}
|
||||
: function isRegex(value) {
|
||||
// In older browsers, typeof regex incorrectly returns 'function'
|
||||
if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $toString(value) === regexClass;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('findKey', require('../findKey'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "mimic-response",
|
||||
"version": "3.1.0",
|
||||
"description": "Mimic a Node.js HTTP response stream",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/mimic-response",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"mimic",
|
||||
"response",
|
||||
"stream",
|
||||
"http",
|
||||
"https",
|
||||
"request",
|
||||
"get",
|
||||
"core"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^14.0.1",
|
||||
"ava": "^2.4.0",
|
||||
"create-test-server": "^2.4.0",
|
||||
"p-event": "^4.1.0",
|
||||
"pify": "^5.0.0",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.30.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* adds a bindGlobal method to Mousetrap that allows you to
|
||||
* bind specific keyboard shortcuts that will still work
|
||||
* inside a text input field
|
||||
*
|
||||
* usage:
|
||||
* Mousetrap.bindGlobal('ctrl+s', _saveChanges);
|
||||
*/
|
||||
/* global Mousetrap:true */
|
||||
(function(Mousetrap) {
|
||||
if (! Mousetrap) {
|
||||
return;
|
||||
}
|
||||
var _globalCallbacks = {};
|
||||
var _originalStopCallback = Mousetrap.prototype.stopCallback;
|
||||
|
||||
Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
|
||||
var self = this;
|
||||
|
||||
if (self.paused) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return _originalStopCallback.call(self, e, element, combo);
|
||||
};
|
||||
|
||||
Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
|
||||
var self = this;
|
||||
self.bind(keys, callback, action);
|
||||
|
||||
if (keys instanceof Array) {
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
_globalCallbacks[keys[i]] = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
_globalCallbacks[keys] = true;
|
||||
};
|
||||
|
||||
Mousetrap.init();
|
||||
}) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined);
|
||||
@@ -0,0 +1,37 @@
|
||||
// Thanks for hints: https://github.com/paulmillr/es6-shim
|
||||
|
||||
"use strict";
|
||||
|
||||
var some = Array.prototype.some
|
||||
, abs = Math.abs
|
||||
, sqrt = Math.sqrt
|
||||
, compare = function (val1, val2) { return val2 - val1; }
|
||||
, divide = function (value) { return value / this; }
|
||||
, add = function (sum, number) { return sum + number * number; };
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = function (val1, val2 /*, …valn*/) {
|
||||
var result, numbers;
|
||||
if (!arguments.length) return 0;
|
||||
some.call(arguments, function (val) {
|
||||
if (isNaN(val)) {
|
||||
result = NaN;
|
||||
return false;
|
||||
}
|
||||
if (!isFinite(val)) {
|
||||
result = Infinity;
|
||||
return true;
|
||||
}
|
||||
if (result !== undefined) return false;
|
||||
val = Number(val);
|
||||
if (val === 0) return false;
|
||||
if (numbers) numbers.push(abs(val));
|
||||
else numbers = [abs(val)];
|
||||
return false;
|
||||
});
|
||||
if (result !== undefined) return result;
|
||||
if (!numbers) return 0;
|
||||
|
||||
numbers.sort(compare);
|
||||
return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0));
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('toInteger', require('../toInteger'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
Reference in New Issue
Block a user