diff --git a/docker-compose.yml b/docker-compose.yml
index ab92cc9..9996962 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -16,7 +16,7 @@ services:
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/auth?sslmode=disable
volumes:
- "./db:/db:ro"
- command: up
+ command: --wait up
profiles: ["migrations"]
depends_on:
- postgres
diff --git a/src/handlers/post.go b/src/handlers/post.go
index b13da5c..e1c3340 100644
--- a/src/handlers/post.go
+++ b/src/handlers/post.go
@@ -29,9 +29,11 @@ type AuthInput struct {
// @Accept json
// @Produce json
// @Param body body AccountInput true "Account object to be written to database"
-// @Success 200 {object} db.CreatedAccount
+// @Success 201 {object} db.CreatedAccount
+// @Failure 400 {object} []ResJSONError
// @Failure 401 {object} []ResJSONError
// @Failure 403 {object} []ResJSONError
+// @Failure 409 {object} []ResJSONError
// @Failure 415 {object} []ResJSONError
// @Failure 500 {object} []ResJSONError
// @Router /account [post]
@@ -79,7 +81,7 @@ func (h Handlers) AccountCreate(c *fiber.Ctx) error {
if err != nil {
if strings.HasPrefix(err.Error(), "ERROR: duplicate key") {
- return c.Status(409).JSON([]ResJSONError{{Error: "accountName is already taken"}})
+ return c.Status(409).JSON([]ResJSONError{{Error: "Name is already taken", Field: "name"}})
}
return c.Status(500).JSON([]ResJSONError{{Error: err.Error()}})
}
diff --git a/tests/.env_example b/tests/.env_example
new file mode 100644
index 0000000..fb54241
--- /dev/null
+++ b/tests/.env_example
@@ -0,0 +1,3 @@
+ADMIN_API_KEY=hihi
+AUTH_URL=http://localhost:4000
+JWT_SHARED_SECRET=hihi
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..2eea525
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1 @@
+.env
\ No newline at end of file
diff --git a/tests/node_modules/.bin/ignored b/tests/node_modules/.bin/ignored
new file mode 120000
index 0000000..0e0ac00
--- /dev/null
+++ b/tests/node_modules/.bin/ignored
@@ -0,0 +1 @@
+../dotignore/bin/ignored
\ No newline at end of file
diff --git a/tests/node_modules/.bin/semver b/tests/node_modules/.bin/semver
new file mode 120000
index 0000000..317eb29
--- /dev/null
+++ b/tests/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver
\ No newline at end of file
diff --git a/tests/node_modules/.bin/tap-out b/tests/node_modules/.bin/tap-out
new file mode 120000
index 0000000..cb6a60e
--- /dev/null
+++ b/tests/node_modules/.bin/tap-out
@@ -0,0 +1 @@
+../tap-out/bin/cmd.js
\ No newline at end of file
diff --git a/tests/node_modules/.bin/tap-spec b/tests/node_modules/.bin/tap-spec
new file mode 120000
index 0000000..a22b7e1
--- /dev/null
+++ b/tests/node_modules/.bin/tap-spec
@@ -0,0 +1 @@
+../tap-spec/bin/cmd.js
\ No newline at end of file
diff --git a/tests/node_modules/.bin/tape b/tests/node_modules/.bin/tape
new file mode 120000
index 0000000..dc4bc23
--- /dev/null
+++ b/tests/node_modules/.bin/tape
@@ -0,0 +1 @@
+../tape/bin/tape
\ No newline at end of file
diff --git a/tests/node_modules/.bin/tape-es b/tests/node_modules/.bin/tape-es
new file mode 120000
index 0000000..e270703
--- /dev/null
+++ b/tests/node_modules/.bin/tape-es
@@ -0,0 +1 @@
+../tape-es/bin/tape-es.js
\ No newline at end of file
diff --git a/tests/node_modules/.bin/tape-watch-es b/tests/node_modules/.bin/tape-watch-es
new file mode 120000
index 0000000..c631e87
--- /dev/null
+++ b/tests/node_modules/.bin/tape-watch-es
@@ -0,0 +1 @@
+../tape-es/bin/tape-watch-es.js
\ No newline at end of file
diff --git a/tests/node_modules/.bin/tspec b/tests/node_modules/.bin/tspec
new file mode 120000
index 0000000..a22b7e1
--- /dev/null
+++ b/tests/node_modules/.bin/tspec
@@ -0,0 +1 @@
+../tap-spec/bin/cmd.js
\ No newline at end of file
diff --git a/tests/node_modules/@sindresorhus/is/dist/index.d.ts b/tests/node_modules/@sindresorhus/is/dist/index.d.ts
new file mode 100644
index 0000000..3687767
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/dist/index.d.ts
@@ -0,0 +1,220 @@
+///
+///
+///
+import { Class, TypedArray, ObservableLike, Primitive } from './types';
+export { Class, TypedArray, ObservableLike, Primitive };
+declare const objectTypeNames: readonly ["Function", "Generator", "AsyncGenerator", "GeneratorFunction", "AsyncGeneratorFunction", "AsyncFunction", "Observable", "Array", "Buffer", "Object", "RegExp", "Date", "Error", "Map", "Set", "WeakMap", "WeakSet", "ArrayBuffer", "SharedArrayBuffer", "DataView", "Promise", "URL", "HTMLElement", ...("Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "BigInt64Array" | "BigUint64Array")[]];
+declare type ObjectTypeName = typeof objectTypeNames[number];
+declare const primitiveTypeNames: readonly ["null", "undefined", "string", "number", "bigint", "boolean", "symbol"];
+declare type PrimitiveTypeName = typeof primitiveTypeNames[number];
+export declare type TypeName = ObjectTypeName | PrimitiveTypeName;
+declare function is(value: unknown): TypeName;
+declare namespace is {
+ var undefined: (value: unknown) => value is undefined;
+ var string: (value: unknown) => value is string;
+ var number: (value: unknown) => value is number;
+ var bigint: (value: unknown) => value is bigint;
+ var function_: (value: unknown) => value is Function;
+ var null_: (value: unknown) => value is null;
+ var class_: (value: unknown) => value is Class;
+ var boolean: (value: unknown) => value is boolean;
+ var symbol: (value: unknown) => value is symbol;
+ var numericString: (value: unknown) => value is string;
+ var array: (value: unknown, assertion?: ((value: T) => value is T) | undefined) => value is T[];
+ var buffer: (value: unknown) => value is Buffer;
+ var nullOrUndefined: (value: unknown) => value is null | undefined;
+ var object: (value: unknown) => value is object;
+ var iterable: (value: unknown) => value is IterableIterator;
+ var asyncIterable: (value: unknown) => value is AsyncIterableIterator;
+ var generator: (value: unknown) => value is Generator;
+ var asyncGenerator: (value: unknown) => value is AsyncGenerator;
+ var nativePromise: (value: unknown) => value is Promise;
+ var promise: (value: unknown) => value is Promise;
+ var generatorFunction: (value: unknown) => value is GeneratorFunction;
+ var asyncGeneratorFunction: (value: unknown) => value is (...args: any[]) => Promise;
+ var asyncFunction: (value: unknown) => value is (...args: any[]) => Promise;
+ var boundFunction: (value: unknown) => value is Function;
+ var regExp: (value: unknown) => value is RegExp;
+ var date: (value: unknown) => value is Date;
+ var error: (value: unknown) => value is Error;
+ var map: (value: unknown) => value is Map;
+ var set: (value: unknown) => value is Set;
+ var weakMap: (value: unknown) => value is WeakMap;
+ var weakSet: (value: unknown) => value is WeakSet;
+ var int8Array: (value: unknown) => value is Int8Array;
+ var uint8Array: (value: unknown) => value is Uint8Array;
+ var uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray;
+ var int16Array: (value: unknown) => value is Int16Array;
+ var uint16Array: (value: unknown) => value is Uint16Array;
+ var int32Array: (value: unknown) => value is Int32Array;
+ var uint32Array: (value: unknown) => value is Uint32Array;
+ var float32Array: (value: unknown) => value is Float32Array;
+ var float64Array: (value: unknown) => value is Float64Array;
+ var bigInt64Array: (value: unknown) => value is BigInt64Array;
+ var bigUint64Array: (value: unknown) => value is BigUint64Array;
+ var arrayBuffer: (value: unknown) => value is ArrayBuffer;
+ var sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer;
+ var dataView: (value: unknown) => value is DataView;
+ var directInstanceOf: (instance: unknown, class_: Class) => instance is T;
+ var urlInstance: (value: unknown) => value is URL;
+ var urlString: (value: unknown) => value is string;
+ var truthy: (value: unknown) => boolean;
+ var falsy: (value: unknown) => boolean;
+ var nan: (value: unknown) => boolean;
+ var primitive: (value: unknown) => value is Primitive;
+ var integer: (value: unknown) => value is number;
+ var safeInteger: (value: unknown) => value is number;
+ var plainObject: (value: unknown) => value is Record;
+ var typedArray: (value: unknown) => value is TypedArray;
+ var arrayLike: (value: unknown) => value is ArrayLike;
+ var inRange: (value: number, range: number | number[]) => value is number;
+ var domElement: (value: unknown) => value is HTMLElement;
+ var observable: (value: unknown) => value is ObservableLike;
+ var nodeStream: (value: unknown) => value is NodeStream;
+ var infinite: (value: unknown) => value is number;
+ var evenInteger: (value: number) => value is number;
+ var oddInteger: (value: number) => value is number;
+ var emptyArray: (value: unknown) => value is never[];
+ var nonEmptyArray: (value: unknown) => value is unknown[];
+ var emptyString: (value: unknown) => value is "";
+ var nonEmptyString: (value: unknown) => value is string;
+ var emptyStringOrWhitespace: (value: unknown) => value is string;
+ var emptyObject: (value: unknown) => value is Record;
+ var nonEmptyObject: (value: unknown) => value is Record;
+ var emptySet: (value: unknown) => value is Set;
+ var nonEmptySet: (value: unknown) => value is Set;
+ var emptyMap: (value: unknown) => value is Map;
+ var nonEmptyMap: (value: unknown) => value is Map;
+ var any: (predicate: Predicate | Predicate[], ...values: unknown[]) => boolean;
+ var all: (predicate: Predicate, ...values: unknown[]) => boolean;
+}
+declare type ObjectKey = string | number | symbol;
+export interface ArrayLike {
+ readonly [index: number]: T;
+ readonly length: number;
+}
+export interface NodeStream extends NodeJS.EventEmitter {
+ pipe(destination: T, options?: {
+ end?: boolean;
+ }): T;
+}
+export declare type Predicate = (value: unknown) => boolean;
+export declare const enum AssertionTypeDescription {
+ class_ = "Class",
+ numericString = "string with a number",
+ nullOrUndefined = "null or undefined",
+ iterable = "Iterable",
+ asyncIterable = "AsyncIterable",
+ nativePromise = "native Promise",
+ urlString = "string with a URL",
+ truthy = "truthy",
+ falsy = "falsy",
+ nan = "NaN",
+ primitive = "primitive",
+ integer = "integer",
+ safeInteger = "integer",
+ plainObject = "plain object",
+ arrayLike = "array-like",
+ typedArray = "TypedArray",
+ domElement = "HTMLElement",
+ nodeStream = "Node.js Stream",
+ infinite = "infinite number",
+ emptyArray = "empty array",
+ nonEmptyArray = "non-empty array",
+ emptyString = "empty string",
+ nonEmptyString = "non-empty string",
+ emptyStringOrWhitespace = "empty string or whitespace",
+ emptyObject = "empty object",
+ nonEmptyObject = "non-empty object",
+ emptySet = "empty set",
+ nonEmptySet = "non-empty set",
+ emptyMap = "empty map",
+ nonEmptyMap = "non-empty map",
+ evenInteger = "even integer",
+ oddInteger = "odd integer",
+ directInstanceOf = "T",
+ inRange = "in range",
+ any = "predicate returns truthy for any value",
+ all = "predicate returns truthy for all values"
+}
+interface Assert {
+ undefined: (value: unknown) => asserts value is undefined;
+ string: (value: unknown) => asserts value is string;
+ number: (value: unknown) => asserts value is number;
+ bigint: (value: unknown) => asserts value is bigint;
+ function_: (value: unknown) => asserts value is Function;
+ null_: (value: unknown) => asserts value is null;
+ class_: (value: unknown) => asserts value is Class;
+ boolean: (value: unknown) => asserts value is boolean;
+ symbol: (value: unknown) => asserts value is symbol;
+ numericString: (value: unknown) => asserts value is string;
+ array: (value: unknown, assertion?: (element: unknown) => asserts element is T) => asserts value is T[];
+ buffer: (value: unknown) => asserts value is Buffer;
+ nullOrUndefined: (value: unknown) => asserts value is null | undefined;
+ object: (value: unknown) => asserts value is Record;
+ iterable: (value: unknown) => asserts value is Iterable;
+ asyncIterable: (value: unknown) => asserts value is AsyncIterable;
+ generator: (value: unknown) => asserts value is Generator;
+ asyncGenerator: (value: unknown) => asserts value is AsyncGenerator;
+ nativePromise: (value: unknown) => asserts value is Promise;
+ promise: (value: unknown) => asserts value is Promise;
+ generatorFunction: (value: unknown) => asserts value is GeneratorFunction;
+ asyncGeneratorFunction: (value: unknown) => asserts value is AsyncGeneratorFunction;
+ asyncFunction: (value: unknown) => asserts value is Function;
+ boundFunction: (value: unknown) => asserts value is Function;
+ regExp: (value: unknown) => asserts value is RegExp;
+ date: (value: unknown) => asserts value is Date;
+ error: (value: unknown) => asserts value is Error;
+ map: (value: unknown) => asserts value is Map;
+ set: (value: unknown) => asserts value is Set;
+ weakMap: (value: unknown) => asserts value is WeakMap;
+ weakSet: (value: unknown) => asserts value is WeakSet;
+ int8Array: (value: unknown) => asserts value is Int8Array;
+ uint8Array: (value: unknown) => asserts value is Uint8Array;
+ uint8ClampedArray: (value: unknown) => asserts value is Uint8ClampedArray;
+ int16Array: (value: unknown) => asserts value is Int16Array;
+ uint16Array: (value: unknown) => asserts value is Uint16Array;
+ int32Array: (value: unknown) => asserts value is Int32Array;
+ uint32Array: (value: unknown) => asserts value is Uint32Array;
+ float32Array: (value: unknown) => asserts value is Float32Array;
+ float64Array: (value: unknown) => asserts value is Float64Array;
+ bigInt64Array: (value: unknown) => asserts value is BigInt64Array;
+ bigUint64Array: (value: unknown) => asserts value is BigUint64Array;
+ arrayBuffer: (value: unknown) => asserts value is ArrayBuffer;
+ sharedArrayBuffer: (value: unknown) => asserts value is SharedArrayBuffer;
+ dataView: (value: unknown) => asserts value is DataView;
+ urlInstance: (value: unknown) => asserts value is URL;
+ urlString: (value: unknown) => asserts value is string;
+ truthy: (value: unknown) => asserts value is unknown;
+ falsy: (value: unknown) => asserts value is unknown;
+ nan: (value: unknown) => asserts value is unknown;
+ primitive: (value: unknown) => asserts value is Primitive;
+ integer: (value: unknown) => asserts value is number;
+ safeInteger: (value: unknown) => asserts value is number;
+ plainObject: (value: unknown) => asserts value is Record;
+ typedArray: (value: unknown) => asserts value is TypedArray;
+ arrayLike: (value: unknown) => asserts value is ArrayLike;
+ domElement: (value: unknown) => asserts value is HTMLElement;
+ observable: (value: unknown) => asserts value is ObservableLike;
+ nodeStream: (value: unknown) => asserts value is NodeStream;
+ infinite: (value: unknown) => asserts value is number;
+ emptyArray: (value: unknown) => asserts value is never[];
+ nonEmptyArray: (value: unknown) => asserts value is unknown[];
+ emptyString: (value: unknown) => asserts value is '';
+ nonEmptyString: (value: unknown) => asserts value is string;
+ emptyStringOrWhitespace: (value: unknown) => asserts value is string;
+ emptyObject: (value: unknown) => asserts value is Record;
+ nonEmptyObject: (value: unknown) => asserts value is Record;
+ emptySet: (value: unknown) => asserts value is Set;
+ nonEmptySet: (value: unknown) => asserts value is Set;
+ emptyMap: (value: unknown) => asserts value is Map;
+ nonEmptyMap: (value: unknown) => asserts value is Map;
+ evenInteger: (value: number) => asserts value is number;
+ oddInteger: (value: number) => asserts value is number;
+ directInstanceOf: (instance: unknown, class_: Class) => asserts instance is T;
+ inRange: (value: number, range: number | number[]) => asserts value is number;
+ any: (predicate: Predicate | Predicate[], ...values: unknown[]) => void | never;
+ all: (predicate: Predicate, ...values: unknown[]) => void | never;
+}
+export declare const assert: Assert;
+export default is;
diff --git a/tests/node_modules/@sindresorhus/is/dist/index.js b/tests/node_modules/@sindresorhus/is/dist/index.js
new file mode 100644
index 0000000..f86cf5c
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/dist/index.js
@@ -0,0 +1,418 @@
+"use strict";
+///
+///
+///
+Object.defineProperty(exports, "__esModule", { value: true });
+const typedArrayTypeNames = [
+ 'Int8Array',
+ 'Uint8Array',
+ 'Uint8ClampedArray',
+ 'Int16Array',
+ 'Uint16Array',
+ 'Int32Array',
+ 'Uint32Array',
+ 'Float32Array',
+ 'Float64Array',
+ 'BigInt64Array',
+ 'BigUint64Array'
+];
+function isTypedArrayName(name) {
+ return typedArrayTypeNames.includes(name);
+}
+const objectTypeNames = [
+ 'Function',
+ 'Generator',
+ 'AsyncGenerator',
+ 'GeneratorFunction',
+ 'AsyncGeneratorFunction',
+ 'AsyncFunction',
+ 'Observable',
+ 'Array',
+ 'Buffer',
+ 'Object',
+ 'RegExp',
+ 'Date',
+ 'Error',
+ 'Map',
+ 'Set',
+ 'WeakMap',
+ 'WeakSet',
+ 'ArrayBuffer',
+ 'SharedArrayBuffer',
+ 'DataView',
+ 'Promise',
+ 'URL',
+ 'HTMLElement',
+ ...typedArrayTypeNames
+];
+function isObjectTypeName(name) {
+ return objectTypeNames.includes(name);
+}
+const primitiveTypeNames = [
+ 'null',
+ 'undefined',
+ 'string',
+ 'number',
+ 'bigint',
+ 'boolean',
+ 'symbol'
+];
+function isPrimitiveTypeName(name) {
+ return primitiveTypeNames.includes(name);
+}
+// eslint-disable-next-line @typescript-eslint/ban-types
+function isOfType(type) {
+ return (value) => typeof value === type;
+}
+const { toString } = Object.prototype;
+const getObjectType = (value) => {
+ const objectTypeName = toString.call(value).slice(8, -1);
+ if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) {
+ return 'HTMLElement';
+ }
+ if (isObjectTypeName(objectTypeName)) {
+ return objectTypeName;
+ }
+ return undefined;
+};
+const isObjectOfType = (type) => (value) => getObjectType(value) === type;
+function is(value) {
+ if (value === null) {
+ return 'null';
+ }
+ switch (typeof value) {
+ case 'undefined':
+ return 'undefined';
+ case 'string':
+ return 'string';
+ case 'number':
+ return 'number';
+ case 'boolean':
+ return 'boolean';
+ case 'function':
+ return 'Function';
+ case 'bigint':
+ return 'bigint';
+ case 'symbol':
+ return 'symbol';
+ default:
+ }
+ if (is.observable(value)) {
+ return 'Observable';
+ }
+ if (is.array(value)) {
+ return 'Array';
+ }
+ if (is.buffer(value)) {
+ return 'Buffer';
+ }
+ const tagType = getObjectType(value);
+ if (tagType) {
+ return tagType;
+ }
+ if (value instanceof String || value instanceof Boolean || value instanceof Number) {
+ throw new TypeError('Please don\'t use object wrappers for primitive types');
+ }
+ return 'Object';
+}
+is.undefined = isOfType('undefined');
+is.string = isOfType('string');
+const isNumberType = isOfType('number');
+is.number = (value) => isNumberType(value) && !is.nan(value);
+is.bigint = isOfType('bigint');
+// eslint-disable-next-line @typescript-eslint/ban-types
+is.function_ = isOfType('function');
+is.null_ = (value) => value === null;
+is.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');
+is.boolean = (value) => value === true || value === false;
+is.symbol = isOfType('symbol');
+is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value));
+is.array = (value, assertion) => {
+ if (!Array.isArray(value)) {
+ return false;
+ }
+ if (!is.function_(assertion)) {
+ return true;
+ }
+ return value.every(assertion);
+};
+is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; };
+is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);
+is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value));
+is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); };
+is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); };
+is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw);
+is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw);
+is.nativePromise = (value) => isObjectOfType('Promise')(value);
+const hasPromiseAPI = (value) => {
+ var _a, _b;
+ return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) &&
+ is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch);
+};
+is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);
+is.generatorFunction = isObjectOfType('GeneratorFunction');
+is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction';
+is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction';
+// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types
+is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');
+is.regExp = isObjectOfType('RegExp');
+is.date = isObjectOfType('Date');
+is.error = isObjectOfType('Error');
+is.map = (value) => isObjectOfType('Map')(value);
+is.set = (value) => isObjectOfType('Set')(value);
+is.weakMap = (value) => isObjectOfType('WeakMap')(value);
+is.weakSet = (value) => isObjectOfType('WeakSet')(value);
+is.int8Array = isObjectOfType('Int8Array');
+is.uint8Array = isObjectOfType('Uint8Array');
+is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');
+is.int16Array = isObjectOfType('Int16Array');
+is.uint16Array = isObjectOfType('Uint16Array');
+is.int32Array = isObjectOfType('Int32Array');
+is.uint32Array = isObjectOfType('Uint32Array');
+is.float32Array = isObjectOfType('Float32Array');
+is.float64Array = isObjectOfType('Float64Array');
+is.bigInt64Array = isObjectOfType('BigInt64Array');
+is.bigUint64Array = isObjectOfType('BigUint64Array');
+is.arrayBuffer = isObjectOfType('ArrayBuffer');
+is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');
+is.dataView = isObjectOfType('DataView');
+is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype;
+is.urlInstance = (value) => isObjectOfType('URL')(value);
+is.urlString = (value) => {
+ if (!is.string(value)) {
+ return false;
+ }
+ try {
+ new URL(value); // eslint-disable-line no-new
+ return true;
+ }
+ catch (_a) {
+ return false;
+ }
+};
+// TODO: Use the `not` operator with a type guard here when it's available.
+// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);`
+is.truthy = (value) => Boolean(value);
+// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);`
+is.falsy = (value) => !value;
+is.nan = (value) => Number.isNaN(value);
+is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value);
+is.integer = (value) => Number.isInteger(value);
+is.safeInteger = (value) => Number.isSafeInteger(value);
+is.plainObject = (value) => {
+ // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
+ if (toString.call(value) !== '[object Object]') {
+ return false;
+ }
+ const prototype = Object.getPrototypeOf(value);
+ return prototype === null || prototype === Object.getPrototypeOf({});
+};
+is.typedArray = (value) => isTypedArrayName(getObjectType(value));
+const isValidLength = (value) => is.safeInteger(value) && value >= 0;
+is.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);
+is.inRange = (value, range) => {
+ if (is.number(range)) {
+ return value >= Math.min(0, range) && value <= Math.max(range, 0);
+ }
+ if (is.array(range) && range.length === 2) {
+ return value >= Math.min(...range) && value <= Math.max(...range);
+ }
+ throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);
+};
+const NODE_TYPE_ELEMENT = 1;
+const DOM_PROPERTIES_TO_CHECK = [
+ 'innerHTML',
+ 'ownerDocument',
+ 'style',
+ 'attributes',
+ 'nodeValue'
+];
+is.domElement = (value) => {
+ return is.object(value) &&
+ value.nodeType === NODE_TYPE_ELEMENT &&
+ is.string(value.nodeName) &&
+ !is.plainObject(value) &&
+ DOM_PROPERTIES_TO_CHECK.every(property => property in value);
+};
+is.observable = (value) => {
+ var _a, _b, _c, _d;
+ if (!value) {
+ return false;
+ }
+ // eslint-disable-next-line no-use-extend-native/no-use-extend-native
+ if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) {
+ return true;
+ }
+ if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) {
+ return true;
+ }
+ return false;
+};
+is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value);
+is.infinite = (value) => value === Infinity || value === -Infinity;
+const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder;
+is.evenInteger = isAbsoluteMod2(0);
+is.oddInteger = isAbsoluteMod2(1);
+is.emptyArray = (value) => is.array(value) && value.length === 0;
+is.nonEmptyArray = (value) => is.array(value) && value.length > 0;
+is.emptyString = (value) => is.string(value) && value.length === 0;
+// TODO: Use `not ''` when the `not` operator is available.
+is.nonEmptyString = (value) => is.string(value) && value.length > 0;
+const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value);
+is.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);
+is.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;
+// TODO: Use `not` operator here to remove `Map` and `Set` from type guard:
+// - https://github.com/Microsoft/TypeScript/pull/29317
+is.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;
+is.emptySet = (value) => is.set(value) && value.size === 0;
+is.nonEmptySet = (value) => is.set(value) && value.size > 0;
+is.emptyMap = (value) => is.map(value) && value.size === 0;
+is.nonEmptyMap = (value) => is.map(value) && value.size > 0;
+const predicateOnArray = (method, predicate, values) => {
+ if (!is.function_(predicate)) {
+ throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);
+ }
+ if (values.length === 0) {
+ throw new TypeError('Invalid number of values');
+ }
+ return method.call(values, predicate);
+};
+is.any = (predicate, ...values) => {
+ const predicates = is.array(predicate) ? predicate : [predicate];
+ return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values));
+};
+is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);
+const assertType = (condition, description, value, options = {}) => {
+ if (!condition) {
+ const { multipleValues } = options;
+ const valuesMessage = multipleValues ?
+ `received values of types ${[
+ ...new Set(value.map(singleValue => `\`${is(singleValue)}\``))
+ ].join(', ')}` :
+ `received value of type \`${is(value)}\``;
+ throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`);
+ }
+};
+exports.assert = {
+ // Unknowns.
+ undefined: (value) => assertType(is.undefined(value), 'undefined', value),
+ string: (value) => assertType(is.string(value), 'string', value),
+ number: (value) => assertType(is.number(value), 'number', value),
+ bigint: (value) => assertType(is.bigint(value), 'bigint', value),
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ function_: (value) => assertType(is.function_(value), 'Function', value),
+ null_: (value) => assertType(is.null_(value), 'null', value),
+ class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value),
+ boolean: (value) => assertType(is.boolean(value), 'boolean', value),
+ symbol: (value) => assertType(is.symbol(value), 'symbol', value),
+ numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value),
+ array: (value, assertion) => {
+ const assert = assertType;
+ assert(is.array(value), 'Array', value);
+ if (assertion) {
+ value.forEach(assertion);
+ }
+ },
+ buffer: (value) => assertType(is.buffer(value), 'Buffer', value),
+ nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value),
+ object: (value) => assertType(is.object(value), 'Object', value),
+ iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value),
+ asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value),
+ generator: (value) => assertType(is.generator(value), 'Generator', value),
+ asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value),
+ nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value),
+ promise: (value) => assertType(is.promise(value), 'Promise', value),
+ generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value),
+ asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value),
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value),
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value),
+ regExp: (value) => assertType(is.regExp(value), 'RegExp', value),
+ date: (value) => assertType(is.date(value), 'Date', value),
+ error: (value) => assertType(is.error(value), 'Error', value),
+ map: (value) => assertType(is.map(value), 'Map', value),
+ set: (value) => assertType(is.set(value), 'Set', value),
+ weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value),
+ weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value),
+ int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value),
+ uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value),
+ uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value),
+ int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value),
+ uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value),
+ int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value),
+ uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value),
+ float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value),
+ float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value),
+ bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value),
+ bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value),
+ arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value),
+ sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value),
+ dataView: (value) => assertType(is.dataView(value), 'DataView', value),
+ urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value),
+ urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value),
+ truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value),
+ falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value),
+ nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value),
+ primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value),
+ integer: (value) => assertType(is.integer(value), "integer" /* integer */, value),
+ safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value),
+ plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value),
+ typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value),
+ arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value),
+ domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value),
+ observable: (value) => assertType(is.observable(value), 'Observable', value),
+ nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value),
+ infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value),
+ emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value),
+ nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value),
+ emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value),
+ nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value),
+ emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value),
+ emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value),
+ nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value),
+ emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value),
+ nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value),
+ emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value),
+ nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value),
+ // Numbers.
+ evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value),
+ oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value),
+ // Two arguments.
+ directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance),
+ inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value),
+ // Variadic functions.
+ any: (predicate, ...values) => {
+ return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true });
+ },
+ all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true })
+};
+// Some few keywords are reserved, but we'll populate them for Node.js users
+// See https://github.com/Microsoft/TypeScript/issues/2536
+Object.defineProperties(is, {
+ class: {
+ value: is.class_
+ },
+ function: {
+ value: is.function_
+ },
+ null: {
+ value: is.null_
+ }
+});
+Object.defineProperties(exports.assert, {
+ class: {
+ value: exports.assert.class_
+ },
+ function: {
+ value: exports.assert.function_
+ },
+ null: {
+ value: exports.assert.null_
+ }
+});
+exports.default = is;
+// For CommonJS default export support
+module.exports = is;
+module.exports.default = is;
+module.exports.assert = exports.assert;
diff --git a/tests/node_modules/@sindresorhus/is/dist/types.d.ts b/tests/node_modules/@sindresorhus/is/dist/types.d.ts
new file mode 100644
index 0000000..a63acda
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/dist/types.d.ts
@@ -0,0 +1,24 @@
+/**
+Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
+*/
+export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
+/**
+Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
+*/
+export declare type Class = new (...arguments_: Arguments) => T;
+/**
+Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`.
+*/
+export declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
+declare global {
+ interface SymbolConstructor {
+ readonly observable: symbol;
+ }
+}
+/**
+Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable).
+*/
+export interface ObservableLike {
+ subscribe(observer: (value: unknown) => void): void;
+ [Symbol.observable](): ObservableLike;
+}
diff --git a/tests/node_modules/@sindresorhus/is/dist/types.js b/tests/node_modules/@sindresorhus/is/dist/types.js
new file mode 100644
index 0000000..0930323
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/dist/types.js
@@ -0,0 +1,3 @@
+"use strict";
+// Extracted from https://github.com/sindresorhus/type-fest/blob/78019f42ea888b0cdceb41a4a78163868de57555/index.d.ts
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tests/node_modules/@sindresorhus/is/license b/tests/node_modules/@sindresorhus/is/license
new file mode 100644
index 0000000..fa7ceba
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (https://sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tests/node_modules/@sindresorhus/is/package.json b/tests/node_modules/@sindresorhus/is/package.json
new file mode 100644
index 0000000..f10f394
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/package.json
@@ -0,0 +1,129 @@
+{
+ "_from": "@sindresorhus/is@^4.0.0",
+ "_id": "@sindresorhus/is@4.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-Qm9hBEBu18wt1PO2flE7LPb30BHMQt1eQgbV76YntdNk73XZGpn3izvGTYxbGgzXKgbCjiia0uxTd3aTNQrY/g==",
+ "_location": "/@sindresorhus/is",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@sindresorhus/is@^4.0.0",
+ "name": "@sindresorhus/is",
+ "escapedName": "@sindresorhus%2fis",
+ "scope": "@sindresorhus",
+ "rawSpec": "^4.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^4.0.0"
+ },
+ "_requiredBy": [
+ "/got"
+ ],
+ "_resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.1.tgz",
+ "_shasum": "d26729db850fa327b7cacc5522252194404226f5",
+ "_spec": "@sindresorhus/is@^4.0.0",
+ "_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/got",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "https://sindresorhus.com"
+ },
+ "ava": {
+ "extensions": [
+ "ts"
+ ],
+ "require": [
+ "ts-node/register"
+ ]
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/is/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Type check values",
+ "devDependencies": {
+ "@sindresorhus/tsconfig": "^0.7.0",
+ "@types/jsdom": "^16.1.0",
+ "@types/node": "^14.0.13",
+ "@types/zen-observable": "^0.8.0",
+ "@typescript-eslint/eslint-plugin": "^2.20.0",
+ "@typescript-eslint/parser": "^2.20.0",
+ "ava": "^3.3.0",
+ "del-cli": "^2.0.0",
+ "eslint-config-xo-typescript": "^0.26.0",
+ "jsdom": "^16.0.1",
+ "rxjs": "^6.4.0",
+ "tempy": "^0.4.0",
+ "ts-node": "^8.3.0",
+ "typescript": "~3.8.2",
+ "xo": "^0.26.1",
+ "zen-observable": "^0.8.8"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "files": [
+ "dist"
+ ],
+ "funding": "https://github.com/sindresorhus/is?sponsor=1",
+ "homepage": "https://github.com/sindresorhus/is#readme",
+ "keywords": [
+ "type",
+ "types",
+ "is",
+ "check",
+ "checking",
+ "validate",
+ "validation",
+ "utility",
+ "util",
+ "typeof",
+ "instanceof",
+ "object",
+ "assert",
+ "assertion",
+ "test",
+ "kind",
+ "primitive",
+ "verify",
+ "compare",
+ "typescript",
+ "typeguards",
+ "types"
+ ],
+ "license": "MIT",
+ "main": "dist/index.js",
+ "name": "@sindresorhus/is",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/is.git"
+ },
+ "scripts": {
+ "build": "del dist && tsc",
+ "prepare": "npm run build",
+ "test": "xo && ava"
+ },
+ "sideEffects": false,
+ "types": "dist/index.d.ts",
+ "version": "4.0.1",
+ "xo": {
+ "extends": "xo-typescript",
+ "extensions": [
+ "ts"
+ ],
+ "parserOptions": {
+ "project": "./tsconfig.xo.json"
+ },
+ "globals": [
+ "BigInt",
+ "BigInt64Array",
+ "BigUint64Array"
+ ],
+ "rules": {
+ "@typescript-eslint/promise-function-async": "off",
+ "@typescript-eslint/no-empty-function": "off",
+ "@typescript-eslint/explicit-function-return-type": "off"
+ }
+ }
+}
diff --git a/tests/node_modules/@sindresorhus/is/readme.md b/tests/node_modules/@sindresorhus/is/readme.md
new file mode 100644
index 0000000..adb9910
--- /dev/null
+++ b/tests/node_modules/@sindresorhus/is/readme.md
@@ -0,0 +1,602 @@
+# is
+
+> Type check values
+
+For example, `is.string('🦄') //=> true`
+
+
+
+## Highlights
+
+- Written in TypeScript
+- [Extensive use of type guards](#type-guards)
+- [Supports type assertions](#type-assertions)
+- [Aware of generic type parameters](#generic-type-parameters) (use with caution)
+- Actively maintained
+- ![Millions of downloads per week](https://img.shields.io/npm/dw/@sindresorhus/is)
+
+## Install
+
+```
+$ npm install @sindresorhus/is
+```
+
+## Usage
+
+```js
+const is = require('@sindresorhus/is');
+
+is('🦄');
+//=> 'string'
+
+is(new Map());
+//=> 'Map'
+
+is.number(6);
+//=> true
+```
+
+[Assertions](#type-assertions) perform the same type checks, but throw an error if the type does not match.
+
+```js
+const {assert} = require('@sindresorhus/is');
+
+assert.string(2);
+//=> Error: Expected value which is `string`, received value of type `number`.
+```
+
+And with TypeScript:
+
+```ts
+import {assert} from '@sindresorhus/is';
+
+assert.string(foo);
+// `foo` is now typed as a `string`.
+```
+
+## API
+
+### is(value)
+
+Returns the type of `value`.
+
+Primitives are lowercase and object types are camelcase.
+
+Example:
+
+- `'undefined'`
+- `'null'`
+- `'string'`
+- `'symbol'`
+- `'Array'`
+- `'Function'`
+- `'Object'`
+
+Note: It will throw an error if you try to feed it object-wrapped primitives, as that's a bad practice. For example `new String('foo')`.
+
+### is.{method}
+
+All the below methods accept a value and returns a boolean for whether the value is of the desired type.
+
+#### Primitives
+
+##### .undefined(value)
+##### .null(value)
+##### .string(value)
+##### .number(value)
+
+Note: `is.number(NaN)` returns `false`. This intentionally deviates from `typeof` behavior to increase user-friendliness of `is` type checks.
+
+##### .boolean(value)
+##### .symbol(value)
+##### .bigint(value)
+
+#### Built-in types
+
+##### .array(value, assertion?)
+
+Returns true if `value` is an array and all of its items match the assertion (if provided).
+
+```js
+is.array(value); // Validate `value` is an array.
+is.array(value, is.number); // Validate `value` is an array and all of its items are numbers.
+```
+
+##### .function(value)
+##### .buffer(value)
+##### .object(value)
+
+Keep in mind that [functions are objects too](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions).
+
+##### .numericString(value)
+
+Returns `true` for a string that represents a number satisfying `is.number`, for example, `'42'` and `'-8.3'`.
+
+Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`.
+
+##### .regExp(value)
+##### .date(value)
+##### .error(value)
+##### .nativePromise(value)
+##### .promise(value)
+
+Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
+
+##### .generator(value)
+
+Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
+
+##### .generatorFunction(value)
+
+##### .asyncFunction(value)
+
+Returns `true` for any `async` function that can be called with the `await` operator.
+
+```js
+is.asyncFunction(async () => {});
+//=> true
+
+is.asyncFunction(() => {});
+//=> false
+```
+
+##### .asyncGenerator(value)
+
+```js
+is.asyncGenerator(
+ (async function * () {
+ yield 4;
+ })()
+);
+//=> true
+
+is.asyncGenerator(
+ (function * () {
+ yield 4;
+ })()
+);
+//=> false
+```
+
+##### .asyncGeneratorFunction(value)
+
+```js
+is.asyncGeneratorFunction(async function * () {
+ yield 4;
+});
+//=> true
+
+is.asyncGeneratorFunction(function * () {
+ yield 4;
+});
+//=> false
+```
+
+##### .boundFunction(value)
+
+Returns `true` for any `bound` function.
+
+```js
+is.boundFunction(() => {});
+//=> true
+
+is.boundFunction(function () {}.bind(null));
+//=> true
+
+is.boundFunction(function () {});
+//=> false
+```
+
+##### .map(value)
+##### .set(value)
+##### .weakMap(value)
+##### .weakSet(value)
+
+#### Typed arrays
+
+##### .int8Array(value)
+##### .uint8Array(value)
+##### .uint8ClampedArray(value)
+##### .int16Array(value)
+##### .uint16Array(value)
+##### .int32Array(value)
+##### .uint32Array(value)
+##### .float32Array(value)
+##### .float64Array(value)
+##### .bigInt64Array(value)
+##### .bigUint64Array(value)
+
+#### Structured data
+
+##### .arrayBuffer(value)
+##### .sharedArrayBuffer(value)
+##### .dataView(value)
+
+#### Emptiness
+
+##### .emptyString(value)
+
+Returns `true` if the value is a `string` and the `.length` is 0.
+
+##### .nonEmptyString(value)
+
+Returns `true` if the value is a `string` and the `.length` is more than 0.
+
+##### .emptyStringOrWhitespace(value)
+
+Returns `true` if `is.emptyString(value)` or if it's a `string` that is all whitespace.
+
+##### .emptyArray(value)
+
+Returns `true` if the value is an `Array` and the `.length` is 0.
+
+##### .nonEmptyArray(value)
+
+Returns `true` if the value is an `Array` and the `.length` is more than 0.
+
+##### .emptyObject(value)
+
+Returns `true` if the value is an `Object` and `Object.keys(value).length` is 0.
+
+Please note that `Object.keys` returns only own enumerable properties. Hence something like this can happen:
+
+```js
+const object1 = {};
+
+Object.defineProperty(object1, 'property1', {
+ value: 42,
+ writable: true,
+ enumerable: false,
+ configurable: true
+});
+
+is.emptyObject(object1);
+//=> true
+```
+
+##### .nonEmptyObject(value)
+
+Returns `true` if the value is an `Object` and `Object.keys(value).length` is more than 0.
+
+##### .emptySet(value)
+
+Returns `true` if the value is a `Set` and the `.size` is 0.
+
+##### .nonEmptySet(Value)
+
+Returns `true` if the value is a `Set` and the `.size` is more than 0.
+
+##### .emptyMap(value)
+
+Returns `true` if the value is a `Map` and the `.size` is 0.
+
+##### .nonEmptyMap(value)
+
+Returns `true` if the value is a `Map` and the `.size` is more than 0.
+
+#### Miscellaneous
+
+##### .directInstanceOf(value, class)
+
+Returns `true` if `value` is a direct instance of `class`.
+
+```js
+is.directInstanceOf(new Error(), Error);
+//=> true
+
+class UnicornError extends Error {}
+
+is.directInstanceOf(new UnicornError(), Error);
+//=> false
+```
+
+##### .urlInstance(value)
+
+Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
+
+```js
+const url = new URL('https://example.com');
+
+is.urlInstance(url);
+//=> true
+```
+
+##### .urlString(value)
+
+Returns `true` if `value` is a URL string.
+
+Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor.
+
+```js
+const url = 'https://example.com';
+
+is.urlString(url);
+//=> true
+
+is.urlString(new URL(url));
+//=> false
+```
+
+##### .truthy(value)
+
+Returns `true` for all values that evaluate to true in a boolean context:
+
+```js
+is.truthy('🦄');
+//=> true
+
+is.truthy(undefined);
+//=> false
+```
+
+##### .falsy(value)
+
+Returns `true` if `value` is one of: `false`, `0`, `''`, `null`, `undefined`, `NaN`.
+
+##### .nan(value)
+##### .nullOrUndefined(value)
+##### .primitive(value)
+
+JavaScript primitives are as follows: `null`, `undefined`, `string`, `number`, `boolean`, `symbol`.
+
+##### .integer(value)
+
+##### .safeInteger(value)
+
+Returns `true` if `value` is a [safe integer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger).
+
+##### .plainObject(value)
+
+An object is plain if it's created by either `{}`, `new Object()`, or `Object.create(null)`.
+
+##### .iterable(value)
+##### .asyncIterable(value)
+##### .class(value)
+
+Returns `true` for instances created by a class.
+
+##### .typedArray(value)
+
+##### .arrayLike(value)
+
+A `value` is array-like if it is not a function and has a `value.length` that is a safe integer greater than or equal to 0.
+
+```js
+is.arrayLike(document.forms);
+//=> true
+
+function foo() {
+ is.arrayLike(arguments);
+ //=> true
+}
+foo();
+```
+
+##### .inRange(value, range)
+
+Check if `value` (number) is in the given `range`. The range is an array of two values, lower bound and upper bound, in no specific order.
+
+```js
+is.inRange(3, [0, 5]);
+is.inRange(3, [5, 0]);
+is.inRange(0, [-2, 2]);
+```
+
+##### .inRange(value, upperBound)
+
+Check if `value` (number) is in the range of `0` to `upperBound`.
+
+```js
+is.inRange(3, 10);
+```
+
+##### .domElement(value)
+
+Returns `true` if `value` is a DOM Element.
+
+##### .nodeStream(value)
+
+Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
+
+```js
+const fs = require('fs');
+
+is.nodeStream(fs.createReadStream('unicorn.png'));
+//=> true
+```
+
+##### .observable(value)
+
+Returns `true` if `value` is an `Observable`.
+
+```js
+const {Observable} = require('rxjs');
+
+is.observable(new Observable());
+//=> true
+```
+
+##### .infinite(value)
+
+Check if `value` is `Infinity` or `-Infinity`.
+
+##### .evenInteger(value)
+
+Returns `true` if `value` is an even integer.
+
+##### .oddInteger(value)
+
+Returns `true` if `value` is an odd integer.
+
+##### .any(predicate | predicate[], ...values)
+
+Using a single `predicate` argument, returns `true` if **any** of the input `values` returns true in the `predicate`:
+
+```js
+is.any(is.string, {}, true, '🦄');
+//=> true
+
+is.any(is.boolean, 'unicorns', [], new Map());
+//=> false
+```
+
+Using an array of `predicate[]`, returns `true` if **any** of the input `values` returns true for **any** of the `predicates` provided in an array:
+
+```js
+is.any([is.string, is.number], {}, true, '🦄');
+//=> true
+
+is.any([is.boolean, is.number], 'unicorns', [], new Map());
+//=> false
+```
+
+##### .all(predicate, ...values)
+
+Returns `true` if **all** of the input `values` returns true in the `predicate`:
+
+```js
+is.all(is.object, {}, new Map(), new Set());
+//=> true
+
+is.all(is.string, '🦄', [], 'unicorns');
+//=> false
+```
+
+## Type guards
+
+When using `is` together with TypeScript, [type guards](http://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types) are being used extensively to infer the correct type inside if-else statements.
+
+```ts
+import is from '@sindresorhus/is';
+
+const padLeft = (value: string, padding: string | number) => {
+ if (is.number(padding)) {
+ // `padding` is typed as `number`
+ return Array(padding + 1).join(' ') + value;
+ }
+
+ if (is.string(padding)) {
+ // `padding` is typed as `string`
+ return padding + value;
+ }
+
+ throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`);
+}
+
+padLeft('🦄', 3);
+//=> ' 🦄'
+
+padLeft('🦄', '🌈');
+//=> '🌈🦄'
+```
+
+## Type assertions
+
+The type guards are also available as [type assertions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions), which throw an error for unexpected types. It is a convenient one-line version of the often repetitive "if-not-expected-type-throw" pattern.
+
+```ts
+import {assert} from '@sindresorhus/is';
+
+const handleMovieRatingApiResponse = (response: unknown) => {
+ assert.plainObject(response);
+ // `response` is now typed as a plain `object` with `unknown` properties.
+
+ assert.number(response.rating);
+ // `response.rating` is now typed as a `number`.
+
+ assert.string(response.title);
+ // `response.title` is now typed as a `string`.
+
+ return `${response.title} (${response.rating * 10})`;
+};
+
+handleMovieRatingApiResponse({rating: 0.87, title: 'The Matrix'});
+//=> 'The Matrix (8.7)'
+
+// This throws an error.
+handleMovieRatingApiResponse({rating: '🦄'});
+```
+
+## Generic type parameters
+
+The type guards and type assertions are aware of [generic type parameters](https://www.typescriptlang.org/docs/handbook/generics.html), such as `Promise` and `Map`. The default is `unknown` for most cases, since `is` cannot check them at runtime. If the generic type is known at compile-time, either implicitly (inferred) or explicitly (provided), `is` propagates the type so it can be used later.
+
+Use generic type parameters with caution. They are only checked by the TypeScript compiler, and not checked by `is` at runtime. This can lead to unexpected behavior, where the generic type is _assumed_ at compile-time, but actually is something completely different at runtime. It is best to use `unknown` (default) and type-check the value of the generic type parameter at runtime with `is` or `assert`.
+
+```ts
+import {assert} from '@sindresorhus/is';
+
+async function badNumberAssumption(input: unknown) {
+ // Bad assumption about the generic type parameter fools the compile-time type system.
+ assert.promise(input);
+ // `input` is a `Promise` but only assumed to be `Promise`.
+
+ const resolved = await input;
+ // `resolved` is typed as `number` but was not actually checked at runtime.
+
+ // Multiplication will return NaN if the input promise did not actually contain a number.
+ return 2 * resolved;
+}
+
+async function goodNumberAssertion(input: unknown) {
+ assert.promise(input);
+ // `input` is typed as `Promise`
+
+ const resolved = await input;
+ // `resolved` is typed as `unknown`
+
+ assert.number(resolved);
+ // `resolved` is typed as `number`
+
+ // Uses runtime checks so only numbers will reach the multiplication.
+ return 2 * resolved;
+}
+
+badNumberAssumption(Promise.resolve('An unexpected string'));
+//=> NaN
+
+// This correctly throws an error because of the unexpected string value.
+goodNumberAssertion(Promise.resolve('An unexpected string'));
+```
+
+## FAQ
+
+### Why yet another type checking module?
+
+There are hundreds of type checking modules on npm, unfortunately, I couldn't find any that fit my needs:
+
+- Includes both type methods and ability to get the type
+- Types of primitives returned as lowercase and object types as camelcase
+- Covers all built-ins
+- Unsurprising behavior
+- Well-maintained
+- Comprehensive test suite
+
+For the ones I found, pick 3 of these.
+
+The most common mistakes I noticed in these modules was using `instanceof` for type checking, forgetting that functions are objects, and omitting `symbol` as a primitive.
+
+## For enterprise
+
+Available as part of the Tidelift Subscription.
+
+The maintainers of @sindresorhus/is and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-sindresorhus-is?utm_source=npm-sindresorhus-is&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+
+## Related
+
+- [ow](https://github.com/sindresorhus/ow) - Function argument validation for humans
+- [is-stream](https://github.com/sindresorhus/is-stream) - Check if something is a Node.js stream
+- [is-observable](https://github.com/sindresorhus/is-observable) - Check if a value is an Observable
+- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array
+- [is-ip](https://github.com/sindresorhus/is-ip) - Check if a string is an IP address
+- [is-array-sorted](https://github.com/sindresorhus/is-array-sorted) - Check if an Array is sorted
+- [is-error-constructor](https://github.com/sindresorhus/is-error-constructor) - Check if a value is an error constructor
+- [is-empty-iterable](https://github.com/sindresorhus/is-empty-iterable) - Check if an Iterable is empty
+- [is-blob](https://github.com/sindresorhus/is-blob) - Check if a value is a Blob - File-like object of immutable, raw data
+- [has-emoji](https://github.com/sindresorhus/has-emoji) - Check whether a string has any emoji
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Giora Guttsait](https://github.com/gioragutt)
+- [Brandon Smith](https://github.com/brandon93s)
diff --git a/tests/node_modules/@szmarczak/http-timer/LICENSE b/tests/node_modules/@szmarczak/http-timer/LICENSE
new file mode 100644
index 0000000..15ad2e8
--- /dev/null
+++ b/tests/node_modules/@szmarczak/http-timer/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Szymon Marczak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/tests/node_modules/@szmarczak/http-timer/README.md b/tests/node_modules/@szmarczak/http-timer/README.md
new file mode 100644
index 0000000..4f6a615
--- /dev/null
+++ b/tests/node_modules/@szmarczak/http-timer/README.md
@@ -0,0 +1,89 @@
+# http-timer
+> Timings for HTTP requests
+
+[![Build Status](https://travis-ci.org/szmarczak/http-timer.svg?branch=master)](https://travis-ci.org/szmarczak/http-timer)
+[![Coverage Status](https://coveralls.io/repos/github/szmarczak/http-timer/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/http-timer?branch=master)
+[![install size](https://packagephobia.now.sh/badge?p=@szmarczak/http-timer)](https://packagephobia.now.sh/result?p=@szmarczak/http-timer)
+
+Inspired by the [`request` package](https://github.com/request/request).
+
+## Installation
+
+NPM:
+
+> `npm install @szmarczak/http-timer`
+
+Yarn:
+
+> `yarn add @szmarczak/http-timer`
+
+## Usage
+```js
+const https = require('https');
+const timer = require('@szmarczak/http-timer');
+
+const request = https.get('https://httpbin.org/anything');
+timer(request);
+
+request.once('response', response => {
+ response.resume();
+ response.once('end', () => {
+ console.log(response.timings); // You can use `request.timings` as well
+ });
+});
+
+// {
+// start: 1572712180361,
+// socket: 1572712180362,
+// lookup: 1572712180415,
+// connect: 1572712180571,
+// upload: 1572712180884,
+// response: 1572712181037,
+// end: 1572712181039,
+// error: undefined,
+// abort: undefined,
+// phases: {
+// wait: 1,
+// dns: 53,
+// tcp: 156,
+// request: 313,
+// firstByte: 153,
+// download: 2,
+// total: 678
+// }
+// }
+```
+
+## API
+
+### timer(request)
+
+Returns: `Object`
+
+**Note**: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
+
+- `start` - Time when the request started.
+- `socket` - Time when a socket was assigned to the request.
+- `lookup` - Time when the DNS lookup finished.
+- `connect` - Time when the socket successfully connected.
+- `secureConnect` - Time when the socket securely connected.
+- `upload` - Time when the request finished uploading.
+- `response` - Time when the request fired `response` event.
+- `end` - Time when the response fired `end` event.
+- `error` - Time when the request fired `error` event.
+- `abort` - Time when the request fired `abort` event.
+- `phases`
+ - `wait` - `timings.socket - timings.start`
+ - `dns` - `timings.lookup - timings.socket`
+ - `tcp` - `timings.connect - timings.lookup`
+ - `tls` - `timings.secureConnect - timings.connect`
+ - `request` - `timings.upload - (timings.secureConnect || timings.connect)`
+ - `firstByte` - `timings.response - timings.upload`
+ - `download` - `timings.end - timings.response`
+ - `total` - `(timings.end || timings.error || timings.abort) - timings.start`
+
+If something has not been measured yet, it will be `undefined`.
+
+## License
+
+MIT
diff --git a/tests/node_modules/@szmarczak/http-timer/dist/source/index.d.ts b/tests/node_modules/@szmarczak/http-timer/dist/source/index.d.ts
new file mode 100644
index 0000000..2620b4a
--- /dev/null
+++ b/tests/node_modules/@szmarczak/http-timer/dist/source/index.d.ts
@@ -0,0 +1,32 @@
+///
+import { ClientRequest, IncomingMessage } from 'http';
+export interface Timings {
+ start: number;
+ socket?: number;
+ lookup?: number;
+ connect?: number;
+ secureConnect?: number;
+ upload?: number;
+ response?: number;
+ end?: number;
+ error?: number;
+ abort?: number;
+ phases: {
+ wait?: number;
+ dns?: number;
+ tcp?: number;
+ tls?: number;
+ request?: number;
+ firstByte?: number;
+ download?: number;
+ total?: number;
+ };
+}
+export interface ClientRequestWithTimings extends ClientRequest {
+ timings?: Timings;
+}
+export interface IncomingMessageWithTimings extends IncomingMessage {
+ timings?: Timings;
+}
+declare const timer: (request: ClientRequestWithTimings) => Timings;
+export default timer;
diff --git a/tests/node_modules/@szmarczak/http-timer/dist/source/index.js b/tests/node_modules/@szmarczak/http-timer/dist/source/index.js
new file mode 100644
index 0000000..c120ace
--- /dev/null
+++ b/tests/node_modules/@szmarczak/http-timer/dist/source/index.js
@@ -0,0 +1,117 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const defer_to_connect_1 = require("defer-to-connect");
+const nodejsMajorVersion = Number(process.versions.node.split('.')[0]);
+const timer = (request) => {
+ const timings = {
+ start: Date.now(),
+ socket: undefined,
+ lookup: undefined,
+ connect: undefined,
+ secureConnect: undefined,
+ upload: undefined,
+ response: undefined,
+ end: undefined,
+ error: undefined,
+ abort: undefined,
+ phases: {
+ wait: undefined,
+ dns: undefined,
+ tcp: undefined,
+ tls: undefined,
+ request: undefined,
+ firstByte: undefined,
+ download: undefined,
+ total: undefined
+ }
+ };
+ request.timings = timings;
+ const handleError = (origin) => {
+ const emit = origin.emit.bind(origin);
+ origin.emit = (event, ...args) => {
+ // Catches the `error` event
+ if (event === 'error') {
+ timings.error = Date.now();
+ timings.phases.total = timings.error - timings.start;
+ origin.emit = emit;
+ }
+ // Saves the original behavior
+ return emit(event, ...args);
+ };
+ };
+ handleError(request);
+ request.prependOnceListener('abort', () => {
+ timings.abort = Date.now();
+ // Let the `end` response event be responsible for setting the total phase,
+ // unless the Node.js major version is >= 13.
+ if (!timings.response || nodejsMajorVersion >= 13) {
+ timings.phases.total = Date.now() - timings.start;
+ }
+ });
+ const onSocket = (socket) => {
+ timings.socket = Date.now();
+ timings.phases.wait = timings.socket - timings.start;
+ const lookupListener = () => {
+ timings.lookup = Date.now();
+ timings.phases.dns = timings.lookup - timings.socket;
+ };
+ socket.prependOnceListener('lookup', lookupListener);
+ defer_to_connect_1.default(socket, {
+ connect: () => {
+ timings.connect = Date.now();
+ if (timings.lookup === undefined) {
+ socket.removeListener('lookup', lookupListener);
+ timings.lookup = timings.connect;
+ timings.phases.dns = timings.lookup - timings.socket;
+ }
+ timings.phases.tcp = timings.connect - timings.lookup;
+ // This callback is called before flushing any data,
+ // so we don't need to set `timings.phases.request` here.
+ },
+ secureConnect: () => {
+ timings.secureConnect = Date.now();
+ timings.phases.tls = timings.secureConnect - timings.connect;
+ }
+ });
+ };
+ if (request.socket) {
+ onSocket(request.socket);
+ }
+ else {
+ request.prependOnceListener('socket', onSocket);
+ }
+ const onUpload = () => {
+ var _a;
+ timings.upload = Date.now();
+ timings.phases.request = timings.upload - (_a = timings.secureConnect, (_a !== null && _a !== void 0 ? _a : timings.connect));
+ };
+ const writableFinished = () => {
+ if (typeof request.writableFinished === 'boolean') {
+ return request.writableFinished;
+ }
+ // Node.js doesn't have `request.writableFinished` property
+ return request.finished && request.outputSize === 0 && (!request.socket || request.socket.writableLength === 0);
+ };
+ if (writableFinished()) {
+ onUpload();
+ }
+ else {
+ request.prependOnceListener('finish', onUpload);
+ }
+ request.prependOnceListener('response', (response) => {
+ timings.response = Date.now();
+ timings.phases.firstByte = timings.response - timings.upload;
+ response.timings = timings;
+ handleError(response);
+ response.prependOnceListener('end', () => {
+ timings.end = Date.now();
+ timings.phases.download = timings.end - timings.response;
+ timings.phases.total = timings.end - timings.start;
+ });
+ });
+ return timings;
+};
+exports.default = timer;
+// For CommonJS default export support
+module.exports = timer;
+module.exports.default = timer;
diff --git a/tests/node_modules/@szmarczak/http-timer/package.json b/tests/node_modules/@szmarczak/http-timer/package.json
new file mode 100644
index 0000000..0636fe8
--- /dev/null
+++ b/tests/node_modules/@szmarczak/http-timer/package.json
@@ -0,0 +1,102 @@
+{
+ "_from": "@szmarczak/http-timer@^4.0.5",
+ "_id": "@szmarczak/http-timer@4.0.5",
+ "_inBundle": false,
+ "_integrity": "sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==",
+ "_location": "/@szmarczak/http-timer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@szmarczak/http-timer@^4.0.5",
+ "name": "@szmarczak/http-timer",
+ "escapedName": "@szmarczak%2fhttp-timer",
+ "scope": "@szmarczak",
+ "rawSpec": "^4.0.5",
+ "saveSpec": null,
+ "fetchSpec": "^4.0.5"
+ },
+ "_requiredBy": [
+ "/got"
+ ],
+ "_resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz",
+ "_shasum": "bfbd50211e9dfa51ba07da58a14cdfd333205152",
+ "_spec": "@szmarczak/http-timer@^4.0.5",
+ "_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/got",
+ "author": {
+ "name": "Szymon Marczak"
+ },
+ "ava": {
+ "typescript": {
+ "rewritePaths": {
+ "tests/": "dist/tests/"
+ }
+ }
+ },
+ "bugs": {
+ "url": "https://github.com/szmarczak/http-timer/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "defer-to-connect": "^2.0.0"
+ },
+ "deprecated": false,
+ "description": "Timings for HTTP requests",
+ "devDependencies": {
+ "@ava/typescript": "^1.1.0",
+ "@sindresorhus/tsconfig": "^0.7.0",
+ "@types/node": "^13.5.1",
+ "@typescript-eslint/eslint-plugin": "^2.18.0",
+ "@typescript-eslint/parser": "^2.18.0",
+ "ava": "^3.2.0",
+ "coveralls": "^3.0.9",
+ "del-cli": "^3.0.0",
+ "eslint-config-xo-typescript": "^0.24.1",
+ "nyc": "^15.0.0",
+ "p-event": "^4.1.0",
+ "typescript": "^3.7.5",
+ "xo": "^0.25.3"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "files": [
+ "dist/source"
+ ],
+ "homepage": "https://github.com/szmarczak/http-timer#readme",
+ "keywords": [
+ "http",
+ "https",
+ "timer",
+ "timings"
+ ],
+ "license": "MIT",
+ "main": "dist/source",
+ "name": "@szmarczak/http-timer",
+ "nyc": {
+ "extension": [
+ ".ts"
+ ],
+ "exclude": [
+ "**/tests/**"
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/szmarczak/http-timer.git"
+ },
+ "scripts": {
+ "build": "del-cli dist && tsc",
+ "coveralls": "nyc report --reporter=text-lcov | coveralls",
+ "prepare": "npm run build",
+ "test": "xo && tsc --noEmit && nyc ava"
+ },
+ "types": "dist/source",
+ "version": "4.0.5",
+ "xo": {
+ "extends": "xo-typescript",
+ "extensions": [
+ "ts"
+ ]
+ }
+}
diff --git a/tests/node_modules/@types/cacheable-request/LICENSE b/tests/node_modules/@types/cacheable-request/LICENSE
new file mode 100644
index 0000000..4b1ad51
--- /dev/null
+++ b/tests/node_modules/@types/cacheable-request/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/tests/node_modules/@types/cacheable-request/README.md b/tests/node_modules/@types/cacheable-request/README.md
new file mode 100644
index 0000000..8a6bd07
--- /dev/null
+++ b/tests/node_modules/@types/cacheable-request/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/cacheable-request`
+
+# Summary
+This package contains type definitions for cacheable-request ( https://github.com/lukechilds/cacheable-request#readme ).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cacheable-request
+
+Additional Details
+ * Last updated: Mon, 25 Mar 2019 16:32:10 GMT
+ * Dependencies: @types/keyv, @types/http-cache-semantics, @types/responselike, @types/node
+ * Global values: none
+
+# Credits
+These definitions were written by BendingBender , Paul Melnikow .
diff --git a/tests/node_modules/@types/cacheable-request/index.d.ts b/tests/node_modules/@types/cacheable-request/index.d.ts
new file mode 100644
index 0000000..16e7782
--- /dev/null
+++ b/tests/node_modules/@types/cacheable-request/index.d.ts
@@ -0,0 +1,137 @@
+// Type definitions for cacheable-request 6.0
+// Project: https://github.com/lukechilds/cacheable-request#readme
+// Definitions by: BendingBender
+// Paul Melnikow
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+///
+
+import { request, RequestOptions, ClientRequest, ServerResponse } from 'http';
+import { URL } from 'url';
+import { EventEmitter } from 'events';
+import { Store } from 'keyv';
+import { Options as CacheSemanticsOptions } from 'http-cache-semantics';
+import ResponseLike = require('responselike');
+
+export = CacheableRequest;
+
+declare const CacheableRequest: CacheableRequest;
+
+type RequestFn = typeof request;
+
+interface CacheableRequest {
+ new (requestFn: RequestFn, storageAdapter?: string | CacheableRequest.StorageAdapter): (
+ opts: string | URL | (RequestOptions & CacheSemanticsOptions),
+ cb?: (response: ServerResponse | ResponseLike) => void
+ ) => CacheableRequest.Emitter;
+
+ RequestError: typeof RequestErrorCls;
+ CacheError: typeof CacheErrorCls;
+}
+
+declare namespace CacheableRequest {
+ type StorageAdapter = Store;
+
+ interface Options {
+ /**
+ * If the cache should be used. Setting this to `false` will completely bypass the cache for the current request.
+ * @default true
+ */
+ cache?: boolean;
+
+ /**
+ * If set to `true` once a cached resource has expired it is deleted and will have to be re-requested.
+ *
+ * If set to `false`, after a cached resource's TTL expires it is kept in the cache and will be revalidated
+ * on the next request with `If-None-Match`/`If-Modified-Since` headers.
+ * @default false
+ */
+ strictTtl?: boolean;
+
+ /**
+ * Limits TTL. The `number` represents milliseconds.
+ * @default undefined
+ */
+ maxTtl?: number;
+
+ /**
+ * When set to `true`, if the DB connection fails we will automatically fallback to a network request.
+ * DB errors will still be emitted to notify you of the problem even though the request callback may succeed.
+ * @default false
+ */
+ automaticFailover?: boolean;
+
+ /**
+ * Forces refreshing the cache. If the response could be retrieved from the cache, it will perform a
+ * new request and override the cache instead.
+ * @default false
+ */
+ forceRefresh?: boolean;
+ }
+
+ interface Emitter extends EventEmitter {
+ addListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ addListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ addListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ on(event: 'request', listener: (request: ClientRequest) => void): this;
+ on(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
+ on(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ once(event: 'request', listener: (request: ClientRequest) => void): this;
+ once(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
+ once(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ prependListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ prependListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ prependListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ prependOnceListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ prependOnceListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ prependOnceListener(
+ event: 'error',
+ listener: (error: RequestError | CacheError) => void
+ ): this;
+ removeListener(event: 'request', listener: (request: ClientRequest) => void): this;
+ removeListener(
+ event: 'response',
+ listener: (response: ServerResponse | ResponseLike) => void
+ ): this;
+ removeListener(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ off(event: 'request', listener: (request: ClientRequest) => void): this;
+ off(event: 'response', listener: (response: ServerResponse | ResponseLike) => void): this;
+ off(event: 'error', listener: (error: RequestError | CacheError) => void): this;
+ removeAllListeners(event?: 'request' | 'response' | 'error'): this;
+ listeners(event: 'request'): Array<(request: ClientRequest) => void>;
+ listeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
+ listeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
+ rawListeners(event: 'request'): Array<(request: ClientRequest) => void>;
+ rawListeners(event: 'response'): Array<(response: ServerResponse | ResponseLike) => void>;
+ rawListeners(event: 'error'): Array<(error: RequestError | CacheError) => void>;
+ emit(event: 'request', request: ClientRequest): boolean;
+ emit(event: 'response', response: ServerResponse | ResponseLike): boolean;
+ emit(event: 'error', error: RequestError | CacheError): boolean;
+ eventNames(): Array<'request' | 'response' | 'error'>;
+ listenerCount(type: 'request' | 'response' | 'error'): number;
+ }
+
+ type RequestError = RequestErrorCls;
+ type CacheError = CacheErrorCls;
+}
+
+declare class RequestErrorCls extends Error {
+ readonly name: 'RequestError';
+
+ constructor(error: Error);
+}
+declare class CacheErrorCls extends Error {
+ readonly name: 'CacheError';
+
+ constructor(error: Error);
+}
diff --git a/tests/node_modules/@types/cacheable-request/package.json b/tests/node_modules/@types/cacheable-request/package.json
new file mode 100644
index 0000000..d8b30ec
--- /dev/null
+++ b/tests/node_modules/@types/cacheable-request/package.json
@@ -0,0 +1,62 @@
+{
+ "_from": "@types/cacheable-request@^6.0.1",
+ "_id": "@types/cacheable-request@6.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==",
+ "_location": "/@types/cacheable-request",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@types/cacheable-request@^6.0.1",
+ "name": "@types/cacheable-request",
+ "escapedName": "@types%2fcacheable-request",
+ "scope": "@types",
+ "rawSpec": "^6.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^6.0.1"
+ },
+ "_requiredBy": [
+ "/got"
+ ],
+ "_resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz",
+ "_shasum": "5d22f3dded1fd3a84c0bbeb5039a7419c2c91976",
+ "_spec": "@types/cacheable-request@^6.0.1",
+ "_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/got",
+ "bugs": {
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "BendingBender",
+ "url": "https://github.com/BendingBender"
+ },
+ {
+ "name": "Paul Melnikow",
+ "url": "https://github.com/paulmelnikow"
+ }
+ ],
+ "dependencies": {
+ "@types/http-cache-semantics": "*",
+ "@types/keyv": "*",
+ "@types/node": "*",
+ "@types/responselike": "*"
+ },
+ "deprecated": false,
+ "description": "TypeScript definitions for cacheable-request",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
+ "license": "MIT",
+ "main": "",
+ "name": "@types/cacheable-request",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/cacheable-request"
+ },
+ "scripts": {},
+ "typeScriptVersion": "2.3",
+ "types": "index",
+ "typesPublisherContentHash": "c6afce5b9ca6ee2952549da29e2d4af2bd367dbf44a175a005063192d46b7814",
+ "version": "6.0.1"
+}
diff --git a/tests/node_modules/@types/http-cache-semantics/LICENSE b/tests/node_modules/@types/http-cache-semantics/LICENSE
new file mode 100644
index 0000000..4b1ad51
--- /dev/null
+++ b/tests/node_modules/@types/http-cache-semantics/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/tests/node_modules/@types/http-cache-semantics/README.md b/tests/node_modules/@types/http-cache-semantics/README.md
new file mode 100644
index 0000000..6245fb3
--- /dev/null
+++ b/tests/node_modules/@types/http-cache-semantics/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/http-cache-semantics`
+
+# Summary
+This package contains type definitions for http-cache-semantics ( https://github.com/kornelski/http-cache-semantics#readme ).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-cache-semantics
+
+Additional Details
+ * Last updated: Wed, 30 Jan 2019 18:47:31 GMT
+ * Dependencies: none
+ * Global values: none
+
+# Credits
+These definitions were written by BendingBender .
diff --git a/tests/node_modules/@types/http-cache-semantics/index.d.ts b/tests/node_modules/@types/http-cache-semantics/index.d.ts
new file mode 100644
index 0000000..40545f3
--- /dev/null
+++ b/tests/node_modules/@types/http-cache-semantics/index.d.ts
@@ -0,0 +1,170 @@
+// Type definitions for http-cache-semantics 4.0
+// Project: https://github.com/kornelski/http-cache-semantics#readme
+// Definitions by: BendingBender
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+export = CachePolicy;
+
+declare class CachePolicy {
+ constructor(req: CachePolicy.Request, res: CachePolicy.Response, options?: CachePolicy.Options);
+
+ /**
+ * Returns `true` if the response can be stored in a cache.
+ * If it's `false` then you MUST NOT store either the request or the response.
+ */
+ storable(): boolean;
+
+ /**
+ * This is the most important method. Use this method to check whether the cached response is still fresh
+ * in the context of the new request.
+ *
+ * If it returns `true`, then the given `request` matches the original response this cache policy has been
+ * created with, and the response can be reused without contacting the server. Note that the old response
+ * can't be returned without being updated, see `responseHeaders()`.
+ *
+ * If it returns `false`, then the response may not be matching at all (e.g. it's for a different URL or method),
+ * or may require to be refreshed first (see `revalidationHeaders()`).
+ */
+ satisfiesWithoutRevalidation(newRequest: CachePolicy.Request): boolean;
+
+ /**
+ * Returns updated, filtered set of response headers to return to clients receiving the cached response.
+ * This function is necessary, because proxies MUST always remove hop-by-hop headers (such as `TE` and `Connection`)
+ * and update response's `Age` to avoid doubling cache time.
+ *
+ * @example
+ * cachedResponse.headers = cachePolicy.responseHeaders(cachedResponse);
+ */
+ responseHeaders(): CachePolicy.Headers;
+
+ /**
+ * Returns approximate time in milliseconds until the response becomes stale (i.e. not fresh).
+ *
+ * After that time (when `timeToLive() <= 0`) the response might not be usable without revalidation. However,
+ * there are exceptions, e.g. a client can explicitly allow stale responses, so always check with
+ * `satisfiesWithoutRevalidation()`.
+ */
+ timeToLive(): number;
+
+ /**
+ * Chances are you'll want to store the `CachePolicy` object along with the cached response.
+ * `obj = policy.toObject()` gives a plain JSON-serializable object.
+ */
+ toObject(): CachePolicy.CachePolicyObject;
+
+ /**
+ * `policy = CachePolicy.fromObject(obj)` creates an instance from object created by `toObject()`.
+ */
+ static fromObject(obj: CachePolicy.CachePolicyObject): CachePolicy;
+
+ /**
+ * Returns updated, filtered set of request headers to send to the origin server to check if the cached
+ * response can be reused. These headers allow the origin server to return status 304 indicating the
+ * response is still fresh. All headers unrelated to caching are passed through as-is.
+ *
+ * Use this method when updating cache from the origin server.
+ *
+ * @example
+ * updateRequest.headers = cachePolicy.revalidationHeaders(updateRequest);
+ */
+ revalidationHeaders(newRequest: CachePolicy.Request): CachePolicy.Headers;
+
+ /**
+ * Use this method to update the cache after receiving a new response from the origin server.
+ */
+ revalidatedPolicy(
+ revalidationRequest: CachePolicy.Request,
+ revalidationResponse: CachePolicy.Response
+ ): CachePolicy.RevalidationPolicy;
+}
+
+declare namespace CachePolicy {
+ interface Request {
+ url?: string;
+ method?: string;
+ headers: Headers;
+ }
+
+ interface Response {
+ status?: number;
+ headers: Headers;
+ }
+
+ interface Options {
+ /**
+ * If `true`, then the response is evaluated from a perspective of a shared cache (i.e. `private` is not
+ * cacheable and `s-maxage` is respected). If `false`, then the response is evaluated from a perspective
+ * of a single-user cache (i.e. `private` is cacheable and `s-maxage` is ignored).
+ * `true` is recommended for HTTP clients.
+ * @default true
+ */
+ shared?: boolean;
+ /**
+ * A fraction of response's age that is used as a fallback cache duration. The default is 0.1 (10%),
+ * e.g. if a file hasn't been modified for 100 days, it'll be cached for 100*0.1 = 10 days.
+ * @default 0.1
+ */
+ cacheHeuristic?: number;
+ /**
+ * A number of milliseconds to assume as the default time to cache responses with `Cache-Control: immutable`.
+ * Note that [per RFC](https://httpwg.org/specs/rfc8246.html#the-immutable-cache-control-extension)
+ * these can become stale, so `max-age` still overrides the default.
+ * @default 24*3600*1000 (24h)
+ */
+ immutableMinTimeToLive?: number;
+ /**
+ * If `true`, common anti-cache directives will be completely ignored if the non-standard `pre-check`
+ * and `post-check` directives are present. These two useless directives are most commonly found
+ * in bad StackOverflow answers and PHP's "session limiter" defaults.
+ * @default false
+ */
+ ignoreCargoCult?: boolean;
+ /**
+ * If `false`, then server's `Date` header won't be used as the base for `max-age`. This is against the RFC,
+ * but it's useful if you want to cache responses with very short `max-age`, but your local clock
+ * is not exactly in sync with the server's.
+ * @default true
+ */
+ trustServerDate?: boolean;
+ }
+
+ interface CachePolicyObject {
+ v: number;
+ t: number;
+ sh: boolean;
+ ch: number;
+ imm: number;
+ st: number;
+ resh: Headers;
+ rescc: { [key: string]: string };
+ m: string;
+ u?: string;
+ h?: string;
+ a: boolean;
+ reqh: Headers | null;
+ reqcc: { [key: string]: string };
+ }
+
+ interface Headers {
+ [header: string]: string | string[] | undefined;
+ }
+
+ interface RevalidationPolicy {
+ /**
+ * A new `CachePolicy` with HTTP headers updated from `revalidationResponse`. You can always replace
+ * the old cached `CachePolicy` with the new one.
+ */
+ policy: CachePolicy;
+ /**
+ * Boolean indicating whether the response body has changed.
+ *
+ * - If `false`, then a valid 304 Not Modified response has been received, and you can reuse the old
+ * cached response body.
+ * - If `true`, you should use new response's body (if present), or make another request to the origin
+ * server without any conditional headers (i.e. don't use `revalidationHeaders()` this time) to get
+ * the new resource.
+ */
+ modified: boolean;
+ matches: boolean;
+ }
+}
diff --git a/tests/node_modules/@types/http-cache-semantics/package.json b/tests/node_modules/@types/http-cache-semantics/package.json
new file mode 100644
index 0000000..96450fa
--- /dev/null
+++ b/tests/node_modules/@types/http-cache-semantics/package.json
@@ -0,0 +1,52 @@
+{
+ "_from": "@types/http-cache-semantics@*",
+ "_id": "@types/http-cache-semantics@4.0.0",
+ "_inBundle": false,
+ "_integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A==",
+ "_location": "/@types/http-cache-semantics",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@types/http-cache-semantics@*",
+ "name": "@types/http-cache-semantics",
+ "escapedName": "@types%2fhttp-cache-semantics",
+ "scope": "@types",
+ "rawSpec": "*",
+ "saveSpec": null,
+ "fetchSpec": "*"
+ },
+ "_requiredBy": [
+ "/@types/cacheable-request"
+ ],
+ "_resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz",
+ "_shasum": "9140779736aa2655635ee756e2467d787cfe8a2a",
+ "_spec": "@types/http-cache-semantics@*",
+ "_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/@types/cacheable-request",
+ "bugs": {
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "BendingBender",
+ "url": "https://github.com/BendingBender"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "TypeScript definitions for http-cache-semantics",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
+ "license": "MIT",
+ "main": "",
+ "name": "@types/http-cache-semantics",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
+ },
+ "scripts": {},
+ "typeScriptVersion": "2.0",
+ "types": "index",
+ "typesPublisherContentHash": "0f2f0f2e4444736e9747a8b7b3cd04c9064067e0181263cfb85337511ae13a35",
+ "version": "4.0.0"
+}
diff --git a/tests/node_modules/@types/keyv/LICENSE b/tests/node_modules/@types/keyv/LICENSE
new file mode 100644
index 0000000..4b1ad51
--- /dev/null
+++ b/tests/node_modules/@types/keyv/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/tests/node_modules/@types/keyv/README.md b/tests/node_modules/@types/keyv/README.md
new file mode 100644
index 0000000..681af21
--- /dev/null
+++ b/tests/node_modules/@types/keyv/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/keyv`
+
+# Summary
+This package contains type definitions for keyv (https://github.com/lukechilds/keyv).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keyv.
+
+### Additional Details
+ * Last updated: Mon, 23 Dec 2019 16:40:54 GMT
+ * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
+ * Global values: none
+
+# Credits
+These definitions were written by AryloYeung (https://github.com/Arylo), and BendingBender (https://github.com/BendingBender).
diff --git a/tests/node_modules/@types/keyv/index.d.ts b/tests/node_modules/@types/keyv/index.d.ts
new file mode 100644
index 0000000..d95745b
--- /dev/null
+++ b/tests/node_modules/@types/keyv/index.d.ts
@@ -0,0 +1,70 @@
+// Type definitions for keyv 3.1
+// Project: https://github.com/lukechilds/keyv
+// Definitions by: AryloYeung
+// BendingBender
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.8
+
+///
+import { EventEmitter } from 'events';
+
+declare class Keyv extends EventEmitter {
+ /**
+ * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
+ */
+ constructor(opts?: Keyv.Options);
+ /**
+ * @param uri The connection string URI.
+ *
+ * Merged into the options object as options.uri.
+ * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
+ */
+ constructor(uri?: string, opts?: Keyv.Options);
+
+ /** Returns the value. */
+ get(key: string): Promise;
+ /**
+ * Set a value.
+ *
+ * By default keys are persistent. You can set an expiry TTL in milliseconds.
+ */
+ set(key: string, value: TValue, ttl?: number): Promise;
+ /**
+ * Deletes an entry.
+ *
+ * Returns `true` if the key existed, `false` if not.
+ */
+ delete(key: string): Promise;
+ /** Delete all entries in the current namespace. */
+ clear(): Promise;
+}
+
+declare namespace Keyv {
+ interface Options {
+ /** Namespace for the current instance. */
+ namespace?: string;
+ /** A custom serialization function. */
+ serialize?: (data: TValue) => string;
+ /** A custom deserialization function. */
+ deserialize?: (data: string) => TValue;
+ /** The connection string URI. */
+ uri?: string;
+ /** The storage adapter instance to be used by Keyv. */
+ store?: Store;
+ /** Default TTL. Can be overridden by specififying a TTL on `.set()`. */
+ ttl?: number;
+ /** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */
+ adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql';
+
+ [key: string]: any;
+ }
+
+ interface Store {
+ get(key: string): TValue | Promise | undefined;
+ set(key: string, value: TValue, ttl?: number): any;
+ delete(key: string): boolean | Promise;
+ clear(): void | Promise;
+ }
+}
+
+export = Keyv;
diff --git a/tests/node_modules/@types/keyv/package.json b/tests/node_modules/@types/keyv/package.json
new file mode 100644
index 0000000..0122b98
--- /dev/null
+++ b/tests/node_modules/@types/keyv/package.json
@@ -0,0 +1,59 @@
+{
+ "_from": "@types/keyv@*",
+ "_id": "@types/keyv@3.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==",
+ "_location": "/@types/keyv",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "@types/keyv@*",
+ "name": "@types/keyv",
+ "escapedName": "@types%2fkeyv",
+ "scope": "@types",
+ "rawSpec": "*",
+ "saveSpec": null,
+ "fetchSpec": "*"
+ },
+ "_requiredBy": [
+ "/@types/cacheable-request"
+ ],
+ "_resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz",
+ "_shasum": "e45a45324fca9dab716ab1230ee249c9fb52cfa7",
+ "_spec": "@types/keyv@*",
+ "_where": "/home/lilleman/go/src/gitlab.larvit.se/power-plan/auth/tests/node_modules/@types/cacheable-request",
+ "bugs": {
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "AryloYeung",
+ "url": "https://github.com/Arylo"
+ },
+ {
+ "name": "BendingBender",
+ "url": "https://github.com/BendingBender"
+ }
+ ],
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "deprecated": false,
+ "description": "TypeScript definitions for keyv",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
+ "license": "MIT",
+ "main": "",
+ "name": "@types/keyv",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+ "directory": "types/keyv"
+ },
+ "scripts": {},
+ "typeScriptVersion": "2.8",
+ "types": "index.d.ts",
+ "typesPublisherContentHash": "883f9e92997b7991324e37284aa16e71d6f43731110ec0e7f62ccca68960aec3",
+ "version": "3.1.1"
+}
diff --git a/tests/node_modules/@types/node/LICENSE b/tests/node_modules/@types/node/LICENSE
new file mode 100755
index 0000000..9e841e7
--- /dev/null
+++ b/tests/node_modules/@types/node/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/tests/node_modules/@types/node/README.md b/tests/node_modules/@types/node/README.md
new file mode 100755
index 0000000..e272818
--- /dev/null
+++ b/tests/node_modules/@types/node/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/node`
+
+# Summary
+This package contains type definitions for Node.js (http://nodejs.org/).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
+
+### Additional Details
+ * Last updated: Fri, 18 Jun 2021 21:01:11 GMT
+ * Dependencies: none
+ * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
+
+# Credits
+These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), and [Yongsheng Zhang](https://github.com/ZYSzys).
diff --git a/tests/node_modules/@types/node/assert.d.ts b/tests/node_modules/@types/node/assert.d.ts
new file mode 100755
index 0000000..e9e3585
--- /dev/null
+++ b/tests/node_modules/@types/node/assert.d.ts
@@ -0,0 +1,124 @@
+declare module 'assert' {
+ /** An alias of `assert.ok()`. */
+ function assert(value: any, message?: string | Error): asserts value;
+ namespace assert {
+ class AssertionError extends Error {
+ actual: any;
+ expected: any;
+ operator: string;
+ generatedMessage: boolean;
+ code: 'ERR_ASSERTION';
+
+ constructor(options?: {
+ /** If provided, the error message is set to this value. */
+ message?: string;
+ /** The `actual` property on the error instance. */
+ actual?: any;
+ /** The `expected` property on the error instance. */
+ expected?: any;
+ /** The `operator` property on the error instance. */
+ operator?: string;
+ /** If provided, the generated stack trace omits frames before this function. */
+ // tslint:disable-next-line:ban-types
+ stackStartFn?: Function;
+ });
+ }
+
+ class CallTracker {
+ calls(exact?: number): () => void;
+ calls any>(fn?: Func, exact?: number): Func;
+ report(): CallTrackerReportInformation[];
+ verify(): void;
+ }
+ interface CallTrackerReportInformation {
+ message: string;
+ /** The actual number of times the function was called. */
+ actual: number;
+ /** The number of times the function was expected to be called. */
+ expected: number;
+ /** The name of the function that is wrapped. */
+ operator: string;
+ /** A stack trace of the function. */
+ stack: object;
+ }
+
+ type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
+
+ function fail(message?: string | Error): never;
+ /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
+ function fail(
+ actual: any,
+ expected: any,
+ message?: string | Error,
+ operator?: string,
+ // tslint:disable-next-line:ban-types
+ stackStartFn?: Function,
+ ): never;
+ function ok(value: any, message?: string | Error): asserts value;
+ /** @deprecated since v9.9.0 - use strictEqual() instead. */
+ function equal(actual: any, expected: any, message?: string | Error): void;
+ /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
+ function notEqual(actual: any, expected: any, message?: string | Error): void;
+ /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
+ function deepEqual(actual: any, expected: any, message?: string | Error): void;
+ /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
+ function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
+ function strictEqual(actual: any, expected: T, message?: string | Error): asserts actual is T;
+ function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
+ function deepStrictEqual(actual: any, expected: T, message?: string | Error): asserts actual is T;
+ function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
+
+ function throws(block: () => any, message?: string | Error): void;
+ function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
+ function doesNotThrow(block: () => any, message?: string | Error): void;
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
+
+ function ifError(value: any): asserts value is null | undefined;
+
+ function rejects(block: (() => Promise) | Promise, message?: string | Error): Promise;
+ function rejects(
+ block: (() => Promise) | Promise,
+ error: AssertPredicate,
+ message?: string | Error,
+ ): Promise;
+ function doesNotReject(block: (() => Promise) | Promise, message?: string | Error): Promise;
+ function doesNotReject(
+ block: (() => Promise) | Promise,
+ error: AssertPredicate,
+ message?: string | Error,
+ ): Promise;
+
+ function match(value: string, regExp: RegExp, message?: string | Error): void;
+ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
+
+ const strict: Omit<
+ typeof assert,
+ | 'equal'
+ | 'notEqual'
+ | 'deepEqual'
+ | 'notDeepEqual'
+ | 'ok'
+ | 'strictEqual'
+ | 'deepStrictEqual'
+ | 'ifError'
+ | 'strict'
+ > & {
+ (value: any, message?: string | Error): asserts value;
+ equal: typeof strictEqual;
+ notEqual: typeof notStrictEqual;
+ deepEqual: typeof deepStrictEqual;
+ notDeepEqual: typeof notDeepStrictEqual;
+
+ // Mapped types and assertion functions are incompatible?
+ // TS2775: Assertions require every name in the call target
+ // to be declared with an explicit type annotation.
+ ok: typeof ok;
+ strictEqual: typeof strictEqual;
+ deepStrictEqual: typeof deepStrictEqual;
+ ifError: typeof ifError;
+ strict: typeof strict;
+ };
+ }
+
+ export = assert;
+}
diff --git a/tests/node_modules/@types/node/assert/strict.d.ts b/tests/node_modules/@types/node/assert/strict.d.ts
new file mode 100755
index 0000000..bc3b2a7
--- /dev/null
+++ b/tests/node_modules/@types/node/assert/strict.d.ts
@@ -0,0 +1,4 @@
+declare module 'assert/strict' {
+ import { strict } from 'assert';
+ export = strict;
+}
diff --git a/tests/node_modules/@types/node/async_hooks.d.ts b/tests/node_modules/@types/node/async_hooks.d.ts
new file mode 100755
index 0000000..92cc9ad
--- /dev/null
+++ b/tests/node_modules/@types/node/async_hooks.d.ts
@@ -0,0 +1,226 @@
+/**
+ * Async Hooks module: https://nodejs.org/api/async_hooks.html
+ */
+declare module 'async_hooks' {
+ /**
+ * Returns the asyncId of the current execution context.
+ */
+ function executionAsyncId(): number;
+
+ /**
+ * The resource representing the current execution.
+ * Useful to store data within the resource.
+ *
+ * Resource objects returned by `executionAsyncResource()` are most often internal
+ * Node.js handle objects with undocumented APIs. Using any functions or properties
+ * on the object is likely to crash your application and should be avoided.
+ *
+ * Using `executionAsyncResource()` in the top-level execution context will
+ * return an empty object as there is no handle or request object to use,
+ * but having an object representing the top-level can be helpful.
+ */
+ function executionAsyncResource(): object;
+
+ /**
+ * Returns the ID of the resource responsible for calling the callback that is currently being executed.
+ */
+ function triggerAsyncId(): number;
+
+ interface HookCallbacks {
+ /**
+ * Called when a class is constructed that has the possibility to emit an asynchronous event.
+ * @param asyncId a unique ID for the async resource
+ * @param type the type of the async resource
+ * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
+ * @param resource reference to the resource representing the async operation, needs to be released during destroy
+ */
+ init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
+
+ /**
+ * When an asynchronous operation is initiated or completes a callback is called to notify the user.
+ * The before callback is called just before said callback is executed.
+ * @param asyncId the unique identifier assigned to the resource about to execute the callback.
+ */
+ before?(asyncId: number): void;
+
+ /**
+ * Called immediately after the callback specified in before is completed.
+ * @param asyncId the unique identifier assigned to the resource which has executed the callback.
+ */
+ after?(asyncId: number): void;
+
+ /**
+ * Called when a promise has resolve() called. This may not be in the same execution id
+ * as the promise itself.
+ * @param asyncId the unique id for the promise that was resolve()d.
+ */
+ promiseResolve?(asyncId: number): void;
+
+ /**
+ * Called after the resource corresponding to asyncId is destroyed
+ * @param asyncId a unique ID for the async resource
+ */
+ destroy?(asyncId: number): void;
+ }
+
+ interface AsyncHook {
+ /**
+ * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
+ */
+ enable(): this;
+
+ /**
+ * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
+ */
+ disable(): this;
+ }
+
+ /**
+ * Registers functions to be called for different lifetime events of each async operation.
+ * @param options the callbacks to register
+ * @return an AsyncHooks instance used for disabling and enabling hooks
+ */
+ function createHook(options: HookCallbacks): AsyncHook;
+
+ interface AsyncResourceOptions {
+ /**
+ * The ID of the execution context that created this async event.
+ * @default executionAsyncId()
+ */
+ triggerAsyncId?: number;
+
+ /**
+ * Disables automatic `emitDestroy` when the object is garbage collected.
+ * This usually does not need to be set (even if `emitDestroy` is called
+ * manually), unless the resource's `asyncId` is retrieved and the
+ * sensitive API's `emitDestroy` is called with it.
+ * @default false
+ */
+ requireManualDestroy?: boolean;
+ }
+
+ /**
+ * The class AsyncResource was designed to be extended by the embedder's async resources.
+ * Using this users can easily trigger the lifetime events of their own resources.
+ */
+ class AsyncResource {
+ /**
+ * AsyncResource() is meant to be extended. Instantiating a
+ * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+ * async_hook.executionAsyncId() is used.
+ * @param type The type of async event.
+ * @param triggerAsyncId The ID of the execution context that created
+ * this async event (default: `executionAsyncId()`), or an
+ * AsyncResourceOptions object (since 9.3)
+ */
+ constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
+
+ /**
+ * Binds the given function to the current execution context.
+ * @param fn The function to bind to the current execution context.
+ * @param type An optional name to associate with the underlying `AsyncResource`.
+ */
+ static bind any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
+
+ /**
+ * Binds the given function to execute to this `AsyncResource`'s scope.
+ * @param fn The function to bind to the current `AsyncResource`.
+ */
+ bind any>(fn: Func): Func & { asyncResource: AsyncResource };
+
+ /**
+ * Call the provided function with the provided arguments in the
+ * execution context of the async resource. This will establish the
+ * context, trigger the AsyncHooks before callbacks, call the function,
+ * trigger the AsyncHooks after callbacks, and then restore the original
+ * execution context.
+ * @param fn The function to call in the execution context of this
+ * async resource.
+ * @param thisArg The receiver to be used for the function call.
+ * @param args Optional arguments to pass to the function.
+ */
+ runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
+
+ /**
+ * Call AsyncHooks destroy callbacks.
+ */
+ emitDestroy(): this;
+
+ /**
+ * @return the unique ID assigned to this AsyncResource instance.
+ */
+ asyncId(): number;
+
+ /**
+ * @return the trigger ID for this AsyncResource instance.
+ */
+ triggerAsyncId(): number;
+ }
+
+ /**
+ * When having multiple instances of `AsyncLocalStorage`, they are independent
+ * from each other. It is safe to instantiate this class multiple times.
+ */
+ class AsyncLocalStorage {
+ /**
+ * This method disables the instance of `AsyncLocalStorage`. All subsequent calls
+ * to `asyncLocalStorage.getStore()` will return `undefined` until
+ * `asyncLocalStorage.run()` is called again.
+ *
+ * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
+ * instance will be exited.
+ *
+ * Calling `asyncLocalStorage.disable()` is required before the
+ * `asyncLocalStorage` can be garbage collected. This does not apply to stores
+ * provided by the `asyncLocalStorage`, as those objects are garbage collected
+ * along with the corresponding async resources.
+ *
+ * This method is to be used when the `asyncLocalStorage` is not in use anymore
+ * in the current process.
+ */
+ disable(): void;
+
+ /**
+ * This method returns the current store. If this method is called outside of an
+ * asynchronous context initialized by calling `asyncLocalStorage.run`, it will
+ * return `undefined`.
+ */
+ getStore(): T | undefined;
+
+ /**
+ * This methods runs a function synchronously within a context and return its
+ * return value. The store is not accessible outside of the callback function or
+ * the asynchronous operations created within the callback.
+ *
+ * Optionally, arguments can be passed to the function. They will be passed to the
+ * callback function.
+ *
+ * I the callback function throws an error, it will be thrown by `run` too. The
+ * stacktrace will not be impacted by this call and the context will be exited.
+ */
+ // TODO: Apply generic vararg once available
+ run(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
+
+ /**
+ * This methods runs a function synchronously outside of a context and return its
+ * return value. The store is not accessible within the callback function or the
+ * asynchronous operations created within the callback.
+ *
+ * Optionally, arguments can be passed to the function. They will be passed to the
+ * callback function.
+ *
+ * If the callback function throws an error, it will be thrown by `exit` too. The
+ * stacktrace will not be impacted by this call and the context will be
+ * re-entered.
+ */
+ // TODO: Apply generic vararg once available
+ exit(callback: (...args: any[]) => R, ...args: any[]): R;
+
+ /**
+ * Calling `asyncLocalStorage.enterWith(store)` will transition into the context
+ * for the remainder of the current synchronous execution and will persist
+ * through any following asynchronous calls.
+ */
+ enterWith(store: T): void;
+ }
+}
diff --git a/tests/node_modules/@types/node/base.d.ts b/tests/node_modules/@types/node/base.d.ts
new file mode 100755
index 0000000..fa67179
--- /dev/null
+++ b/tests/node_modules/@types/node/base.d.ts
@@ -0,0 +1,19 @@
+// NOTE: These definitions support NodeJS and TypeScript 3.7.
+
+// NOTE: TypeScript version-specific augmentations can be found in the following paths:
+// - ~/base.d.ts - Shared definitions common to all TypeScript versions
+// - ~/index.d.ts - Definitions specific to TypeScript 2.1
+// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
+// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
+
+// Reference required types from the default lib:
+///
+///
+///
+///
+
+// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
+///
+
+// TypeScript 3.7-specific augmentations:
+///
diff --git a/tests/node_modules/@types/node/buffer.d.ts b/tests/node_modules/@types/node/buffer.d.ts
new file mode 100755
index 0000000..a415a4d
--- /dev/null
+++ b/tests/node_modules/@types/node/buffer.d.ts
@@ -0,0 +1,84 @@
+declare module 'buffer' {
+ import { BinaryLike } from 'crypto';
+
+ export const INSPECT_MAX_BYTES: number;
+ export const kMaxLength: number;
+ export const kStringMaxLength: number;
+ export const constants: {
+ MAX_LENGTH: number;
+ MAX_STRING_LENGTH: number;
+ };
+ const BuffType: typeof Buffer;
+
+ export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
+
+ export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
+
+ export const SlowBuffer: {
+ /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
+ new(size: number): Buffer;
+ prototype: Buffer;
+ };
+
+ export { BuffType as Buffer };
+
+ /**
+ * @experimental
+ */
+ export interface BlobOptions {
+ /**
+ * @default 'utf8'
+ */
+ encoding?: BufferEncoding;
+
+ /**
+ * The Blob content-type. The intent is for `type` to convey
+ * the MIME media type of the data, however no validation of the type format
+ * is performed.
+ */
+ type?: string;
+ }
+
+ /**
+ * @experimental
+ */
+ export class Blob {
+ /**
+ * Returns a promise that fulfills with an {ArrayBuffer} containing a copy of the `Blob` data.
+ */
+ readonly size: number;
+
+ /**
+ * The content-type of the `Blob`.
+ */
+ readonly type: string;
+
+ /**
+ * Creates a new `Blob` object containing a concatenation of the given sources.
+ *
+ * {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into
+ * the 'Blob' and can therefore be safely modified after the 'Blob' is created.
+ *
+ * String sources are also copied into the `Blob`.
+ */
+ constructor(sources: Array<(BinaryLike | Blob)>, options?: BlobOptions);
+
+ arrayBuffer(): Promise;
+
+ /**
+ * @param start The starting index.
+ * @param end The ending index.
+ * @param type The content-type for the new `Blob`
+ */
+ slice(start?: number, end?: number, type?: string): Blob;
+
+ /**
+ * Returns a promise that resolves the contents of the `Blob` decoded as a UTF-8 string.
+ */
+ text(): Promise;
+ }
+}
+
+declare module 'node:buffer' {
+ export * from 'buffer';
+}
diff --git a/tests/node_modules/@types/node/child_process.d.ts b/tests/node_modules/@types/node/child_process.d.ts
new file mode 100755
index 0000000..37fd485
--- /dev/null
+++ b/tests/node_modules/@types/node/child_process.d.ts
@@ -0,0 +1,526 @@
+declare module 'child_process' {
+ import { BaseEncodingOptions } from 'fs';
+ import { EventEmitter, Abortable } from 'events';
+ import * as net from 'net';
+ import { Writable, Readable, Stream, Pipe } from 'stream';
+
+ type Serializable = string | object | number | boolean | bigint;
+ type SendHandle = net.Socket | net.Server;
+
+ interface ChildProcess extends EventEmitter {
+ stdin: Writable | null;
+ stdout: Readable | null;
+ stderr: Readable | null;
+ readonly channel?: Pipe | null;
+ readonly stdio: [
+ Writable | null, // stdin
+ Readable | null, // stdout
+ Readable | null, // stderr
+ Readable | Writable | null | undefined, // extra
+ Readable | Writable | null | undefined // extra
+ ];
+ readonly killed: boolean;
+ readonly pid?: number;
+ readonly connected: boolean;
+ readonly exitCode: number | null;
+ readonly signalCode: NodeJS.Signals | null;
+ readonly spawnargs: string[];
+ readonly spawnfile: string;
+ kill(signal?: NodeJS.Signals | number): boolean;
+ send(message: Serializable, callback?: (error: Error | null) => void): boolean;
+ send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
+ send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
+ disconnect(): void;
+ unref(): void;
+ ref(): void;
+
+ /**
+ * events.EventEmitter
+ * 1. close
+ * 2. disconnect
+ * 3. error
+ * 4. exit
+ * 5. message
+ * 6. spawn
+ */
+
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (err: Error) => void): this;
+ addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ addListener(event: "spawn", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", err: Error): boolean;
+ emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
+ emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
+ emit(event: "spawn", listener: () => void): boolean;
+
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (err: Error) => void): this;
+ on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ on(event: "spawn", listener: () => void): this;
+
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (err: Error) => void): this;
+ once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ once(event: "spawn", listener: () => void): this;
+
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (err: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependListener(event: "spawn", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+ prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+ prependOnceListener(event: "spawn", listener: () => void): this;
+ }
+
+ // return this object when stdio option is undefined or not specified
+ interface ChildProcessWithoutNullStreams extends ChildProcess {
+ stdin: Writable;
+ stdout: Readable;
+ stderr: Readable;
+ readonly stdio: [
+ Writable, // stdin
+ Readable, // stdout
+ Readable, // stderr
+ Readable | Writable | null | undefined, // extra, no modification
+ Readable | Writable | null | undefined // extra, no modification
+ ];
+ }
+
+ // return this object when stdio option is a tuple of 3
+ interface ChildProcessByStdio<
+ I extends null | Writable,
+ O extends null | Readable,
+ E extends null | Readable,
+ > extends ChildProcess {
+ stdin: I;
+ stdout: O;
+ stderr: E;
+ readonly stdio: [
+ I,
+ O,
+ E,
+ Readable | Writable | null | undefined, // extra, no modification
+ Readable | Writable | null | undefined // extra, no modification
+ ];
+ }
+
+ interface MessageOptions {
+ keepOpen?: boolean;
+ }
+
+ type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
+
+ type StdioOptions = IOType | Array<(IOType | "ipc" | Stream | number | null | undefined)>;
+
+ type SerializationType = 'json' | 'advanced';
+
+ interface MessagingOptions extends Abortable {
+ /**
+ * Specify the kind of serialization used for sending messages between processes.
+ * @default 'json'
+ */
+ serialization?: SerializationType;
+
+ /**
+ * The signal value to be used when the spawned process will be killed by the abort signal.
+ * @default 'SIGTERM'
+ */
+ killSignal?: NodeJS.Signals | number;
+ }
+
+ interface ProcessEnvOptions {
+ uid?: number;
+ gid?: number;
+ cwd?: string;
+ env?: NodeJS.ProcessEnv;
+ }
+
+ interface CommonOptions extends ProcessEnvOptions {
+ /**
+ * @default true
+ */
+ windowsHide?: boolean;
+ /**
+ * @default 0
+ */
+ timeout?: number;
+ }
+
+ interface CommonSpawnOptions extends CommonOptions, MessagingOptions, Abortable {
+ argv0?: string;
+ stdio?: StdioOptions;
+ shell?: boolean | string;
+ windowsVerbatimArguments?: boolean;
+ }
+
+ interface SpawnOptions extends CommonSpawnOptions {
+ detached?: boolean;
+ }
+
+ interface SpawnOptionsWithoutStdio extends SpawnOptions {
+ stdio?: StdioPipeNamed | StdioPipe[];
+ }
+
+ type StdioNull = 'inherit' | 'ignore' | Stream;
+ type StdioPipeNamed = 'pipe' | 'overlapped';
+ type StdioPipe = undefined | null | StdioPipeNamed;
+
+ interface SpawnOptionsWithStdioTuple<
+ Stdin extends StdioNull | StdioPipe,
+ Stdout extends StdioNull | StdioPipe,
+ Stderr extends StdioNull | StdioPipe,
+ > extends SpawnOptions {
+ stdio: [Stdin, Stdout, Stderr];
+ }
+
+ // overloads of spawn without 'args'
+ function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+
+ function spawn(command: string, options: SpawnOptions): ChildProcess;
+
+ // overloads of spawn with 'args'
+ function spawn(command: string, args?: ReadonlyArray, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+ function spawn(
+ command: string,
+ args: ReadonlyArray,
+ options: SpawnOptionsWithStdioTuple,
+ ): ChildProcessByStdio;
+
+ function spawn(command: string, args: ReadonlyArray, options: SpawnOptions): ChildProcess;
+
+ interface ExecOptions extends CommonOptions {
+ shell?: string;
+ maxBuffer?: number;
+ killSignal?: NodeJS.Signals | number;
+ }
+
+ interface ExecOptionsWithStringEncoding extends ExecOptions {
+ encoding: BufferEncoding;
+ }
+
+ interface ExecOptionsWithBufferEncoding extends ExecOptions {
+ encoding: BufferEncoding | null; // specify `null`.
+ }
+
+ interface ExecException extends Error {
+ cmd?: string;
+ killed?: boolean;
+ code?: number;
+ signal?: NodeJS.Signals;
+ }
+
+ // no `options` definitely means stdout/stderr are `string`.
+ function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+ function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+ function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+ function exec(
+ command: string,
+ options: { encoding: BufferEncoding } & ExecOptions,
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
+ function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
+ function exec(
+ command: string,
+ options: (BaseEncodingOptions & ExecOptions) | undefined | null,
+ callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+
+ interface PromiseWithChild extends Promise {
+ child: ChildProcess;
+ }
+
+ // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+ namespace exec {
+ function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
+ function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(command: string, options?: (BaseEncodingOptions & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+ }
+
+ interface ExecFileOptions extends CommonOptions, Abortable {
+ maxBuffer?: number;
+ killSignal?: NodeJS.Signals | number;
+ windowsVerbatimArguments?: boolean;
+ shell?: boolean | string;
+ signal?: AbortSignal;
+ }
+ interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
+ encoding: 'buffer' | null;
+ }
+ interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
+ encoding: BufferEncoding;
+ }
+ type ExecFileException = ExecException & NodeJS.ErrnoException;
+
+ function execFile(file: string): ChildProcess;
+ function execFile(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
+ function execFile(file: string, args?: ReadonlyArray | null): ChildProcess;
+ function execFile(file: string, args: ReadonlyArray | undefined | null, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): ChildProcess;
+
+ // no `options` definitely means stdout/stderr are `string`.
+ function execFile(file: string, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
+ function execFile(file: string, args: ReadonlyArray | undefined | null, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+ // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+ function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+ function execFile(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: ExecFileOptionsWithBufferEncoding,
+ callback: (error: ExecFileException | null, stdout: Buffer, stderr: Buffer) => void,
+ ): ChildProcess;
+
+ // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+ function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
+ function execFile(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: ExecFileOptionsWithStringEncoding,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void,
+ ): ChildProcess;
+
+ // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+ // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+ function execFile(
+ file: string,
+ options: ExecFileOptionsWithOtherEncoding,
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: ExecFileOptionsWithOtherEncoding,
+ callback: (error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+ ): ChildProcess;
+
+ // `options` without an `encoding` means stdout/stderr are definitely `string`.
+ function execFile(file: string, options: ExecFileOptions, callback: (error: ExecFileException | null, stdout: string, stderr: string) => void): ChildProcess;
+ function execFile(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: ExecFileOptions,
+ callback: (error: ExecFileException | null, stdout: string, stderr: string) => void
+ ): ChildProcess;
+
+ // fallback if nothing else matches. Worst case is always `string | Buffer`.
+ function execFile(
+ file: string,
+ options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
+ callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
+ ): ChildProcess;
+ function execFile(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
+ callback: ((error: ExecFileException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
+ ): ChildProcess;
+
+ // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+ namespace execFile {
+ function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(file: string, args: ReadonlyArray | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
+ function __promisify__(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
+ function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+ function __promisify__(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: ExecFileOptionsWithOtherEncoding,
+ ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+ function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(file: string, args: ReadonlyArray | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+ function __promisify__(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+ function __promisify__(
+ file: string,
+ args: ReadonlyArray | undefined | null,
+ options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
+ ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+ }
+
+ interface ForkOptions extends ProcessEnvOptions, MessagingOptions, Abortable {
+ execPath?: string;
+ execArgv?: string[];
+ silent?: boolean;
+ stdio?: StdioOptions;
+ detached?: boolean;
+ windowsVerbatimArguments?: boolean;
+ }
+ function fork(modulePath: string, options?: ForkOptions): ChildProcess;
+ function fork(modulePath: string, args?: ReadonlyArray, options?: ForkOptions): ChildProcess;
+
+ interface SpawnSyncOptions extends CommonSpawnOptions {
+ input?: string | NodeJS.ArrayBufferView;
+ maxBuffer?: number;
+ encoding?: BufferEncoding | 'buffer' | null;
+ }
+ interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
+ encoding?: 'buffer' | null;
+ }
+ interface SpawnSyncReturns {
+ pid: number;
+ output: string[];
+ stdout: T;
+ stderr: T;
+ status: number | null;
+ signal: NodeJS.Signals | null;
+ error?: Error;
+ }
+ function spawnSync(command: string): SpawnSyncReturns;
+ function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns;
+ function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns;
+ function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns;
+ function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns;
+ function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns;
+ function spawnSync(command: string, args?: ReadonlyArray, options?: SpawnSyncOptions): SpawnSyncReturns;
+
+ interface ExecSyncOptions extends CommonOptions {
+ input?: string | Uint8Array;
+ stdio?: StdioOptions;
+ shell?: string;
+ killSignal?: NodeJS.Signals | number;
+ maxBuffer?: number;
+ encoding?: BufferEncoding | 'buffer' | null;
+ }
+ interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
+ encoding?: 'buffer' | null;
+ }
+ function execSync(command: string): Buffer;
+ function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
+ function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
+ function execSync(command: string, options?: ExecSyncOptions): Buffer;
+
+ interface ExecFileSyncOptions extends CommonOptions {
+ input?: string | NodeJS.ArrayBufferView;
+ stdio?: StdioOptions;
+ killSignal?: NodeJS.Signals | number;
+ maxBuffer?: number;
+ encoding?: BufferEncoding;
+ shell?: boolean | string;
+ }
+ interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
+ encoding: BufferEncoding;
+ }
+ interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
+ encoding: BufferEncoding; // specify `null`.
+ }
+ function execFileSync(command: string): Buffer;
+ function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
+ function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+ function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
+ function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithStringEncoding): string;
+ function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+ function execFileSync(command: string, args?: ReadonlyArray, options?: ExecFileSyncOptions): Buffer;
+}
diff --git a/tests/node_modules/@types/node/cluster.d.ts b/tests/node_modules/@types/node/cluster.d.ts
new file mode 100755
index 0000000..5117639
--- /dev/null
+++ b/tests/node_modules/@types/node/cluster.d.ts
@@ -0,0 +1,262 @@
+declare module 'cluster' {
+ import * as child from 'child_process';
+ import EventEmitter = require('events');
+ import * as net from 'net';
+
+ // interfaces
+ interface ClusterSettings {
+ execArgv?: string[]; // default: process.execArgv
+ exec?: string;
+ args?: string[];
+ silent?: boolean;
+ stdio?: any[];
+ uid?: number;
+ gid?: number;
+ inspectPort?: number | (() => number);
+ }
+
+ interface Address {
+ address: string;
+ port: number;
+ addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
+ }
+
+ class Worker extends EventEmitter {
+ id: number;
+ process: child.ChildProcess;
+ send(message: child.Serializable, sendHandle?: child.SendHandle, callback?: (error: Error | null) => void): boolean;
+ kill(signal?: string): void;
+ destroy(signal?: string): void;
+ disconnect(): void;
+ isConnected(): boolean;
+ isDead(): boolean;
+ exitedAfterDisconnect: boolean;
+
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. error
+ * 3. exit
+ * 4. listening
+ * 5. message
+ * 6. online
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "disconnect", listener: () => void): this;
+ addListener(event: "error", listener: (error: Error) => void): this;
+ addListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ addListener(event: "listening", listener: (address: Address) => void): this;
+ addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ addListener(event: "online", listener: () => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "disconnect"): boolean;
+ emit(event: "error", error: Error): boolean;
+ emit(event: "exit", code: number, signal: string): boolean;
+ emit(event: "listening", address: Address): boolean;
+ emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
+ emit(event: "online"): boolean;
+
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "disconnect", listener: () => void): this;
+ on(event: "error", listener: (error: Error) => void): this;
+ on(event: "exit", listener: (code: number, signal: string) => void): this;
+ on(event: "listening", listener: (address: Address) => void): this;
+ on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ on(event: "online", listener: () => void): this;
+
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "disconnect", listener: () => void): this;
+ once(event: "error", listener: (error: Error) => void): this;
+ once(event: "exit", listener: (code: number, signal: string) => void): this;
+ once(event: "listening", listener: (address: Address) => void): this;
+ once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ once(event: "online", listener: () => void): this;
+
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "disconnect", listener: () => void): this;
+ prependListener(event: "error", listener: (error: Error) => void): this;
+ prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ prependListener(event: "listening", listener: (address: Address) => void): this;
+ prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependListener(event: "online", listener: () => void): this;
+
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "disconnect", listener: () => void): this;
+ prependOnceListener(event: "error", listener: (error: Error) => void): this;
+ prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
+ prependOnceListener(event: "listening", listener: (address: Address) => void): this;
+ prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependOnceListener(event: "online", listener: () => void): this;
+ }
+
+ interface Cluster extends EventEmitter {
+ Worker: Worker;
+ disconnect(callback?: () => void): void;
+ fork(env?: any): Worker;
+ isMaster: boolean;
+ isWorker: boolean;
+ schedulingPolicy: number;
+ settings: ClusterSettings;
+ setupMaster(settings?: ClusterSettings): void;
+ worker?: Worker;
+ workers?: NodeJS.Dict;
+
+ readonly SCHED_NONE: number;
+ readonly SCHED_RR: number;
+
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. exit
+ * 3. fork
+ * 4. listening
+ * 5. message
+ * 6. online
+ * 7. setup
+ */
+ addListener(event: string, listener: (...args: any[]) => void): this;
+ addListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ addListener(event: "fork", listener: (worker: Worker) => void): this;
+ addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ addListener(event: "online", listener: (worker: Worker) => void): this;
+ addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+ emit(event: string | symbol, ...args: any[]): boolean;
+ emit(event: "disconnect", worker: Worker): boolean;
+ emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
+ emit(event: "fork", worker: Worker): boolean;
+ emit(event: "listening", worker: Worker, address: Address): boolean;
+ emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
+ emit(event: "online", worker: Worker): boolean;
+ emit(event: "setup", settings: ClusterSettings): boolean;
+
+ on(event: string, listener: (...args: any[]) => void): this;
+ on(event: "disconnect", listener: (worker: Worker) => void): this;
+ on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ on(event: "fork", listener: (worker: Worker) => void): this;
+ on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ on(event: "online", listener: (worker: Worker) => void): this;
+ on(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+ once(event: string, listener: (...args: any[]) => void): this;
+ once(event: "disconnect", listener: (worker: Worker) => void): this;
+ once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ once(event: "fork", listener: (worker: Worker) => void): this;
+ once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ once(event: "online", listener: (worker: Worker) => void): this;
+ once(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+ prependListener(event: string, listener: (...args: any[]) => void): this;
+ prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
+ prependListener(event: "online", listener: (worker: Worker) => void): this;
+ prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+ prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+ prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+ prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
+ prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
+ prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+ }
+
+ const SCHED_NONE: number;
+ const SCHED_RR: number;
+
+ function disconnect(callback?: () => void): void;
+ function fork(env?: any): Worker;
+ const isMaster: boolean;
+ const isWorker: boolean;
+ let schedulingPolicy: number;
+ const settings: ClusterSettings;
+ function setupMaster(settings?: ClusterSettings): void;
+ const worker: Worker;
+ const workers: NodeJS.Dict;
+
+ /**
+ * events.EventEmitter
+ * 1. disconnect
+ * 2. exit
+ * 3. fork
+ * 4. listening
+ * 5. message
+ * 6. online
+ * 7. setup
+ */
+ function addListener(event: string, listener: (...args: any[]) => void): Cluster;
+ function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+ function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
+ function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
+ function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+ function emit(event: string | symbol, ...args: any[]): boolean;
+ function emit(event: "disconnect", worker: Worker): boolean;
+ function emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
+ function emit(event: "fork", worker: Worker): boolean;
+ function emit(event: "listening", worker: Worker, address: Address): boolean;
+ function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
+ function emit(event: "online", worker: Worker): boolean;
+ function emit(event: "setup", settings: ClusterSettings): boolean;
+
+ function on(event: string, listener: (...args: any[]) => void): Cluster;
+ function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ function on(event: "fork", listener: (worker: Worker) => void): Cluster;
+ function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ function on(event: "online", listener: (worker: Worker) => void): Cluster;
+ function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+ function once(event: string, listener: (...args: any[]) => void): Cluster;
+ function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ function once(event: "fork", listener: (worker: Worker) => void): Cluster;
+ function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined.
+ function once(event: "online", listener: (worker: Worker) => void): Cluster;
+ function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+ function removeListener(event: string, listener: (...args: any[]) => void): Cluster;
+ function removeAllListeners(event?: string): Cluster;
+ function setMaxListeners(n: number): Cluster;
+ function getMaxListeners(): number;
+ function listeners(event: string): Function[];
+ function listenerCount(type: string): number;
+
+ function prependListener(event: string, listener: (...args: any[]) => void): Cluster;
+ function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+ function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
+ function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
+ function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+ function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
+ function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+ function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+ function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+ function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+ // the handle is a net.Socket or net.Server object, or undefined.
+ function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
+ function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
+ function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+ function eventNames(): string[];
+}
diff --git a/tests/node_modules/@types/node/console.d.ts b/tests/node_modules/@types/node/console.d.ts
new file mode 100755
index 0000000..e5f9cba
--- /dev/null
+++ b/tests/node_modules/@types/node/console.d.ts
@@ -0,0 +1,133 @@
+declare module 'console' {
+ import { InspectOptions } from 'util';
+
+ global {
+ // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
+ interface Console {
+ Console: NodeJS.ConsoleConstructor;
+ /**
+ * A simple assertion test that verifies whether `value` is truthy.
+ * If it is not, an `AssertionError` is thrown.
+ * If provided, the error `message` is formatted using `util.format()` and used as the error message.
+ */
+ assert(value: any, message?: string, ...optionalParams: any[]): void;
+ /**
+ * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
+ * When `stdout` is not a TTY, this method does nothing.
+ */
+ clear(): void;
+ /**
+ * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
+ */
+ count(label?: string): void;
+ /**
+ * Resets the internal counter specific to `label`.
+ */
+ countReset(label?: string): void;
+ /**
+ * The `console.debug()` function is an alias for {@link console.log}.
+ */
+ debug(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Uses {@link util.inspect} on `obj` and prints the resulting string to `stdout`.
+ * This function bypasses any custom `inspect()` function defined on `obj`.
+ */
+ dir(obj: any, options?: InspectOptions): void;
+ /**
+ * This method calls {@link console.log} passing it the arguments received. Please note that this method does not produce any XML formatting
+ */
+ dirxml(...data: any[]): void;
+ /**
+ * Prints to `stderr` with newline.
+ */
+ error(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Increases indentation of subsequent lines by two spaces.
+ * If one or more `label`s are provided, those are printed first without the additional indentation.
+ */
+ group(...label: any[]): void;
+ /**
+ * The `console.groupCollapsed()` function is an alias for {@link console.group}.
+ */
+ groupCollapsed(...label: any[]): void;
+ /**
+ * Decreases indentation of subsequent lines by two spaces.
+ */
+ groupEnd(): void;
+ /**
+ * The {@link console.info} function is an alias for {@link console.log}.
+ */
+ info(message?: any, ...optionalParams: any[]): void;
+ /**
+ * Prints to `stdout` with newline.
+ */
+ log(message?: any, ...optionalParams: any[]): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Prints to `stdout` the array `array` formatted as a table.
+ */
+ table(tabularData: any, properties?: ReadonlyArray): void;
+ /**
+ * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
+ */
+ time(label?: string): void;
+ /**
+ * Stops a timer that was previously started by calling {@link console.time} and prints the result to `stdout`.
+ */
+ timeEnd(label?: string): void;
+ /**
+ * For a timer that was previously started by calling {@link console.time}, prints the elapsed time and other `data` arguments to `stdout`.
+ */
+ timeLog(label?: string, ...data: any[]): void;
+ /**
+ * Prints to `stderr` the string 'Trace :', followed by the {@link util.format} formatted message and stack trace to the current position in the code.
+ */
+ trace(message?: any, ...optionalParams: any[]): void;
+ /**
+ * The {@link console.warn} function is an alias for {@link console.error}.
+ */
+ warn(message?: any, ...optionalParams: any[]): void;
+
+ // --- Inspector mode only ---
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Starts a JavaScript CPU profile with an optional label.
+ */
+ profile(label?: string): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
+ */
+ profileEnd(label?: string): void;
+ /**
+ * This method does not display anything unless used in the inspector.
+ * Adds an event with the label `label` to the Timeline panel of the inspector.
+ */
+ timeStamp(label?: string): void;
+ }
+
+ var console: Console;
+
+ namespace NodeJS {
+ interface ConsoleConstructorOptions {
+ stdout: WritableStream;
+ stderr?: WritableStream;
+ ignoreErrors?: boolean;
+ colorMode?: boolean | 'auto';
+ inspectOptions?: InspectOptions;
+ }
+
+ interface ConsoleConstructor {
+ prototype: Console;
+ new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
+ new(options: ConsoleConstructorOptions): Console;
+ }
+
+ interface Global {
+ console: typeof console;
+ }
+ }
+ }
+
+ export = console;
+}
diff --git a/tests/node_modules/@types/node/constants.d.ts b/tests/node_modules/@types/node/constants.d.ts
new file mode 100755
index 0000000..98ff976
--- /dev/null
+++ b/tests/node_modules/@types/node/constants.d.ts
@@ -0,0 +1,13 @@
+/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
+declare module 'constants' {
+ import { constants as osConstants, SignalConstants } from 'os';
+ import { constants as cryptoConstants } from 'crypto';
+ import { constants as fsConstants } from 'fs';
+
+ const exp: typeof osConstants.errno &
+ typeof osConstants.priority &
+ SignalConstants &
+ typeof cryptoConstants &
+ typeof fsConstants;
+ export = exp;
+}
diff --git a/tests/node_modules/@types/node/crypto.d.ts b/tests/node_modules/@types/node/crypto.d.ts
new file mode 100755
index 0000000..db06d15
--- /dev/null
+++ b/tests/node_modules/@types/node/crypto.d.ts
@@ -0,0 +1,1580 @@
+declare module 'crypto' {
+ import * as stream from 'stream';
+ import { PeerCertificate } from 'tls';
+
+ interface Certificate {
+ /**
+ * @deprecated
+ * @param spkac
+ * @returns The challenge component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportChallenge(spkac: BinaryLike): Buffer;
+ /**
+ * @deprecated
+ * @param spkac
+ * @param encoding The encoding of the spkac string.
+ * @returns The public key component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
+ /**
+ * @deprecated
+ * @param spkac
+ * @returns `true` if the given `spkac` data structure is valid,
+ * `false` otherwise.
+ */
+ verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+ }
+ const Certificate: Certificate & {
+ /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
+ new(): Certificate;
+ /** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
+ (): Certificate;
+
+ /**
+ * @param spkac
+ * @returns The challenge component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportChallenge(spkac: BinaryLike): Buffer;
+ /**
+ * @param spkac
+ * @param encoding The encoding of the spkac string.
+ * @returns The public key component of the `spkac` data structure,
+ * which includes a public key and a challenge.
+ */
+ exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
+ /**
+ * @param spkac
+ * @returns `true` if the given `spkac` data structure is valid,
+ * `false` otherwise.
+ */
+ verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+ };
+
+ namespace constants {
+ // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
+ const OPENSSL_VERSION_NUMBER: number;
+
+ /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
+ const SSL_OP_ALL: number;
+ /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+ const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
+ /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+ const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
+ /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */
+ const SSL_OP_CISCO_ANYCONNECT: number;
+ /** Instructs OpenSSL to turn on cookie exchange. */
+ const SSL_OP_COOKIE_EXCHANGE: number;
+ /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */
+ const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
+ /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
+ const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
+ /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */
+ const SSL_OP_EPHEMERAL_RSA: number;
+ /** Allows initial connection to servers that do not support RI. */
+ const SSL_OP_LEGACY_SERVER_CONNECT: number;
+ const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
+ const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
+ /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */
+ const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
+ const SSL_OP_NETSCAPE_CA_DN_BUG: number;
+ const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
+ const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
+ const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
+ /** Instructs OpenSSL to disable support for SSL/TLS compression. */
+ const SSL_OP_NO_COMPRESSION: number;
+ const SSL_OP_NO_QUERY_MTU: number;
+ /** Instructs OpenSSL to always start a new session when performing renegotiation. */
+ const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
+ const SSL_OP_NO_SSLv2: number;
+ const SSL_OP_NO_SSLv3: number;
+ const SSL_OP_NO_TICKET: number;
+ const SSL_OP_NO_TLSv1: number;
+ const SSL_OP_NO_TLSv1_1: number;
+ const SSL_OP_NO_TLSv1_2: number;
+ const SSL_OP_PKCS1_CHECK_1: number;
+ const SSL_OP_PKCS1_CHECK_2: number;
+ /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */
+ const SSL_OP_SINGLE_DH_USE: number;
+ /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */
+ const SSL_OP_SINGLE_ECDH_USE: number;
+ const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
+ const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
+ const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
+ const SSL_OP_TLS_D5_BUG: number;
+ /** Instructs OpenSSL to disable version rollback attack detection. */
+ const SSL_OP_TLS_ROLLBACK_BUG: number;
+
+ const ENGINE_METHOD_RSA: number;
+ const ENGINE_METHOD_DSA: number;
+ const ENGINE_METHOD_DH: number;
+ const ENGINE_METHOD_RAND: number;
+ const ENGINE_METHOD_EC: number;
+ const ENGINE_METHOD_CIPHERS: number;
+ const ENGINE_METHOD_DIGESTS: number;
+ const ENGINE_METHOD_PKEY_METHS: number;
+ const ENGINE_METHOD_PKEY_ASN1_METHS: number;
+ const ENGINE_METHOD_ALL: number;
+ const ENGINE_METHOD_NONE: number;
+
+ const DH_CHECK_P_NOT_SAFE_PRIME: number;
+ const DH_CHECK_P_NOT_PRIME: number;
+ const DH_UNABLE_TO_CHECK_GENERATOR: number;
+ const DH_NOT_SUITABLE_GENERATOR: number;
+
+ const ALPN_ENABLED: number;
+
+ const RSA_PKCS1_PADDING: number;
+ const RSA_SSLV23_PADDING: number;
+ const RSA_NO_PADDING: number;
+ const RSA_PKCS1_OAEP_PADDING: number;
+ const RSA_X931_PADDING: number;
+ const RSA_PKCS1_PSS_PADDING: number;
+ /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */
+ const RSA_PSS_SALTLEN_DIGEST: number;
+ /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */
+ const RSA_PSS_SALTLEN_MAX_SIGN: number;
+ /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */
+ const RSA_PSS_SALTLEN_AUTO: number;
+
+ const POINT_CONVERSION_COMPRESSED: number;
+ const POINT_CONVERSION_UNCOMPRESSED: number;
+ const POINT_CONVERSION_HYBRID: number;
+
+ /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */
+ const defaultCoreCipherList: string;
+ /** Specifies the active default cipher list used by the current Node.js process (colon-separated values). */
+ const defaultCipherList: string;
+ }
+
+ interface HashOptions extends stream.TransformOptions {
+ /**
+ * For XOF hash functions such as `shake256`, the
+ * outputLength option can be used to specify the desired output length in bytes.
+ */
+ outputLength?: number;
+ }
+
+ /** @deprecated since v10.0.0 */
+ const fips: boolean;
+
+ function createHash(algorithm: string, options?: HashOptions): Hash;
+ function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
+
+ // https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
+ type BinaryToTextEncoding = 'base64' | 'hex';
+ type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
+ type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
+
+ type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
+
+ type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
+
+ class Hash extends stream.Transform {
+ private constructor();
+ copy(): Hash;
+ update(data: BinaryLike): Hash;
+ update(data: string, input_encoding: Encoding): Hash;
+ digest(): Buffer;
+ digest(encoding: BinaryToTextEncoding): string;
+ }
+ class Hmac extends stream.Transform {
+ private constructor();
+ update(data: BinaryLike): Hmac;
+ update(data: string, input_encoding: Encoding): Hmac;
+ digest(): Buffer;
+ digest(encoding: BinaryToTextEncoding): string;
+ }
+
+ type KeyObjectType = 'secret' | 'public' | 'private';
+
+ interface KeyExportOptions {
+ type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
+ format: T;
+ cipher?: string;
+ passphrase?: string | Buffer;
+ }
+
+ interface JwkKeyExportOptions {
+ format: 'jwk';
+ }
+
+ interface JsonWebKey {
+ crv?: string;
+ d?: string;
+ dp?: string;
+ dq?: string;
+ e?: string;
+ k?: string;
+ kty?: string;
+ n?: string;
+ p?: string;
+ q?: string;
+ qi?: string;
+ x?: string;
+ y?: string;
+ }
+
+ interface AsymmetricKeyDetails {
+ /**
+ * Key size in bits (RSA, DSA).
+ */
+ modulusLength?: number;
+ /**
+ * Public exponent (RSA).
+ */
+ publicExponent?: bigint;
+ /**
+ * Size of q in bits (DSA).
+ */
+ divisorLength?: number;
+ /**
+ * Name of the curve (EC).
+ */
+ namedCurve?: string;
+ }
+
+ class KeyObject {
+ private constructor();
+ asymmetricKeyType?: KeyType;
+ /**
+ * For asymmetric keys, this property represents the size of the embedded key in
+ * bytes. This property is `undefined` for symmetric keys.
+ */
+ asymmetricKeySize?: number;
+ /**
+ * This property exists only on asymmetric keys. Depending on the type of the key,
+ * this object contains information about the key. None of the information obtained
+ * through this property can be used to uniquely identify a key or to compromise the
+ * security of the key.
+ */
+ asymmetricKeyDetails?: AsymmetricKeyDetails;
+ export(options: KeyExportOptions<'pem'>): string | Buffer;
+ export(options?: KeyExportOptions<'der'>): Buffer;
+ symmetricKeySize?: number;
+ type: KeyObjectType;
+ }
+
+ type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305';
+ type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
+
+ type BinaryLike = string | NodeJS.ArrayBufferView;
+
+ type CipherKey = BinaryLike | KeyObject;
+
+ interface CipherCCMOptions extends stream.TransformOptions {
+ authTagLength: number;
+ }
+ interface CipherGCMOptions extends stream.TransformOptions {
+ authTagLength?: number;
+ }
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM;
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
+ /** @deprecated since v10.0.0 use `createCipheriv()` */
+ function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
+
+ function createCipheriv(
+ algorithm: CipherCCMTypes,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options: CipherCCMOptions,
+ ): CipherCCM;
+ function createCipheriv(
+ algorithm: CipherGCMTypes,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: CipherGCMOptions,
+ ): CipherGCM;
+ function createCipheriv(
+ algorithm: string,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: stream.TransformOptions,
+ ): Cipher;
+
+ class Cipher extends stream.Transform {
+ private constructor();
+ update(data: BinaryLike): Buffer;
+ update(data: string, input_encoding: Encoding): Buffer;
+ update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string;
+ update(data: string, input_encoding: Encoding | undefined, output_encoding: Encoding): string;
+ final(): Buffer;
+ final(output_encoding: BufferEncoding): string;
+ setAutoPadding(auto_padding?: boolean): this;
+ // getAuthTag(): Buffer;
+ // setAAD(buffer: NodeJS.ArrayBufferView): this;
+ }
+ interface CipherCCM extends Cipher {
+ setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this;
+ getAuthTag(): Buffer;
+ }
+ interface CipherGCM extends Cipher {
+ setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this;
+ getAuthTag(): Buffer;
+ }
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM;
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
+ /** @deprecated since v10.0.0 use `createDecipheriv()` */
+ function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
+
+ function createDecipheriv(
+ algorithm: CipherCCMTypes,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options: CipherCCMOptions,
+ ): DecipherCCM;
+ function createDecipheriv(
+ algorithm: CipherGCMTypes,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: CipherGCMOptions,
+ ): DecipherGCM;
+ function createDecipheriv(
+ algorithm: string,
+ key: CipherKey,
+ iv: BinaryLike | null,
+ options?: stream.TransformOptions,
+ ): Decipher;
+
+ class Decipher extends stream.Transform {
+ private constructor();
+ update(data: NodeJS.ArrayBufferView): Buffer;
+ update(data: string, input_encoding: Encoding): Buffer;
+ update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string;
+ update(data: string, input_encoding: Encoding | undefined, output_encoding: Encoding): string;
+ final(): Buffer;
+ final(output_encoding: BufferEncoding): string;
+ setAutoPadding(auto_padding?: boolean): this;
+ // setAuthTag(tag: NodeJS.ArrayBufferView): this;
+ // setAAD(buffer: NodeJS.ArrayBufferView): this;
+ }
+ interface DecipherCCM extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this;
+ }
+ interface DecipherGCM extends Decipher {
+ setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+ setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this;
+ }
+
+ interface PrivateKeyInput {
+ key: string | Buffer;
+ format?: KeyFormat;
+ type?: 'pkcs1' | 'pkcs8' | 'sec1';
+ passphrase?: string | Buffer;
+ }
+
+ interface PublicKeyInput {
+ key: string | Buffer;
+ format?: KeyFormat;
+ type?: 'pkcs1' | 'spki';
+ }
+
+ function generateKey(type: 'hmac' | 'aes', options: {length: number}, callback: (err: Error | null, key: KeyObject) => void): void;
+
+ function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
+ function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
+ function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
+
+ function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
+
+ type DSAEncoding = 'der' | 'ieee-p1363';
+
+ interface SigningOptions {
+ /**
+ * @See crypto.constants.RSA_PKCS1_PADDING
+ */
+ padding?: number;
+ saltLength?: number;
+ dsaEncoding?: DSAEncoding;
+ }
+
+ interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions { }
+ interface SignKeyObjectInput extends SigningOptions {
+ key: KeyObject;
+ }
+ interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions { }
+ interface VerifyKeyObjectInput extends SigningOptions {
+ key: KeyObject;
+ }
+
+ type KeyLike = string | Buffer | KeyObject;
+
+ class Signer extends stream.Writable {
+ private constructor();
+
+ update(data: BinaryLike): Signer;
+ update(data: string, input_encoding: Encoding): Signer;
+ sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
+ sign(
+ private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
+ output_format: BinaryToTextEncoding,
+ ): string;
+ }
+
+ function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
+ class Verify extends stream.Writable {
+ private constructor();
+
+ update(data: BinaryLike): Verify;
+ update(data: string, input_encoding: Encoding): Verify;
+ verify(
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
+ signature: NodeJS.ArrayBufferView,
+ ): boolean;
+ verify(
+ object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
+ signature: string,
+ signature_format?: BinaryToTextEncoding,
+ ): boolean;
+ // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
+ // The signature field accepts a TypedArray type, but it is only available starting ES2017
+ }
+ function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
+ function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
+ function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding): DiffieHellman;
+ function createDiffieHellman(
+ prime: string,
+ prime_encoding: BinaryToTextEncoding,
+ generator: number | NodeJS.ArrayBufferView,
+ ): DiffieHellman;
+ function createDiffieHellman(
+ prime: string,
+ prime_encoding: BinaryToTextEncoding,
+ generator: string,
+ generator_encoding: BinaryToTextEncoding,
+ ): DiffieHellman;
+ class DiffieHellman {
+ private constructor();
+ generateKeys(): Buffer;
+ generateKeys(encoding: BinaryToTextEncoding): string;
+ computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
+ computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
+ computeSecret(
+ other_public_key: string,
+ input_encoding: BinaryToTextEncoding,
+ output_encoding: BinaryToTextEncoding,
+ ): string;
+ getPrime(): Buffer;
+ getPrime(encoding: BinaryToTextEncoding): string;
+ getGenerator(): Buffer;
+ getGenerator(encoding: BinaryToTextEncoding): string;
+ getPublicKey(): Buffer;
+ getPublicKey(encoding: BinaryToTextEncoding): string;
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
+ setPublicKey(public_key: NodeJS.ArrayBufferView): void;
+ setPublicKey(public_key: string, encoding: BufferEncoding): void;
+ setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
+ setPrivateKey(private_key: string, encoding: BufferEncoding): void;
+ verifyError: number;
+ }
+ function getDiffieHellman(group_name: string): DiffieHellman;
+ function pbkdf2(
+ password: BinaryLike,
+ salt: BinaryLike,
+ iterations: number,
+ keylen: number,
+ digest: string,
+ callback: (err: Error | null, derivedKey: Buffer) => any,
+ ): void;
+ function pbkdf2Sync(
+ password: BinaryLike,
+ salt: BinaryLike,
+ iterations: number,
+ keylen: number,
+ digest: string,
+ ): Buffer;
+
+ function randomBytes(size: number): Buffer;
+ function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+ function pseudoRandomBytes(size: number): Buffer;
+ function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+
+ function randomInt(max: number): number;
+ function randomInt(min: number, max: number): number;
+ function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
+ function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
+
+ function randomFillSync(buffer: T, offset?: number, size?: number): T;
+ function randomFill(
+ buffer: T,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ function randomFill(
+ buffer: T,
+ offset: number,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+ function randomFill(
+ buffer: T,
+ offset: number,
+ size: number,
+ callback: (err: Error | null, buf: T) => void,
+ ): void;
+
+ interface ScryptOptions {
+ cost?: number;
+ blockSize?: number;
+ parallelization?: number;
+ N?: number;
+ r?: number;
+ p?: number;
+ maxmem?: number;
+ }
+ function scrypt(
+ password: BinaryLike,
+ salt: BinaryLike,
+ keylen: number,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ function scrypt(
+ password: BinaryLike,
+ salt: BinaryLike,
+ keylen: number,
+ options: ScryptOptions,
+ callback: (err: Error | null, derivedKey: Buffer) => void,
+ ): void;
+ function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
+
+ interface RsaPublicKey {
+ key: KeyLike;
+ padding?: number;
+ }
+ interface RsaPrivateKey {
+ key: KeyLike;
+ passphrase?: string;
+ /**
+ * @default 'sha1'
+ */
+ oaepHash?: string;
+ oaepLabel?: NodeJS.TypedArray;
+ padding?: number;
+ }
+ function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+ function getCiphers(): string[];
+ function getCurves(): string[];
+ function getFips(): 1 | 0;
+ function getHashes(): string[];
+ class ECDH {
+ private constructor();
+ static convertKey(
+ key: BinaryLike,
+ curve: string,
+ inputEncoding?: BinaryToTextEncoding,
+ outputEncoding?: 'latin1' | 'hex' | 'base64',
+ format?: 'uncompressed' | 'compressed' | 'hybrid',
+ ): Buffer | string;
+ generateKeys(): Buffer;
+ generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
+ computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
+ computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
+ computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
+ computeSecret(
+ other_public_key: string,
+ input_encoding: BinaryToTextEncoding,
+ output_encoding: BinaryToTextEncoding,
+ ): string;
+ getPrivateKey(): Buffer;
+ getPrivateKey(encoding: BinaryToTextEncoding): string;
+ getPublicKey(): Buffer;
+ getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
+ setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
+ setPrivateKey(private_key: string, encoding: BinaryToTextEncoding): void;
+ }
+ function createECDH(curve_name: string): ECDH;
+ function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
+ /** @deprecated since v10.0.0 */
+ const DEFAULT_ENCODING: BufferEncoding;
+
+ type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
+ type KeyFormat = 'pem' | 'der';
+
+ interface BasePrivateKeyEncodingOptions {
+ format: T;
+ cipher?: string;
+ passphrase?: string;
+ }
+
+ interface KeyPairKeyObjectResult {
+ publicKey: KeyObject;
+ privateKey: KeyObject;
+ }
+
+ interface ED25519KeyPairKeyObjectOptions {
+ /**
+ * No options.
+ */
+ }
+
+ interface ED448KeyPairKeyObjectOptions {
+ /**
+ * No options.
+ */
+ }
+
+ interface X25519KeyPairKeyObjectOptions {
+ /**
+ * No options.
+ */
+ }
+
+ interface X448KeyPairKeyObjectOptions {
+ /**
+ * No options.
+ */
+ }
+
+ interface ECKeyPairKeyObjectOptions {
+ /**
+ * Name of the curve to use.
+ */
+ namedCurve: string;
+ }
+
+ interface RSAKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+
+ /**
+ * @default 0x10001
+ */
+ publicExponent?: number;
+ }
+
+ interface DSAKeyPairKeyObjectOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+
+ /**
+ * Size of q in bits
+ */
+ divisorLength: number;
+ }
+
+ interface RSAKeyPairOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * @default 0x10001
+ */
+ publicExponent?: number;
+
+ publicKeyEncoding: {
+ type: 'pkcs1' | 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'pkcs1' | 'pkcs8';
+ };
+ }
+
+ interface DSAKeyPairOptions {
+ /**
+ * Key size in bits
+ */
+ modulusLength: number;
+ /**
+ * Size of q in bits
+ */
+ divisorLength: number;
+
+ publicKeyEncoding: {
+ type: 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'pkcs8';
+ };
+ }
+
+ interface ECKeyPairOptions {
+ /**
+ * Name of the curve to use.
+ */
+ namedCurve: string;
+
+ publicKeyEncoding: {
+ type: 'pkcs1' | 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'sec1' | 'pkcs8';
+ };
+ }
+
+ interface ED25519KeyPairOptions {
+ publicKeyEncoding: {
+ type: 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'pkcs8';
+ };
+ }
+
+ interface ED448KeyPairOptions {
+ publicKeyEncoding: {
+ type: 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'pkcs8';
+ };
+ }
+
+ interface X25519KeyPairOptions {
+ publicKeyEncoding: {
+ type: 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'pkcs8';
+ };
+ }
+
+ interface X448KeyPairOptions {
+ publicKeyEncoding: {
+ type: 'spki';
+ format: PubF;
+ };
+ privateKeyEncoding: BasePrivateKeyEncodingOptions & {
+ type: 'pkcs8';
+ };
+ }
+
+ interface KeyPairSyncResult {
+ publicKey: T1;
+ privateKey: T2;
+ }
+
+ function generateKeyPairSync(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPairSync(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPairSync(
+ type: 'ec',
+ options: ECKeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ec',
+ options: ECKeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ec',
+ options: ECKeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ec',
+ options: ECKeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPairSync(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPairSync(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPairSync(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPairSync(
+ type: 'x448',
+ options: X448KeyPairOptions<'pem', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'x448',
+ options: X448KeyPairOptions<'pem', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'x448',
+ options: X448KeyPairOptions<'der', 'pem'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(
+ type: 'x448',
+ options: X448KeyPairOptions<'der', 'der'>,
+ ): KeyPairSyncResult;
+ function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+ function generateKeyPair(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'rsa',
+ options: RSAKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ function generateKeyPair(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'dsa',
+ options: DSAKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ function generateKeyPair(
+ type: 'ec',
+ options: ECKeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ec',
+ options: ECKeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ec',
+ options: ECKeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ec',
+ options: ECKeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ec',
+ options: ECKeyPairKeyObjectOptions,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ function generateKeyPair(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed25519',
+ options: ED25519KeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed25519',
+ options: ED25519KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ function generateKeyPair(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed448',
+ options: ED448KeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'ed448',
+ options: ED448KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ function generateKeyPair(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x25519',
+ options: X25519KeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x25519',
+ options: X25519KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ function generateKeyPair(
+ type: 'x448',
+ options: X448KeyPairOptions<'pem', 'pem'>,
+ callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x448',
+ options: X448KeyPairOptions<'pem', 'der'>,
+ callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x448',
+ options: X448KeyPairOptions<'der', 'pem'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x448',
+ options: X448KeyPairOptions<'der', 'der'>,
+ callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+ ): void;
+ function generateKeyPair(
+ type: 'x448',
+ options: X448KeyPairKeyObjectOptions | undefined,
+ callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+ ): void;
+
+ namespace generateKeyPair {
+ function __promisify__(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'pem', 'pem'>,
+ ): Promise<{ publicKey: string; privateKey: string }>;
+ function __promisify__(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'pem', 'der'>,
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
+ function __promisify__(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'der', 'pem'>,
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
+ function __promisify__(
+ type: 'rsa',
+ options: RSAKeyPairOptions<'der', 'der'>,
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
+ function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise;
+
+ function __promisify__(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'pem', 'pem'>,
+ ): Promise<{ publicKey: string; privateKey: string }>;
+ function __promisify__(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'pem', 'der'>,
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
+ function __promisify__(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'der', 'pem'>,
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
+ function __promisify__(
+ type: 'dsa',
+ options: DSAKeyPairOptions<'der', 'der'>,
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
+ function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise;
+
+ function __promisify__(
+ type: 'ec',
+ options: ECKeyPairOptions<'pem', 'pem'>,
+ ): Promise<{ publicKey: string; privateKey: string }>;
+ function __promisify__(
+ type: 'ec',
+ options: ECKeyPairOptions<'pem', 'der'>,
+ ): Promise<{ publicKey: string; privateKey: Buffer }>;
+ function __promisify__(
+ type: 'ec',
+ options: ECKeyPairOptions<'der', 'pem'>,
+ ): Promise<{ publicKey: Buffer; privateKey: string }>;
+ function __promisify__(
+ type: 'ec',
+ options: ECKeyPairOptions<'der', 'der'>,
+ ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
+ function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise