김대선

node_modules 파일 제거

Showing 1000 changed files with 1 additions and 5025 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

1 datas/ 1 datas/
2 +node_modules/
...\ No newline at end of file ...\ No newline at end of file
......
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../extract-zip/cli.js" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../extract-zip/cli.js" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\extract-zip\cli.js" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../extract-zip/cli.js" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../extract-zip/cli.js" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../mime/cli.js" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../mime/cli.js" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\mime\cli.js" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../mime/cli.js" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../mime/cli.js" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
1 -#!/bin/sh
2 -basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 -
4 -case `uname` in
5 - *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
6 -esac
7 -
8 -if [ -x "$basedir/node" ]; then
9 - "$basedir/node" "$basedir/../rimraf/bin.js" "$@"
10 - ret=$?
11 -else
12 - node "$basedir/../rimraf/bin.js" "$@"
13 - ret=$?
14 -fi
15 -exit $ret
1 -@ECHO off
2 -SETLOCAL
3 -CALL :find_dp0
4 -
5 -IF EXIST "%dp0%\node.exe" (
6 - SET "_prog=%dp0%\node.exe"
7 -) ELSE (
8 - SET "_prog=node"
9 - SET PATHEXT=%PATHEXT:;.JS;=;%
10 -)
11 -
12 -"%_prog%" "%dp0%\..\rimraf\bin.js" %*
13 -ENDLOCAL
14 -EXIT /b %errorlevel%
15 -:find_dp0
16 -SET dp0=%~dp0
17 -EXIT /b
1 -#!/usr/bin/env pwsh
2 -$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3 -
4 -$exe=""
5 -if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6 - # Fix case when both the Windows and Linux builds of Node
7 - # are installed in the same directory
8 - $exe=".exe"
9 -}
10 -$ret=0
11 -if (Test-Path "$basedir/node$exe") {
12 - & "$basedir/node$exe" "$basedir/../rimraf/bin.js" $args
13 - $ret=$LASTEXITCODE
14 -} else {
15 - & "node$exe" "$basedir/../rimraf/bin.js" $args
16 - $ret=$LASTEXITCODE
17 -}
18 -exit $ret
This diff is collapsed. Click to expand it.
1 - MIT License
2 -
3 - Copyright (c) Microsoft Corporation.
4 -
5 - Permission is hereby granted, free of charge, to any person obtaining a copy
6 - of this software and associated documentation files (the "Software"), to deal
7 - in the Software without restriction, including without limitation the rights
8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 - copies of the Software, and to permit persons to whom the Software is
10 - furnished to do so, subject to the following conditions:
11 -
12 - The above copyright notice and this permission notice shall be included in all
13 - copies or substantial portions of the Software.
14 -
15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 - SOFTWARE
1 -# Installation
2 -> `npm install --save @types/node`
3 -
4 -# Summary
5 -This package contains type definitions for Node.js (http://nodejs.org/).
6 -
7 -# Details
8 -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9 -
10 -### Additional Details
11 - * Last updated: Tue, 04 May 2021 23:03:11 GMT
12 - * Dependencies: none
13 - * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14 -
15 -# Credits
16 -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).
1 -declare module 'assert' {
2 - /** An alias of `assert.ok()`. */
3 - function assert(value: any, message?: string | Error): asserts value;
4 - namespace assert {
5 - class AssertionError extends Error {
6 - actual: any;
7 - expected: any;
8 - operator: string;
9 - generatedMessage: boolean;
10 - code: 'ERR_ASSERTION';
11 -
12 - constructor(options?: {
13 - /** If provided, the error message is set to this value. */
14 - message?: string;
15 - /** The `actual` property on the error instance. */
16 - actual?: any;
17 - /** The `expected` property on the error instance. */
18 - expected?: any;
19 - /** The `operator` property on the error instance. */
20 - operator?: string;
21 - /** If provided, the generated stack trace omits frames before this function. */
22 - // tslint:disable-next-line:ban-types
23 - stackStartFn?: Function;
24 - });
25 - }
26 -
27 - class CallTracker {
28 - calls(exact?: number): () => void;
29 - calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30 - report(): CallTrackerReportInformation[];
31 - verify(): void;
32 - }
33 - interface CallTrackerReportInformation {
34 - message: string;
35 - /** The actual number of times the function was called. */
36 - actual: number;
37 - /** The number of times the function was expected to be called. */
38 - expected: number;
39 - /** The name of the function that is wrapped. */
40 - operator: string;
41 - /** A stack trace of the function. */
42 - stack: object;
43 - }
44 -
45 - type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
46 -
47 - function fail(message?: string | Error): never;
48 - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49 - function fail(
50 - actual: any,
51 - expected: any,
52 - message?: string | Error,
53 - operator?: string,
54 - // tslint:disable-next-line:ban-types
55 - stackStartFn?: Function,
56 - ): never;
57 - function ok(value: any, message?: string | Error): asserts value;
58 - /** @deprecated since v9.9.0 - use strictEqual() instead. */
59 - function equal(actual: any, expected: any, message?: string | Error): void;
60 - /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61 - function notEqual(actual: any, expected: any, message?: string | Error): void;
62 - /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63 - function deepEqual(actual: any, expected: any, message?: string | Error): void;
64 - /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65 - function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
66 - function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
67 - function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68 - function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
69 - function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
70 -
71 - function throws(block: () => any, message?: string | Error): void;
72 - function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73 - function doesNotThrow(block: () => any, message?: string | Error): void;
74 - function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75 -
76 - function ifError(value: any): asserts value is null | undefined;
77 -
78 - function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
79 - function rejects(
80 - block: (() => Promise<any>) | Promise<any>,
81 - error: AssertPredicate,
82 - message?: string | Error,
83 - ): Promise<void>;
84 - function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85 - function doesNotReject(
86 - block: (() => Promise<any>) | Promise<any>,
87 - error: AssertPredicate,
88 - message?: string | Error,
89 - ): Promise<void>;
90 -
91 - function match(value: string, regExp: RegExp, message?: string | Error): void;
92 - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93 -
94 - const strict: Omit<
95 - typeof assert,
96 - | 'equal'
97 - | 'notEqual'
98 - | 'deepEqual'
99 - | 'notDeepEqual'
100 - | 'ok'
101 - | 'strictEqual'
102 - | 'deepStrictEqual'
103 - | 'ifError'
104 - | 'strict'
105 - > & {
106 - (value: any, message?: string | Error): asserts value;
107 - equal: typeof strictEqual;
108 - notEqual: typeof notStrictEqual;
109 - deepEqual: typeof deepStrictEqual;
110 - notDeepEqual: typeof notDeepStrictEqual;
111 -
112 - // Mapped types and assertion functions are incompatible?
113 - // TS2775: Assertions require every name in the call target
114 - // to be declared with an explicit type annotation.
115 - ok: typeof ok;
116 - strictEqual: typeof strictEqual;
117 - deepStrictEqual: typeof deepStrictEqual;
118 - ifError: typeof ifError;
119 - strict: typeof strict;
120 - };
121 - }
122 -
123 - export = assert;
124 -}
1 -declare module 'assert/strict' {
2 - import { strict } from 'assert';
3 - export = strict;
4 -}
1 -/**
2 - * Async Hooks module: https://nodejs.org/api/async_hooks.html
3 - */
4 -declare module 'async_hooks' {
5 - /**
6 - * Returns the asyncId of the current execution context.
7 - */
8 - function executionAsyncId(): number;
9 -
10 - /**
11 - * The resource representing the current execution.
12 - * Useful to store data within the resource.
13 - *
14 - * Resource objects returned by `executionAsyncResource()` are most often internal
15 - * Node.js handle objects with undocumented APIs. Using any functions or properties
16 - * on the object is likely to crash your application and should be avoided.
17 - *
18 - * Using `executionAsyncResource()` in the top-level execution context will
19 - * return an empty object as there is no handle or request object to use,
20 - * but having an object representing the top-level can be helpful.
21 - */
22 - function executionAsyncResource(): object;
23 -
24 - /**
25 - * Returns the ID of the resource responsible for calling the callback that is currently being executed.
26 - */
27 - function triggerAsyncId(): number;
28 -
29 - interface HookCallbacks {
30 - /**
31 - * Called when a class is constructed that has the possibility to emit an asynchronous event.
32 - * @param asyncId a unique ID for the async resource
33 - * @param type the type of the async resource
34 - * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
35 - * @param resource reference to the resource representing the async operation, needs to be released during destroy
36 - */
37 - init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
38 -
39 - /**
40 - * When an asynchronous operation is initiated or completes a callback is called to notify the user.
41 - * The before callback is called just before said callback is executed.
42 - * @param asyncId the unique identifier assigned to the resource about to execute the callback.
43 - */
44 - before?(asyncId: number): void;
45 -
46 - /**
47 - * Called immediately after the callback specified in before is completed.
48 - * @param asyncId the unique identifier assigned to the resource which has executed the callback.
49 - */
50 - after?(asyncId: number): void;
51 -
52 - /**
53 - * Called when a promise has resolve() called. This may not be in the same execution id
54 - * as the promise itself.
55 - * @param asyncId the unique id for the promise that was resolve()d.
56 - */
57 - promiseResolve?(asyncId: number): void;
58 -
59 - /**
60 - * Called after the resource corresponding to asyncId is destroyed
61 - * @param asyncId a unique ID for the async resource
62 - */
63 - destroy?(asyncId: number): void;
64 - }
65 -
66 - interface AsyncHook {
67 - /**
68 - * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
69 - */
70 - enable(): this;
71 -
72 - /**
73 - * 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.
74 - */
75 - disable(): this;
76 - }
77 -
78 - /**
79 - * Registers functions to be called for different lifetime events of each async operation.
80 - * @param options the callbacks to register
81 - * @return an AsyncHooks instance used for disabling and enabling hooks
82 - */
83 - function createHook(options: HookCallbacks): AsyncHook;
84 -
85 - interface AsyncResourceOptions {
86 - /**
87 - * The ID of the execution context that created this async event.
88 - * Default: `executionAsyncId()`
89 - */
90 - triggerAsyncId?: number;
91 -
92 - /**
93 - * Disables automatic `emitDestroy` when the object is garbage collected.
94 - * This usually does not need to be set (even if `emitDestroy` is called
95 - * manually), unless the resource's `asyncId` is retrieved and the
96 - * sensitive API's `emitDestroy` is called with it.
97 - * Default: `false`
98 - */
99 - requireManualDestroy?: boolean;
100 - }
101 -
102 - /**
103 - * The class AsyncResource was designed to be extended by the embedder's async resources.
104 - * Using this users can easily trigger the lifetime events of their own resources.
105 - */
106 - class AsyncResource {
107 - /**
108 - * AsyncResource() is meant to be extended. Instantiating a
109 - * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
110 - * async_hook.executionAsyncId() is used.
111 - * @param type The type of async event.
112 - * @param triggerAsyncId The ID of the execution context that created
113 - * this async event (default: `executionAsyncId()`), or an
114 - * AsyncResourceOptions object (since 9.3)
115 - */
116 - constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
117 -
118 - /**
119 - * Binds the given function to the current execution context.
120 - * @param fn The function to bind to the current execution context.
121 - * @param type An optional name to associate with the underlying `AsyncResource`.
122 - */
123 - static bind<Func extends (...args: any[]) => any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
124 -
125 - /**
126 - * Binds the given function to execute to this `AsyncResource`'s scope.
127 - * @param fn The function to bind to the current `AsyncResource`.
128 - */
129 - bind<Func extends (...args: any[]) => any>(fn: Func): Func & { asyncResource: AsyncResource };
130 -
131 - /**
132 - * Call the provided function with the provided arguments in the
133 - * execution context of the async resource. This will establish the
134 - * context, trigger the AsyncHooks before callbacks, call the function,
135 - * trigger the AsyncHooks after callbacks, and then restore the original
136 - * execution context.
137 - * @param fn The function to call in the execution context of this
138 - * async resource.
139 - * @param thisArg The receiver to be used for the function call.
140 - * @param args Optional arguments to pass to the function.
141 - */
142 - runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
143 -
144 - /**
145 - * Call AsyncHooks destroy callbacks.
146 - */
147 - emitDestroy(): this;
148 -
149 - /**
150 - * @return the unique ID assigned to this AsyncResource instance.
151 - */
152 - asyncId(): number;
153 -
154 - /**
155 - * @return the trigger ID for this AsyncResource instance.
156 - */
157 - triggerAsyncId(): number;
158 - }
159 -
160 - /**
161 - * When having multiple instances of `AsyncLocalStorage`, they are independent
162 - * from each other. It is safe to instantiate this class multiple times.
163 - */
164 - class AsyncLocalStorage<T> {
165 - /**
166 - * This method disables the instance of `AsyncLocalStorage`. All subsequent calls
167 - * to `asyncLocalStorage.getStore()` will return `undefined` until
168 - * `asyncLocalStorage.run()` is called again.
169 - *
170 - * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
171 - * instance will be exited.
172 - *
173 - * Calling `asyncLocalStorage.disable()` is required before the
174 - * `asyncLocalStorage` can be garbage collected. This does not apply to stores
175 - * provided by the `asyncLocalStorage`, as those objects are garbage collected
176 - * along with the corresponding async resources.
177 - *
178 - * This method is to be used when the `asyncLocalStorage` is not in use anymore
179 - * in the current process.
180 - */
181 - disable(): void;
182 -
183 - /**
184 - * This method returns the current store. If this method is called outside of an
185 - * asynchronous context initialized by calling `asyncLocalStorage.run`, it will
186 - * return `undefined`.
187 - */
188 - getStore(): T | undefined;
189 -
190 - /**
191 - * This methods runs a function synchronously within a context and return its
192 - * return value. The store is not accessible outside of the callback function or
193 - * the asynchronous operations created within the callback.
194 - *
195 - * Optionally, arguments can be passed to the function. They will be passed to the
196 - * callback function.
197 - *
198 - * I the callback function throws an error, it will be thrown by `run` too. The
199 - * stacktrace will not be impacted by this call and the context will be exited.
200 - */
201 - // TODO: Apply generic vararg once available
202 - run<R>(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
203 -
204 - /**
205 - * This methods runs a function synchronously outside of a context and return its
206 - * return value. The store is not accessible within the callback function or the
207 - * asynchronous operations created within the callback.
208 - *
209 - * Optionally, arguments can be passed to the function. They will be passed to the
210 - * callback function.
211 - *
212 - * If the callback function throws an error, it will be thrown by `exit` too. The
213 - * stacktrace will not be impacted by this call and the context will be
214 - * re-entered.
215 - */
216 - // TODO: Apply generic vararg once available
217 - exit<R>(callback: (...args: any[]) => R, ...args: any[]): R;
218 -
219 - /**
220 - * Calling `asyncLocalStorage.enterWith(store)` will transition into the context
221 - * for the remainder of the current synchronous execution and will persist
222 - * through any following asynchronous calls.
223 - */
224 - enterWith(store: T): void;
225 - }
226 -}
1 -// NOTE: These definitions support NodeJS and TypeScript 3.7.
2 -
3 -// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 -// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 -// - ~/index.d.ts - Definitions specific to TypeScript 2.1
6 -// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
7 -// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
8 -
9 -// Reference required types from the default lib:
10 -/// <reference lib="es2018" />
11 -/// <reference lib="esnext.asynciterable" />
12 -/// <reference lib="esnext.intl" />
13 -/// <reference lib="esnext.bigint" />
14 -
15 -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16 -/// <reference path="ts3.6/base.d.ts" />
17 -
18 -// TypeScript 3.7-specific augmentations:
19 -/// <reference path="assert.d.ts" />
1 -declare module 'buffer' {
2 - export const INSPECT_MAX_BYTES: number;
3 - export const kMaxLength: number;
4 - export const kStringMaxLength: number;
5 - export const constants: {
6 - MAX_LENGTH: number;
7 - MAX_STRING_LENGTH: number;
8 - };
9 - const BuffType: typeof Buffer;
10 -
11 - export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
12 -
13 - export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
14 -
15 - export const SlowBuffer: {
16 - /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
17 - new(size: number): Buffer;
18 - prototype: Buffer;
19 - };
20 -
21 - export { BuffType as Buffer };
22 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -declare module 'console' {
2 - import { InspectOptions } from 'util';
3 -
4 - global {
5 - // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
6 - interface Console {
7 - Console: NodeJS.ConsoleConstructor;
8 - /**
9 - * A simple assertion test that verifies whether `value` is truthy.
10 - * If it is not, an `AssertionError` is thrown.
11 - * If provided, the error `message` is formatted using `util.format()` and used as the error message.
12 - */
13 - assert(value: any, message?: string, ...optionalParams: any[]): void;
14 - /**
15 - * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
16 - * When `stdout` is not a TTY, this method does nothing.
17 - */
18 - clear(): void;
19 - /**
20 - * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
21 - */
22 - count(label?: string): void;
23 - /**
24 - * Resets the internal counter specific to `label`.
25 - */
26 - countReset(label?: string): void;
27 - /**
28 - * The `console.debug()` function is an alias for {@link console.log()}.
29 - */
30 - debug(message?: any, ...optionalParams: any[]): void;
31 - /**
32 - * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`.
33 - * This function bypasses any custom `inspect()` function defined on `obj`.
34 - */
35 - dir(obj: any, options?: InspectOptions): void;
36 - /**
37 - * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting
38 - */
39 - dirxml(...data: any[]): void;
40 - /**
41 - * Prints to `stderr` with newline.
42 - */
43 - error(message?: any, ...optionalParams: any[]): void;
44 - /**
45 - * Increases indentation of subsequent lines by two spaces.
46 - * If one or more `label`s are provided, those are printed first without the additional indentation.
47 - */
48 - group(...label: any[]): void;
49 - /**
50 - * The `console.groupCollapsed()` function is an alias for {@link console.group()}.
51 - */
52 - groupCollapsed(...label: any[]): void;
53 - /**
54 - * Decreases indentation of subsequent lines by two spaces.
55 - */
56 - groupEnd(): void;
57 - /**
58 - * The {@link console.info()} function is an alias for {@link console.log()}.
59 - */
60 - info(message?: any, ...optionalParams: any[]): void;
61 - /**
62 - * Prints to `stdout` with newline.
63 - */
64 - log(message?: any, ...optionalParams: any[]): void;
65 - /**
66 - * This method does not display anything unless used in the inspector.
67 - * Prints to `stdout` the array `array` formatted as a table.
68 - */
69 - table(tabularData: any, properties?: ReadonlyArray<string>): void;
70 - /**
71 - * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
72 - */
73 - time(label?: string): void;
74 - /**
75 - * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`.
76 - */
77 - timeEnd(label?: string): void;
78 - /**
79 - * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`.
80 - */
81 - timeLog(label?: string, ...data: any[]): void;
82 - /**
83 - * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.
84 - */
85 - trace(message?: any, ...optionalParams: any[]): void;
86 - /**
87 - * The {@link console.warn()} function is an alias for {@link console.error()}.
88 - */
89 - warn(message?: any, ...optionalParams: any[]): void;
90 -
91 - // --- Inspector mode only ---
92 - /**
93 - * This method does not display anything unless used in the inspector.
94 - * Starts a JavaScript CPU profile with an optional label.
95 - */
96 - profile(label?: string): void;
97 - /**
98 - * This method does not display anything unless used in the inspector.
99 - * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
100 - */
101 - profileEnd(label?: string): void;
102 - /**
103 - * This method does not display anything unless used in the inspector.
104 - * Adds an event with the label `label` to the Timeline panel of the inspector.
105 - */
106 - timeStamp(label?: string): void;
107 - }
108 -
109 - var console: Console;
110 -
111 - namespace NodeJS {
112 - interface ConsoleConstructorOptions {
113 - stdout: WritableStream;
114 - stderr?: WritableStream;
115 - ignoreErrors?: boolean;
116 - colorMode?: boolean | 'auto';
117 - inspectOptions?: InspectOptions;
118 - }
119 -
120 - interface ConsoleConstructor {
121 - prototype: Console;
122 - new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
123 - new(options: ConsoleConstructorOptions): Console;
124 - }
125 -
126 - interface Global {
127 - console: typeof console;
128 - }
129 - }
130 - }
131 -
132 - export = console;
133 -}
1 -/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
2 -declare module 'constants' {
3 - import { constants as osConstants, SignalConstants } from 'os';
4 - import { constants as cryptoConstants } from 'crypto';
5 - import { constants as fsConstants } from 'fs';
6 -
7 - const exp: typeof osConstants.errno &
8 - typeof osConstants.priority &
9 - SignalConstants &
10 - typeof cryptoConstants &
11 - typeof fsConstants;
12 - export = exp;
13 -}
This diff is collapsed. Click to expand it.
1 -declare module 'dgram' {
2 - import { AddressInfo } from 'net';
3 - import * as dns from 'dns';
4 - import EventEmitter = require('events');
5 -
6 - interface RemoteInfo {
7 - address: string;
8 - family: 'IPv4' | 'IPv6';
9 - port: number;
10 - size: number;
11 - }
12 -
13 - interface BindOptions {
14 - port?: number;
15 - address?: string;
16 - exclusive?: boolean;
17 - fd?: number;
18 - }
19 -
20 - type SocketType = "udp4" | "udp6";
21 -
22 - interface SocketOptions {
23 - type: SocketType;
24 - reuseAddr?: boolean;
25 - /**
26 - * @default false
27 - */
28 - ipv6Only?: boolean;
29 - recvBufferSize?: number;
30 - sendBufferSize?: number;
31 - lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
32 - }
33 -
34 - function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
35 - function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
36 -
37 - class Socket extends EventEmitter {
38 - addMembership(multicastAddress: string, multicastInterface?: string): void;
39 - address(): AddressInfo;
40 - bind(port?: number, address?: string, callback?: () => void): void;
41 - bind(port?: number, callback?: () => void): void;
42 - bind(callback?: () => void): void;
43 - bind(options: BindOptions, callback?: () => void): void;
44 - close(callback?: () => void): void;
45 - connect(port: number, address?: string, callback?: () => void): void;
46 - connect(port: number, callback: () => void): void;
47 - disconnect(): void;
48 - dropMembership(multicastAddress: string, multicastInterface?: string): void;
49 - getRecvBufferSize(): number;
50 - getSendBufferSize(): number;
51 - ref(): this;
52 - remoteAddress(): AddressInfo;
53 - send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
54 - send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
55 - send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
56 - send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
57 - send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
58 - send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
59 - setBroadcast(flag: boolean): void;
60 - setMulticastInterface(multicastInterface: string): void;
61 - setMulticastLoopback(flag: boolean): void;
62 - setMulticastTTL(ttl: number): void;
63 - setRecvBufferSize(size: number): void;
64 - setSendBufferSize(size: number): void;
65 - setTTL(ttl: number): void;
66 - unref(): this;
67 - /**
68 - * Tells the kernel to join a source-specific multicast channel at the given
69 - * `sourceAddress` and `groupAddress`, using the `multicastInterface` with the
70 - * `IP_ADD_SOURCE_MEMBERSHIP` socket option.
71 - * If the `multicastInterface` argument
72 - * is not specified, the operating system will choose one interface and will add
73 - * membership to it.
74 - * To add membership to every available interface, call
75 - * `socket.addSourceSpecificMembership()` multiple times, once per interface.
76 - */
77 - addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
78 -
79 - /**
80 - * Instructs the kernel to leave a source-specific multicast channel at the given
81 - * `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`
82 - * socket option. This method is automatically called by the kernel when the
83 - * socket is closed or the process terminates, so most apps will never have
84 - * reason to call this.
85 - *
86 - * If `multicastInterface` is not specified, the operating system will attempt to
87 - * drop membership on all valid interfaces.
88 - */
89 - dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
90 -
91 - /**
92 - * events.EventEmitter
93 - * 1. close
94 - * 2. connect
95 - * 3. error
96 - * 4. listening
97 - * 5. message
98 - */
99 - addListener(event: string, listener: (...args: any[]) => void): this;
100 - addListener(event: "close", listener: () => void): this;
101 - addListener(event: "connect", listener: () => void): this;
102 - addListener(event: "error", listener: (err: Error) => void): this;
103 - addListener(event: "listening", listener: () => void): this;
104 - addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
105 -
106 - emit(event: string | symbol, ...args: any[]): boolean;
107 - emit(event: "close"): boolean;
108 - emit(event: "connect"): boolean;
109 - emit(event: "error", err: Error): boolean;
110 - emit(event: "listening"): boolean;
111 - emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
112 -
113 - on(event: string, listener: (...args: any[]) => void): this;
114 - on(event: "close", listener: () => void): this;
115 - on(event: "connect", listener: () => void): this;
116 - on(event: "error", listener: (err: Error) => void): this;
117 - on(event: "listening", listener: () => void): this;
118 - on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
119 -
120 - once(event: string, listener: (...args: any[]) => void): this;
121 - once(event: "close", listener: () => void): this;
122 - once(event: "connect", listener: () => void): this;
123 - once(event: "error", listener: (err: Error) => void): this;
124 - once(event: "listening", listener: () => void): this;
125 - once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
126 -
127 - prependListener(event: string, listener: (...args: any[]) => void): this;
128 - prependListener(event: "close", listener: () => void): this;
129 - prependListener(event: "connect", listener: () => void): this;
130 - prependListener(event: "error", listener: (err: Error) => void): this;
131 - prependListener(event: "listening", listener: () => void): this;
132 - prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
133 -
134 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
135 - prependOnceListener(event: "close", listener: () => void): this;
136 - prependOnceListener(event: "connect", listener: () => void): this;
137 - prependOnceListener(event: "error", listener: (err: Error) => void): this;
138 - prependOnceListener(event: "listening", listener: () => void): this;
139 - prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
140 - }
141 -}
This diff is collapsed. Click to expand it.
1 -declare module "dns/promises" {
2 - import {
3 - LookupAddress,
4 - LookupOneOptions,
5 - LookupAllOptions,
6 - LookupOptions,
7 - AnyRecord,
8 - CaaRecord,
9 - MxRecord,
10 - NaptrRecord,
11 - SoaRecord,
12 - SrvRecord,
13 - ResolveWithTtlOptions,
14 - RecordWithTtl,
15 - ResolveOptions,
16 - ResolverOptions,
17 - } from "dns";
18 -
19 - function getServers(): string[];
20 -
21 - function lookup(hostname: string, family: number): Promise<LookupAddress>;
22 - function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
23 - function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
24 - function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
25 - function lookup(hostname: string): Promise<LookupAddress>;
26 -
27 - function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>;
28 -
29 - function resolve(hostname: string): Promise<string[]>;
30 - function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
31 - function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
32 - function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
33 - function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
34 - function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
35 - function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
36 - function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
37 - function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
38 - function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
39 - function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
40 - function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
41 - function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
42 - function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
43 -
44 - function resolve4(hostname: string): Promise<string[]>;
45 - function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
46 - function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
47 -
48 - function resolve6(hostname: string): Promise<string[]>;
49 - function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
50 - function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
51 -
52 - function resolveAny(hostname: string): Promise<AnyRecord[]>;
53 -
54 - function resolveCaa(hostname: string): Promise<CaaRecord[]>;
55 -
56 - function resolveCname(hostname: string): Promise<string[]>;
57 -
58 - function resolveMx(hostname: string): Promise<MxRecord[]>;
59 -
60 - function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
61 -
62 - function resolveNs(hostname: string): Promise<string[]>;
63 -
64 - function resolvePtr(hostname: string): Promise<string[]>;
65 -
66 - function resolveSoa(hostname: string): Promise<SoaRecord>;
67 -
68 - function resolveSrv(hostname: string): Promise<SrvRecord[]>;
69 -
70 - function resolveTxt(hostname: string): Promise<string[][]>;
71 -
72 - function reverse(ip: string): Promise<string[]>;
73 -
74 - function setServers(servers: ReadonlyArray<string>): void;
75 -
76 - class Resolver {
77 - constructor(options?: ResolverOptions);
78 -
79 - cancel(): void;
80 - getServers: typeof getServers;
81 - resolve: typeof resolve;
82 - resolve4: typeof resolve4;
83 - resolve6: typeof resolve6;
84 - resolveAny: typeof resolveAny;
85 - resolveCname: typeof resolveCname;
86 - resolveMx: typeof resolveMx;
87 - resolveNaptr: typeof resolveNaptr;
88 - resolveNs: typeof resolveNs;
89 - resolvePtr: typeof resolvePtr;
90 - resolveSoa: typeof resolveSoa;
91 - resolveSrv: typeof resolveSrv;
92 - resolveTxt: typeof resolveTxt;
93 - reverse: typeof reverse;
94 - setLocalAddress(ipv4?: string, ipv6?: string): void;
95 - setServers: typeof setServers;
96 - }
97 -}
1 -declare module 'domain' {
2 - import EventEmitter = require('events');
3 -
4 - global {
5 - namespace NodeJS {
6 - interface Domain extends EventEmitter {
7 - run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
8 - add(emitter: EventEmitter | Timer): void;
9 - remove(emitter: EventEmitter | Timer): void;
10 - bind<T extends Function>(cb: T): T;
11 - intercept<T extends Function>(cb: T): T;
12 - }
13 - }
14 - }
15 -
16 - interface Domain extends NodeJS.Domain {}
17 - class Domain extends EventEmitter {
18 - members: Array<EventEmitter | NodeJS.Timer>;
19 - enter(): void;
20 - exit(): void;
21 - }
22 -
23 - function create(): Domain;
24 -}
1 -declare module 'events' {
2 - interface EventEmitterOptions {
3 - /**
4 - * Enables automatic capturing of promise rejection.
5 - */
6 - captureRejections?: boolean;
7 - }
8 -
9 - interface NodeEventTarget {
10 - once(event: string | symbol, listener: (...args: any[]) => void): this;
11 - }
12 -
13 - interface DOMEventTarget {
14 - addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
15 - }
16 -
17 - interface StaticEventEmitterOptions {
18 - signal?: AbortSignal;
19 - }
20 -
21 - interface EventEmitter extends NodeJS.EventEmitter {}
22 - class EventEmitter {
23 - constructor(options?: EventEmitterOptions);
24 -
25 - static once(emitter: NodeEventTarget, event: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
26 - static once(emitter: DOMEventTarget, event: string, options?: StaticEventEmitterOptions): Promise<any[]>;
27 - static on(emitter: NodeJS.EventEmitter, event: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
28 -
29 - /** @deprecated since v4.0.0 */
30 - static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number;
31 -
32 - /**
33 - * This symbol shall be used to install a listener for only monitoring `'error'`
34 - * events. Listeners installed using this symbol are called before the regular
35 - * `'error'` listeners are called.
36 - *
37 - * Installing a listener using this symbol does not change the behavior once an
38 - * `'error'` event is emitted, therefore the process will still crash if no
39 - * regular `'error'` listener is installed.
40 - */
41 - static readonly errorMonitor: unique symbol;
42 - static readonly captureRejectionSymbol: unique symbol;
43 -
44 - /**
45 - * Sets or gets the default captureRejection value for all emitters.
46 - */
47 - // TODO: These should be described using static getter/setter pairs:
48 - static captureRejections: boolean;
49 - static defaultMaxListeners: number;
50 - }
51 -
52 - import internal = require('events');
53 - namespace EventEmitter {
54 - // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
55 - export { internal as EventEmitter };
56 - }
57 -
58 - global {
59 - namespace NodeJS {
60 - interface EventEmitter {
61 - addListener(event: string | symbol, listener: (...args: any[]) => void): this;
62 - on(event: string | symbol, listener: (...args: any[]) => void): this;
63 - once(event: string | symbol, listener: (...args: any[]) => void): this;
64 - removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
65 - off(event: string | symbol, listener: (...args: any[]) => void): this;
66 - removeAllListeners(event?: string | symbol): this;
67 - setMaxListeners(n: number): this;
68 - getMaxListeners(): number;
69 - listeners(event: string | symbol): Function[];
70 - rawListeners(event: string | symbol): Function[];
71 - emit(event: string | symbol, ...args: any[]): boolean;
72 - listenerCount(event: string | symbol): number;
73 - // Added in Node 6...
74 - prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
75 - prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
76 - eventNames(): Array<string | symbol>;
77 - }
78 - }
79 - }
80 -
81 - export = EventEmitter;
82 -}
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -declare var global: NodeJS.Global & typeof globalThis;
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -declare module 'https' {
2 - import * as tls from 'tls';
3 - import * as http from 'http';
4 - import { URL } from 'url';
5 -
6 - type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
7 -
8 - type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
9 - rejectUnauthorized?: boolean; // Defaults to true
10 - servername?: string; // SNI TLS Extension
11 - };
12 -
13 - interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
14 - rejectUnauthorized?: boolean;
15 - maxCachedSessions?: number;
16 - }
17 -
18 - class Agent extends http.Agent {
19 - constructor(options?: AgentOptions);
20 - options: AgentOptions;
21 - }
22 -
23 - interface Server extends http.HttpBase {}
24 - class Server extends tls.Server {
25 - constructor(requestListener?: http.RequestListener);
26 - constructor(options: ServerOptions, requestListener?: http.RequestListener);
27 - }
28 -
29 - function createServer(requestListener?: http.RequestListener): Server;
30 - function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
31 - function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
32 - function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
33 - function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
34 - function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
35 - let globalAgent: Agent;
36 -}
1 -// Type definitions for non-npm package Node.js 15.0
2 -// Project: http://nodejs.org/
3 -// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4 -// DefinitelyTyped <https://github.com/DefinitelyTyped>
5 -// Alberto Schiabel <https://github.com/jkomyno>
6 -// Alvis HT Tang <https://github.com/alvis>
7 -// Andrew Makarov <https://github.com/r3nya>
8 -// Benjamin Toueg <https://github.com/btoueg>
9 -// Chigozirim C. <https://github.com/smac89>
10 -// David Junger <https://github.com/touffy>
11 -// Deividas Bakanas <https://github.com/DeividasBakanas>
12 -// Eugene Y. Q. Shen <https://github.com/eyqs>
13 -// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
14 -// Hoàng Văn Khải <https://github.com/KSXGitHub>
15 -// Huw <https://github.com/hoo29>
16 -// Kelvin Jin <https://github.com/kjin>
17 -// Klaus Meinhardt <https://github.com/ajafff>
18 -// Lishude <https://github.com/islishude>
19 -// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
20 -// Mohsen Azimi <https://github.com/mohsen1>
21 -// Nicolas Even <https://github.com/n-e>
22 -// Nikita Galkin <https://github.com/galkin>
23 -// Parambir Singh <https://github.com/parambirs>
24 -// Sebastian Silbermann <https://github.com/eps1lon>
25 -// Simon Schick <https://github.com/SimonSchick>
26 -// Thomas den Hollander <https://github.com/ThomasdenH>
27 -// Wilco Bakker <https://github.com/WilcoBakker>
28 -// wwwy3y3 <https://github.com/wwwy3y3>
29 -// Samuel Ainsworth <https://github.com/samuela>
30 -// Kyle Uehlein <https://github.com/kuehlein>
31 -// Thanik Bhongbhibhat <https://github.com/bhongy>
32 -// Marcin Kopacz <https://github.com/chyzwar>
33 -// Trivikram Kamat <https://github.com/trivikr>
34 -// Minh Son Nguyen <https://github.com/nguymin4>
35 -// Junxiao Shi <https://github.com/yoursunny>
36 -// Ilia Baryshnikov <https://github.com/qwelias>
37 -// ExE Boss <https://github.com/ExE-Boss>
38 -// Surasak Chaisurin <https://github.com/Ryan-Willpower>
39 -// Piotr Błażejewicz <https://github.com/peterblazejewicz>
40 -// Anna Henningsen <https://github.com/addaleax>
41 -// Jason Kwok <https://github.com/JasonHK>
42 -// Victor Perin <https://github.com/victorperin>
43 -// Yongsheng Zhang <https://github.com/ZYSzys>
44 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
45 -
46 -// NOTE: These definitions support NodeJS and TypeScript 3.7.
47 -// Typically type modifications should be made in base.d.ts instead of here
48 -
49 -/// <reference path="base.d.ts" />
50 -
51 -// NOTE: TypeScript version-specific augmentations can be found in the following paths:
52 -// - ~/base.d.ts - Shared definitions common to all TypeScript versions
53 -// - ~/index.d.ts - Definitions specific to TypeScript 2.8
54 -// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5
55 -
56 -// NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides
57 -// within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions
58 -// prior to TypeScript 3.5, so the older definitions will be found here.
This diff could not be displayed because it is too large.
1 -declare module 'module' {
2 - import { URL } from 'url';
3 - namespace Module {
4 - /**
5 - * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
6 - * It does not add or remove exported names from the ES Modules.
7 - */
8 - function syncBuiltinESMExports(): void;
9 -
10 - function findSourceMap(path: string, error?: Error): SourceMap;
11 - interface SourceMapPayload {
12 - file: string;
13 - version: number;
14 - sources: string[];
15 - sourcesContent: string[];
16 - names: string[];
17 - mappings: string;
18 - sourceRoot: string;
19 - }
20 -
21 - interface SourceMapping {
22 - generatedLine: number;
23 - generatedColumn: number;
24 - originalSource: string;
25 - originalLine: number;
26 - originalColumn: number;
27 - }
28 -
29 - class SourceMap {
30 - readonly payload: SourceMapPayload;
31 - constructor(payload: SourceMapPayload);
32 - findEntry(line: number, column: number): SourceMapping;
33 - }
34 - }
35 - interface Module extends NodeModule {}
36 - class Module {
37 - static runMain(): void;
38 - static wrap(code: string): string;
39 -
40 - /**
41 - * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
42 - */
43 - static createRequireFromPath(path: string): NodeRequire;
44 - static createRequire(path: string | URL): NodeRequire;
45 - static builtinModules: string[];
46 -
47 - static Module: typeof Module;
48 -
49 - constructor(id: string, parent?: Module);
50 - }
51 - export = Module;
52 -}
This diff is collapsed. Click to expand it.
1 -declare module 'os' {
2 - interface CpuInfo {
3 - model: string;
4 - speed: number;
5 - times: {
6 - user: number;
7 - nice: number;
8 - sys: number;
9 - idle: number;
10 - irq: number;
11 - };
12 - }
13 -
14 - interface NetworkInterfaceBase {
15 - address: string;
16 - netmask: string;
17 - mac: string;
18 - internal: boolean;
19 - cidr: string | null;
20 - }
21 -
22 - interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
23 - family: "IPv4";
24 - }
25 -
26 - interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
27 - family: "IPv6";
28 - scopeid: number;
29 - }
30 -
31 - interface UserInfo<T> {
32 - username: T;
33 - uid: number;
34 - gid: number;
35 - shell: T;
36 - homedir: T;
37 - }
38 -
39 - type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
40 -
41 - function hostname(): string;
42 - function loadavg(): number[];
43 - function uptime(): number;
44 - function freemem(): number;
45 - function totalmem(): number;
46 - function cpus(): CpuInfo[];
47 - function type(): string;
48 - function release(): string;
49 - function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
50 - function homedir(): string;
51 - function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52 - function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
53 -
54 - type SignalConstants = {
55 - [key in NodeJS.Signals]: number;
56 - };
57 -
58 - namespace constants {
59 - const UV_UDP_REUSEADDR: number;
60 - namespace signals {}
61 - const signals: SignalConstants;
62 - namespace errno {
63 - const E2BIG: number;
64 - const EACCES: number;
65 - const EADDRINUSE: number;
66 - const EADDRNOTAVAIL: number;
67 - const EAFNOSUPPORT: number;
68 - const EAGAIN: number;
69 - const EALREADY: number;
70 - const EBADF: number;
71 - const EBADMSG: number;
72 - const EBUSY: number;
73 - const ECANCELED: number;
74 - const ECHILD: number;
75 - const ECONNABORTED: number;
76 - const ECONNREFUSED: number;
77 - const ECONNRESET: number;
78 - const EDEADLK: number;
79 - const EDESTADDRREQ: number;
80 - const EDOM: number;
81 - const EDQUOT: number;
82 - const EEXIST: number;
83 - const EFAULT: number;
84 - const EFBIG: number;
85 - const EHOSTUNREACH: number;
86 - const EIDRM: number;
87 - const EILSEQ: number;
88 - const EINPROGRESS: number;
89 - const EINTR: number;
90 - const EINVAL: number;
91 - const EIO: number;
92 - const EISCONN: number;
93 - const EISDIR: number;
94 - const ELOOP: number;
95 - const EMFILE: number;
96 - const EMLINK: number;
97 - const EMSGSIZE: number;
98 - const EMULTIHOP: number;
99 - const ENAMETOOLONG: number;
100 - const ENETDOWN: number;
101 - const ENETRESET: number;
102 - const ENETUNREACH: number;
103 - const ENFILE: number;
104 - const ENOBUFS: number;
105 - const ENODATA: number;
106 - const ENODEV: number;
107 - const ENOENT: number;
108 - const ENOEXEC: number;
109 - const ENOLCK: number;
110 - const ENOLINK: number;
111 - const ENOMEM: number;
112 - const ENOMSG: number;
113 - const ENOPROTOOPT: number;
114 - const ENOSPC: number;
115 - const ENOSR: number;
116 - const ENOSTR: number;
117 - const ENOSYS: number;
118 - const ENOTCONN: number;
119 - const ENOTDIR: number;
120 - const ENOTEMPTY: number;
121 - const ENOTSOCK: number;
122 - const ENOTSUP: number;
123 - const ENOTTY: number;
124 - const ENXIO: number;
125 - const EOPNOTSUPP: number;
126 - const EOVERFLOW: number;
127 - const EPERM: number;
128 - const EPIPE: number;
129 - const EPROTO: number;
130 - const EPROTONOSUPPORT: number;
131 - const EPROTOTYPE: number;
132 - const ERANGE: number;
133 - const EROFS: number;
134 - const ESPIPE: number;
135 - const ESRCH: number;
136 - const ESTALE: number;
137 - const ETIME: number;
138 - const ETIMEDOUT: number;
139 - const ETXTBSY: number;
140 - const EWOULDBLOCK: number;
141 - const EXDEV: number;
142 - const WSAEINTR: number;
143 - const WSAEBADF: number;
144 - const WSAEACCES: number;
145 - const WSAEFAULT: number;
146 - const WSAEINVAL: number;
147 - const WSAEMFILE: number;
148 - const WSAEWOULDBLOCK: number;
149 - const WSAEINPROGRESS: number;
150 - const WSAEALREADY: number;
151 - const WSAENOTSOCK: number;
152 - const WSAEDESTADDRREQ: number;
153 - const WSAEMSGSIZE: number;
154 - const WSAEPROTOTYPE: number;
155 - const WSAENOPROTOOPT: number;
156 - const WSAEPROTONOSUPPORT: number;
157 - const WSAESOCKTNOSUPPORT: number;
158 - const WSAEOPNOTSUPP: number;
159 - const WSAEPFNOSUPPORT: number;
160 - const WSAEAFNOSUPPORT: number;
161 - const WSAEADDRINUSE: number;
162 - const WSAEADDRNOTAVAIL: number;
163 - const WSAENETDOWN: number;
164 - const WSAENETUNREACH: number;
165 - const WSAENETRESET: number;
166 - const WSAECONNABORTED: number;
167 - const WSAECONNRESET: number;
168 - const WSAENOBUFS: number;
169 - const WSAEISCONN: number;
170 - const WSAENOTCONN: number;
171 - const WSAESHUTDOWN: number;
172 - const WSAETOOMANYREFS: number;
173 - const WSAETIMEDOUT: number;
174 - const WSAECONNREFUSED: number;
175 - const WSAELOOP: number;
176 - const WSAENAMETOOLONG: number;
177 - const WSAEHOSTDOWN: number;
178 - const WSAEHOSTUNREACH: number;
179 - const WSAENOTEMPTY: number;
180 - const WSAEPROCLIM: number;
181 - const WSAEUSERS: number;
182 - const WSAEDQUOT: number;
183 - const WSAESTALE: number;
184 - const WSAEREMOTE: number;
185 - const WSASYSNOTREADY: number;
186 - const WSAVERNOTSUPPORTED: number;
187 - const WSANOTINITIALISED: number;
188 - const WSAEDISCON: number;
189 - const WSAENOMORE: number;
190 - const WSAECANCELLED: number;
191 - const WSAEINVALIDPROCTABLE: number;
192 - const WSAEINVALIDPROVIDER: number;
193 - const WSAEPROVIDERFAILEDINIT: number;
194 - const WSASYSCALLFAILURE: number;
195 - const WSASERVICE_NOT_FOUND: number;
196 - const WSATYPE_NOT_FOUND: number;
197 - const WSA_E_NO_MORE: number;
198 - const WSA_E_CANCELLED: number;
199 - const WSAEREFUSED: number;
200 - }
201 - namespace priority {
202 - const PRIORITY_LOW: number;
203 - const PRIORITY_BELOW_NORMAL: number;
204 - const PRIORITY_NORMAL: number;
205 - const PRIORITY_ABOVE_NORMAL: number;
206 - const PRIORITY_HIGH: number;
207 - const PRIORITY_HIGHEST: number;
208 - }
209 - }
210 -
211 - function arch(): string;
212 - /**
213 - * Returns a string identifying the kernel version.
214 - * On POSIX systems, the operating system release is determined by calling
215 - * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available,
216 - * `GetVersionExW()` will be used. See
217 - * https://en.wikipedia.org/wiki/Uname#Examples for more information.
218 - */
219 - function version(): string;
220 - function platform(): NodeJS.Platform;
221 - function tmpdir(): string;
222 - const EOL: string;
223 - function endianness(): "BE" | "LE";
224 - /**
225 - * Gets the priority of a process.
226 - * Defaults to current process.
227 - */
228 - function getPriority(pid?: number): number;
229 - /**
230 - * Sets the priority of the current process.
231 - * @param priority Must be in range of -20 to 19
232 - */
233 - function setPriority(priority: number): void;
234 - /**
235 - * Sets the priority of the process specified process.
236 - * @param priority Must be in range of -20 to 19
237 - */
238 - function setPriority(pid: number, priority: number): void;
239 -}
1 -{
2 - "name": "@types/node",
3 - "version": "15.0.2",
4 - "description": "TypeScript definitions for Node.js",
5 - "license": "MIT",
6 - "contributors": [
7 - {
8 - "name": "Microsoft TypeScript",
9 - "url": "https://github.com/Microsoft",
10 - "githubUsername": "Microsoft"
11 - },
12 - {
13 - "name": "DefinitelyTyped",
14 - "url": "https://github.com/DefinitelyTyped",
15 - "githubUsername": "DefinitelyTyped"
16 - },
17 - {
18 - "name": "Alberto Schiabel",
19 - "url": "https://github.com/jkomyno",
20 - "githubUsername": "jkomyno"
21 - },
22 - {
23 - "name": "Alvis HT Tang",
24 - "url": "https://github.com/alvis",
25 - "githubUsername": "alvis"
26 - },
27 - {
28 - "name": "Andrew Makarov",
29 - "url": "https://github.com/r3nya",
30 - "githubUsername": "r3nya"
31 - },
32 - {
33 - "name": "Benjamin Toueg",
34 - "url": "https://github.com/btoueg",
35 - "githubUsername": "btoueg"
36 - },
37 - {
38 - "name": "Chigozirim C.",
39 - "url": "https://github.com/smac89",
40 - "githubUsername": "smac89"
41 - },
42 - {
43 - "name": "David Junger",
44 - "url": "https://github.com/touffy",
45 - "githubUsername": "touffy"
46 - },
47 - {
48 - "name": "Deividas Bakanas",
49 - "url": "https://github.com/DeividasBakanas",
50 - "githubUsername": "DeividasBakanas"
51 - },
52 - {
53 - "name": "Eugene Y. Q. Shen",
54 - "url": "https://github.com/eyqs",
55 - "githubUsername": "eyqs"
56 - },
57 - {
58 - "name": "Hannes Magnusson",
59 - "url": "https://github.com/Hannes-Magnusson-CK",
60 - "githubUsername": "Hannes-Magnusson-CK"
61 - },
62 - {
63 - "name": "Hoàng Văn Khải",
64 - "url": "https://github.com/KSXGitHub",
65 - "githubUsername": "KSXGitHub"
66 - },
67 - {
68 - "name": "Huw",
69 - "url": "https://github.com/hoo29",
70 - "githubUsername": "hoo29"
71 - },
72 - {
73 - "name": "Kelvin Jin",
74 - "url": "https://github.com/kjin",
75 - "githubUsername": "kjin"
76 - },
77 - {
78 - "name": "Klaus Meinhardt",
79 - "url": "https://github.com/ajafff",
80 - "githubUsername": "ajafff"
81 - },
82 - {
83 - "name": "Lishude",
84 - "url": "https://github.com/islishude",
85 - "githubUsername": "islishude"
86 - },
87 - {
88 - "name": "Mariusz Wiktorczyk",
89 - "url": "https://github.com/mwiktorczyk",
90 - "githubUsername": "mwiktorczyk"
91 - },
92 - {
93 - "name": "Mohsen Azimi",
94 - "url": "https://github.com/mohsen1",
95 - "githubUsername": "mohsen1"
96 - },
97 - {
98 - "name": "Nicolas Even",
99 - "url": "https://github.com/n-e",
100 - "githubUsername": "n-e"
101 - },
102 - {
103 - "name": "Nikita Galkin",
104 - "url": "https://github.com/galkin",
105 - "githubUsername": "galkin"
106 - },
107 - {
108 - "name": "Parambir Singh",
109 - "url": "https://github.com/parambirs",
110 - "githubUsername": "parambirs"
111 - },
112 - {
113 - "name": "Sebastian Silbermann",
114 - "url": "https://github.com/eps1lon",
115 - "githubUsername": "eps1lon"
116 - },
117 - {
118 - "name": "Simon Schick",
119 - "url": "https://github.com/SimonSchick",
120 - "githubUsername": "SimonSchick"
121 - },
122 - {
123 - "name": "Thomas den Hollander",
124 - "url": "https://github.com/ThomasdenH",
125 - "githubUsername": "ThomasdenH"
126 - },
127 - {
128 - "name": "Wilco Bakker",
129 - "url": "https://github.com/WilcoBakker",
130 - "githubUsername": "WilcoBakker"
131 - },
132 - {
133 - "name": "wwwy3y3",
134 - "url": "https://github.com/wwwy3y3",
135 - "githubUsername": "wwwy3y3"
136 - },
137 - {
138 - "name": "Samuel Ainsworth",
139 - "url": "https://github.com/samuela",
140 - "githubUsername": "samuela"
141 - },
142 - {
143 - "name": "Kyle Uehlein",
144 - "url": "https://github.com/kuehlein",
145 - "githubUsername": "kuehlein"
146 - },
147 - {
148 - "name": "Thanik Bhongbhibhat",
149 - "url": "https://github.com/bhongy",
150 - "githubUsername": "bhongy"
151 - },
152 - {
153 - "name": "Marcin Kopacz",
154 - "url": "https://github.com/chyzwar",
155 - "githubUsername": "chyzwar"
156 - },
157 - {
158 - "name": "Trivikram Kamat",
159 - "url": "https://github.com/trivikr",
160 - "githubUsername": "trivikr"
161 - },
162 - {
163 - "name": "Minh Son Nguyen",
164 - "url": "https://github.com/nguymin4",
165 - "githubUsername": "nguymin4"
166 - },
167 - {
168 - "name": "Junxiao Shi",
169 - "url": "https://github.com/yoursunny",
170 - "githubUsername": "yoursunny"
171 - },
172 - {
173 - "name": "Ilia Baryshnikov",
174 - "url": "https://github.com/qwelias",
175 - "githubUsername": "qwelias"
176 - },
177 - {
178 - "name": "ExE Boss",
179 - "url": "https://github.com/ExE-Boss",
180 - "githubUsername": "ExE-Boss"
181 - },
182 - {
183 - "name": "Surasak Chaisurin",
184 - "url": "https://github.com/Ryan-Willpower",
185 - "githubUsername": "Ryan-Willpower"
186 - },
187 - {
188 - "name": "Piotr Błażejewicz",
189 - "url": "https://github.com/peterblazejewicz",
190 - "githubUsername": "peterblazejewicz"
191 - },
192 - {
193 - "name": "Anna Henningsen",
194 - "url": "https://github.com/addaleax",
195 - "githubUsername": "addaleax"
196 - },
197 - {
198 - "name": "Jason Kwok",
199 - "url": "https://github.com/JasonHK",
200 - "githubUsername": "JasonHK"
201 - },
202 - {
203 - "name": "Victor Perin",
204 - "url": "https://github.com/victorperin",
205 - "githubUsername": "victorperin"
206 - },
207 - {
208 - "name": "Yongsheng Zhang",
209 - "url": "https://github.com/ZYSzys",
210 - "githubUsername": "ZYSzys"
211 - }
212 - ],
213 - "main": "",
214 - "types": "index.d.ts",
215 - "typesVersions": {
216 - "<=3.6": {
217 - "*": [
218 - "ts3.6/*"
219 - ]
220 - }
221 - },
222 - "repository": {
223 - "type": "git",
224 - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
225 - "directory": "types/node"
226 - },
227 - "scripts": {},
228 - "dependencies": {},
229 - "typesPublisherContentHash": "b9f4badc74a3b8d0d3d6d7d094196c4851f8a80a2c34e8ba50f75d7de65c3c63",
230 - "typeScriptVersion": "3.5"
231 -}
...\ No newline at end of file ...\ No newline at end of file
1 -declare module 'path' {
2 - namespace path {
3 - /**
4 - * A parsed path object generated by path.parse() or consumed by path.format().
5 - */
6 - interface ParsedPath {
7 - /**
8 - * The root of the path such as '/' or 'c:\'
9 - */
10 - root: string;
11 - /**
12 - * The full directory path such as '/home/user/dir' or 'c:\path\dir'
13 - */
14 - dir: string;
15 - /**
16 - * The file name including extension (if any) such as 'index.html'
17 - */
18 - base: string;
19 - /**
20 - * The file extension (if any) such as '.html'
21 - */
22 - ext: string;
23 - /**
24 - * The file name without extension (if any) such as 'index'
25 - */
26 - name: string;
27 - }
28 -
29 - interface FormatInputPathObject {
30 - /**
31 - * The root of the path such as '/' or 'c:\'
32 - */
33 - root?: string;
34 - /**
35 - * The full directory path such as '/home/user/dir' or 'c:\path\dir'
36 - */
37 - dir?: string;
38 - /**
39 - * The file name including extension (if any) such as 'index.html'
40 - */
41 - base?: string;
42 - /**
43 - * The file extension (if any) such as '.html'
44 - */
45 - ext?: string;
46 - /**
47 - * The file name without extension (if any) such as 'index'
48 - */
49 - name?: string;
50 - }
51 -
52 - interface PlatformPath {
53 - /**
54 - * Normalize a string path, reducing '..' and '.' parts.
55 - * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
56 - *
57 - * @param p string path to normalize.
58 - */
59 - normalize(p: string): string;
60 - /**
61 - * Join all arguments together and normalize the resulting path.
62 - * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
63 - *
64 - * @param paths paths to join.
65 - */
66 - join(...paths: string[]): string;
67 - /**
68 - * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
69 - *
70 - * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
71 - *
72 - * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
73 - * until an absolute path is found. If after using all {from} paths still no absolute path is found,
74 - * the current working directory is used as well. The resulting path is normalized,
75 - * and trailing slashes are removed unless the path gets resolved to the root directory.
76 - *
77 - * @param pathSegments string paths to join. Non-string arguments are ignored.
78 - */
79 - resolve(...pathSegments: string[]): string;
80 - /**
81 - * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
82 - *
83 - * @param path path to test.
84 - */
85 - isAbsolute(p: string): boolean;
86 - /**
87 - * Solve the relative path from {from} to {to}.
88 - * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
89 - */
90 - relative(from: string, to: string): string;
91 - /**
92 - * Return the directory name of a path. Similar to the Unix dirname command.
93 - *
94 - * @param p the path to evaluate.
95 - */
96 - dirname(p: string): string;
97 - /**
98 - * Return the last portion of a path. Similar to the Unix basename command.
99 - * Often used to extract the file name from a fully qualified path.
100 - *
101 - * @param p the path to evaluate.
102 - * @param ext optionally, an extension to remove from the result.
103 - */
104 - basename(p: string, ext?: string): string;
105 - /**
106 - * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
107 - * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
108 - *
109 - * @param p the path to evaluate.
110 - */
111 - extname(p: string): string;
112 - /**
113 - * The platform-specific file separator. '\\' or '/'.
114 - */
115 - readonly sep: string;
116 - /**
117 - * The platform-specific file delimiter. ';' or ':'.
118 - */
119 - readonly delimiter: string;
120 - /**
121 - * Returns an object from a path string - the opposite of format().
122 - *
123 - * @param pathString path to evaluate.
124 - */
125 - parse(p: string): ParsedPath;
126 - /**
127 - * Returns a path string from an object - the opposite of parse().
128 - *
129 - * @param pathString path to evaluate.
130 - */
131 - format(pP: FormatInputPathObject): string;
132 - /**
133 - * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
134 - * If path is not a string, path will be returned without modifications.
135 - * This method is meaningful only on Windows system.
136 - * On POSIX systems, the method is non-operational and always returns path without modifications.
137 - */
138 - toNamespacedPath(path: string): string;
139 - /**
140 - * Posix specific pathing.
141 - * Same as parent object on posix.
142 - */
143 - readonly posix: PlatformPath;
144 - /**
145 - * Windows specific pathing.
146 - * Same as parent object on windows
147 - */
148 - readonly win32: PlatformPath;
149 - }
150 - }
151 - const path: path.PlatformPath;
152 - export = path;
153 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -/**
2 - * @deprecated since v7.0.0
3 - * The version of the punycode module bundled in Node.js is being deprecated.
4 - * In a future major version of Node.js this module will be removed.
5 - * Users currently depending on the punycode module should switch to using
6 - * the userland-provided Punycode.js module instead.
7 - */
8 -declare module 'punycode' {
9 - /**
10 - * @deprecated since v7.0.0
11 - * The version of the punycode module bundled in Node.js is being deprecated.
12 - * In a future major version of Node.js this module will be removed.
13 - * Users currently depending on the punycode module should switch to using
14 - * the userland-provided Punycode.js module instead.
15 - */
16 - function decode(string: string): string;
17 - /**
18 - * @deprecated since v7.0.0
19 - * The version of the punycode module bundled in Node.js is being deprecated.
20 - * In a future major version of Node.js this module will be removed.
21 - * Users currently depending on the punycode module should switch to using
22 - * the userland-provided Punycode.js module instead.
23 - */
24 - function encode(string: string): string;
25 - /**
26 - * @deprecated since v7.0.0
27 - * The version of the punycode module bundled in Node.js is being deprecated.
28 - * In a future major version of Node.js this module will be removed.
29 - * Users currently depending on the punycode module should switch to using
30 - * the userland-provided Punycode.js module instead.
31 - */
32 - function toUnicode(domain: string): string;
33 - /**
34 - * @deprecated since v7.0.0
35 - * The version of the punycode module bundled in Node.js is being deprecated.
36 - * In a future major version of Node.js this module will be removed.
37 - * Users currently depending on the punycode module should switch to using
38 - * the userland-provided Punycode.js module instead.
39 - */
40 - function toASCII(domain: string): string;
41 - /**
42 - * @deprecated since v7.0.0
43 - * The version of the punycode module bundled in Node.js is being deprecated.
44 - * In a future major version of Node.js this module will be removed.
45 - * Users currently depending on the punycode module should switch to using
46 - * the userland-provided Punycode.js module instead.
47 - */
48 - const ucs2: ucs2;
49 - interface ucs2 {
50 - /**
51 - * @deprecated since v7.0.0
52 - * The version of the punycode module bundled in Node.js is being deprecated.
53 - * In a future major version of Node.js this module will be removed.
54 - * Users currently depending on the punycode module should switch to using
55 - * the userland-provided Punycode.js module instead.
56 - */
57 - decode(string: string): number[];
58 - /**
59 - * @deprecated since v7.0.0
60 - * The version of the punycode module bundled in Node.js is being deprecated.
61 - * In a future major version of Node.js this module will be removed.
62 - * Users currently depending on the punycode module should switch to using
63 - * the userland-provided Punycode.js module instead.
64 - */
65 - encode(codePoints: ReadonlyArray<number>): string;
66 - }
67 - /**
68 - * @deprecated since v7.0.0
69 - * The version of the punycode module bundled in Node.js is being deprecated.
70 - * In a future major version of Node.js this module will be removed.
71 - * Users currently depending on the punycode module should switch to using
72 - * the userland-provided Punycode.js module instead.
73 - */
74 - const version: string;
75 -}
1 -declare module 'querystring' {
2 - interface StringifyOptions {
3 - encodeURIComponent?: (str: string) => string;
4 - }
5 -
6 - interface ParseOptions {
7 - maxKeys?: number;
8 - decodeURIComponent?: (str: string) => string;
9 - }
10 -
11 - interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
12 -
13 - interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {
14 - }
15 -
16 - function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
17 - function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
18 - /**
19 - * The querystring.encode() function is an alias for querystring.stringify().
20 - */
21 - const encode: typeof stringify;
22 - /**
23 - * The querystring.decode() function is an alias for querystring.parse().
24 - */
25 - const decode: typeof parse;
26 - function escape(str: string): string;
27 - function unescape(str: string): string;
28 -}
1 -declare module 'readline' {
2 - import EventEmitter = require('events');
3 -
4 - interface Key {
5 - sequence?: string;
6 - name?: string;
7 - ctrl?: boolean;
8 - meta?: boolean;
9 - shift?: boolean;
10 - }
11 -
12 - class Interface extends EventEmitter {
13 - readonly terminal: boolean;
14 -
15 - // Need direct access to line/cursor data, for use in external processes
16 - // see: https://github.com/nodejs/node/issues/30347
17 - /** The current input data */
18 - readonly line: string;
19 - /** The current cursor position in the input line */
20 - readonly cursor: number;
21 -
22 - /**
23 - * NOTE: According to the documentation:
24 - *
25 - * > Instances of the `readline.Interface` class are constructed using the
26 - * > `readline.createInterface()` method.
27 - *
28 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
29 - */
30 - protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
31 - /**
32 - * NOTE: According to the documentation:
33 - *
34 - * > Instances of the `readline.Interface` class are constructed using the
35 - * > `readline.createInterface()` method.
36 - *
37 - * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
38 - */
39 - protected constructor(options: ReadLineOptions);
40 -
41 - setPrompt(prompt: string): void;
42 - prompt(preserveCursor?: boolean): void;
43 - question(query: string, callback: (answer: string) => void): void;
44 - pause(): this;
45 - resume(): this;
46 - close(): void;
47 - write(data: string | Buffer, key?: Key): void;
48 -
49 - /**
50 - * Returns the real position of the cursor in relation to the input
51 - * prompt + string. Long input (wrapping) strings, as well as multiple
52 - * line prompts are included in the calculations.
53 - */
54 - getCursorPos(): CursorPos;
55 -
56 - /**
57 - * events.EventEmitter
58 - * 1. close
59 - * 2. line
60 - * 3. pause
61 - * 4. resume
62 - * 5. SIGCONT
63 - * 6. SIGINT
64 - * 7. SIGTSTP
65 - */
66 -
67 - addListener(event: string, listener: (...args: any[]) => void): this;
68 - addListener(event: "close", listener: () => void): this;
69 - addListener(event: "line", listener: (input: string) => void): this;
70 - addListener(event: "pause", listener: () => void): this;
71 - addListener(event: "resume", listener: () => void): this;
72 - addListener(event: "SIGCONT", listener: () => void): this;
73 - addListener(event: "SIGINT", listener: () => void): this;
74 - addListener(event: "SIGTSTP", listener: () => void): this;
75 -
76 - emit(event: string | symbol, ...args: any[]): boolean;
77 - emit(event: "close"): boolean;
78 - emit(event: "line", input: string): boolean;
79 - emit(event: "pause"): boolean;
80 - emit(event: "resume"): boolean;
81 - emit(event: "SIGCONT"): boolean;
82 - emit(event: "SIGINT"): boolean;
83 - emit(event: "SIGTSTP"): boolean;
84 -
85 - on(event: string, listener: (...args: any[]) => void): this;
86 - on(event: "close", listener: () => void): this;
87 - on(event: "line", listener: (input: string) => void): this;
88 - on(event: "pause", listener: () => void): this;
89 - on(event: "resume", listener: () => void): this;
90 - on(event: "SIGCONT", listener: () => void): this;
91 - on(event: "SIGINT", listener: () => void): this;
92 - on(event: "SIGTSTP", listener: () => void): this;
93 -
94 - once(event: string, listener: (...args: any[]) => void): this;
95 - once(event: "close", listener: () => void): this;
96 - once(event: "line", listener: (input: string) => void): this;
97 - once(event: "pause", listener: () => void): this;
98 - once(event: "resume", listener: () => void): this;
99 - once(event: "SIGCONT", listener: () => void): this;
100 - once(event: "SIGINT", listener: () => void): this;
101 - once(event: "SIGTSTP", listener: () => void): this;
102 -
103 - prependListener(event: string, listener: (...args: any[]) => void): this;
104 - prependListener(event: "close", listener: () => void): this;
105 - prependListener(event: "line", listener: (input: string) => void): this;
106 - prependListener(event: "pause", listener: () => void): this;
107 - prependListener(event: "resume", listener: () => void): this;
108 - prependListener(event: "SIGCONT", listener: () => void): this;
109 - prependListener(event: "SIGINT", listener: () => void): this;
110 - prependListener(event: "SIGTSTP", listener: () => void): this;
111 -
112 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
113 - prependOnceListener(event: "close", listener: () => void): this;
114 - prependOnceListener(event: "line", listener: (input: string) => void): this;
115 - prependOnceListener(event: "pause", listener: () => void): this;
116 - prependOnceListener(event: "resume", listener: () => void): this;
117 - prependOnceListener(event: "SIGCONT", listener: () => void): this;
118 - prependOnceListener(event: "SIGINT", listener: () => void): this;
119 - prependOnceListener(event: "SIGTSTP", listener: () => void): this;
120 - [Symbol.asyncIterator](): AsyncIterableIterator<string>;
121 - }
122 -
123 - type ReadLine = Interface; // type forwarded for backwards compatibility
124 -
125 - type Completer = (line: string) => CompleterResult;
126 - type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
127 -
128 - type CompleterResult = [string[], string];
129 -
130 - interface ReadLineOptions {
131 - input: NodeJS.ReadableStream;
132 - output?: NodeJS.WritableStream;
133 - completer?: Completer | AsyncCompleter;
134 - terminal?: boolean;
135 - historySize?: number;
136 - prompt?: string;
137 - crlfDelay?: number;
138 - removeHistoryDuplicates?: boolean;
139 - escapeCodeTimeout?: number;
140 - tabSize?: number;
141 - }
142 -
143 - function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
144 - function createInterface(options: ReadLineOptions): Interface;
145 - function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
146 -
147 - type Direction = -1 | 0 | 1;
148 -
149 - interface CursorPos {
150 - rows: number;
151 - cols: number;
152 - }
153 -
154 - /**
155 - * Clears the current line of this WriteStream in a direction identified by `dir`.
156 - */
157 - function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
158 - /**
159 - * Clears this `WriteStream` from the current cursor down.
160 - */
161 - function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
162 - /**
163 - * Moves this WriteStream's cursor to the specified position.
164 - */
165 - function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
166 - /**
167 - * Moves this WriteStream's cursor relative to its current position.
168 - */
169 - function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
170 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 -declare module "stream/promises" {
2 - import { FinishedOptions, PipelineSource, PipelineTransform,
3 - PipelineDestination, PipelinePromise, PipelineOptions } from "stream";
4 -
5 - function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
6 -
7 - function pipeline<A extends PipelineSource<any>,
8 - B extends PipelineDestination<A, any>>(
9 - source: A,
10 - destination: B,
11 - options?: PipelineOptions
12 - ): PipelinePromise<B>;
13 - function pipeline<A extends PipelineSource<any>,
14 - T1 extends PipelineTransform<A, any>,
15 - B extends PipelineDestination<T1, any>>(
16 - source: A,
17 - transform1: T1,
18 - destination: B,
19 - options?: PipelineOptions
20 - ): PipelinePromise<B>;
21 - function pipeline<A extends PipelineSource<any>,
22 - T1 extends PipelineTransform<A, any>,
23 - T2 extends PipelineTransform<T1, any>,
24 - B extends PipelineDestination<T2, any>>(
25 - source: A,
26 - transform1: T1,
27 - transform2: T2,
28 - destination: B,
29 - options?: PipelineOptions
30 - ): PipelinePromise<B>;
31 - function pipeline<A extends PipelineSource<any>,
32 - T1 extends PipelineTransform<A, any>,
33 - T2 extends PipelineTransform<T1, any>,
34 - T3 extends PipelineTransform<T2, any>,
35 - B extends PipelineDestination<T3, any>>(
36 - source: A,
37 - transform1: T1,
38 - transform2: T2,
39 - transform3: T3,
40 - destination: B,
41 - options?: PipelineOptions
42 - ): PipelinePromise<B>;
43 - function pipeline<A extends PipelineSource<any>,
44 - T1 extends PipelineTransform<A, any>,
45 - T2 extends PipelineTransform<T1, any>,
46 - T3 extends PipelineTransform<T2, any>,
47 - T4 extends PipelineTransform<T3, any>,
48 - B extends PipelineDestination<T4, any>>(
49 - source: A,
50 - transform1: T1,
51 - transform2: T2,
52 - transform3: T3,
53 - transform4: T4,
54 - destination: B,
55 - options?: PipelineOptions
56 - ): PipelinePromise<B>;
57 -
58 - function pipeline(
59 - streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
60 - options?: PipelineOptions
61 - ): Promise<void>;
62 - function pipeline(
63 - stream1: NodeJS.ReadableStream,
64 - stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
65 - ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>,
66 - ): Promise<void>;
67 -}
1 -declare module 'string_decoder' {
2 - class StringDecoder {
3 - constructor(encoding?: BufferEncoding);
4 - write(buffer: Buffer): string;
5 - end(buffer?: Buffer): string;
6 - }
7 -}
1 -declare module 'timers' {
2 - interface TimerOptions {
3 - /**
4 - * Set to `false` to indicate that the scheduled `Timeout`
5 - * should not require the Node.js event loop to remain active.
6 - * @default true
7 - */
8 - ref?: boolean;
9 -
10 - /**
11 - * An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`.
12 - */
13 - signal?: AbortSignal;
14 - }
15 -
16 - function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
17 - namespace setTimeout {
18 - function __promisify__(ms: number): Promise<void>;
19 - function __promisify__<T>(ms: number, value: T, options?: TimerOptions): Promise<T>;
20 - }
21 - function clearTimeout(timeoutId: NodeJS.Timeout): void;
22 - function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
23 - function clearInterval(intervalId: NodeJS.Timeout): void;
24 - function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
25 - namespace setImmediate {
26 - function __promisify__(): Promise<void>;
27 - function __promisify__<T>(value: T, options?: TimerOptions): Promise<T>;
28 - }
29 - function clearImmediate(immediateId: NodeJS.Immediate): void;
30 -}
1 -declare module 'timers/promises' {
2 - import { TimerOptions } from 'timers';
3 -
4 - /**
5 - * Returns a promise that resolves after the specified delay in milliseconds.
6 - */
7 - function setTimeout<T>(delay: number, value?: T, options?: TimerOptions): Promise<T>;
8 -
9 - /**
10 - * Returns a promise that resolves in the next tick.
11 - */
12 - function setImmediate<T>(value: T, options?: TimerOptions): Promise<T>;
13 -}
This diff is collapsed. Click to expand it.
1 -declare module 'trace_events' {
2 - /**
3 - * The `Tracing` object is used to enable or disable tracing for sets of
4 - * categories. Instances are created using the
5 - * `trace_events.createTracing()` method.
6 - *
7 - * When created, the `Tracing` object is disabled. Calling the
8 - * `tracing.enable()` method adds the categories to the set of enabled trace
9 - * event categories. Calling `tracing.disable()` will remove the categories
10 - * from the set of enabled trace event categories.
11 - */
12 - interface Tracing {
13 - /**
14 - * A comma-separated list of the trace event categories covered by this
15 - * `Tracing` object.
16 - */
17 - readonly categories: string;
18 -
19 - /**
20 - * Disables this `Tracing` object.
21 - *
22 - * Only trace event categories _not_ covered by other enabled `Tracing`
23 - * objects and _not_ specified by the `--trace-event-categories` flag
24 - * will be disabled.
25 - */
26 - disable(): void;
27 -
28 - /**
29 - * Enables this `Tracing` object for the set of categories covered by
30 - * the `Tracing` object.
31 - */
32 - enable(): void;
33 -
34 - /**
35 - * `true` only if the `Tracing` object has been enabled.
36 - */
37 - readonly enabled: boolean;
38 - }
39 -
40 - interface CreateTracingOptions {
41 - /**
42 - * An array of trace category names. Values included in the array are
43 - * coerced to a string when possible. An error will be thrown if the
44 - * value cannot be coerced.
45 - */
46 - categories: string[];
47 - }
48 -
49 - /**
50 - * Creates and returns a Tracing object for the given set of categories.
51 - */
52 - function createTracing(options: CreateTracingOptions): Tracing;
53 -
54 - /**
55 - * Returns a comma-separated list of all currently-enabled trace event
56 - * categories. The current set of enabled trace event categories is
57 - * determined by the union of all currently-enabled `Tracing` objects and
58 - * any categories enabled using the `--trace-event-categories` flag.
59 - */
60 - function getEnabledCategories(): string | undefined;
61 -}
1 -declare module 'assert' {
2 - /** An alias of `assert.ok()`. */
3 - function assert(value: any, message?: string | Error): void;
4 - namespace assert {
5 - class AssertionError extends Error {
6 - actual: any;
7 - expected: any;
8 - operator: string;
9 - generatedMessage: boolean;
10 - code: 'ERR_ASSERTION';
11 -
12 - constructor(options?: {
13 - /** If provided, the error message is set to this value. */
14 - message?: string;
15 - /** The `actual` property on the error instance. */
16 - actual?: any;
17 - /** The `expected` property on the error instance. */
18 - expected?: any;
19 - /** The `operator` property on the error instance. */
20 - operator?: string;
21 - /** If provided, the generated stack trace omits frames before this function. */
22 - // tslint:disable-next-line:ban-types
23 - stackStartFn?: Function;
24 - });
25 - }
26 -
27 - class CallTracker {
28 - calls(exact?: number): () => void;
29 - calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30 - report(): CallTrackerReportInformation[];
31 - verify(): void;
32 - }
33 - interface CallTrackerReportInformation {
34 - message: string;
35 - /** The actual number of times the function was called. */
36 - actual: number;
37 - /** The number of times the function was expected to be called. */
38 - expected: number;
39 - /** The name of the function that is wrapped. */
40 - operator: string;
41 - /** A stack trace of the function. */
42 - stack: object;
43 - }
44 -
45 - type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
46 -
47 - function fail(message?: string | Error): never;
48 - /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49 - function fail(
50 - actual: any,
51 - expected: any,
52 - message?: string | Error,
53 - operator?: string,
54 - // tslint:disable-next-line:ban-types
55 - stackStartFn?: Function,
56 - ): never;
57 - function ok(value: any, message?: string | Error): void;
58 - /** @deprecated since v9.9.0 - use strictEqual() instead. */
59 - function equal(actual: any, expected: any, message?: string | Error): void;
60 - /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61 - function notEqual(actual: any, expected: any, message?: string | Error): void;
62 - /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63 - function deepEqual(actual: any, expected: any, message?: string | Error): void;
64 - /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65 - function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
66 - function strictEqual(actual: any, expected: any, message?: string | Error): void;
67 - function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68 - function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
69 - function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
70 -
71 - function throws(block: () => any, message?: string | Error): void;
72 - function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73 - function doesNotThrow(block: () => any, message?: string | Error): void;
74 - function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75 -
76 - function ifError(value: any): void;
77 -
78 - function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
79 - function rejects(
80 - block: (() => Promise<any>) | Promise<any>,
81 - error: AssertPredicate,
82 - message?: string | Error,
83 - ): Promise<void>;
84 - function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85 - function doesNotReject(
86 - block: (() => Promise<any>) | Promise<any>,
87 - error: AssertPredicate,
88 - message?: string | Error,
89 - ): Promise<void>;
90 -
91 - function match(value: string, regExp: RegExp, message?: string | Error): void;
92 - function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93 -
94 - const strict: typeof assert;
95 - }
96 -
97 - export = assert;
98 -}
1 -// NOTE: These definitions support NodeJS and TypeScript 3.6 and earlier.
2 -
3 -// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 -// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 -// - ~/index.d.ts - Definitions specific to TypeScript 3.7 and above
6 -// - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
7 -// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
8 -
9 -// Reference required types from the default lib:
10 -/// <reference lib="es2018" />
11 -/// <reference lib="esnext.asynciterable" />
12 -/// <reference lib="esnext.intl" />
13 -/// <reference lib="esnext.bigint" />
14 -
15 -// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16 -/// <reference path="../assert/strict.d.ts" />
17 -/// <reference path="../globals.d.ts" />
18 -/// <reference path="../async_hooks.d.ts" />
19 -/// <reference path="../buffer.d.ts" />
20 -/// <reference path="../child_process.d.ts" />
21 -/// <reference path="../cluster.d.ts" />
22 -/// <reference path="../console.d.ts" />
23 -/// <reference path="../constants.d.ts" />
24 -/// <reference path="../crypto.d.ts" />
25 -/// <reference path="../dgram.d.ts" />
26 -/// <reference path="../dns.d.ts" />
27 -/// <reference path="../dns/promises.d.ts" />
28 -/// <reference path="../dns/promises.d.ts" />
29 -/// <reference path="../domain.d.ts" />
30 -/// <reference path="../events.d.ts" />
31 -/// <reference path="../fs.d.ts" />
32 -/// <reference path="../fs/promises.d.ts" />
33 -/// <reference path="../http.d.ts" />
34 -/// <reference path="../http2.d.ts" />
35 -/// <reference path="../https.d.ts" />
36 -/// <reference path="../inspector.d.ts" />
37 -/// <reference path="../module.d.ts" />
38 -/// <reference path="../net.d.ts" />
39 -/// <reference path="../os.d.ts" />
40 -/// <reference path="../path.d.ts" />
41 -/// <reference path="../perf_hooks.d.ts" />
42 -/// <reference path="../process.d.ts" />
43 -/// <reference path="../punycode.d.ts" />
44 -/// <reference path="../querystring.d.ts" />
45 -/// <reference path="../readline.d.ts" />
46 -/// <reference path="../repl.d.ts" />
47 -/// <reference path="../stream.d.ts" />
48 -/// <reference path="../stream/promises.d.ts" />
49 -/// <reference path="../string_decoder.d.ts" />
50 -/// <reference path="../timers.d.ts" />
51 -/// <reference path="../timers/promises.d.ts" />
52 -/// <reference path="../tls.d.ts" />
53 -/// <reference path="../trace_events.d.ts" />
54 -/// <reference path="../tty.d.ts" />
55 -/// <reference path="../url.d.ts" />
56 -/// <reference path="../util.d.ts" />
57 -/// <reference path="../v8.d.ts" />
58 -/// <reference path="../vm.d.ts" />
59 -/// <reference path="../worker_threads.d.ts" />
60 -/// <reference path="../zlib.d.ts" />
61 -
62 -// TypeScript 3.5-specific augmentations:
63 -/// <reference path="../globals.global.d.ts" />
64 -
65 -// TypeScript 3.5-specific augmentations:
66 -/// <reference path="../wasi.d.ts" />
1 -// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6.
2 -// This is required to enable typing assert in ts3.7 without causing errors
3 -// Typically type modifications should be made in base.d.ts instead of here
4 -
5 -/// <reference path="base.d.ts" />
6 -
7 -/// <reference path="assert.d.ts" />
1 -declare module 'tty' {
2 - import * as net from 'net';
3 -
4 - function isatty(fd: number): boolean;
5 - class ReadStream extends net.Socket {
6 - constructor(fd: number, options?: net.SocketConstructorOpts);
7 - isRaw: boolean;
8 - setRawMode(mode: boolean): this;
9 - isTTY: boolean;
10 - }
11 - /**
12 - * -1 - to the left from cursor
13 - * 0 - the entire line
14 - * 1 - to the right from cursor
15 - */
16 - type Direction = -1 | 0 | 1;
17 - class WriteStream extends net.Socket {
18 - constructor(fd: number);
19 - addListener(event: string, listener: (...args: any[]) => void): this;
20 - addListener(event: "resize", listener: () => void): this;
21 -
22 - emit(event: string | symbol, ...args: any[]): boolean;
23 - emit(event: "resize"): boolean;
24 -
25 - on(event: string, listener: (...args: any[]) => void): this;
26 - on(event: "resize", listener: () => void): this;
27 -
28 - once(event: string, listener: (...args: any[]) => void): this;
29 - once(event: "resize", listener: () => void): this;
30 -
31 - prependListener(event: string, listener: (...args: any[]) => void): this;
32 - prependListener(event: "resize", listener: () => void): this;
33 -
34 - prependOnceListener(event: string, listener: (...args: any[]) => void): this;
35 - prependOnceListener(event: "resize", listener: () => void): this;
36 -
37 - /**
38 - * Clears the current line of this WriteStream in a direction identified by `dir`.
39 - */
40 - clearLine(dir: Direction, callback?: () => void): boolean;
41 - /**
42 - * Clears this `WriteStream` from the current cursor down.
43 - */
44 - clearScreenDown(callback?: () => void): boolean;
45 - /**
46 - * Moves this WriteStream's cursor to the specified position.
47 - */
48 - cursorTo(x: number, y?: number, callback?: () => void): boolean;
49 - cursorTo(x: number, callback: () => void): boolean;
50 - /**
51 - * Moves this WriteStream's cursor relative to its current position.
52 - */
53 - moveCursor(dx: number, dy: number, callback?: () => void): boolean;
54 - /**
55 - * @default `process.env`
56 - */
57 - getColorDepth(env?: {}): number;
58 - hasColors(depth?: number): boolean;
59 - hasColors(env?: {}): boolean;
60 - hasColors(depth: number, env?: {}): boolean;
61 - getWindowSize(): [number, number];
62 - columns: number;
63 - rows: number;
64 - isTTY: boolean;
65 - }
66 -}
1 -declare module 'url' {
2 - import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
3 -
4 - // Input to `url.format`
5 - interface UrlObject {
6 - auth?: string | null;
7 - hash?: string | null;
8 - host?: string | null;
9 - hostname?: string | null;
10 - href?: string | null;
11 - pathname?: string | null;
12 - protocol?: string | null;
13 - search?: string | null;
14 - slashes?: boolean | null;
15 - port?: string | number | null;
16 - query?: string | null | ParsedUrlQueryInput;
17 - }
18 -
19 - // Output of `url.parse`
20 - interface Url {
21 - auth: string | null;
22 - hash: string | null;
23 - host: string | null;
24 - hostname: string | null;
25 - href: string;
26 - path: string | null;
27 - pathname: string | null;
28 - protocol: string | null;
29 - search: string | null;
30 - slashes: boolean | null;
31 - port: string | null;
32 - query: string | null | ParsedUrlQuery;
33 - }
34 -
35 - interface UrlWithParsedQuery extends Url {
36 - query: ParsedUrlQuery;
37 - }
38 -
39 - interface UrlWithStringQuery extends Url {
40 - query: string | null;
41 - }
42 -
43 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
44 - function parse(urlStr: string): UrlWithStringQuery;
45 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
46 - function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
47 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
48 - function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
49 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
50 - function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
51 -
52 - function format(URL: URL, options?: URLFormatOptions): string;
53 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
54 - function format(urlObject: UrlObject | string): string;
55 - /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
56 - function resolve(from: string, to: string): string;
57 -
58 - function domainToASCII(domain: string): string;
59 - function domainToUnicode(domain: string): string;
60 -
61 - /**
62 - * This function ensures the correct decodings of percent-encoded characters as
63 - * well as ensuring a cross-platform valid absolute path string.
64 - * @param url The file URL string or URL object to convert to a path.
65 - */
66 - function fileURLToPath(url: string | URL): string;
67 -
68 - /**
69 - * This function ensures that path is resolved absolutely, and that the URL
70 - * control characters are correctly encoded when converting into a File URL.
71 - * @param url The path to convert to a File URL.
72 - */
73 - function pathToFileURL(url: string): URL;
74 -
75 - interface URLFormatOptions {
76 - auth?: boolean;
77 - fragment?: boolean;
78 - search?: boolean;
79 - unicode?: boolean;
80 - }
81 -
82 - class URL {
83 - constructor(input: string, base?: string | URL);
84 - hash: string;
85 - host: string;
86 - hostname: string;
87 - href: string;
88 - readonly origin: string;
89 - password: string;
90 - pathname: string;
91 - port: string;
92 - protocol: string;
93 - search: string;
94 - readonly searchParams: URLSearchParams;
95 - username: string;
96 - toString(): string;
97 - toJSON(): string;
98 - }
99 -
100 - class URLSearchParams implements Iterable<[string, string]> {
101 - constructor(init?: URLSearchParams | string | NodeJS.Dict<string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
102 - append(name: string, value: string): void;
103 - delete(name: string): void;
104 - entries(): IterableIterator<[string, string]>;
105 - forEach(callback: (value: string, name: string, searchParams: this) => void): void;
106 - get(name: string): string | null;
107 - getAll(name: string): string[];
108 - has(name: string): boolean;
109 - keys(): IterableIterator<string>;
110 - set(name: string, value: string): void;
111 - sort(): void;
112 - toString(): string;
113 - values(): IterableIterator<string>;
114 - [Symbol.iterator](): IterableIterator<[string, string]>;
115 - }
116 -}
This diff is collapsed. Click to expand it.
1 -declare module 'v8' {
2 - import { Readable } from 'stream';
3 -
4 - interface HeapSpaceInfo {
5 - space_name: string;
6 - space_size: number;
7 - space_used_size: number;
8 - space_available_size: number;
9 - physical_space_size: number;
10 - }
11 -
12 - // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
13 - type DoesZapCodeSpaceFlag = 0 | 1;
14 -
15 - interface HeapInfo {
16 - total_heap_size: number;
17 - total_heap_size_executable: number;
18 - total_physical_size: number;
19 - total_available_size: number;
20 - used_heap_size: number;
21 - heap_size_limit: number;
22 - malloced_memory: number;
23 - peak_malloced_memory: number;
24 - does_zap_garbage: DoesZapCodeSpaceFlag;
25 - number_of_native_contexts: number;
26 - number_of_detached_contexts: number;
27 - }
28 -
29 - interface HeapCodeStatistics {
30 - code_and_metadata_size: number;
31 - bytecode_and_metadata_size: number;
32 - external_script_source_size: number;
33 - }
34 -
35 - /**
36 - * Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features.
37 - * This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8.
38 - */
39 - function cachedDataVersionTag(): number;
40 -
41 - function getHeapStatistics(): HeapInfo;
42 - function getHeapSpaceStatistics(): HeapSpaceInfo[];
43 - function setFlagsFromString(flags: string): void;
44 - /**
45 - * Generates a snapshot of the current V8 heap and returns a Readable
46 - * Stream that may be used to read the JSON serialized representation.
47 - * This conversation was marked as resolved by joyeecheung
48 - * This JSON stream format is intended to be used with tools such as
49 - * Chrome DevTools. The JSON schema is undocumented and specific to the
50 - * V8 engine, and may change from one version of V8 to the next.
51 - */
52 - function getHeapSnapshot(): Readable;
53 -
54 - /**
55 - *
56 - * @param fileName The file path where the V8 heap snapshot is to be
57 - * saved. If not specified, a file name with the pattern
58 - * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
59 - * generated, where `{pid}` will be the PID of the Node.js process,
60 - * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
61 - * the main Node.js thread or the id of a worker thread.
62 - */
63 - function writeHeapSnapshot(fileName?: string): string;
64 -
65 - function getHeapCodeStatistics(): HeapCodeStatistics;
66 -
67 - class Serializer {
68 - /**
69 - * Writes out a header, which includes the serialization format version.
70 - */
71 - writeHeader(): void;
72 -
73 - /**
74 - * Serializes a JavaScript value and adds the serialized representation to the internal buffer.
75 - * This throws an error if value cannot be serialized.
76 - */
77 - writeValue(val: any): boolean;
78 -
79 - /**
80 - * Returns the stored internal buffer.
81 - * This serializer should not be used once the buffer is released.
82 - * Calling this method results in undefined behavior if a previous write has failed.
83 - */
84 - releaseBuffer(): Buffer;
85 -
86 - /**
87 - * Marks an ArrayBuffer as having its contents transferred out of band.\
88 - * Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().
89 - */
90 - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
91 -
92 - /**
93 - * Write a raw 32-bit unsigned integer.
94 - */
95 - writeUint32(value: number): void;
96 -
97 - /**
98 - * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
99 - */
100 - writeUint64(hi: number, lo: number): void;
101 -
102 - /**
103 - * Write a JS number value.
104 - */
105 - writeDouble(value: number): void;
106 -
107 - /**
108 - * Write raw bytes into the serializer’s internal buffer.
109 - * The deserializer will require a way to compute the length of the buffer.
110 - */
111 - writeRawBytes(buffer: NodeJS.TypedArray): void;
112 - }
113 -
114 - /**
115 - * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
116 - * and only stores the part of their underlying `ArrayBuffers` that they are referring to.
117 - */
118 - class DefaultSerializer extends Serializer {
119 - }
120 -
121 - class Deserializer {
122 - constructor(data: NodeJS.TypedArray);
123 - /**
124 - * Reads and validates a header (including the format version).
125 - * May, for example, reject an invalid or unsupported wire format.
126 - * In that case, an Error is thrown.
127 - */
128 - readHeader(): boolean;
129 -
130 - /**
131 - * Deserializes a JavaScript value from the buffer and returns it.
132 - */
133 - readValue(): any;
134 -
135 - /**
136 - * Marks an ArrayBuffer as having its contents transferred out of band.
137 - * Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer()
138 - * (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).
139 - */
140 - transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
141 -
142 - /**
143 - * Reads the underlying wire format version.
144 - * Likely mostly to be useful to legacy code reading old wire format versions.
145 - * May not be called before .readHeader().
146 - */
147 - getWireFormatVersion(): number;
148 -
149 - /**
150 - * Read a raw 32-bit unsigned integer and return it.
151 - */
152 - readUint32(): number;
153 -
154 - /**
155 - * Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.
156 - */
157 - readUint64(): [number, number];
158 -
159 - /**
160 - * Read a JS number value.
161 - */
162 - readDouble(): number;
163 -
164 - /**
165 - * Read raw bytes from the deserializer’s internal buffer.
166 - * The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().
167 - */
168 - readRawBytes(length: number): Buffer;
169 - }
170 -
171 - /**
172 - * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
173 - * and only stores the part of their underlying `ArrayBuffers` that they are referring to.
174 - */
175 - class DefaultDeserializer extends Deserializer {
176 - }
177 -
178 - /**
179 - * Uses a `DefaultSerializer` to serialize value into a buffer.
180 - */
181 - function serialize(value: any): Buffer;
182 -
183 - /**
184 - * Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
185 - */
186 - function deserialize(data: NodeJS.TypedArray): any;
187 -}
1 -declare module 'vm' {
2 - interface Context extends NodeJS.Dict<any> { }
3 - interface BaseOptions {
4 - /**
5 - * Specifies the filename used in stack traces produced by this script.
6 - * Default: `''`.
7 - */
8 - filename?: string;
9 - /**
10 - * Specifies the line number offset that is displayed in stack traces produced by this script.
11 - * Default: `0`.
12 - */
13 - lineOffset?: number;
14 - /**
15 - * Specifies the column number offset that is displayed in stack traces produced by this script.
16 - * Default: `0`
17 - */
18 - columnOffset?: number;
19 - }
20 - interface ScriptOptions extends BaseOptions {
21 - displayErrors?: boolean;
22 - timeout?: number;
23 - cachedData?: Buffer;
24 - /** @deprecated in favor of `script.createCachedData()` */
25 - produceCachedData?: boolean;
26 - }
27 - interface RunningScriptOptions extends BaseOptions {
28 - /**
29 - * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
30 - * Default: `true`.
31 - */
32 - displayErrors?: boolean;
33 - /**
34 - * Specifies the number of milliseconds to execute code before terminating execution.
35 - * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
36 - */
37 - timeout?: number;
38 - /**
39 - * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
40 - * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
41 - * If execution is terminated, an `Error` will be thrown.
42 - * Default: `false`.
43 - */
44 - breakOnSigint?: boolean;
45 - /**
46 - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
47 - */
48 - microtaskMode?: 'afterEvaluate';
49 - }
50 - interface CompileFunctionOptions extends BaseOptions {
51 - /**
52 - * Provides an optional data with V8's code cache data for the supplied source.
53 - */
54 - cachedData?: Buffer;
55 - /**
56 - * Specifies whether to produce new cache data.
57 - * Default: `false`,
58 - */
59 - produceCachedData?: boolean;
60 - /**
61 - * The sandbox/context in which the said function should be compiled in.
62 - */
63 - parsingContext?: Context;
64 -
65 - /**
66 - * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
67 - */
68 - contextExtensions?: Object[];
69 - }
70 -
71 - interface CreateContextOptions {
72 - /**
73 - * Human-readable name of the newly created context.
74 - * @default 'VM Context i' Where i is an ascending numerical index of the created context.
75 - */
76 - name?: string;
77 - /**
78 - * Corresponds to the newly created context for display purposes.
79 - * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
80 - * like the value of the `url.origin` property of a URL object.
81 - * Most notably, this string should omit the trailing slash, as that denotes a path.
82 - * @default ''
83 - */
84 - origin?: string;
85 - codeGeneration?: {
86 - /**
87 - * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
88 - * will throw an EvalError.
89 - * @default true
90 - */
91 - strings?: boolean;
92 - /**
93 - * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
94 - * @default true
95 - */
96 - wasm?: boolean;
97 - };
98 - /**
99 - * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
100 - */
101 - microtaskMode?: 'afterEvaluate';
102 - }
103 -
104 - type MeasureMemoryMode = 'summary' | 'detailed';
105 -
106 - interface MeasureMemoryOptions {
107 - /**
108 - * @default 'summary'
109 - */
110 - mode?: MeasureMemoryMode;
111 - context?: Context;
112 - }
113 -
114 - interface MemoryMeasurement {
115 - total: {
116 - jsMemoryEstimate: number;
117 - jsMemoryRange: [number, number];
118 - };
119 - }
120 -
121 - class Script {
122 - constructor(code: string, options?: ScriptOptions);
123 - runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
124 - runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
125 - runInThisContext(options?: RunningScriptOptions): any;
126 - createCachedData(): Buffer;
127 - cachedDataRejected?: boolean;
128 - }
129 - function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
130 - function isContext(sandbox: Context): boolean;
131 - function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
132 - function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
133 - function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
134 - function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function;
135 -
136 - /**
137 - * Measure the memory known to V8 and used by the current execution context or a specified context.
138 - *
139 - * The format of the object that the returned Promise may resolve with is
140 - * specific to the V8 engine and may change from one version of V8 to the next.
141 - *
142 - * The returned result is different from the statistics returned by
143 - * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures
144 - * the memory reachable by V8 from a specific context, while
145 - * `v8.getHeapSpaceStatistics()` measures the memory used by an instance
146 - * of V8 engine, which can switch among multiple contexts that reference
147 - * objects in the heap of one engine.
148 - *
149 - * @experimental
150 - */
151 - function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
152 -}
1 -declare module 'wasi' {
2 - interface WASIOptions {
3 - /**
4 - * An array of strings that the WebAssembly application will
5 - * see as command line arguments. The first argument is the virtual path to the
6 - * WASI command itself.
7 - */
8 - args?: string[];
9 -
10 - /**
11 - * An object similar to `process.env` that the WebAssembly
12 - * application will see as its environment.
13 - */
14 - env?: object;
15 -
16 - /**
17 - * This object represents the WebAssembly application's
18 - * sandbox directory structure. The string keys of `preopens` are treated as
19 - * directories within the sandbox. The corresponding values in `preopens` are
20 - * the real paths to those directories on the host machine.
21 - */
22 - preopens?: NodeJS.Dict<string>;
23 -
24 - /**
25 - * By default, WASI applications terminate the Node.js
26 - * process via the `__wasi_proc_exit()` function. Setting this option to `true`
27 - * causes `wasi.start()` to return the exit code rather than terminate the
28 - * process.
29 - * @default false
30 - */
31 - returnOnExit?: boolean;
32 -
33 - /**
34 - * The file descriptor used as standard input in the WebAssembly application.
35 - * @default 0
36 - */
37 - stdin?: number;
38 -
39 - /**
40 - * The file descriptor used as standard output in the WebAssembly application.
41 - * @default 1
42 - */
43 - stdout?: number;
44 -
45 - /**
46 - * The file descriptor used as standard error in the WebAssembly application.
47 - * @default 2
48 - */
49 - stderr?: number;
50 - }
51 -
52 - class WASI {
53 - constructor(options?: WASIOptions);
54 - /**
55 - *
56 - * Attempt to begin execution of `instance` by invoking its `_start()` export.
57 - * If `instance` does not contain a `_start()` export, then `start()` attempts to
58 - * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
59 - * is present on `instance`, then `start()` does nothing.
60 - *
61 - * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
62 - * `memory`. If `instance` does not have a `memory` export an exception is thrown.
63 - *
64 - * If `start()` is called more than once, an exception is thrown.
65 - */
66 - start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
67 -
68 - /**
69 - * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present.
70 - * If `instance` contains a `_start()` export, then an exception is thrown.
71 - *
72 - * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
73 - * `memory`. If `instance` does not have a `memory` export an exception is thrown.
74 - *
75 - * If `initialize()` is called more than once, an exception is thrown.
76 - */
77 - initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
78 -
79 - /**
80 - * Is an object that implements the WASI system call API. This object
81 - * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
82 - * [`WebAssembly.Instance`][].
83 - */
84 - readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
85 - }
86 -}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 - MIT License
2 -
3 - Copyright (c) Microsoft Corporation. All rights reserved.
4 -
5 - Permission is hereby granted, free of charge, to any person obtaining a copy
6 - of this software and associated documentation files (the "Software"), to deal
7 - in the Software without restriction, including without limitation the rights
8 - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 - copies of the Software, and to permit persons to whom the Software is
10 - furnished to do so, subject to the following conditions:
11 -
12 - The above copyright notice and this permission notice shall be included in all
13 - copies or substantial portions of the Software.
14 -
15 - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 - SOFTWARE
1 -# Installation
2 -> `npm install --save @types/yauzl`
3 -
4 -# Summary
5 -This package contains type definitions for yauzl (https://github.com/thejoshwolfe/yauzl).
6 -
7 -# Details
8 -Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl
9 -
10 -Additional Details
11 - * Last updated: Wed, 02 Jan 2019 20:27:45 GMT
12 - * Dependencies: @types/node
13 - * Global values: none
14 -
15 -# Credits
16 -These definitions were written by Florian Keller <https://github.com/ffflorian>.
1 -// Type definitions for yauzl 2.9
2 -// Project: https://github.com/thejoshwolfe/yauzl
3 -// Definitions by: Florian Keller <https://github.com/ffflorian>
4 -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5 -
6 -/// <reference types="node" />
7 -
8 -import { EventEmitter } from 'events';
9 -import { Readable } from 'stream';
10 -
11 -export abstract class RandomAccessReader extends EventEmitter {
12 - _readStreamForRange(start: number, end: number): void;
13 - createReadStream(options: { start: number; end: number }): void;
14 - read(buffer: Buffer, offset: number, length: number, position: number, callback: (err?: Error) => void): void;
15 - close(callback: (err?: Error) => void): void;
16 -}
17 -
18 -export class Entry {
19 - comment: string;
20 - compressedSize: number;
21 - compressionMethod: number;
22 - crc32: number;
23 - externalFileAttributes: number;
24 - extraFieldLength: number;
25 - extraFields: Array<{ id: number; data: Buffer }>;
26 - fileCommentLength: number;
27 - fileName: string;
28 - fileNameLength: number;
29 - generalPurposeBitFlag: number;
30 - internalFileAttributes: number;
31 - lastModFileDate: number;
32 - lastModFileTime: number;
33 - relativeOffsetOfLocalHeader: number;
34 - uncompressedSize: number;
35 - versionMadeBy: number;
36 - versionNeededToExtract: number;
37 -
38 - getLastModDate(): Date;
39 - isEncrypted(): boolean;
40 - isCompressed(): boolean;
41 -}
42 -
43 -export interface ZipFileOptions {
44 - decompress: boolean | null;
45 - decrypt: boolean | null;
46 - start: number | null;
47 - end: number | null;
48 -}
49 -
50 -export class ZipFile extends EventEmitter {
51 - autoClose: boolean;
52 - comment: string;
53 - decodeStrings: boolean;
54 - emittedError: boolean;
55 - entriesRead: number;
56 - entryCount: number;
57 - fileSize: number;
58 - isOpen: boolean;
59 - lazyEntries: boolean;
60 - readEntryCursor: boolean;
61 - validateEntrySizes: boolean;
62 -
63 - constructor(
64 - reader: RandomAccessReader,
65 - centralDirectoryOffset: number,
66 - fileSize: number,
67 - entryCount: number,
68 - comment: string,
69 - autoClose: boolean,
70 - lazyEntries: boolean,
71 - decodeStrings: boolean,
72 - validateEntrySizes: boolean,
73 - );
74 -
75 - openReadStream(entry: Entry, options: ZipFileOptions, callback: (err?: Error, stream?: Readable) => void): void;
76 - openReadStream(entry: Entry, callback: (err?: Error, stream?: Readable) => void): void;
77 - close(): void;
78 - readEntry(): void;
79 -}
80 -
81 -export interface Options {
82 - autoClose?: boolean;
83 - lazyEntries?: boolean;
84 - decodeStrings?: boolean;
85 - validateEntrySizes?: boolean;
86 - strictFileNames?: boolean;
87 -}
88 -
89 -export function open(path: string, options: Options, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
90 -export function open(path: string, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
91 -export function fromFd(fd: number, options: Options, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
92 -export function fromFd(fd: number, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
93 -export function fromBuffer(buffer: Buffer, options: Options, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
94 -export function fromBuffer(buffer: Buffer, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
95 -export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number, options: Options, callback: (err?: Error, zipfile?: ZipFile) => void): void;
96 -export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number, callback: (err?: Error, zipfile?: ZipFile) => void): void;
97 -export function dosDateTimeToDate(date: number, time: number): Date;
98 -export function validateFileName(fileName: string): string | null;
1 -{
2 - "name": "@types/yauzl",
3 - "version": "2.9.1",
4 - "description": "TypeScript definitions for yauzl",
5 - "license": "MIT",
6 - "contributors": [
7 - {
8 - "name": "Florian Keller",
9 - "url": "https://github.com/ffflorian",
10 - "githubUsername": "ffflorian"
11 - }
12 - ],
13 - "main": "",
14 - "types": "index",
15 - "repository": {
16 - "type": "git",
17 - "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
18 - },
19 - "scripts": {},
20 - "dependencies": {
21 - "@types/node": "*"
22 - },
23 - "typesPublisherContentHash": "78f765e4caa71766b61010d584b87ea4cf34e0bac10cac6b16d722d8a8456073",
24 - "typeScriptVersion": "2.0"
25 -}
...\ No newline at end of file ...\ No newline at end of file
1 -1.3.7 / 2019-04-29
2 -==================
3 -
4 - * deps: negotiator@0.6.2
5 - - Fix sorting charset, encoding, and language with extra parameters
6 -
7 -1.3.6 / 2019-04-28
8 -==================
9 -
10 - * deps: mime-types@~2.1.24
11 - - deps: mime-db@~1.40.0
12 -
13 -1.3.5 / 2018-02-28
14 -==================
15 -
16 - * deps: mime-types@~2.1.18
17 - - deps: mime-db@~1.33.0
18 -
19 -1.3.4 / 2017-08-22
20 -==================
21 -
22 - * deps: mime-types@~2.1.16
23 - - deps: mime-db@~1.29.0
24 -
25 -1.3.3 / 2016-05-02
26 -==================
27 -
28 - * deps: mime-types@~2.1.11
29 - - deps: mime-db@~1.23.0
30 - * deps: negotiator@0.6.1
31 - - perf: improve `Accept` parsing speed
32 - - perf: improve `Accept-Charset` parsing speed
33 - - perf: improve `Accept-Encoding` parsing speed
34 - - perf: improve `Accept-Language` parsing speed
35 -
36 -1.3.2 / 2016-03-08
37 -==================
38 -
39 - * deps: mime-types@~2.1.10
40 - - Fix extension of `application/dash+xml`
41 - - Update primary extension for `audio/mp4`
42 - - deps: mime-db@~1.22.0
43 -
44 -1.3.1 / 2016-01-19
45 -==================
46 -
47 - * deps: mime-types@~2.1.9
48 - - deps: mime-db@~1.21.0
49 -
50 -1.3.0 / 2015-09-29
51 -==================
52 -
53 - * deps: mime-types@~2.1.7
54 - - deps: mime-db@~1.19.0
55 - * deps: negotiator@0.6.0
56 - - Fix including type extensions in parameters in `Accept` parsing
57 - - Fix parsing `Accept` parameters with quoted equals
58 - - Fix parsing `Accept` parameters with quoted semicolons
59 - - Lazy-load modules from main entry point
60 - - perf: delay type concatenation until needed
61 - - perf: enable strict mode
62 - - perf: hoist regular expressions
63 - - perf: remove closures getting spec properties
64 - - perf: remove a closure from media type parsing
65 - - perf: remove property delete from media type parsing
66 -
67 -1.2.13 / 2015-09-06
68 -===================
69 -
70 - * deps: mime-types@~2.1.6
71 - - deps: mime-db@~1.18.0
72 -
73 -1.2.12 / 2015-07-30
74 -===================
75 -
76 - * deps: mime-types@~2.1.4
77 - - deps: mime-db@~1.16.0
78 -
79 -1.2.11 / 2015-07-16
80 -===================
81 -
82 - * deps: mime-types@~2.1.3
83 - - deps: mime-db@~1.15.0
84 -
85 -1.2.10 / 2015-07-01
86 -===================
87 -
88 - * deps: mime-types@~2.1.2
89 - - deps: mime-db@~1.14.0
90 -
91 -1.2.9 / 2015-06-08
92 -==================
93 -
94 - * deps: mime-types@~2.1.1
95 - - perf: fix deopt during mapping
96 -
97 -1.2.8 / 2015-06-07
98 -==================
99 -
100 - * deps: mime-types@~2.1.0
101 - - deps: mime-db@~1.13.0
102 - * perf: avoid argument reassignment & argument slice
103 - * perf: avoid negotiator recursive construction
104 - * perf: enable strict mode
105 - * perf: remove unnecessary bitwise operator
106 -
107 -1.2.7 / 2015-05-10
108 -==================
109 -
110 - * deps: negotiator@0.5.3
111 - - Fix media type parameter matching to be case-insensitive
112 -
113 -1.2.6 / 2015-05-07
114 -==================
115 -
116 - * deps: mime-types@~2.0.11
117 - - deps: mime-db@~1.9.1
118 - * deps: negotiator@0.5.2
119 - - Fix comparing media types with quoted values
120 - - Fix splitting media types with quoted commas
121 -
122 -1.2.5 / 2015-03-13
123 -==================
124 -
125 - * deps: mime-types@~2.0.10
126 - - deps: mime-db@~1.8.0
127 -
128 -1.2.4 / 2015-02-14
129 -==================
130 -
131 - * Support Node.js 0.6
132 - * deps: mime-types@~2.0.9
133 - - deps: mime-db@~1.7.0
134 - * deps: negotiator@0.5.1
135 - - Fix preference sorting to be stable for long acceptable lists
136 -
137 -1.2.3 / 2015-01-31
138 -==================
139 -
140 - * deps: mime-types@~2.0.8
141 - - deps: mime-db@~1.6.0
142 -
143 -1.2.2 / 2014-12-30
144 -==================
145 -
146 - * deps: mime-types@~2.0.7
147 - - deps: mime-db@~1.5.0
148 -
149 -1.2.1 / 2014-12-30
150 -==================
151 -
152 - * deps: mime-types@~2.0.5
153 - - deps: mime-db@~1.3.1
154 -
155 -1.2.0 / 2014-12-19
156 -==================
157 -
158 - * deps: negotiator@0.5.0
159 - - Fix list return order when large accepted list
160 - - Fix missing identity encoding when q=0 exists
161 - - Remove dynamic building of Negotiator class
162 -
163 -1.1.4 / 2014-12-10
164 -==================
165 -
166 - * deps: mime-types@~2.0.4
167 - - deps: mime-db@~1.3.0
168 -
169 -1.1.3 / 2014-11-09
170 -==================
171 -
172 - * deps: mime-types@~2.0.3
173 - - deps: mime-db@~1.2.0
174 -
175 -1.1.2 / 2014-10-14
176 -==================
177 -
178 - * deps: negotiator@0.4.9
179 - - Fix error when media type has invalid parameter
180 -
181 -1.1.1 / 2014-09-28
182 -==================
183 -
184 - * deps: mime-types@~2.0.2
185 - - deps: mime-db@~1.1.0
186 - * deps: negotiator@0.4.8
187 - - Fix all negotiations to be case-insensitive
188 - - Stable sort preferences of same quality according to client order
189 -
190 -1.1.0 / 2014-09-02
191 -==================
192 -
193 - * update `mime-types`
194 -
195 -1.0.7 / 2014-07-04
196 -==================
197 -
198 - * Fix wrong type returned from `type` when match after unknown extension
199 -
200 -1.0.6 / 2014-06-24
201 -==================
202 -
203 - * deps: negotiator@0.4.7
204 -
205 -1.0.5 / 2014-06-20
206 -==================
207 -
208 - * fix crash when unknown extension given
209 -
210 -1.0.4 / 2014-06-19
211 -==================
212 -
213 - * use `mime-types`
214 -
215 -1.0.3 / 2014-06-11
216 -==================
217 -
218 - * deps: negotiator@0.4.6
219 - - Order by specificity when quality is the same
220 -
221 -1.0.2 / 2014-05-29
222 -==================
223 -
224 - * Fix interpretation when header not in request
225 - * deps: pin negotiator@0.4.5
226 -
227 -1.0.1 / 2014-01-18
228 -==================
229 -
230 - * Identity encoding isn't always acceptable
231 - * deps: negotiator@~0.4.0
232 -
233 -1.0.0 / 2013-12-27
234 -==================
235 -
236 - * Genesis
1 -(The MIT License)
2 -
3 -Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
4 -Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
5 -
6 -Permission is hereby granted, free of charge, to any person obtaining
7 -a copy of this software and associated documentation files (the
8 -'Software'), to deal in the Software without restriction, including
9 -without limitation the rights to use, copy, modify, merge, publish,
10 -distribute, sublicense, and/or sell copies of the Software, and to
11 -permit persons to whom the Software is furnished to do so, subject to
12 -the following conditions:
13 -
14 -The above copyright notice and this permission notice shall be
15 -included in all copies or substantial portions of the Software.
16 -
17 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1 -# accepts
2 -
3 -[![NPM Version][npm-version-image]][npm-url]
4 -[![NPM Downloads][npm-downloads-image]][npm-url]
5 -[![Node.js Version][node-version-image]][node-version-url]
6 -[![Build Status][travis-image]][travis-url]
7 -[![Test Coverage][coveralls-image]][coveralls-url]
8 -
9 -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator).
10 -Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
11 -
12 -In addition to negotiator, it allows:
13 -
14 -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])`
15 - as well as `('text/html', 'application/json')`.
16 -- Allows type shorthands such as `json`.
17 -- Returns `false` when no types match
18 -- Treats non-existent headers as `*`
19 -
20 -## Installation
21 -
22 -This is a [Node.js](https://nodejs.org/en/) module available through the
23 -[npm registry](https://www.npmjs.com/). Installation is done using the
24 -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
25 -
26 -```sh
27 -$ npm install accepts
28 -```
29 -
30 -## API
31 -
32 -<!-- eslint-disable no-unused-vars -->
33 -
34 -```js
35 -var accepts = require('accepts')
36 -```
37 -
38 -### accepts(req)
39 -
40 -Create a new `Accepts` object for the given `req`.
41 -
42 -#### .charset(charsets)
43 -
44 -Return the first accepted charset. If nothing in `charsets` is accepted,
45 -then `false` is returned.
46 -
47 -#### .charsets()
48 -
49 -Return the charsets that the request accepts, in the order of the client's
50 -preference (most preferred first).
51 -
52 -#### .encoding(encodings)
53 -
54 -Return the first accepted encoding. If nothing in `encodings` is accepted,
55 -then `false` is returned.
56 -
57 -#### .encodings()
58 -
59 -Return the encodings that the request accepts, in the order of the client's
60 -preference (most preferred first).
61 -
62 -#### .language(languages)
63 -
64 -Return the first accepted language. If nothing in `languages` is accepted,
65 -then `false` is returned.
66 -
67 -#### .languages()
68 -
69 -Return the languages that the request accepts, in the order of the client's
70 -preference (most preferred first).
71 -
72 -#### .type(types)
73 -
74 -Return the first accepted type (and it is returned as the same text as what
75 -appears in the `types` array). If nothing in `types` is accepted, then `false`
76 -is returned.
77 -
78 -The `types` array can contain full MIME types or file extensions. Any value
79 -that is not a full MIME types is passed to `require('mime-types').lookup`.
80 -
81 -#### .types()
82 -
83 -Return the types that the request accepts, in the order of the client's
84 -preference (most preferred first).
85 -
86 -## Examples
87 -
88 -### Simple type negotiation
89 -
90 -This simple example shows how to use `accepts` to return a different typed
91 -respond body based on what the client wants to accept. The server lists it's
92 -preferences in order and will get back the best match between the client and
93 -server.
94 -
95 -```js
96 -var accepts = require('accepts')
97 -var http = require('http')
98 -
99 -function app (req, res) {
100 - var accept = accepts(req)
101 -
102 - // the order of this list is significant; should be server preferred order
103 - switch (accept.type(['json', 'html'])) {
104 - case 'json':
105 - res.setHeader('Content-Type', 'application/json')
106 - res.write('{"hello":"world!"}')
107 - break
108 - case 'html':
109 - res.setHeader('Content-Type', 'text/html')
110 - res.write('<b>hello, world!</b>')
111 - break
112 - default:
113 - // the fallback is text/plain, so no need to specify it above
114 - res.setHeader('Content-Type', 'text/plain')
115 - res.write('hello, world!')
116 - break
117 - }
118 -
119 - res.end()
120 -}
121 -
122 -http.createServer(app).listen(3000)
123 -```
124 -
125 -You can test this out with the cURL program:
126 -```sh
127 -curl -I -H'Accept: text/html' http://localhost:3000/
128 -```
129 -
130 -## License
131 -
132 -[MIT](LICENSE)
133 -
134 -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/accepts/master
135 -[coveralls-url]: https://coveralls.io/r/jshttp/accepts?branch=master
136 -[node-version-image]: https://badgen.net/npm/node/accepts
137 -[node-version-url]: https://nodejs.org/en/download
138 -[npm-downloads-image]: https://badgen.net/npm/dm/accepts
139 -[npm-url]: https://npmjs.org/package/accepts
140 -[npm-version-image]: https://badgen.net/npm/v/accepts
141 -[travis-image]: https://badgen.net/travis/jshttp/accepts/master
142 -[travis-url]: https://travis-ci.org/jshttp/accepts
1 -/*!
2 - * accepts
3 - * Copyright(c) 2014 Jonathan Ong
4 - * Copyright(c) 2015 Douglas Christopher Wilson
5 - * MIT Licensed
6 - */
7 -
8 -'use strict'
9 -
10 -/**
11 - * Module dependencies.
12 - * @private
13 - */
14 -
15 -var Negotiator = require('negotiator')
16 -var mime = require('mime-types')
17 -
18 -/**
19 - * Module exports.
20 - * @public
21 - */
22 -
23 -module.exports = Accepts
24 -
25 -/**
26 - * Create a new Accepts object for the given req.
27 - *
28 - * @param {object} req
29 - * @public
30 - */
31 -
32 -function Accepts (req) {
33 - if (!(this instanceof Accepts)) {
34 - return new Accepts(req)
35 - }
36 -
37 - this.headers = req.headers
38 - this.negotiator = new Negotiator(req)
39 -}
40 -
41 -/**
42 - * Check if the given `type(s)` is acceptable, returning
43 - * the best match when true, otherwise `undefined`, in which
44 - * case you should respond with 406 "Not Acceptable".
45 - *
46 - * The `type` value may be a single mime type string
47 - * such as "application/json", the extension name
48 - * such as "json" or an array `["json", "html", "text/plain"]`. When a list
49 - * or array is given the _best_ match, if any is returned.
50 - *
51 - * Examples:
52 - *
53 - * // Accept: text/html
54 - * this.types('html');
55 - * // => "html"
56 - *
57 - * // Accept: text/*, application/json
58 - * this.types('html');
59 - * // => "html"
60 - * this.types('text/html');
61 - * // => "text/html"
62 - * this.types('json', 'text');
63 - * // => "json"
64 - * this.types('application/json');
65 - * // => "application/json"
66 - *
67 - * // Accept: text/*, application/json
68 - * this.types('image/png');
69 - * this.types('png');
70 - * // => undefined
71 - *
72 - * // Accept: text/*;q=.5, application/json
73 - * this.types(['html', 'json']);
74 - * this.types('html', 'json');
75 - * // => "json"
76 - *
77 - * @param {String|Array} types...
78 - * @return {String|Array|Boolean}
79 - * @public
80 - */
81 -
82 -Accepts.prototype.type =
83 -Accepts.prototype.types = function (types_) {
84 - var types = types_
85 -
86 - // support flattened arguments
87 - if (types && !Array.isArray(types)) {
88 - types = new Array(arguments.length)
89 - for (var i = 0; i < types.length; i++) {
90 - types[i] = arguments[i]
91 - }
92 - }
93 -
94 - // no types, return all requested types
95 - if (!types || types.length === 0) {
96 - return this.negotiator.mediaTypes()
97 - }
98 -
99 - // no accept header, return first given type
100 - if (!this.headers.accept) {
101 - return types[0]
102 - }
103 -
104 - var mimes = types.map(extToMime)
105 - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime))
106 - var first = accepts[0]
107 -
108 - return first
109 - ? types[mimes.indexOf(first)]
110 - : false
111 -}
112 -
113 -/**
114 - * Return accepted encodings or best fit based on `encodings`.
115 - *
116 - * Given `Accept-Encoding: gzip, deflate`
117 - * an array sorted by quality is returned:
118 - *
119 - * ['gzip', 'deflate']
120 - *
121 - * @param {String|Array} encodings...
122 - * @return {String|Array}
123 - * @public
124 - */
125 -
126 -Accepts.prototype.encoding =
127 -Accepts.prototype.encodings = function (encodings_) {
128 - var encodings = encodings_
129 -
130 - // support flattened arguments
131 - if (encodings && !Array.isArray(encodings)) {
132 - encodings = new Array(arguments.length)
133 - for (var i = 0; i < encodings.length; i++) {
134 - encodings[i] = arguments[i]
135 - }
136 - }
137 -
138 - // no encodings, return all requested encodings
139 - if (!encodings || encodings.length === 0) {
140 - return this.negotiator.encodings()
141 - }
142 -
143 - return this.negotiator.encodings(encodings)[0] || false
144 -}
145 -
146 -/**
147 - * Return accepted charsets or best fit based on `charsets`.
148 - *
149 - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
150 - * an array sorted by quality is returned:
151 - *
152 - * ['utf-8', 'utf-7', 'iso-8859-1']
153 - *
154 - * @param {String|Array} charsets...
155 - * @return {String|Array}
156 - * @public
157 - */
158 -
159 -Accepts.prototype.charset =
160 -Accepts.prototype.charsets = function (charsets_) {
161 - var charsets = charsets_
162 -
163 - // support flattened arguments
164 - if (charsets && !Array.isArray(charsets)) {
165 - charsets = new Array(arguments.length)
166 - for (var i = 0; i < charsets.length; i++) {
167 - charsets[i] = arguments[i]
168 - }
169 - }
170 -
171 - // no charsets, return all requested charsets
172 - if (!charsets || charsets.length === 0) {
173 - return this.negotiator.charsets()
174 - }
175 -
176 - return this.negotiator.charsets(charsets)[0] || false
177 -}
178 -
179 -/**
180 - * Return accepted languages or best fit based on `langs`.
181 - *
182 - * Given `Accept-Language: en;q=0.8, es, pt`
183 - * an array sorted by quality is returned:
184 - *
185 - * ['es', 'pt', 'en']
186 - *
187 - * @param {String|Array} langs...
188 - * @return {Array|String}
189 - * @public
190 - */
191 -
192 -Accepts.prototype.lang =
193 -Accepts.prototype.langs =
194 -Accepts.prototype.language =
195 -Accepts.prototype.languages = function (languages_) {
196 - var languages = languages_
197 -
198 - // support flattened arguments
199 - if (languages && !Array.isArray(languages)) {
200 - languages = new Array(arguments.length)
201 - for (var i = 0; i < languages.length; i++) {
202 - languages[i] = arguments[i]
203 - }
204 - }
205 -
206 - // no languages, return all requested languages
207 - if (!languages || languages.length === 0) {
208 - return this.negotiator.languages()
209 - }
210 -
211 - return this.negotiator.languages(languages)[0] || false
212 -}
213 -
214 -/**
215 - * Convert extnames to mime.
216 - *
217 - * @param {String} type
218 - * @return {String}
219 - * @private
220 - */
221 -
222 -function extToMime (type) {
223 - return type.indexOf('/') === -1
224 - ? mime.lookup(type)
225 - : type
226 -}
227 -
228 -/**
229 - * Check if mime is valid.
230 - *
231 - * @param {String} type
232 - * @return {String}
233 - * @private
234 - */
235 -
236 -function validMime (type) {
237 - return typeof type === 'string'
238 -}
1 -{
2 - "name": "accepts",
3 - "description": "Higher-level content negotiation",
4 - "version": "1.3.7",
5 - "contributors": [
6 - "Douglas Christopher Wilson <doug@somethingdoug.com>",
7 - "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
8 - ],
9 - "license": "MIT",
10 - "repository": "jshttp/accepts",
11 - "dependencies": {
12 - "mime-types": "~2.1.24",
13 - "negotiator": "0.6.2"
14 - },
15 - "devDependencies": {
16 - "deep-equal": "1.0.1",
17 - "eslint": "5.16.0",
18 - "eslint-config-standard": "12.0.0",
19 - "eslint-plugin-import": "2.17.2",
20 - "eslint-plugin-markdown": "1.0.0",
21 - "eslint-plugin-node": "8.0.1",
22 - "eslint-plugin-promise": "4.1.1",
23 - "eslint-plugin-standard": "4.0.0",
24 - "mocha": "6.1.4",
25 - "nyc": "14.0.0"
26 - },
27 - "files": [
28 - "LICENSE",
29 - "HISTORY.md",
30 - "index.js"
31 - ],
32 - "engines": {
33 - "node": ">= 0.6"
34 - },
35 - "scripts": {
36 - "lint": "eslint --plugin markdown --ext js,md .",
37 - "test": "mocha --reporter spec --check-leaks --bail test/",
38 - "test-cov": "nyc --reporter=html --reporter=text npm test",
39 - "test-travis": "nyc --reporter=text npm test"
40 - },
41 - "keywords": [
42 - "content",
43 - "negotiation",
44 - "accept",
45 - "accepts"
46 - ]
47 -}
1 -agent-base
2 -==========
3 -### Turn a function into an [`http.Agent`][http.Agent] instance
4 -[![Build Status](https://github.com/TooTallNate/node-agent-base/workflows/Node%20CI/badge.svg)](https://github.com/TooTallNate/node-agent-base/actions?workflow=Node+CI)
5 -
6 -This module provides an `http.Agent` generator. That is, you pass it an async
7 -callback function, and it returns a new `http.Agent` instance that will invoke the
8 -given callback function when sending outbound HTTP requests.
9 -
10 -#### Some subclasses:
11 -
12 -Here's some more interesting uses of `agent-base`.
13 -Send a pull request to list yours!
14 -
15 - * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
16 - * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
17 - * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
18 - * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
19 -
20 -
21 -Installation
22 -------------
23 -
24 -Install with `npm`:
25 -
26 -``` bash
27 -$ npm install agent-base
28 -```
29 -
30 -
31 -Example
32 --------
33 -
34 -Here's a minimal example that creates a new `net.Socket` connection to the server
35 -for every HTTP request (i.e. the equivalent of `agent: false` option):
36 -
37 -```js
38 -var net = require('net');
39 -var tls = require('tls');
40 -var url = require('url');
41 -var http = require('http');
42 -var agent = require('agent-base');
43 -
44 -var endpoint = 'http://nodejs.org/api/';
45 -var parsed = url.parse(endpoint);
46 -
47 -// This is the important part!
48 -parsed.agent = agent(function (req, opts) {
49 - var socket;
50 - // `secureEndpoint` is true when using the https module
51 - if (opts.secureEndpoint) {
52 - socket = tls.connect(opts);
53 - } else {
54 - socket = net.connect(opts);
55 - }
56 - return socket;
57 -});
58 -
59 -// Everything else works just like normal...
60 -http.get(parsed, function (res) {
61 - console.log('"response" event!', res.headers);
62 - res.pipe(process.stdout);
63 -});
64 -```
65 -
66 -Returning a Promise or using an `async` function is also supported:
67 -
68 -```js
69 -agent(async function (req, opts) {
70 - await sleep(1000);
71 - // etc…
72 -});
73 -```
74 -
75 -Return another `http.Agent` instance to "pass through" the responsibility
76 -for that HTTP request to that agent:
77 -
78 -```js
79 -agent(function (req, opts) {
80 - return opts.secureEndpoint ? https.globalAgent : http.globalAgent;
81 -});
82 -```
83 -
84 -
85 -API
86 ----
87 -
88 -## Agent(Function callback[, Object options]) → [http.Agent][]
89 -
90 -Creates a base `http.Agent` that will execute the callback function `callback`
91 -for every HTTP request that it is used as the `agent` for. The callback function
92 -is responsible for creating a `stream.Duplex` instance of some kind that will be
93 -used as the underlying socket in the HTTP request.
94 -
95 -The `options` object accepts the following properties:
96 -
97 - * `timeout` - Number - Timeout for the `callback()` function in milliseconds. Defaults to Infinity (optional).
98 -
99 -The callback function should have the following signature:
100 -
101 -### callback(http.ClientRequest req, Object options, Function cb) → undefined
102 -
103 -The ClientRequest `req` can be accessed to read request headers and
104 -and the path, etc. The `options` object contains the options passed
105 -to the `http.request()`/`https.request()` function call, and is formatted
106 -to be directly passed to `net.connect()`/`tls.connect()`, or however
107 -else you want a Socket to be created. Pass the created socket to
108 -the callback function `cb` once created, and the HTTP request will
109 -continue to proceed.
110 -
111 -If the `https` module is used to invoke the HTTP request, then the
112 -`secureEndpoint` property on `options` _will be set to `true`_.
113 -
114 -
115 -License
116 --------
117 -
118 -(The MIT License)
119 -
120 -Copyright (c) 2013 Nathan Rajlich &lt;nathan@tootallnate.net&gt;
121 -
122 -Permission is hereby granted, free of charge, to any person obtaining
123 -a copy of this software and associated documentation files (the
124 -'Software'), to deal in the Software without restriction, including
125 -without limitation the rights to use, copy, modify, merge, publish,
126 -distribute, sublicense, and/or sell copies of the Software, and to
127 -permit persons to whom the Software is furnished to do so, subject to
128 -the following conditions:
129 -
130 -The above copyright notice and this permission notice shall be
131 -included in all copies or substantial portions of the Software.
132 -
133 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
134 -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
135 -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
136 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
137 -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
138 -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
139 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
140 -
141 -[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
142 -[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
143 -[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
144 -[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
145 -[http.Agent]: https://nodejs.org/api/http.html#http_class_http_agent
1 -/// <reference types="node" />
2 -import net from 'net';
3 -import http from 'http';
4 -import https from 'https';
5 -import { Duplex } from 'stream';
6 -import { EventEmitter } from 'events';
7 -declare function createAgent(opts?: createAgent.AgentOptions): createAgent.Agent;
8 -declare function createAgent(callback: createAgent.AgentCallback, opts?: createAgent.AgentOptions): createAgent.Agent;
9 -declare namespace createAgent {
10 - interface ClientRequest extends http.ClientRequest {
11 - _last?: boolean;
12 - _hadError?: boolean;
13 - method: string;
14 - }
15 - interface AgentRequestOptions {
16 - host?: string;
17 - path?: string;
18 - port: number;
19 - }
20 - interface HttpRequestOptions extends AgentRequestOptions, Omit<http.RequestOptions, keyof AgentRequestOptions> {
21 - secureEndpoint: false;
22 - }
23 - interface HttpsRequestOptions extends AgentRequestOptions, Omit<https.RequestOptions, keyof AgentRequestOptions> {
24 - secureEndpoint: true;
25 - }
26 - type RequestOptions = HttpRequestOptions | HttpsRequestOptions;
27 - type AgentLike = Pick<createAgent.Agent, 'addRequest'> | http.Agent;
28 - type AgentCallbackReturn = Duplex | AgentLike;
29 - type AgentCallbackCallback = (err?: Error | null, socket?: createAgent.AgentCallbackReturn) => void;
30 - type AgentCallbackPromise = (req: createAgent.ClientRequest, opts: createAgent.RequestOptions) => createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
31 - type AgentCallback = typeof Agent.prototype.callback;
32 - type AgentOptions = {
33 - timeout?: number;
34 - };
35 - /**
36 - * Base `http.Agent` implementation.
37 - * No pooling/keep-alive is implemented by default.
38 - *
39 - * @param {Function} callback
40 - * @api public
41 - */
42 - class Agent extends EventEmitter {
43 - timeout: number | null;
44 - maxFreeSockets: number;
45 - maxTotalSockets: number;
46 - maxSockets: number;
47 - sockets: {
48 - [key: string]: net.Socket[];
49 - };
50 - freeSockets: {
51 - [key: string]: net.Socket[];
52 - };
53 - requests: {
54 - [key: string]: http.IncomingMessage[];
55 - };
56 - options: https.AgentOptions;
57 - private promisifiedCallback?;
58 - private explicitDefaultPort?;
59 - private explicitProtocol?;
60 - constructor(callback?: createAgent.AgentCallback | createAgent.AgentOptions, _opts?: createAgent.AgentOptions);
61 - get defaultPort(): number;
62 - set defaultPort(v: number);
63 - get protocol(): string;
64 - set protocol(v: string);
65 - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions, fn: createAgent.AgentCallbackCallback): void;
66 - callback(req: createAgent.ClientRequest, opts: createAgent.RequestOptions): createAgent.AgentCallbackReturn | Promise<createAgent.AgentCallbackReturn>;
67 - /**
68 - * Called by node-core's "_http_client.js" module when creating
69 - * a new HTTP request with this Agent instance.
70 - *
71 - * @api public
72 - */
73 - addRequest(req: ClientRequest, _opts: RequestOptions): void;
74 - freeSocket(socket: net.Socket, opts: AgentOptions): void;
75 - destroy(): void;
76 - }
77 -}
78 -export = createAgent;
1 -"use strict";
2 -var __importDefault = (this && this.__importDefault) || function (mod) {
3 - return (mod && mod.__esModule) ? mod : { "default": mod };
4 -};
5 -const events_1 = require("events");
6 -const debug_1 = __importDefault(require("debug"));
7 -const promisify_1 = __importDefault(require("./promisify"));
8 -const debug = debug_1.default('agent-base');
9 -function isAgent(v) {
10 - return Boolean(v) && typeof v.addRequest === 'function';
11 -}
12 -function isSecureEndpoint() {
13 - const { stack } = new Error();
14 - if (typeof stack !== 'string')
15 - return false;
16 - return stack.split('\n').some(l => l.indexOf('(https.js:') !== -1 || l.indexOf('node:https:') !== -1);
17 -}
18 -function createAgent(callback, opts) {
19 - return new createAgent.Agent(callback, opts);
20 -}
21 -(function (createAgent) {
22 - /**
23 - * Base `http.Agent` implementation.
24 - * No pooling/keep-alive is implemented by default.
25 - *
26 - * @param {Function} callback
27 - * @api public
28 - */
29 - class Agent extends events_1.EventEmitter {
30 - constructor(callback, _opts) {
31 - super();
32 - let opts = _opts;
33 - if (typeof callback === 'function') {
34 - this.callback = callback;
35 - }
36 - else if (callback) {
37 - opts = callback;
38 - }
39 - // Timeout for the socket to be returned from the callback
40 - this.timeout = null;
41 - if (opts && typeof opts.timeout === 'number') {
42 - this.timeout = opts.timeout;
43 - }
44 - // These aren't actually used by `agent-base`, but are required
45 - // for the TypeScript definition files in `@types/node` :/
46 - this.maxFreeSockets = 1;
47 - this.maxSockets = 1;
48 - this.maxTotalSockets = Infinity;
49 - this.sockets = {};
50 - this.freeSockets = {};
51 - this.requests = {};
52 - this.options = {};
53 - }
54 - get defaultPort() {
55 - if (typeof this.explicitDefaultPort === 'number') {
56 - return this.explicitDefaultPort;
57 - }
58 - return isSecureEndpoint() ? 443 : 80;
59 - }
60 - set defaultPort(v) {
61 - this.explicitDefaultPort = v;
62 - }
63 - get protocol() {
64 - if (typeof this.explicitProtocol === 'string') {
65 - return this.explicitProtocol;
66 - }
67 - return isSecureEndpoint() ? 'https:' : 'http:';
68 - }
69 - set protocol(v) {
70 - this.explicitProtocol = v;
71 - }
72 - callback(req, opts, fn) {
73 - throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
74 - }
75 - /**
76 - * Called by node-core's "_http_client.js" module when creating
77 - * a new HTTP request with this Agent instance.
78 - *
79 - * @api public
80 - */
81 - addRequest(req, _opts) {
82 - const opts = Object.assign({}, _opts);
83 - if (typeof opts.secureEndpoint !== 'boolean') {
84 - opts.secureEndpoint = isSecureEndpoint();
85 - }
86 - if (opts.host == null) {
87 - opts.host = 'localhost';
88 - }
89 - if (opts.port == null) {
90 - opts.port = opts.secureEndpoint ? 443 : 80;
91 - }
92 - if (opts.protocol == null) {
93 - opts.protocol = opts.secureEndpoint ? 'https:' : 'http:';
94 - }
95 - if (opts.host && opts.path) {
96 - // If both a `host` and `path` are specified then it's most
97 - // likely the result of a `url.parse()` call... we need to
98 - // remove the `path` portion so that `net.connect()` doesn't
99 - // attempt to open that as a unix socket file.
100 - delete opts.path;
101 - }
102 - delete opts.agent;
103 - delete opts.hostname;
104 - delete opts._defaultAgent;
105 - delete opts.defaultPort;
106 - delete opts.createConnection;
107 - // Hint to use "Connection: close"
108 - // XXX: non-documented `http` module API :(
109 - req._last = true;
110 - req.shouldKeepAlive = false;
111 - let timedOut = false;
112 - let timeoutId = null;
113 - const timeoutMs = opts.timeout || this.timeout;
114 - const onerror = (err) => {
115 - if (req._hadError)
116 - return;
117 - req.emit('error', err);
118 - // For Safety. Some additional errors might fire later on
119 - // and we need to make sure we don't double-fire the error event.
120 - req._hadError = true;
121 - };
122 - const ontimeout = () => {
123 - timeoutId = null;
124 - timedOut = true;
125 - const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
126 - err.code = 'ETIMEOUT';
127 - onerror(err);
128 - };
129 - const callbackError = (err) => {
130 - if (timedOut)
131 - return;
132 - if (timeoutId !== null) {
133 - clearTimeout(timeoutId);
134 - timeoutId = null;
135 - }
136 - onerror(err);
137 - };
138 - const onsocket = (socket) => {
139 - if (timedOut)
140 - return;
141 - if (timeoutId != null) {
142 - clearTimeout(timeoutId);
143 - timeoutId = null;
144 - }
145 - if (isAgent(socket)) {
146 - // `socket` is actually an `http.Agent` instance, so
147 - // relinquish responsibility for this `req` to the Agent
148 - // from here on
149 - debug('Callback returned another Agent instance %o', socket.constructor.name);
150 - socket.addRequest(req, opts);
151 - return;
152 - }
153 - if (socket) {
154 - socket.once('free', () => {
155 - this.freeSocket(socket, opts);
156 - });
157 - req.onSocket(socket);
158 - return;
159 - }
160 - const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
161 - onerror(err);
162 - };
163 - if (typeof this.callback !== 'function') {
164 - onerror(new Error('`callback` is not defined'));
165 - return;
166 - }
167 - if (!this.promisifiedCallback) {
168 - if (this.callback.length >= 3) {
169 - debug('Converting legacy callback function to promise');
170 - this.promisifiedCallback = promisify_1.default(this.callback);
171 - }
172 - else {
173 - this.promisifiedCallback = this.callback;
174 - }
175 - }
176 - if (typeof timeoutMs === 'number' && timeoutMs > 0) {
177 - timeoutId = setTimeout(ontimeout, timeoutMs);
178 - }
179 - if ('port' in opts && typeof opts.port !== 'number') {
180 - opts.port = Number(opts.port);
181 - }
182 - try {
183 - debug('Resolving socket for %o request: %o', opts.protocol, `${req.method} ${req.path}`);
184 - Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
185 - }
186 - catch (err) {
187 - Promise.reject(err).catch(callbackError);
188 - }
189 - }
190 - freeSocket(socket, opts) {
191 - debug('Freeing socket %o %o', socket.constructor.name, opts);
192 - socket.destroy();
193 - }
194 - destroy() {
195 - debug('Destroying agent %o', this.constructor.name);
196 - }
197 - }
198 - createAgent.Agent = Agent;
199 - // So that `instanceof` works correctly
200 - createAgent.prototype = createAgent.Agent.prototype;
201 -})(createAgent || (createAgent = {}));
202 -module.exports = createAgent;
203 -//# sourceMappingURL=index.js.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAIA,mCAAsC;AACtC,kDAAgC;AAChC,4DAAoC;AAEpC,MAAM,KAAK,GAAG,eAAW,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,OAAO,CAAC,CAAM;IACtB,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED,SAAS,gBAAgB;IACxB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxG,CAAC;AAOD,SAAS,WAAW,CACnB,QAA+D,EAC/D,IAA+B;IAE/B,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED,WAAU,WAAW;IAmDpB;;;;;;OAMG;IACH,MAAa,KAAM,SAAQ,qBAAY;QAmBtC,YACC,QAA+D,EAC/D,KAAgC;YAEhC,KAAK,EAAE,CAAC;YAER,IAAI,IAAI,GAAG,KAAK,CAAC;YACjB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;gBACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;aACzB;iBAAM,IAAI,QAAQ,EAAE;gBACpB,IAAI,GAAG,QAAQ,CAAC;aAChB;YAED,0DAA0D;YAC1D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,EAAE;gBAC7C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;aAC5B;YAED,+DAA+D;YAC/D,0DAA0D;YAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;YACpB,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;YAChC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;YAClB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QACnB,CAAC;QAED,IAAI,WAAW;YACd,IAAI,OAAO,IAAI,CAAC,mBAAmB,KAAK,QAAQ,EAAE;gBACjD,OAAO,IAAI,CAAC,mBAAmB,CAAC;aAChC;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC;QAED,IAAI,WAAW,CAAC,CAAS;YACxB,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ;YACX,IAAI,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,EAAE;gBAC9C,OAAO,IAAI,CAAC,gBAAgB,CAAC;aAC7B;YACD,OAAO,gBAAgB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;QAChD,CAAC;QAED,IAAI,QAAQ,CAAC,CAAS;YACrB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC3B,CAAC;QAaD,QAAQ,CACP,GAA8B,EAC9B,IAA8B,EAC9B,EAAsC;YAKtC,MAAM,IAAI,KAAK,CACd,yFAAyF,CACzF,CAAC;QACH,CAAC;QAED;;;;;WAKG;QACH,UAAU,CAAC,GAAkB,EAAE,KAAqB;YACnD,MAAM,IAAI,qBAAwB,KAAK,CAAE,CAAC;YAE1C,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE;gBAC7C,IAAI,CAAC,cAAc,GAAG,gBAAgB,EAAE,CAAC;aACzC;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;aACxB;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;aAC3C;YAED,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;aACzD;YAED,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE;gBAC3B,2DAA2D;gBAC3D,0DAA0D;gBAC1D,4DAA4D;gBAC5D,8CAA8C;gBAC9C,OAAO,IAAI,CAAC,IAAI,CAAC;aACjB;YAED,OAAO,IAAI,CAAC,KAAK,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;YACrB,OAAO,IAAI,CAAC,aAAa,CAAC;YAC1B,OAAO,IAAI,CAAC,WAAW,CAAC;YACxB,OAAO,IAAI,CAAC,gBAAgB,CAAC;YAE7B,kCAAkC;YAClC,2CAA2C;YAC3C,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,GAAG,KAAK,CAAC;YAE5B,IAAI,QAAQ,GAAG,KAAK,CAAC;YACrB,IAAI,SAAS,GAAyC,IAAI,CAAC;YAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;YAE/C,MAAM,OAAO,GAAG,CAAC,GAA0B,EAAE,EAAE;gBAC9C,IAAI,GAAG,CAAC,SAAS;oBAAE,OAAO;gBAC1B,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;gBACvB,yDAAyD;gBACzD,iEAAiE;gBACjE,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,CAAC,CAAC;YAEF,MAAM,SAAS,GAAG,GAAG,EAAE;gBACtB,SAAS,GAAG,IAAI,CAAC;gBACjB,QAAQ,GAAG,IAAI,CAAC;gBAChB,MAAM,GAAG,GAA0B,IAAI,KAAK,CAC3C,sDAAsD,SAAS,IAAI,CACnE,CAAC;gBACF,GAAG,CAAC,IAAI,GAAG,UAAU,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,aAAa,GAAG,CAAC,GAA0B,EAAE,EAAE;gBACpD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,KAAK,IAAI,EAAE;oBACvB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBACD,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,MAAM,QAAQ,GAAG,CAAC,MAA2B,EAAE,EAAE;gBAChD,IAAI,QAAQ;oBAAE,OAAO;gBACrB,IAAI,SAAS,IAAI,IAAI,EAAE;oBACtB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,SAAS,GAAG,IAAI,CAAC;iBACjB;gBAED,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;oBACpB,oDAAoD;oBACpD,wDAAwD;oBACxD,eAAe;oBACf,KAAK,CACJ,6CAA6C,EAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CACvB,CAAC;oBACD,MAA4B,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;oBACpD,OAAO;iBACP;gBAED,IAAI,MAAM,EAAE;oBACX,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;wBACxB,IAAI,CAAC,UAAU,CAAC,MAAoB,EAAE,IAAI,CAAC,CAAC;oBAC7C,CAAC,CAAC,CAAC;oBACH,GAAG,CAAC,QAAQ,CAAC,MAAoB,CAAC,CAAC;oBACnC,OAAO;iBACP;gBAED,MAAM,GAAG,GAAG,IAAI,KAAK,CACpB,qDAAqD,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,CAC/E,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,CAAC;YACd,CAAC,CAAC;YAEF,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,UAAU,EAAE;gBACxC,OAAO,CAAC,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;gBAChD,OAAO;aACP;YAED,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;gBAC9B,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,IAAI,CAAC,EAAE;oBAC9B,KAAK,CAAC,gDAAgD,CAAC,CAAC;oBACxD,IAAI,CAAC,mBAAmB,GAAG,mBAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;iBACpD;qBAAM;oBACN,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,QAAQ,CAAC;iBACzC;aACD;YAED,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,GAAG,CAAC,EAAE;gBACnD,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;aAC7C;YAED,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACpD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC9B;YAED,IAAI;gBACH,KAAK,CACJ,qCAAqC,EACrC,IAAI,CAAC,QAAQ,EACb,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE,CAC3B,CAAC;gBACF,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CACxD,QAAQ,EACR,aAAa,CACb,CAAC;aACF;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;aACzC;QACF,CAAC;QAED,UAAU,CAAC,MAAkB,EAAE,IAAkB;YAChD,KAAK,CAAC,sBAAsB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC7D,MAAM,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAED,OAAO;YACN,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC;KACD;IAxPY,iBAAK,QAwPjB,CAAA;IAED,uCAAuC;IACvC,WAAW,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC;AACrD,CAAC,EAtTS,WAAW,KAAX,WAAW,QAsTpB;AAED,iBAAS,WAAW,CAAC"}
...\ No newline at end of file ...\ No newline at end of file
1 -import { ClientRequest, RequestOptions, AgentCallbackCallback, AgentCallbackPromise } from './index';
2 -declare type LegacyCallback = (req: ClientRequest, opts: RequestOptions, fn: AgentCallbackCallback) => void;
3 -export default function promisify(fn: LegacyCallback): AgentCallbackPromise;
4 -export {};
1 -"use strict";
2 -Object.defineProperty(exports, "__esModule", { value: true });
3 -function promisify(fn) {
4 - return function (req, opts) {
5 - return new Promise((resolve, reject) => {
6 - fn.call(this, req, opts, (err, rtn) => {
7 - if (err) {
8 - reject(err);
9 - }
10 - else {
11 - resolve(rtn);
12 - }
13 - });
14 - });
15 - };
16 -}
17 -exports.default = promisify;
18 -//# sourceMappingURL=promisify.js.map
...\ No newline at end of file ...\ No newline at end of file
1 -{"version":3,"file":"promisify.js","sourceRoot":"","sources":["../../src/promisify.ts"],"names":[],"mappings":";;AAeA,SAAwB,SAAS,CAAC,EAAkB;IACnD,OAAO,UAAsB,GAAkB,EAAE,IAAoB;QACpE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACtC,EAAE,CAAC,IAAI,CACN,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,CAAC,GAA6B,EAAE,GAAyB,EAAE,EAAE;gBAC5D,IAAI,GAAG,EAAE;oBACR,MAAM,CAAC,GAAG,CAAC,CAAC;iBACZ;qBAAM;oBACN,OAAO,CAAC,GAAG,CAAC,CAAC;iBACb;YACF,CAAC,CACD,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC;AAjBD,4BAiBC"}
...\ No newline at end of file ...\ No newline at end of file
1 -(The MIT License)
2 -
3 -Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
4 -
5 -Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6 -and associated documentation files (the 'Software'), to deal in the Software without restriction,
7 -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9 -subject to the following conditions:
10 -
11 -The above copyright notice and this permission notice shall be included in all copies or substantial
12 -portions of the Software.
13 -
14 -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15 -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16 -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17 -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18 -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 -
This diff is collapsed. Click to expand it.
1 -{
2 - "name": "debug",
3 - "version": "4.3.1",
4 - "repository": {
5 - "type": "git",
6 - "url": "git://github.com/visionmedia/debug.git"
7 - },
8 - "description": "small debugging utility",
9 - "keywords": [
10 - "debug",
11 - "log",
12 - "debugger"
13 - ],
14 - "files": [
15 - "src",
16 - "LICENSE",
17 - "README.md"
18 - ],
19 - "author": "TJ Holowaychuk <tj@vision-media.ca>",
20 - "contributors": [
21 - "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
22 - "Andrew Rhyne <rhyneandrew@gmail.com>",
23 - "Josh Junon <josh@junon.me>"
24 - ],
25 - "license": "MIT",
26 - "scripts": {
27 - "lint": "xo",
28 - "test": "npm run test:node && npm run test:browser && npm run lint",
29 - "test:node": "istanbul cover _mocha -- test.js",
30 - "test:browser": "karma start --single-run",
31 - "test:coverage": "cat ./coverage/lcov.info | coveralls"
32 - },
33 - "dependencies": {
34 - "ms": "2.1.2"
35 - },
36 - "devDependencies": {
37 - "brfs": "^2.0.1",
38 - "browserify": "^16.2.3",
39 - "coveralls": "^3.0.2",
40 - "istanbul": "^0.4.5",
41 - "karma": "^3.1.4",
42 - "karma-browserify": "^6.0.0",
43 - "karma-chrome-launcher": "^2.2.0",
44 - "karma-mocha": "^1.3.0",
45 - "mocha": "^5.2.0",
46 - "mocha-lcov-reporter": "^1.2.0",
47 - "xo": "^0.23.0"
48 - },
49 - "peerDependenciesMeta": {
50 - "supports-color": {
51 - "optional": true
52 - }
53 - },
54 - "main": "./src/index.js",
55 - "browser": "./src/browser.js",
56 - "engines": {
57 - "node": ">=6.0"
58 - }
59 -}
1 -/* eslint-env browser */
2 -
3 -/**
4 - * This is the web browser implementation of `debug()`.
5 - */
6 -
7 -exports.formatArgs = formatArgs;
8 -exports.save = save;
9 -exports.load = load;
10 -exports.useColors = useColors;
11 -exports.storage = localstorage();
12 -exports.destroy = (() => {
13 - let warned = false;
14 -
15 - return () => {
16 - if (!warned) {
17 - warned = true;
18 - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
19 - }
20 - };
21 -})();
22 -
23 -/**
24 - * Colors.
25 - */
26 -
27 -exports.colors = [
28 - '#0000CC',
29 - '#0000FF',
30 - '#0033CC',
31 - '#0033FF',
32 - '#0066CC',
33 - '#0066FF',
34 - '#0099CC',
35 - '#0099FF',
36 - '#00CC00',
37 - '#00CC33',
38 - '#00CC66',
39 - '#00CC99',
40 - '#00CCCC',
41 - '#00CCFF',
42 - '#3300CC',
43 - '#3300FF',
44 - '#3333CC',
45 - '#3333FF',
46 - '#3366CC',
47 - '#3366FF',
48 - '#3399CC',
49 - '#3399FF',
50 - '#33CC00',
51 - '#33CC33',
52 - '#33CC66',
53 - '#33CC99',
54 - '#33CCCC',
55 - '#33CCFF',
56 - '#6600CC',
57 - '#6600FF',
58 - '#6633CC',
59 - '#6633FF',
60 - '#66CC00',
61 - '#66CC33',
62 - '#9900CC',
63 - '#9900FF',
64 - '#9933CC',
65 - '#9933FF',
66 - '#99CC00',
67 - '#99CC33',
68 - '#CC0000',
69 - '#CC0033',
70 - '#CC0066',
71 - '#CC0099',
72 - '#CC00CC',
73 - '#CC00FF',
74 - '#CC3300',
75 - '#CC3333',
76 - '#CC3366',
77 - '#CC3399',
78 - '#CC33CC',
79 - '#CC33FF',
80 - '#CC6600',
81 - '#CC6633',
82 - '#CC9900',
83 - '#CC9933',
84 - '#CCCC00',
85 - '#CCCC33',
86 - '#FF0000',
87 - '#FF0033',
88 - '#FF0066',
89 - '#FF0099',
90 - '#FF00CC',
91 - '#FF00FF',
92 - '#FF3300',
93 - '#FF3333',
94 - '#FF3366',
95 - '#FF3399',
96 - '#FF33CC',
97 - '#FF33FF',
98 - '#FF6600',
99 - '#FF6633',
100 - '#FF9900',
101 - '#FF9933',
102 - '#FFCC00',
103 - '#FFCC33'
104 -];
105 -
106 -/**
107 - * Currently only WebKit-based Web Inspectors, Firefox >= v31,
108 - * and the Firebug extension (any Firefox version) are known
109 - * to support "%c" CSS customizations.
110 - *
111 - * TODO: add a `localStorage` variable to explicitly enable/disable colors
112 - */
113 -
114 -// eslint-disable-next-line complexity
115 -function useColors() {
116 - // NB: In an Electron preload script, document will be defined but not fully
117 - // initialized. Since we know we're in Chrome, we'll just detect this case
118 - // explicitly
119 - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
120 - return true;
121 - }
122 -
123 - // Internet Explorer and Edge do not support colors.
124 - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
125 - return false;
126 - }
127 -
128 - // Is webkit? http://stackoverflow.com/a/16459606/376773
129 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
130 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
131 - // Is firebug? http://stackoverflow.com/a/398120/376773
132 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
133 - // Is firefox >= v31?
134 - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
135 - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
136 - // Double check webkit in userAgent just in case we are in a worker
137 - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
138 -}
139 -
140 -/**
141 - * Colorize log arguments if enabled.
142 - *
143 - * @api public
144 - */
145 -
146 -function formatArgs(args) {
147 - args[0] = (this.useColors ? '%c' : '') +
148 - this.namespace +
149 - (this.useColors ? ' %c' : ' ') +
150 - args[0] +
151 - (this.useColors ? '%c ' : ' ') +
152 - '+' + module.exports.humanize(this.diff);
153 -
154 - if (!this.useColors) {
155 - return;
156 - }
157 -
158 - const c = 'color: ' + this.color;
159 - args.splice(1, 0, c, 'color: inherit');
160 -
161 - // The final "%c" is somewhat tricky, because there could be other
162 - // arguments passed either before or after the %c, so we need to
163 - // figure out the correct index to insert the CSS into
164 - let index = 0;
165 - let lastC = 0;
166 - args[0].replace(/%[a-zA-Z%]/g, match => {
167 - if (match === '%%') {
168 - return;
169 - }
170 - index++;
171 - if (match === '%c') {
172 - // We only are interested in the *last* %c
173 - // (the user may have provided their own)
174 - lastC = index;
175 - }
176 - });
177 -
178 - args.splice(lastC, 0, c);
179 -}
180 -
181 -/**
182 - * Invokes `console.debug()` when available.
183 - * No-op when `console.debug` is not a "function".
184 - * If `console.debug` is not available, falls back
185 - * to `console.log`.
186 - *
187 - * @api public
188 - */
189 -exports.log = console.debug || console.log || (() => {});
190 -
191 -/**
192 - * Save `namespaces`.
193 - *
194 - * @param {String} namespaces
195 - * @api private
196 - */
197 -function save(namespaces) {
198 - try {
199 - if (namespaces) {
200 - exports.storage.setItem('debug', namespaces);
201 - } else {
202 - exports.storage.removeItem('debug');
203 - }
204 - } catch (error) {
205 - // Swallow
206 - // XXX (@Qix-) should we be logging these?
207 - }
208 -}
209 -
210 -/**
211 - * Load `namespaces`.
212 - *
213 - * @return {String} returns the previously persisted debug modes
214 - * @api private
215 - */
216 -function load() {
217 - let r;
218 - try {
219 - r = exports.storage.getItem('debug');
220 - } catch (error) {
221 - // Swallow
222 - // XXX (@Qix-) should we be logging these?
223 - }
224 -
225 - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
226 - if (!r && typeof process !== 'undefined' && 'env' in process) {
227 - r = process.env.DEBUG;
228 - }
229 -
230 - return r;
231 -}
232 -
233 -/**
234 - * Localstorage attempts to return the localstorage.
235 - *
236 - * This is necessary because safari throws
237 - * when a user disables cookies/localstorage
238 - * and you attempt to access it.
239 - *
240 - * @return {LocalStorage}
241 - * @api private
242 - */
243 -
244 -function localstorage() {
245 - try {
246 - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
247 - // The Browser also has localStorage in the global context.
248 - return localStorage;
249 - } catch (error) {
250 - // Swallow
251 - // XXX (@Qix-) should we be logging these?
252 - }
253 -}
254 -
255 -module.exports = require('./common')(exports);
256 -
257 -const {formatters} = module.exports;
258 -
259 -/**
260 - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
261 - */
262 -
263 -formatters.j = function (v) {
264 - try {
265 - return JSON.stringify(v);
266 - } catch (error) {
267 - return '[UnexpectedJSONParseError]: ' + error.message;
268 - }
269 -};
1 -
2 -/**
3 - * This is the common logic for both the Node.js and web browser
4 - * implementations of `debug()`.
5 - */
6 -
7 -function setup(env) {
8 - createDebug.debug = createDebug;
9 - createDebug.default = createDebug;
10 - createDebug.coerce = coerce;
11 - createDebug.disable = disable;
12 - createDebug.enable = enable;
13 - createDebug.enabled = enabled;
14 - createDebug.humanize = require('ms');
15 - createDebug.destroy = destroy;
16 -
17 - Object.keys(env).forEach(key => {
18 - createDebug[key] = env[key];
19 - });
20 -
21 - /**
22 - * The currently active debug mode names, and names to skip.
23 - */
24 -
25 - createDebug.names = [];
26 - createDebug.skips = [];
27 -
28 - /**
29 - * Map of special "%n" handling functions, for the debug "format" argument.
30 - *
31 - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
32 - */
33 - createDebug.formatters = {};
34 -
35 - /**
36 - * Selects a color for a debug namespace
37 - * @param {String} namespace The namespace string for the for the debug instance to be colored
38 - * @return {Number|String} An ANSI color code for the given namespace
39 - * @api private
40 - */
41 - function selectColor(namespace) {
42 - let hash = 0;
43 -
44 - for (let i = 0; i < namespace.length; i++) {
45 - hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
46 - hash |= 0; // Convert to 32bit integer
47 - }
48 -
49 - return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
50 - }
51 - createDebug.selectColor = selectColor;
52 -
53 - /**
54 - * Create a debugger with the given `namespace`.
55 - *
56 - * @param {String} namespace
57 - * @return {Function}
58 - * @api public
59 - */
60 - function createDebug(namespace) {
61 - let prevTime;
62 - let enableOverride = null;
63 -
64 - function debug(...args) {
65 - // Disabled?
66 - if (!debug.enabled) {
67 - return;
68 - }
69 -
70 - const self = debug;
71 -
72 - // Set `diff` timestamp
73 - const curr = Number(new Date());
74 - const ms = curr - (prevTime || curr);
75 - self.diff = ms;
76 - self.prev = prevTime;
77 - self.curr = curr;
78 - prevTime = curr;
79 -
80 - args[0] = createDebug.coerce(args[0]);
81 -
82 - if (typeof args[0] !== 'string') {
83 - // Anything else let's inspect with %O
84 - args.unshift('%O');
85 - }
86 -
87 - // Apply any `formatters` transformations
88 - let index = 0;
89 - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
90 - // If we encounter an escaped % then don't increase the array index
91 - if (match === '%%') {
92 - return '%';
93 - }
94 - index++;
95 - const formatter = createDebug.formatters[format];
96 - if (typeof formatter === 'function') {
97 - const val = args[index];
98 - match = formatter.call(self, val);
99 -
100 - // Now we need to remove `args[index]` since it's inlined in the `format`
101 - args.splice(index, 1);
102 - index--;
103 - }
104 - return match;
105 - });
106 -
107 - // Apply env-specific formatting (colors, etc.)
108 - createDebug.formatArgs.call(self, args);
109 -
110 - const logFn = self.log || createDebug.log;
111 - logFn.apply(self, args);
112 - }
113 -
114 - debug.namespace = namespace;
115 - debug.useColors = createDebug.useColors();
116 - debug.color = createDebug.selectColor(namespace);
117 - debug.extend = extend;
118 - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
119 -
120 - Object.defineProperty(debug, 'enabled', {
121 - enumerable: true,
122 - configurable: false,
123 - get: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,
124 - set: v => {
125 - enableOverride = v;
126 - }
127 - });
128 -
129 - // Env-specific initialization logic for debug instances
130 - if (typeof createDebug.init === 'function') {
131 - createDebug.init(debug);
132 - }
133 -
134 - return debug;
135 - }
136 -
137 - function extend(namespace, delimiter) {
138 - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
139 - newDebug.log = this.log;
140 - return newDebug;
141 - }
142 -
143 - /**
144 - * Enables a debug mode by namespaces. This can include modes
145 - * separated by a colon and wildcards.
146 - *
147 - * @param {String} namespaces
148 - * @api public
149 - */
150 - function enable(namespaces) {
151 - createDebug.save(namespaces);
152 -
153 - createDebug.names = [];
154 - createDebug.skips = [];
155 -
156 - let i;
157 - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
158 - const len = split.length;
159 -
160 - for (i = 0; i < len; i++) {
161 - if (!split[i]) {
162 - // ignore empty strings
163 - continue;
164 - }
165 -
166 - namespaces = split[i].replace(/\*/g, '.*?');
167 -
168 - if (namespaces[0] === '-') {
169 - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
170 - } else {
171 - createDebug.names.push(new RegExp('^' + namespaces + '$'));
172 - }
173 - }
174 - }
175 -
176 - /**
177 - * Disable debug output.
178 - *
179 - * @return {String} namespaces
180 - * @api public
181 - */
182 - function disable() {
183 - const namespaces = [
184 - ...createDebug.names.map(toNamespace),
185 - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
186 - ].join(',');
187 - createDebug.enable('');
188 - return namespaces;
189 - }
190 -
191 - /**
192 - * Returns true if the given mode name is enabled, false otherwise.
193 - *
194 - * @param {String} name
195 - * @return {Boolean}
196 - * @api public
197 - */
198 - function enabled(name) {
199 - if (name[name.length - 1] === '*') {
200 - return true;
201 - }
202 -
203 - let i;
204 - let len;
205 -
206 - for (i = 0, len = createDebug.skips.length; i < len; i++) {
207 - if (createDebug.skips[i].test(name)) {
208 - return false;
209 - }
210 - }
211 -
212 - for (i = 0, len = createDebug.names.length; i < len; i++) {
213 - if (createDebug.names[i].test(name)) {
214 - return true;
215 - }
216 - }
217 -
218 - return false;
219 - }
220 -
221 - /**
222 - * Convert regexp to namespace
223 - *
224 - * @param {RegExp} regxep
225 - * @return {String} namespace
226 - * @api private
227 - */
228 - function toNamespace(regexp) {
229 - return regexp.toString()
230 - .substring(2, regexp.toString().length - 2)
231 - .replace(/\.\*\?$/, '*');
232 - }
233 -
234 - /**
235 - * Coerce `val`.
236 - *
237 - * @param {Mixed} val
238 - * @return {Mixed}
239 - * @api private
240 - */
241 - function coerce(val) {
242 - if (val instanceof Error) {
243 - return val.stack || val.message;
244 - }
245 - return val;
246 - }
247 -
248 - /**
249 - * XXX DO NOT USE. This is a temporary stub function.
250 - * XXX It WILL be removed in the next major release.
251 - */
252 - function destroy() {
253 - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
254 - }
255 -
256 - createDebug.enable(createDebug.load());
257 -
258 - return createDebug;
259 -}
260 -
261 -module.exports = setup;
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.