mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Deploy Production Code for Commit 0752a8c57b
🚀
This commit is contained in:
parent
0752a8c57b
commit
b36f842fa3
26
lib/lib.js
26
lib/lib.js
@ -23,8 +23,24 @@ function run(configuration) {
|
|||||||
let status = constants_1.Status.RUNNING;
|
let status = constants_1.Status.RUNNING;
|
||||||
try {
|
try {
|
||||||
(0, core_1.info)(`
|
(0, core_1.info)(`
|
||||||
GitHub Pages Deploy Action 🚀
|
╭━━━╮╭╮╭╮╱╭╮╱╱╭╮╱╱╭━━━╮
|
||||||
|
┃╭━╮┣╯╰┫┃╱┃┃╱╱┃┃╱╱┃╭━╮┃
|
||||||
|
┃┃╱╰╋╮╭┫╰━╯┣╮╭┫╰━╮┃╰━╯┣━━┳━━┳━━┳━━╮
|
||||||
|
┃┃╭━╋┫┃┃╭━╮┃┃┃┃╭╮┃┃╭━━┫╭╮┃╭╮┃┃━┫━━┫
|
||||||
|
┃╰┻━┃┃╰┫┃╱┃┃╰╯┃╰╯┃┃┃╱╱┃╭╮┃╰╯┃┃━╋━━┃
|
||||||
|
╰━━━┻┻━┻╯╱╰┻━━┻━━╯╰╯╱╱╰╯╰┻━╮┣━━┻━━╯
|
||||||
|
╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╭━╯┃
|
||||||
|
╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╰━━╯
|
||||||
|
╭━━━╮╱╱╱╱╱╭╮╱╱╱╱╱╱╱╱╭━━━╮╱╱╭╮
|
||||||
|
╰╮╭╮┃╱╱╱╱╱┃┃╱╱╱╱╱╱╱╱┃╭━╮┃╱╭╯╰╮
|
||||||
|
╱┃┃┃┣━━┳━━┫┃╭━━┳╮╱╭╮┃┃╱┃┣━┻╮╭╋┳━━┳━╮
|
||||||
|
╱┃┃┃┃┃━┫╭╮┃┃┃╭╮┃┃╱┃┃┃╰━╯┃╭━┫┃┣┫╭╮┃╭╮╮
|
||||||
|
╭╯╰╯┃┃━┫╰╯┃╰┫╰╯┃╰━╯┃┃╭━╮┃╰━┫╰┫┃╰╯┃┃┃┃
|
||||||
|
╰━━━┻━━┫╭━┻━┻━━┻━╮╭╯╰╯╱╰┻━━┻━┻┻━━┻╯╰╯
|
||||||
|
╱╱╱╱╱╱╱┃┃╱╱╱╱╱╱╭━╯┃
|
||||||
|
╱╱╱╱╱╱╱╰╯╱╱╱╱╱╱╰━━╯
|
||||||
|
`);
|
||||||
|
(0, core_1.info)(`
|
||||||
💖 Support: https://github.com/sponsors/JamesIves
|
💖 Support: https://github.com/sponsors/JamesIves
|
||||||
📣 Maintained by James Ives: https://jamesiv.es
|
📣 Maintained by James Ives: https://jamesiv.es
|
||||||
|
|
||||||
@ -50,11 +66,13 @@ function run(configuration) {
|
|||||||
(0, core_1.setFailed)((0, util_1.extractErrorMessage)(error));
|
(0, core_1.setFailed)((0, util_1.extractErrorMessage)(error));
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
(0, core_1.info)(`${status === constants_1.Status.FAILED
|
const terminationMessage = `${status === constants_1.Status.FAILED
|
||||||
? 'Deployment failed! ❌'
|
? 'Deployment failed! ❌'
|
||||||
: status === constants_1.Status.SUCCESS
|
: status === constants_1.Status.SUCCESS
|
||||||
? 'Completed deployment successfully! ✅'
|
? 'Completed deployment successfully! ✅'
|
||||||
: 'There is nothing to commit. Exiting early… 📭'}`);
|
: 'There is nothing to commit. Exiting early… 📭'}`;
|
||||||
|
(0, core_1.info)(terminationMessage);
|
||||||
|
(0, core_1.notice)(terminationMessage);
|
||||||
(0, core_1.exportVariable)('deployment_status', status);
|
(0, core_1.exportVariable)('deployment_status', status);
|
||||||
(0, core_1.setOutput)('deployment-status', status);
|
(0, core_1.setOutput)('deployment-status', status);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ const hasRequiredParameters = (action, params) => {
|
|||||||
/* Verifies the action has the required parameters to run, otherwise throw an error. */
|
/* Verifies the action has the required parameters to run, otherwise throw an error. */
|
||||||
const checkParameters = (action) => {
|
const checkParameters = (action) => {
|
||||||
if (!hasRequiredParameters(action, ['token', 'sshKey'])) {
|
if (!hasRequiredParameters(action, ['token', 'sshKey'])) {
|
||||||
throw new Error('No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. If you wish to use an ssh deploy token then you must set SSH to true.');
|
throw new Error('No deployment token/method was provided. You must provide the action with either a Personal Access Token or the GitHub Token secret in order to deploy. For more details on how to use an ssh deploy key please refer to the documentation.');
|
||||||
}
|
}
|
||||||
if (!hasRequiredParameters(action, ['branch'])) {
|
if (!hasRequiredParameters(action, ['branch'])) {
|
||||||
throw new Error('Branch is required.');
|
throw new Error('Branch is required.');
|
||||||
@ -52,7 +52,7 @@ const checkParameters = (action) => {
|
|||||||
throw new Error(`The directory you're trying to deploy named ${action.folderPath} doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗`);
|
throw new Error(`The directory you're trying to deploy named ${action.folderPath} doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗`);
|
||||||
}
|
}
|
||||||
if (!constants_1.SupportedOperatingSystems.includes(process.env.RUNNER_OS)) {
|
if (!constants_1.SupportedOperatingSystems.includes(process.env.RUNNER_OS)) {
|
||||||
(0, core_1.info)(`The operating system you're using is not supported and results may be varied. Please refer to the documentation for more details. ❗`);
|
(0, core_1.warning)(`The operating system you're using is not supported and results may be varied. Please refer to the documentation for more details. ❗`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
exports.checkParameters = checkParameters;
|
exports.checkParameters = checkParameters;
|
||||||
|
4
node_modules/@types/node/README.md
generated
vendored
4
node_modules/@types/node/README.md
generated
vendored
@ -8,9 +8,9 @@ This package contains type definitions for Node.js (https://nodejs.org/).
|
|||||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
||||||
|
|
||||||
### Additional Details
|
### Additional Details
|
||||||
* Last updated: Tue, 04 Jan 2022 18:31:31 GMT
|
* Last updated: Thu, 27 Jan 2022 20:31:30 GMT
|
||||||
* Dependencies: none
|
* Dependencies: none
|
||||||
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
|
||||||
|
|
||||||
# Credits
|
# Credits
|
||||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [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), [Seth Westphal](https://github.com/westy92), [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), [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), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
|
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), [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), [Seth Westphal](https://github.com/westy92), [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), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), and [wafuwafu13](https://github.com/wafuwafu13).
|
||||||
|
2
node_modules/@types/node/crypto.d.ts
generated
vendored
2
node_modules/@types/node/crypto.d.ts
generated
vendored
@ -250,7 +250,7 @@ declare module 'crypto' {
|
|||||||
*/
|
*/
|
||||||
function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
|
function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
|
||||||
// https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
|
// https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
|
||||||
type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex';
|
type BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary';
|
||||||
type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
|
type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
|
||||||
type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
|
type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
|
||||||
type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
|
type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
|
||||||
|
34
node_modules/@types/node/events.d.ts
generated
vendored
34
node_modules/@types/node/events.d.ts
generated
vendored
@ -50,7 +50,7 @@ declare module 'events' {
|
|||||||
listener: (...args: any[]) => void,
|
listener: (...args: any[]) => void,
|
||||||
opts?: {
|
opts?: {
|
||||||
once: boolean;
|
once: boolean;
|
||||||
}
|
},
|
||||||
): any;
|
): any;
|
||||||
}
|
}
|
||||||
interface StaticEventEmitterOptions {
|
interface StaticEventEmitterOptions {
|
||||||
@ -154,7 +154,11 @@ declare module 'events' {
|
|||||||
* ```
|
* ```
|
||||||
* @since v11.13.0, v10.16.0
|
* @since v11.13.0, v10.16.0
|
||||||
*/
|
*/
|
||||||
static once(emitter: NodeEventTarget, eventName: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
|
static once(
|
||||||
|
emitter: NodeEventTarget,
|
||||||
|
eventName: string | symbol,
|
||||||
|
options?: StaticEventEmitterOptions,
|
||||||
|
): Promise<any[]>;
|
||||||
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
static once(emitter: DOMEventTarget, eventName: string, options?: StaticEventEmitterOptions): Promise<any[]>;
|
||||||
/**
|
/**
|
||||||
* ```js
|
* ```js
|
||||||
@ -214,7 +218,11 @@ declare module 'events' {
|
|||||||
* @param eventName The name of the event being listened for
|
* @param eventName The name of the event being listened for
|
||||||
* @return that iterates `eventName` events emitted by the `emitter`
|
* @return that iterates `eventName` events emitted by the `emitter`
|
||||||
*/
|
*/
|
||||||
static on(emitter: NodeJS.EventEmitter, eventName: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
|
static on(
|
||||||
|
emitter: NodeJS.EventEmitter,
|
||||||
|
eventName: string,
|
||||||
|
options?: StaticEventEmitterOptions,
|
||||||
|
): AsyncIterableIterator<any>;
|
||||||
/**
|
/**
|
||||||
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
* A class method that returns the number of listeners for the given `eventName`registered on the given `emitter`.
|
||||||
*
|
*
|
||||||
@ -260,6 +268,26 @@ declare module 'events' {
|
|||||||
* @since v15.2.0, v14.17.0
|
* @since v15.2.0, v14.17.0
|
||||||
*/
|
*/
|
||||||
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
static getEventListeners(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
|
||||||
|
/**
|
||||||
|
* By default `EventEmitter`s will print a warning if more than `10` listeners are
|
||||||
|
* added for a particular event. This is a useful default that helps finding
|
||||||
|
* memory leaks. The `EventEmitter.setMaxListeners()` method allows the default limit to be
|
||||||
|
* modified (if eventTargets is empty) or modify the limit specified in every `EventTarget` | `EventEmitter` passed as arguments.
|
||||||
|
* The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
|
||||||
|
*
|
||||||
|
* ```js
|
||||||
|
* EventEmitter.setMaxListeners(20);
|
||||||
|
* // Equivalent to
|
||||||
|
* EventEmitter.defaultMaxListeners = 20;
|
||||||
|
*
|
||||||
|
* const eventTarget = new EventTarget();
|
||||||
|
* // Only way to increase limit for `EventTarget` instances
|
||||||
|
* // as these doesn't expose its own `setMaxListeners` method
|
||||||
|
* EventEmitter.setMaxListeners(20, eventTarget);
|
||||||
|
* ```
|
||||||
|
* @since v15.3.0, v14.17.0
|
||||||
|
*/
|
||||||
|
static setMaxListeners(n?: number, ...eventTargets: Array<DOMEventTarget | NodeJS.EventEmitter>): void;
|
||||||
/**
|
/**
|
||||||
* This symbol shall be used to install a listener for only monitoring `'error'`
|
* This symbol shall be used to install a listener for only monitoring `'error'`
|
||||||
* events. Listeners installed using this symbol are called before the regular
|
* events. Listeners installed using this symbol are called before the regular
|
||||||
|
10
node_modules/@types/node/http.d.ts
generated
vendored
10
node_modules/@types/node/http.d.ts
generated
vendored
@ -621,6 +621,16 @@ declare module 'http' {
|
|||||||
* @since v14.5.0, v12.19.0
|
* @since v14.5.0, v12.19.0
|
||||||
*/
|
*/
|
||||||
protocol: string;
|
protocol: string;
|
||||||
|
/**
|
||||||
|
* Whether the request is send through a reused socket.
|
||||||
|
* @since v13.0.0, v12.16.0
|
||||||
|
*/
|
||||||
|
reusedSocket: boolean;
|
||||||
|
/**
|
||||||
|
* Limits maximum response headers count. If set to 0, no limit will be applied.
|
||||||
|
* @default 2000
|
||||||
|
*/
|
||||||
|
maxHeadersCount: number;
|
||||||
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
||||||
/**
|
/**
|
||||||
* The request method.
|
* The request method.
|
||||||
|
1
node_modules/@types/node/index.d.ts
generated
vendored
1
node_modules/@types/node/index.d.ts
generated
vendored
@ -34,7 +34,6 @@
|
|||||||
// Junxiao Shi <https://github.com/yoursunny>
|
// Junxiao Shi <https://github.com/yoursunny>
|
||||||
// Ilia Baryshnikov <https://github.com/qwelias>
|
// Ilia Baryshnikov <https://github.com/qwelias>
|
||||||
// ExE Boss <https://github.com/ExE-Boss>
|
// ExE Boss <https://github.com/ExE-Boss>
|
||||||
// Surasak Chaisurin <https://github.com/Ryan-Willpower>
|
|
||||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||||
// Anna Henningsen <https://github.com/addaleax>
|
// Anna Henningsen <https://github.com/addaleax>
|
||||||
// Victor Perin <https://github.com/victorperin>
|
// Victor Perin <https://github.com/victorperin>
|
||||||
|
9
node_modules/@types/node/package.json
generated
vendored
9
node_modules/@types/node/package.json
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@types/node",
|
"name": "@types/node",
|
||||||
"version": "17.0.8",
|
"version": "17.0.13",
|
||||||
"description": "TypeScript definitions for Node.js",
|
"description": "TypeScript definitions for Node.js",
|
||||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -175,11 +175,6 @@
|
|||||||
"url": "https://github.com/ExE-Boss",
|
"url": "https://github.com/ExE-Boss",
|
||||||
"githubUsername": "ExE-Boss"
|
"githubUsername": "ExE-Boss"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "Surasak Chaisurin",
|
|
||||||
"url": "https://github.com/Ryan-Willpower",
|
|
||||||
"githubUsername": "Ryan-Willpower"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Piotr Błażejewicz",
|
"name": "Piotr Błażejewicz",
|
||||||
"url": "https://github.com/peterblazejewicz",
|
"url": "https://github.com/peterblazejewicz",
|
||||||
@ -225,6 +220,6 @@
|
|||||||
},
|
},
|
||||||
"scripts": {},
|
"scripts": {},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"typesPublisherContentHash": "133a958e0122898f222d66bf1e776d90a38ee878a694bbe229cf5e02db71deef",
|
"typesPublisherContentHash": "9bb87f550fbe63454ad9588c0e9123a36bfa55232062afbc431a3498525daf94",
|
||||||
"typeScriptVersion": "3.8"
|
"typeScriptVersion": "3.8"
|
||||||
}
|
}
|
2
node_modules/@types/node/util.d.ts
generated
vendored
2
node_modules/@types/node/util.d.ts
generated
vendored
@ -317,7 +317,7 @@ declare module 'util' {
|
|||||||
* @return The representation of `object`.
|
* @return The representation of `object`.
|
||||||
*/
|
*/
|
||||||
export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
export function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
||||||
export function inspect(object: any, options: InspectOptions): string;
|
export function inspect(object: any, options?: InspectOptions): string;
|
||||||
export namespace inspect {
|
export namespace inspect {
|
||||||
let colors: NodeJS.Dict<[number, number]>;
|
let colors: NodeJS.Dict<[number, number]>;
|
||||||
let styles: {
|
let styles: {
|
||||||
|
272
node_modules/node-fetch/CHANGELOG.md
generated
vendored
272
node_modules/node-fetch/CHANGELOG.md
generated
vendored
@ -1,272 +0,0 @@
|
|||||||
|
|
||||||
Changelog
|
|
||||||
=========
|
|
||||||
|
|
||||||
|
|
||||||
# 2.x release
|
|
||||||
|
|
||||||
## v2.6.1
|
|
||||||
|
|
||||||
**This is an important security release. It is strongly recommended to update as soon as possible.**
|
|
||||||
|
|
||||||
- Fix: honor the `size` option after following a redirect.
|
|
||||||
|
|
||||||
## v2.6.0
|
|
||||||
|
|
||||||
- Enhance: `options.agent`, it now accepts a function that returns custom http(s).Agent instance based on current URL, see readme for more information.
|
|
||||||
- Fix: incorrect `Content-Length` was returned for stream body in 2.5.0 release; note that `node-fetch` doesn't calculate content length for stream body.
|
|
||||||
- Fix: `Response.url` should return empty string instead of `null` by default.
|
|
||||||
|
|
||||||
## v2.5.0
|
|
||||||
|
|
||||||
- Enhance: `Response` object now includes `redirected` property.
|
|
||||||
- Enhance: `fetch()` now accepts third-party `Blob` implementation as body.
|
|
||||||
- Other: disable `package-lock.json` generation as we never commit them.
|
|
||||||
- Other: dev dependency update.
|
|
||||||
- Other: readme update.
|
|
||||||
|
|
||||||
## v2.4.1
|
|
||||||
|
|
||||||
- Fix: `Blob` import rule for node < 10, as `Readable` isn't a named export.
|
|
||||||
|
|
||||||
## v2.4.0
|
|
||||||
|
|
||||||
- Enhance: added `Brotli` compression support (using node's zlib).
|
|
||||||
- Enhance: updated `Blob` implementation per spec.
|
|
||||||
- Fix: set content type automatically for `URLSearchParams`.
|
|
||||||
- Fix: `Headers` now reject empty header names.
|
|
||||||
- Fix: test cases, as node 12+ no longer accepts invalid header response.
|
|
||||||
|
|
||||||
## v2.3.0
|
|
||||||
|
|
||||||
- Enhance: added `AbortSignal` support, with README example.
|
|
||||||
- Enhance: handle invalid `Location` header during redirect by rejecting them explicitly with `FetchError`.
|
|
||||||
- Fix: update `browser.js` to support react-native environment, where `self` isn't available globally.
|
|
||||||
|
|
||||||
## v2.2.1
|
|
||||||
|
|
||||||
- Fix: `compress` flag shouldn't overwrite existing `Accept-Encoding` header.
|
|
||||||
- Fix: multiple `import` rules, where `PassThrough` etc. doesn't have a named export when using node <10 and `--exerimental-modules` flag.
|
|
||||||
- Other: Better README.
|
|
||||||
|
|
||||||
## v2.2.0
|
|
||||||
|
|
||||||
- Enhance: Support all `ArrayBuffer` view types
|
|
||||||
- Enhance: Support Web Workers
|
|
||||||
- Enhance: Support Node.js' `--experimental-modules` mode; deprecate `.es.js` file
|
|
||||||
- Fix: Add `__esModule` property to the exports object
|
|
||||||
- Other: Better example in README for writing response to a file
|
|
||||||
- Other: More tests for Agent
|
|
||||||
|
|
||||||
## v2.1.2
|
|
||||||
|
|
||||||
- Fix: allow `Body` methods to work on `ArrayBuffer`-backed `Body` objects
|
|
||||||
- Fix: reject promise returned by `Body` methods when the accumulated `Buffer` exceeds the maximum size
|
|
||||||
- Fix: support custom `Host` headers with any casing
|
|
||||||
- Fix: support importing `fetch()` from TypeScript in `browser.js`
|
|
||||||
- Fix: handle the redirect response body properly
|
|
||||||
|
|
||||||
## v2.1.1
|
|
||||||
|
|
||||||
Fix packaging errors in v2.1.0.
|
|
||||||
|
|
||||||
## v2.1.0
|
|
||||||
|
|
||||||
- Enhance: allow using ArrayBuffer as the `body` of a `fetch()` or `Request`
|
|
||||||
- Fix: store HTTP headers of a `Headers` object internally with the given case, for compatibility with older servers that incorrectly treated header names in a case-sensitive manner
|
|
||||||
- Fix: silently ignore invalid HTTP headers
|
|
||||||
- Fix: handle HTTP redirect responses without a `Location` header just like non-redirect responses
|
|
||||||
- Fix: include bodies when following a redirection when appropriate
|
|
||||||
|
|
||||||
## v2.0.0
|
|
||||||
|
|
||||||
This is a major release. Check [our upgrade guide](https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md) for an overview on some key differences between v1 and v2.
|
|
||||||
|
|
||||||
### General changes
|
|
||||||
|
|
||||||
- Major: Node.js 0.10.x and 0.12.x support is dropped
|
|
||||||
- Major: `require('node-fetch/lib/response')` etc. is now unsupported; use `require('node-fetch').Response` or ES6 module imports
|
|
||||||
- Enhance: start testing on Node.js v4.x, v6.x, v8.x LTS, as well as v9.x stable
|
|
||||||
- Enhance: use Rollup to produce a distributed bundle (less memory overhead and faster startup)
|
|
||||||
- Enhance: make `Object.prototype.toString()` on Headers, Requests, and Responses return correct class strings
|
|
||||||
- Other: rewrite in ES2015 using Babel
|
|
||||||
- Other: use Codecov for code coverage tracking
|
|
||||||
- Other: update package.json script for npm 5
|
|
||||||
- Other: `encoding` module is now optional (alpha.7)
|
|
||||||
- Other: expose browser.js through package.json, avoid bundling mishaps (alpha.9)
|
|
||||||
- Other: allow TypeScript to `import` node-fetch by exposing default (alpha.9)
|
|
||||||
|
|
||||||
### HTTP requests
|
|
||||||
|
|
||||||
- Major: overwrite user's `Content-Length` if we can be sure our information is correct (per spec)
|
|
||||||
- Fix: errors in a response are caught before the body is accessed
|
|
||||||
- Fix: support WHATWG URL objects, created by `whatwg-url` package or `require('url').URL` in Node.js 7+
|
|
||||||
|
|
||||||
### Response and Request classes
|
|
||||||
|
|
||||||
- Major: `response.text()` no longer attempts to detect encoding, instead always opting for UTF-8 (per spec); use `response.textConverted()` for the v1 behavior
|
|
||||||
- Major: make `response.json()` throw error instead of returning an empty object on 204 no-content respose (per spec; reverts behavior changed in v1.6.2)
|
|
||||||
- Major: internal methods are no longer exposed
|
|
||||||
- Major: throw error when a `GET` or `HEAD` Request is constructed with a non-null body (per spec)
|
|
||||||
- Enhance: add `response.arrayBuffer()` (also applies to Requests)
|
|
||||||
- Enhance: add experimental `response.blob()` (also applies to Requests)
|
|
||||||
- Enhance: `URLSearchParams` is now accepted as a body
|
|
||||||
- Enhance: wrap `response.json()` json parsing error as `FetchError`
|
|
||||||
- Fix: fix Request and Response with `null` body
|
|
||||||
|
|
||||||
### Headers class
|
|
||||||
|
|
||||||
- Major: remove `headers.getAll()`; make `get()` return all headers delimited by commas (per spec)
|
|
||||||
- Enhance: make Headers iterable
|
|
||||||
- Enhance: make Headers constructor accept an array of tuples
|
|
||||||
- Enhance: make sure header names and values are valid in HTTP
|
|
||||||
- Fix: coerce Headers prototype function parameters to strings, where applicable
|
|
||||||
|
|
||||||
### Documentation
|
|
||||||
|
|
||||||
- Enhance: more comprehensive API docs
|
|
||||||
- Enhance: add a list of default headers in README
|
|
||||||
|
|
||||||
|
|
||||||
# 1.x release
|
|
||||||
|
|
||||||
## backport releases (v1.7.0 and beyond)
|
|
||||||
|
|
||||||
See [changelog on 1.x branch](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) for details.
|
|
||||||
|
|
||||||
## v1.6.3
|
|
||||||
|
|
||||||
- Enhance: error handling document to explain `FetchError` design
|
|
||||||
- Fix: support `form-data` 2.x releases (requires `form-data` >= 2.1.0)
|
|
||||||
|
|
||||||
## v1.6.2
|
|
||||||
|
|
||||||
- Enhance: minor document update
|
|
||||||
- Fix: response.json() returns empty object on 204 no-content response instead of throwing a syntax error
|
|
||||||
|
|
||||||
## v1.6.1
|
|
||||||
|
|
||||||
- Fix: if `res.body` is a non-stream non-formdata object, we will call `body.toString` and send it as a string
|
|
||||||
- Fix: `counter` value is incorrectly set to `follow` value when wrapping Request instance
|
|
||||||
- Fix: documentation update
|
|
||||||
|
|
||||||
## v1.6.0
|
|
||||||
|
|
||||||
- Enhance: added `res.buffer()` api for convenience, it returns body as a Node.js buffer
|
|
||||||
- Enhance: better old server support by handling raw deflate response
|
|
||||||
- Enhance: skip encoding detection for non-HTML/XML response
|
|
||||||
- Enhance: minor document update
|
|
||||||
- Fix: HEAD request doesn't need decompression, as body is empty
|
|
||||||
- Fix: `req.body` now accepts a Node.js buffer
|
|
||||||
|
|
||||||
## v1.5.3
|
|
||||||
|
|
||||||
- Fix: handle 204 and 304 responses when body is empty but content-encoding is gzip/deflate
|
|
||||||
- Fix: allow resolving response and cloned response in any order
|
|
||||||
- Fix: avoid setting `content-length` when `form-data` body use streams
|
|
||||||
- Fix: send DELETE request with content-length when body is present
|
|
||||||
- Fix: allow any url when calling new Request, but still reject non-http(s) url in fetch
|
|
||||||
|
|
||||||
## v1.5.2
|
|
||||||
|
|
||||||
- Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent
|
|
||||||
|
|
||||||
## v1.5.1
|
|
||||||
|
|
||||||
- Fix: redirect mode `manual` should work even when there is no redirection or broken redirection
|
|
||||||
|
|
||||||
## v1.5.0
|
|
||||||
|
|
||||||
- Enhance: rejected promise now use custom `Error` (thx to @pekeler)
|
|
||||||
- Enhance: `FetchError` contains `err.type` and `err.code`, allows for better error handling (thx to @pekeler)
|
|
||||||
- Enhance: basic support for redirect mode `manual` and `error`, allows for location header extraction (thx to @jimmywarting for the initial PR)
|
|
||||||
|
|
||||||
## v1.4.1
|
|
||||||
|
|
||||||
- Fix: wrapping Request instance with FormData body again should preserve the body as-is
|
|
||||||
|
|
||||||
## v1.4.0
|
|
||||||
|
|
||||||
- Enhance: Request and Response now have `clone` method (thx to @kirill-konshin for the initial PR)
|
|
||||||
- Enhance: Request and Response now have proper string and buffer body support (thx to @kirill-konshin)
|
|
||||||
- Enhance: Body constructor has been refactored out (thx to @kirill-konshin)
|
|
||||||
- Enhance: Headers now has `forEach` method (thx to @tricoder42)
|
|
||||||
- Enhance: back to 100% code coverage
|
|
||||||
- Fix: better form-data support (thx to @item4)
|
|
||||||
- Fix: better character encoding detection under chunked encoding (thx to @dsuket for the initial PR)
|
|
||||||
|
|
||||||
## v1.3.3
|
|
||||||
|
|
||||||
- Fix: make sure `Content-Length` header is set when body is string for POST/PUT/PATCH requests
|
|
||||||
- Fix: handle body stream error, for cases such as incorrect `Content-Encoding` header
|
|
||||||
- Fix: when following certain redirects, use `GET` on subsequent request per Fetch Spec
|
|
||||||
- Fix: `Request` and `Response` constructors now parse headers input using `Headers`
|
|
||||||
|
|
||||||
## v1.3.2
|
|
||||||
|
|
||||||
- Enhance: allow auto detect of form-data input (no `FormData` spec on node.js, this is form-data specific feature)
|
|
||||||
|
|
||||||
## v1.3.1
|
|
||||||
|
|
||||||
- Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side)
|
|
||||||
|
|
||||||
## v1.3.0
|
|
||||||
|
|
||||||
- Enhance: now `fetch.Request` is exposed as well
|
|
||||||
|
|
||||||
## v1.2.1
|
|
||||||
|
|
||||||
- Enhance: `Headers` now normalized `Number` value to `String`, prevent common mistakes
|
|
||||||
|
|
||||||
## v1.2.0
|
|
||||||
|
|
||||||
- Enhance: now fetch.Headers and fetch.Response are exposed, making testing easier
|
|
||||||
|
|
||||||
## v1.1.2
|
|
||||||
|
|
||||||
- Fix: `Headers` should only support `String` and `Array` properties, and ignore others
|
|
||||||
|
|
||||||
## v1.1.1
|
|
||||||
|
|
||||||
- Enhance: now req.headers accept both plain object and `Headers` instance
|
|
||||||
|
|
||||||
## v1.1.0
|
|
||||||
|
|
||||||
- Enhance: timeout now also applies to response body (in case of slow response)
|
|
||||||
- Fix: timeout is now cleared properly when fetch is done/has failed
|
|
||||||
|
|
||||||
## v1.0.6
|
|
||||||
|
|
||||||
- Fix: less greedy content-type charset matching
|
|
||||||
|
|
||||||
## v1.0.5
|
|
||||||
|
|
||||||
- Fix: when `follow = 0`, fetch should not follow redirect
|
|
||||||
- Enhance: update tests for better coverage
|
|
||||||
- Enhance: code formatting
|
|
||||||
- Enhance: clean up doc
|
|
||||||
|
|
||||||
## v1.0.4
|
|
||||||
|
|
||||||
- Enhance: test iojs support
|
|
||||||
- Enhance: timeout attached to socket event only fire once per redirect
|
|
||||||
|
|
||||||
## v1.0.3
|
|
||||||
|
|
||||||
- Fix: response size limit should reject large chunk
|
|
||||||
- Enhance: added character encoding detection for xml, such as rss/atom feed (encoding in DTD)
|
|
||||||
|
|
||||||
## v1.0.2
|
|
||||||
|
|
||||||
- Fix: added res.ok per spec change
|
|
||||||
|
|
||||||
## v1.0.0
|
|
||||||
|
|
||||||
- Enhance: better test coverage and doc
|
|
||||||
|
|
||||||
|
|
||||||
# 0.x release
|
|
||||||
|
|
||||||
## v0.1
|
|
||||||
|
|
||||||
- Major: initial public release
|
|
58
node_modules/node-fetch/lib/index.es.js
generated
vendored
58
node_modules/node-fetch/lib/index.es.js
generated
vendored
@ -3,6 +3,7 @@ process.emitWarning("The .es.js file is deprecated. Use .mjs instead.");
|
|||||||
import Stream from 'stream';
|
import Stream from 'stream';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
import Url from 'url';
|
import Url from 'url';
|
||||||
|
import whatwgUrl from 'whatwg-url';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import zlib from 'zlib';
|
import zlib from 'zlib';
|
||||||
|
|
||||||
@ -1137,11 +1138,32 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const INTERNALS$2 = Symbol('Request internals');
|
const INTERNALS$2 = Symbol('Request internals');
|
||||||
|
const URL = Url.URL || whatwgUrl.URL;
|
||||||
|
|
||||||
// fix an issue where "format", "parse" aren't a named export for node <10
|
// fix an issue where "format", "parse" aren't a named export for node <10
|
||||||
const parse_url = Url.parse;
|
const parse_url = Url.parse;
|
||||||
const format_url = Url.format;
|
const format_url = Url.format;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper around `new URL` to handle arbitrary URLs
|
||||||
|
*
|
||||||
|
* @param {string} urlStr
|
||||||
|
* @return {void}
|
||||||
|
*/
|
||||||
|
function parseURL(urlStr) {
|
||||||
|
/*
|
||||||
|
Check whether the URL is absolute or not
|
||||||
|
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
||||||
|
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
||||||
|
*/
|
||||||
|
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
||||||
|
urlStr = new URL(urlStr).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to old implementation for arbitrary URLs
|
||||||
|
return parse_url(urlStr);
|
||||||
|
}
|
||||||
|
|
||||||
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1178,14 +1200,14 @@ class Request {
|
|||||||
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
||||||
// will fall into this branch also (since their `toString()` will return
|
// will fall into this branch also (since their `toString()` will return
|
||||||
// `href` property anyway)
|
// `href` property anyway)
|
||||||
parsedURL = parse_url(input.href);
|
parsedURL = parseURL(input.href);
|
||||||
} else {
|
} else {
|
||||||
// coerce input to a string before attempting to parse
|
// coerce input to a string before attempting to parse
|
||||||
parsedURL = parse_url(`${input}`);
|
parsedURL = parseURL(`${input}`);
|
||||||
}
|
}
|
||||||
input = {};
|
input = {};
|
||||||
} else {
|
} else {
|
||||||
parsedURL = parse_url(input.url);
|
parsedURL = parseURL(input.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
let method = init.method || input.method || 'GET';
|
let method = init.method || input.method || 'GET';
|
||||||
@ -1379,9 +1401,17 @@ AbortError.prototype = Object.create(Error.prototype);
|
|||||||
AbortError.prototype.constructor = AbortError;
|
AbortError.prototype.constructor = AbortError;
|
||||||
AbortError.prototype.name = 'AbortError';
|
AbortError.prototype.name = 'AbortError';
|
||||||
|
|
||||||
|
const URL$1 = Url.URL || whatwgUrl.URL;
|
||||||
|
|
||||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
||||||
const PassThrough$1 = Stream.PassThrough;
|
const PassThrough$1 = Stream.PassThrough;
|
||||||
const resolve_url = Url.resolve;
|
|
||||||
|
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
|
||||||
|
const orig = new URL$1(original).hostname;
|
||||||
|
const dest = new URL$1(destination).hostname;
|
||||||
|
|
||||||
|
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch function
|
* Fetch function
|
||||||
@ -1469,7 +1499,19 @@ function fetch(url, opts) {
|
|||||||
const location = headers.get('Location');
|
const location = headers.get('Location');
|
||||||
|
|
||||||
// HTTP fetch step 5.3
|
// HTTP fetch step 5.3
|
||||||
const locationURL = location === null ? null : resolve_url(request.url, location);
|
let locationURL = null;
|
||||||
|
try {
|
||||||
|
locationURL = location === null ? null : new URL$1(location, request.url).toString();
|
||||||
|
} catch (err) {
|
||||||
|
// error here can only be invalid URL in Location: header
|
||||||
|
// do not throw when options.redirect == manual
|
||||||
|
// let the user extract the errorneous redirect URL
|
||||||
|
if (request.redirect !== 'manual') {
|
||||||
|
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
|
||||||
|
finalize();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HTTP fetch step 5.5
|
// HTTP fetch step 5.5
|
||||||
switch (request.redirect) {
|
switch (request.redirect) {
|
||||||
@ -1517,6 +1559,12 @@ function fetch(url, opts) {
|
|||||||
size: request.size
|
size: request.size
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
||||||
|
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
||||||
|
requestOpts.headers.delete(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HTTP-redirect fetch step 9
|
// HTTP-redirect fetch step 9
|
||||||
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
||||||
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
||||||
|
58
node_modules/node-fetch/lib/index.js
generated
vendored
58
node_modules/node-fetch/lib/index.js
generated
vendored
@ -7,6 +7,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|||||||
var Stream = _interopDefault(require('stream'));
|
var Stream = _interopDefault(require('stream'));
|
||||||
var http = _interopDefault(require('http'));
|
var http = _interopDefault(require('http'));
|
||||||
var Url = _interopDefault(require('url'));
|
var Url = _interopDefault(require('url'));
|
||||||
|
var whatwgUrl = _interopDefault(require('whatwg-url'));
|
||||||
var https = _interopDefault(require('https'));
|
var https = _interopDefault(require('https'));
|
||||||
var zlib = _interopDefault(require('zlib'));
|
var zlib = _interopDefault(require('zlib'));
|
||||||
|
|
||||||
@ -1141,11 +1142,32 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const INTERNALS$2 = Symbol('Request internals');
|
const INTERNALS$2 = Symbol('Request internals');
|
||||||
|
const URL = Url.URL || whatwgUrl.URL;
|
||||||
|
|
||||||
// fix an issue where "format", "parse" aren't a named export for node <10
|
// fix an issue where "format", "parse" aren't a named export for node <10
|
||||||
const parse_url = Url.parse;
|
const parse_url = Url.parse;
|
||||||
const format_url = Url.format;
|
const format_url = Url.format;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper around `new URL` to handle arbitrary URLs
|
||||||
|
*
|
||||||
|
* @param {string} urlStr
|
||||||
|
* @return {void}
|
||||||
|
*/
|
||||||
|
function parseURL(urlStr) {
|
||||||
|
/*
|
||||||
|
Check whether the URL is absolute or not
|
||||||
|
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
||||||
|
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
||||||
|
*/
|
||||||
|
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
||||||
|
urlStr = new URL(urlStr).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to old implementation for arbitrary URLs
|
||||||
|
return parse_url(urlStr);
|
||||||
|
}
|
||||||
|
|
||||||
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1182,14 +1204,14 @@ class Request {
|
|||||||
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
||||||
// will fall into this branch also (since their `toString()` will return
|
// will fall into this branch also (since their `toString()` will return
|
||||||
// `href` property anyway)
|
// `href` property anyway)
|
||||||
parsedURL = parse_url(input.href);
|
parsedURL = parseURL(input.href);
|
||||||
} else {
|
} else {
|
||||||
// coerce input to a string before attempting to parse
|
// coerce input to a string before attempting to parse
|
||||||
parsedURL = parse_url(`${input}`);
|
parsedURL = parseURL(`${input}`);
|
||||||
}
|
}
|
||||||
input = {};
|
input = {};
|
||||||
} else {
|
} else {
|
||||||
parsedURL = parse_url(input.url);
|
parsedURL = parseURL(input.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
let method = init.method || input.method || 'GET';
|
let method = init.method || input.method || 'GET';
|
||||||
@ -1383,9 +1405,17 @@ AbortError.prototype = Object.create(Error.prototype);
|
|||||||
AbortError.prototype.constructor = AbortError;
|
AbortError.prototype.constructor = AbortError;
|
||||||
AbortError.prototype.name = 'AbortError';
|
AbortError.prototype.name = 'AbortError';
|
||||||
|
|
||||||
|
const URL$1 = Url.URL || whatwgUrl.URL;
|
||||||
|
|
||||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
||||||
const PassThrough$1 = Stream.PassThrough;
|
const PassThrough$1 = Stream.PassThrough;
|
||||||
const resolve_url = Url.resolve;
|
|
||||||
|
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
|
||||||
|
const orig = new URL$1(original).hostname;
|
||||||
|
const dest = new URL$1(destination).hostname;
|
||||||
|
|
||||||
|
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch function
|
* Fetch function
|
||||||
@ -1473,7 +1503,19 @@ function fetch(url, opts) {
|
|||||||
const location = headers.get('Location');
|
const location = headers.get('Location');
|
||||||
|
|
||||||
// HTTP fetch step 5.3
|
// HTTP fetch step 5.3
|
||||||
const locationURL = location === null ? null : resolve_url(request.url, location);
|
let locationURL = null;
|
||||||
|
try {
|
||||||
|
locationURL = location === null ? null : new URL$1(location, request.url).toString();
|
||||||
|
} catch (err) {
|
||||||
|
// error here can only be invalid URL in Location: header
|
||||||
|
// do not throw when options.redirect == manual
|
||||||
|
// let the user extract the errorneous redirect URL
|
||||||
|
if (request.redirect !== 'manual') {
|
||||||
|
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
|
||||||
|
finalize();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HTTP fetch step 5.5
|
// HTTP fetch step 5.5
|
||||||
switch (request.redirect) {
|
switch (request.redirect) {
|
||||||
@ -1521,6 +1563,12 @@ function fetch(url, opts) {
|
|||||||
size: request.size
|
size: request.size
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
||||||
|
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
||||||
|
requestOpts.headers.delete(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HTTP-redirect fetch step 9
|
// HTTP-redirect fetch step 9
|
||||||
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
||||||
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
||||||
|
58
node_modules/node-fetch/lib/index.mjs
generated
vendored
58
node_modules/node-fetch/lib/index.mjs
generated
vendored
@ -1,6 +1,7 @@
|
|||||||
import Stream from 'stream';
|
import Stream from 'stream';
|
||||||
import http from 'http';
|
import http from 'http';
|
||||||
import Url from 'url';
|
import Url from 'url';
|
||||||
|
import whatwgUrl from 'whatwg-url';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import zlib from 'zlib';
|
import zlib from 'zlib';
|
||||||
|
|
||||||
@ -1135,11 +1136,32 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const INTERNALS$2 = Symbol('Request internals');
|
const INTERNALS$2 = Symbol('Request internals');
|
||||||
|
const URL = Url.URL || whatwgUrl.URL;
|
||||||
|
|
||||||
// fix an issue where "format", "parse" aren't a named export for node <10
|
// fix an issue where "format", "parse" aren't a named export for node <10
|
||||||
const parse_url = Url.parse;
|
const parse_url = Url.parse;
|
||||||
const format_url = Url.format;
|
const format_url = Url.format;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper around `new URL` to handle arbitrary URLs
|
||||||
|
*
|
||||||
|
* @param {string} urlStr
|
||||||
|
* @return {void}
|
||||||
|
*/
|
||||||
|
function parseURL(urlStr) {
|
||||||
|
/*
|
||||||
|
Check whether the URL is absolute or not
|
||||||
|
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
||||||
|
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
||||||
|
*/
|
||||||
|
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
||||||
|
urlStr = new URL(urlStr).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to old implementation for arbitrary URLs
|
||||||
|
return parse_url(urlStr);
|
||||||
|
}
|
||||||
|
|
||||||
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1176,14 +1198,14 @@ class Request {
|
|||||||
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
||||||
// will fall into this branch also (since their `toString()` will return
|
// will fall into this branch also (since their `toString()` will return
|
||||||
// `href` property anyway)
|
// `href` property anyway)
|
||||||
parsedURL = parse_url(input.href);
|
parsedURL = parseURL(input.href);
|
||||||
} else {
|
} else {
|
||||||
// coerce input to a string before attempting to parse
|
// coerce input to a string before attempting to parse
|
||||||
parsedURL = parse_url(`${input}`);
|
parsedURL = parseURL(`${input}`);
|
||||||
}
|
}
|
||||||
input = {};
|
input = {};
|
||||||
} else {
|
} else {
|
||||||
parsedURL = parse_url(input.url);
|
parsedURL = parseURL(input.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
let method = init.method || input.method || 'GET';
|
let method = init.method || input.method || 'GET';
|
||||||
@ -1377,9 +1399,17 @@ AbortError.prototype = Object.create(Error.prototype);
|
|||||||
AbortError.prototype.constructor = AbortError;
|
AbortError.prototype.constructor = AbortError;
|
||||||
AbortError.prototype.name = 'AbortError';
|
AbortError.prototype.name = 'AbortError';
|
||||||
|
|
||||||
|
const URL$1 = Url.URL || whatwgUrl.URL;
|
||||||
|
|
||||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
||||||
const PassThrough$1 = Stream.PassThrough;
|
const PassThrough$1 = Stream.PassThrough;
|
||||||
const resolve_url = Url.resolve;
|
|
||||||
|
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
|
||||||
|
const orig = new URL$1(original).hostname;
|
||||||
|
const dest = new URL$1(destination).hostname;
|
||||||
|
|
||||||
|
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch function
|
* Fetch function
|
||||||
@ -1467,7 +1497,19 @@ function fetch(url, opts) {
|
|||||||
const location = headers.get('Location');
|
const location = headers.get('Location');
|
||||||
|
|
||||||
// HTTP fetch step 5.3
|
// HTTP fetch step 5.3
|
||||||
const locationURL = location === null ? null : resolve_url(request.url, location);
|
let locationURL = null;
|
||||||
|
try {
|
||||||
|
locationURL = location === null ? null : new URL$1(location, request.url).toString();
|
||||||
|
} catch (err) {
|
||||||
|
// error here can only be invalid URL in Location: header
|
||||||
|
// do not throw when options.redirect == manual
|
||||||
|
// let the user extract the errorneous redirect URL
|
||||||
|
if (request.redirect !== 'manual') {
|
||||||
|
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
|
||||||
|
finalize();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HTTP fetch step 5.5
|
// HTTP fetch step 5.5
|
||||||
switch (request.redirect) {
|
switch (request.redirect) {
|
||||||
@ -1515,6 +1557,12 @@ function fetch(url, opts) {
|
|||||||
size: request.size
|
size: request.size
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
||||||
|
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
||||||
|
requestOpts.headers.delete(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HTTP-redirect fetch step 9
|
// HTTP-redirect fetch step 9
|
||||||
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
||||||
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
||||||
|
4
node_modules/node-fetch/node_modules/tr46/.npmignore
generated
vendored
Normal file
4
node_modules/node-fetch/node_modules/tr46/.npmignore
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
scripts/
|
||||||
|
test/
|
||||||
|
|
||||||
|
!lib/mapping_table.json
|
193
node_modules/node-fetch/node_modules/tr46/index.js
generated
vendored
Normal file
193
node_modules/node-fetch/node_modules/tr46/index.js
generated
vendored
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
var punycode = require("punycode");
|
||||||
|
var mappingTable = require("./lib/mappingTable.json");
|
||||||
|
|
||||||
|
var PROCESSING_OPTIONS = {
|
||||||
|
TRANSITIONAL: 0,
|
||||||
|
NONTRANSITIONAL: 1
|
||||||
|
};
|
||||||
|
|
||||||
|
function normalize(str) { // fix bug in v8
|
||||||
|
return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000');
|
||||||
|
}
|
||||||
|
|
||||||
|
function findStatus(val) {
|
||||||
|
var start = 0;
|
||||||
|
var end = mappingTable.length - 1;
|
||||||
|
|
||||||
|
while (start <= end) {
|
||||||
|
var mid = Math.floor((start + end) / 2);
|
||||||
|
|
||||||
|
var target = mappingTable[mid];
|
||||||
|
if (target[0][0] <= val && target[0][1] >= val) {
|
||||||
|
return target;
|
||||||
|
} else if (target[0][0] > val) {
|
||||||
|
end = mid - 1;
|
||||||
|
} else {
|
||||||
|
start = mid + 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
||||||
|
|
||||||
|
function countSymbols(string) {
|
||||||
|
return string
|
||||||
|
// replace every surrogate pair with a BMP symbol
|
||||||
|
.replace(regexAstralSymbols, '_')
|
||||||
|
// then get the length
|
||||||
|
.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
function mapChars(domain_name, useSTD3, processing_option) {
|
||||||
|
var hasError = false;
|
||||||
|
var processed = "";
|
||||||
|
|
||||||
|
var len = countSymbols(domain_name);
|
||||||
|
for (var i = 0; i < len; ++i) {
|
||||||
|
var codePoint = domain_name.codePointAt(i);
|
||||||
|
var status = findStatus(codePoint);
|
||||||
|
|
||||||
|
switch (status[1]) {
|
||||||
|
case "disallowed":
|
||||||
|
hasError = true;
|
||||||
|
processed += String.fromCodePoint(codePoint);
|
||||||
|
break;
|
||||||
|
case "ignored":
|
||||||
|
break;
|
||||||
|
case "mapped":
|
||||||
|
processed += String.fromCodePoint.apply(String, status[2]);
|
||||||
|
break;
|
||||||
|
case "deviation":
|
||||||
|
if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {
|
||||||
|
processed += String.fromCodePoint.apply(String, status[2]);
|
||||||
|
} else {
|
||||||
|
processed += String.fromCodePoint(codePoint);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "valid":
|
||||||
|
processed += String.fromCodePoint(codePoint);
|
||||||
|
break;
|
||||||
|
case "disallowed_STD3_mapped":
|
||||||
|
if (useSTD3) {
|
||||||
|
hasError = true;
|
||||||
|
processed += String.fromCodePoint(codePoint);
|
||||||
|
} else {
|
||||||
|
processed += String.fromCodePoint.apply(String, status[2]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "disallowed_STD3_valid":
|
||||||
|
if (useSTD3) {
|
||||||
|
hasError = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
processed += String.fromCodePoint(codePoint);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
string: processed,
|
||||||
|
error: hasError
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;
|
||||||
|
|
||||||
|
function validateLabel(label, processing_option) {
|
||||||
|
if (label.substr(0, 4) === "xn--") {
|
||||||
|
label = punycode.toUnicode(label);
|
||||||
|
processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
var error = false;
|
||||||
|
|
||||||
|
if (normalize(label) !== label ||
|
||||||
|
(label[3] === "-" && label[4] === "-") ||
|
||||||
|
label[0] === "-" || label[label.length - 1] === "-" ||
|
||||||
|
label.indexOf(".") !== -1 ||
|
||||||
|
label.search(combiningMarksRegex) === 0) {
|
||||||
|
error = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var len = countSymbols(label);
|
||||||
|
for (var i = 0; i < len; ++i) {
|
||||||
|
var status = findStatus(label.codePointAt(i));
|
||||||
|
if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") ||
|
||||||
|
(processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&
|
||||||
|
status[1] !== "valid" && status[1] !== "deviation")) {
|
||||||
|
error = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
label: label,
|
||||||
|
error: error
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function processing(domain_name, useSTD3, processing_option) {
|
||||||
|
var result = mapChars(domain_name, useSTD3, processing_option);
|
||||||
|
result.string = normalize(result.string);
|
||||||
|
|
||||||
|
var labels = result.string.split(".");
|
||||||
|
for (var i = 0; i < labels.length; ++i) {
|
||||||
|
try {
|
||||||
|
var validation = validateLabel(labels[i]);
|
||||||
|
labels[i] = validation.label;
|
||||||
|
result.error = result.error || validation.error;
|
||||||
|
} catch(e) {
|
||||||
|
result.error = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
string: labels.join("."),
|
||||||
|
error: result.error
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {
|
||||||
|
var result = processing(domain_name, useSTD3, processing_option);
|
||||||
|
var labels = result.string.split(".");
|
||||||
|
labels = labels.map(function(l) {
|
||||||
|
try {
|
||||||
|
return punycode.toASCII(l);
|
||||||
|
} catch(e) {
|
||||||
|
result.error = true;
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (verifyDnsLength) {
|
||||||
|
var total = labels.slice(0, labels.length - 1).join(".").length;
|
||||||
|
if (total.length > 253 || total.length === 0) {
|
||||||
|
result.error = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var i=0; i < labels.length; ++i) {
|
||||||
|
if (labels.length > 63 || labels.length === 0) {
|
||||||
|
result.error = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.error) return null;
|
||||||
|
return labels.join(".");
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.toUnicode = function(domain_name, useSTD3) {
|
||||||
|
var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);
|
||||||
|
|
||||||
|
return {
|
||||||
|
domain: result.string,
|
||||||
|
error: result.error
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;
|
0
node_modules/node-fetch/node_modules/tr46/lib/.gitkeep
generated
vendored
Normal file
0
node_modules/node-fetch/node_modules/tr46/lib/.gitkeep
generated
vendored
Normal file
1
node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json
generated
vendored
Normal file
1
node_modules/node-fetch/node_modules/tr46/lib/mappingTable.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
31
node_modules/node-fetch/node_modules/tr46/package.json
generated
vendored
Normal file
31
node_modules/node-fetch/node_modules/tr46/package.json
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "tr46",
|
||||||
|
"version": "0.0.3",
|
||||||
|
"description": "An implementation of the Unicode TR46 spec",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "mocha",
|
||||||
|
"pretest": "node scripts/getLatestUnicodeTests.js",
|
||||||
|
"prepublish": "node scripts/generateMappingTable.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/Sebmaster/tr46.js.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"unicode",
|
||||||
|
"tr46",
|
||||||
|
"url",
|
||||||
|
"whatwg"
|
||||||
|
],
|
||||||
|
"author": "Sebastian Mayr <npm@smayr.name>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Sebmaster/tr46.js/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Sebmaster/tr46.js#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"mocha": "^2.2.5",
|
||||||
|
"request": "^2.57.0"
|
||||||
|
}
|
||||||
|
}
|
12
node_modules/node-fetch/node_modules/webidl-conversions/LICENSE.md
generated
vendored
Normal file
12
node_modules/node-fetch/node_modules/webidl-conversions/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# The BSD 2-Clause License
|
||||||
|
|
||||||
|
Copyright (c) 2014, Domenic Denicola
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
53
node_modules/node-fetch/node_modules/webidl-conversions/README.md
generated
vendored
Normal file
53
node_modules/node-fetch/node_modules/webidl-conversions/README.md
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# WebIDL Type Conversions on JavaScript Values
|
||||||
|
|
||||||
|
This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [WebIDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types).
|
||||||
|
|
||||||
|
The goal is that you should be able to write code like
|
||||||
|
|
||||||
|
```js
|
||||||
|
const conversions = require("webidl-conversions");
|
||||||
|
|
||||||
|
function doStuff(x, y) {
|
||||||
|
x = conversions["boolean"](x);
|
||||||
|
y = conversions["unsigned long"](y);
|
||||||
|
// actual algorithm code here
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
and your function `doStuff` will behave the same as a WebIDL operation declared as
|
||||||
|
|
||||||
|
```webidl
|
||||||
|
void doStuff(boolean x, unsigned long y);
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
This package's main module's default export is an object with a variety of methods, each corresponding to a different WebIDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the WebIDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the WebIDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float).
|
||||||
|
|
||||||
|
## Status
|
||||||
|
|
||||||
|
All of the numeric types are implemented (float being implemented as double) and some others are as well - check the source for all of them. This list will grow over time in service of the [HTML as Custom Elements](https://github.com/dglazkov/html-as-custom-elements) project, but in the meantime, pull requests welcome!
|
||||||
|
|
||||||
|
I'm not sure yet what the strategy will be for modifiers, e.g. [`[Clamp]`](http://heycam.github.io/webidl/#Clamp). Maybe something like `conversions["unsigned long"](x, { clamp: true })`? We'll see.
|
||||||
|
|
||||||
|
We might also want to extend the API to give better error messages, e.g. "Argument 1 of HTMLMediaElement.fastSeek is not a finite floating-point value" instead of "Argument is not a finite floating-point value." This would require passing in more information to the conversion functions than we currently do.
|
||||||
|
|
||||||
|
## Background
|
||||||
|
|
||||||
|
What's actually going on here, conceptually, is pretty weird. Let's try to explain.
|
||||||
|
|
||||||
|
WebIDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on WebIDL values, i.e. instances of WebIDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a WebIDL value of [WebIDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules.
|
||||||
|
|
||||||
|
Separately from its type system, WebIDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given WebIDL operation, how does that get converted into a WebIDL value? For example, a JavaScript `true` passed in the position of a WebIDL `boolean` argument becomes a WebIDL `true`. But, a JavaScript `true` passed in the position of a [WebIDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a WebIDL `1`. And so on.
|
||||||
|
|
||||||
|
Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the WebIDL algorithms, they don't actually use WebIDL values, since those aren't "real" outside of specs. Instead, implementations apply the WebIDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`.
|
||||||
|
|
||||||
|
The upside of all this is that implementations can abstract all the conversion logic away, letting WebIDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of WebIDL, in a nutshell.
|
||||||
|
|
||||||
|
And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given WebIDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ WebIDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ WebIDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a WebIDL `1` in an unsigned long context, which then becomes a JavaScript `1`.
|
||||||
|
|
||||||
|
## Don't Use This
|
||||||
|
|
||||||
|
Seriously, why would you ever use this? You really shouldn't. WebIDL is … not great, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from WebIDL. In general, your JavaScript should not be trying to become more like WebIDL; if anything, we should fix WebIDL to make it more like JavaScript.
|
||||||
|
|
||||||
|
The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in WebIDL.
|
189
node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js
generated
vendored
Normal file
189
node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js
generated
vendored
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
var conversions = {};
|
||||||
|
module.exports = conversions;
|
||||||
|
|
||||||
|
function sign(x) {
|
||||||
|
return x < 0 ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function evenRound(x) {
|
||||||
|
// Round x to the nearest integer, choosing the even integer if it lies halfway between two.
|
||||||
|
if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)
|
||||||
|
return Math.floor(x);
|
||||||
|
} else {
|
||||||
|
return Math.round(x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function createNumberConversion(bitLength, typeOpts) {
|
||||||
|
if (!typeOpts.unsigned) {
|
||||||
|
--bitLength;
|
||||||
|
}
|
||||||
|
const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);
|
||||||
|
const upperBound = Math.pow(2, bitLength) - 1;
|
||||||
|
|
||||||
|
const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);
|
||||||
|
const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);
|
||||||
|
|
||||||
|
return function(V, opts) {
|
||||||
|
if (!opts) opts = {};
|
||||||
|
|
||||||
|
let x = +V;
|
||||||
|
|
||||||
|
if (opts.enforceRange) {
|
||||||
|
if (!Number.isFinite(x)) {
|
||||||
|
throw new TypeError("Argument is not a finite number");
|
||||||
|
}
|
||||||
|
|
||||||
|
x = sign(x) * Math.floor(Math.abs(x));
|
||||||
|
if (x < lowerBound || x > upperBound) {
|
||||||
|
throw new TypeError("Argument is not in byte range");
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isNaN(x) && opts.clamp) {
|
||||||
|
x = evenRound(x);
|
||||||
|
|
||||||
|
if (x < lowerBound) x = lowerBound;
|
||||||
|
if (x > upperBound) x = upperBound;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Number.isFinite(x) || x === 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
x = sign(x) * Math.floor(Math.abs(x));
|
||||||
|
x = x % moduloVal;
|
||||||
|
|
||||||
|
if (!typeOpts.unsigned && x >= moduloBound) {
|
||||||
|
return x - moduloVal;
|
||||||
|
} else if (typeOpts.unsigned) {
|
||||||
|
if (x < 0) {
|
||||||
|
x += moduloVal;
|
||||||
|
} else if (x === -0) { // don't return negative zero
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
conversions["void"] = function () {
|
||||||
|
return undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["boolean"] = function (val) {
|
||||||
|
return !!val;
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["byte"] = createNumberConversion(8, { unsigned: false });
|
||||||
|
conversions["octet"] = createNumberConversion(8, { unsigned: true });
|
||||||
|
|
||||||
|
conversions["short"] = createNumberConversion(16, { unsigned: false });
|
||||||
|
conversions["unsigned short"] = createNumberConversion(16, { unsigned: true });
|
||||||
|
|
||||||
|
conversions["long"] = createNumberConversion(32, { unsigned: false });
|
||||||
|
conversions["unsigned long"] = createNumberConversion(32, { unsigned: true });
|
||||||
|
|
||||||
|
conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });
|
||||||
|
conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });
|
||||||
|
|
||||||
|
conversions["double"] = function (V) {
|
||||||
|
const x = +V;
|
||||||
|
|
||||||
|
if (!Number.isFinite(x)) {
|
||||||
|
throw new TypeError("Argument is not a finite floating-point value");
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["unrestricted double"] = function (V) {
|
||||||
|
const x = +V;
|
||||||
|
|
||||||
|
if (isNaN(x)) {
|
||||||
|
throw new TypeError("Argument is NaN");
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
};
|
||||||
|
|
||||||
|
// not quite valid, but good enough for JS
|
||||||
|
conversions["float"] = conversions["double"];
|
||||||
|
conversions["unrestricted float"] = conversions["unrestricted double"];
|
||||||
|
|
||||||
|
conversions["DOMString"] = function (V, opts) {
|
||||||
|
if (!opts) opts = {};
|
||||||
|
|
||||||
|
if (opts.treatNullAsEmptyString && V === null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return String(V);
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["ByteString"] = function (V, opts) {
|
||||||
|
const x = String(V);
|
||||||
|
let c = undefined;
|
||||||
|
for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {
|
||||||
|
if (c > 255) {
|
||||||
|
throw new TypeError("Argument is not a valid bytestring");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["USVString"] = function (V) {
|
||||||
|
const S = String(V);
|
||||||
|
const n = S.length;
|
||||||
|
const U = [];
|
||||||
|
for (let i = 0; i < n; ++i) {
|
||||||
|
const c = S.charCodeAt(i);
|
||||||
|
if (c < 0xD800 || c > 0xDFFF) {
|
||||||
|
U.push(String.fromCodePoint(c));
|
||||||
|
} else if (0xDC00 <= c && c <= 0xDFFF) {
|
||||||
|
U.push(String.fromCodePoint(0xFFFD));
|
||||||
|
} else {
|
||||||
|
if (i === n - 1) {
|
||||||
|
U.push(String.fromCodePoint(0xFFFD));
|
||||||
|
} else {
|
||||||
|
const d = S.charCodeAt(i + 1);
|
||||||
|
if (0xDC00 <= d && d <= 0xDFFF) {
|
||||||
|
const a = c & 0x3FF;
|
||||||
|
const b = d & 0x3FF;
|
||||||
|
U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));
|
||||||
|
++i;
|
||||||
|
} else {
|
||||||
|
U.push(String.fromCodePoint(0xFFFD));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return U.join('');
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["Date"] = function (V, opts) {
|
||||||
|
if (!(V instanceof Date)) {
|
||||||
|
throw new TypeError("Argument is not a Date object");
|
||||||
|
}
|
||||||
|
if (isNaN(V)) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return V;
|
||||||
|
};
|
||||||
|
|
||||||
|
conversions["RegExp"] = function (V, opts) {
|
||||||
|
if (!(V instanceof RegExp)) {
|
||||||
|
V = new RegExp(V);
|
||||||
|
}
|
||||||
|
|
||||||
|
return V;
|
||||||
|
};
|
23
node_modules/node-fetch/node_modules/webidl-conversions/package.json
generated
vendored
Normal file
23
node_modules/node-fetch/node_modules/webidl-conversions/package.json
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"name": "webidl-conversions",
|
||||||
|
"version": "3.0.1",
|
||||||
|
"description": "Implements the WebIDL algorithms for converting to and from JavaScript values",
|
||||||
|
"main": "lib/index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "mocha test/*.js"
|
||||||
|
},
|
||||||
|
"repository": "jsdom/webidl-conversions",
|
||||||
|
"keywords": [
|
||||||
|
"webidl",
|
||||||
|
"web",
|
||||||
|
"types"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"lib/"
|
||||||
|
],
|
||||||
|
"author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"devDependencies": {
|
||||||
|
"mocha": "^1.21.4"
|
||||||
|
}
|
||||||
|
}
|
21
node_modules/node-fetch/node_modules/whatwg-url/LICENSE.txt
generated
vendored
Normal file
21
node_modules/node-fetch/node_modules/whatwg-url/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015–2016 Sebastian Mayr
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
67
node_modules/node-fetch/node_modules/whatwg-url/README.md
generated
vendored
Normal file
67
node_modules/node-fetch/node_modules/whatwg-url/README.md
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# whatwg-url
|
||||||
|
|
||||||
|
whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom).
|
||||||
|
|
||||||
|
## Current Status
|
||||||
|
|
||||||
|
whatwg-url is currently up to date with the URL spec up to commit [a62223](https://github.com/whatwg/url/commit/a622235308342c9adc7fc2fd1659ff059f7d5e2a).
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### The `URL` Constructor
|
||||||
|
|
||||||
|
The main API is the [`URL`](https://url.spec.whatwg.org/#url) export, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use this.
|
||||||
|
|
||||||
|
### Low-level URL Standard API
|
||||||
|
|
||||||
|
The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type.
|
||||||
|
|
||||||
|
- [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })`
|
||||||
|
- [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })`
|
||||||
|
- [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)`
|
||||||
|
- [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)`
|
||||||
|
- [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)`
|
||||||
|
- [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/browsers.html#serialization-of-an-origin): `serializeURLOrigin(urlRecord)`
|
||||||
|
- [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)`
|
||||||
|
- [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)`
|
||||||
|
- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)`
|
||||||
|
|
||||||
|
The `stateOverride` parameter is one of the following strings:
|
||||||
|
|
||||||
|
- [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state)
|
||||||
|
- [`"scheme"`](https://url.spec.whatwg.org/#scheme-state)
|
||||||
|
- [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state)
|
||||||
|
- [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state)
|
||||||
|
- [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state)
|
||||||
|
- [`"relative"`](https://url.spec.whatwg.org/#relative-state)
|
||||||
|
- [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state)
|
||||||
|
- [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state)
|
||||||
|
- [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state)
|
||||||
|
- [`"authority"`](https://url.spec.whatwg.org/#authority-state)
|
||||||
|
- [`"host"`](https://url.spec.whatwg.org/#host-state)
|
||||||
|
- [`"hostname"`](https://url.spec.whatwg.org/#hostname-state)
|
||||||
|
- [`"port"`](https://url.spec.whatwg.org/#port-state)
|
||||||
|
- [`"file"`](https://url.spec.whatwg.org/#file-state)
|
||||||
|
- [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state)
|
||||||
|
- [`"file host"`](https://url.spec.whatwg.org/#file-host-state)
|
||||||
|
- [`"path start"`](https://url.spec.whatwg.org/#path-start-state)
|
||||||
|
- [`"path"`](https://url.spec.whatwg.org/#path-state)
|
||||||
|
- [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state)
|
||||||
|
- [`"query"`](https://url.spec.whatwg.org/#query-state)
|
||||||
|
- [`"fragment"`](https://url.spec.whatwg.org/#fragment-state)
|
||||||
|
|
||||||
|
The URL record type has the following API:
|
||||||
|
|
||||||
|
- [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme)
|
||||||
|
- [`username`](https://url.spec.whatwg.org/#concept-url-username)
|
||||||
|
- [`password`](https://url.spec.whatwg.org/#concept-url-password)
|
||||||
|
- [`host`](https://url.spec.whatwg.org/#concept-url-host)
|
||||||
|
- [`port`](https://url.spec.whatwg.org/#concept-url-port)
|
||||||
|
- [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array)
|
||||||
|
- [`query`](https://url.spec.whatwg.org/#concept-url-query)
|
||||||
|
- [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment)
|
||||||
|
- [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean)
|
||||||
|
|
||||||
|
These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state.
|
||||||
|
|
||||||
|
The return value of "failure" in the spec is represented by the string `"failure"`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ the string `"failure"`.
|
200
node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js
generated
vendored
Normal file
200
node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js
generated
vendored
Normal file
@ -0,0 +1,200 @@
|
|||||||
|
"use strict";
|
||||||
|
const usm = require("./url-state-machine");
|
||||||
|
|
||||||
|
exports.implementation = class URLImpl {
|
||||||
|
constructor(constructorArgs) {
|
||||||
|
const url = constructorArgs[0];
|
||||||
|
const base = constructorArgs[1];
|
||||||
|
|
||||||
|
let parsedBase = null;
|
||||||
|
if (base !== undefined) {
|
||||||
|
parsedBase = usm.basicURLParse(base);
|
||||||
|
if (parsedBase === "failure") {
|
||||||
|
throw new TypeError("Invalid base URL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
|
||||||
|
if (parsedURL === "failure") {
|
||||||
|
throw new TypeError("Invalid URL");
|
||||||
|
}
|
||||||
|
|
||||||
|
this._url = parsedURL;
|
||||||
|
|
||||||
|
// TODO: query stuff
|
||||||
|
}
|
||||||
|
|
||||||
|
get href() {
|
||||||
|
return usm.serializeURL(this._url);
|
||||||
|
}
|
||||||
|
|
||||||
|
set href(v) {
|
||||||
|
const parsedURL = usm.basicURLParse(v);
|
||||||
|
if (parsedURL === "failure") {
|
||||||
|
throw new TypeError("Invalid URL");
|
||||||
|
}
|
||||||
|
|
||||||
|
this._url = parsedURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
get origin() {
|
||||||
|
return usm.serializeURLOrigin(this._url);
|
||||||
|
}
|
||||||
|
|
||||||
|
get protocol() {
|
||||||
|
return this._url.scheme + ":";
|
||||||
|
}
|
||||||
|
|
||||||
|
set protocol(v) {
|
||||||
|
usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" });
|
||||||
|
}
|
||||||
|
|
||||||
|
get username() {
|
||||||
|
return this._url.username;
|
||||||
|
}
|
||||||
|
|
||||||
|
set username(v) {
|
||||||
|
if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
usm.setTheUsername(this._url, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
get password() {
|
||||||
|
return this._url.password;
|
||||||
|
}
|
||||||
|
|
||||||
|
set password(v) {
|
||||||
|
if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
usm.setThePassword(this._url, v);
|
||||||
|
}
|
||||||
|
|
||||||
|
get host() {
|
||||||
|
const url = this._url;
|
||||||
|
|
||||||
|
if (url.host === null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (url.port === null) {
|
||||||
|
return usm.serializeHost(url.host);
|
||||||
|
}
|
||||||
|
|
||||||
|
return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port);
|
||||||
|
}
|
||||||
|
|
||||||
|
set host(v) {
|
||||||
|
if (this._url.cannotBeABaseURL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
|
||||||
|
}
|
||||||
|
|
||||||
|
get hostname() {
|
||||||
|
if (this._url.host === null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return usm.serializeHost(this._url.host);
|
||||||
|
}
|
||||||
|
|
||||||
|
set hostname(v) {
|
||||||
|
if (this._url.cannotBeABaseURL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" });
|
||||||
|
}
|
||||||
|
|
||||||
|
get port() {
|
||||||
|
if (this._url.port === null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return usm.serializeInteger(this._url.port);
|
||||||
|
}
|
||||||
|
|
||||||
|
set port(v) {
|
||||||
|
if (usm.cannotHaveAUsernamePasswordPort(this._url)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (v === "") {
|
||||||
|
this._url.port = null;
|
||||||
|
} else {
|
||||||
|
usm.basicURLParse(v, { url: this._url, stateOverride: "port" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get pathname() {
|
||||||
|
if (this._url.cannotBeABaseURL) {
|
||||||
|
return this._url.path[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._url.path.length === 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "/" + this._url.path.join("/");
|
||||||
|
}
|
||||||
|
|
||||||
|
set pathname(v) {
|
||||||
|
if (this._url.cannotBeABaseURL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._url.path = [];
|
||||||
|
usm.basicURLParse(v, { url: this._url, stateOverride: "path start" });
|
||||||
|
}
|
||||||
|
|
||||||
|
get search() {
|
||||||
|
if (this._url.query === null || this._url.query === "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "?" + this._url.query;
|
||||||
|
}
|
||||||
|
|
||||||
|
set search(v) {
|
||||||
|
// TODO: query stuff
|
||||||
|
|
||||||
|
const url = this._url;
|
||||||
|
|
||||||
|
if (v === "") {
|
||||||
|
url.query = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const input = v[0] === "?" ? v.substring(1) : v;
|
||||||
|
url.query = "";
|
||||||
|
usm.basicURLParse(input, { url, stateOverride: "query" });
|
||||||
|
}
|
||||||
|
|
||||||
|
get hash() {
|
||||||
|
if (this._url.fragment === null || this._url.fragment === "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "#" + this._url.fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
set hash(v) {
|
||||||
|
if (v === "") {
|
||||||
|
this._url.fragment = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const input = v[0] === "#" ? v.substring(1) : v;
|
||||||
|
this._url.fragment = "";
|
||||||
|
usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" });
|
||||||
|
}
|
||||||
|
|
||||||
|
toJSON() {
|
||||||
|
return this.href;
|
||||||
|
}
|
||||||
|
};
|
196
node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js
generated
vendored
Normal file
196
node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js
generated
vendored
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
const conversions = require("webidl-conversions");
|
||||||
|
const utils = require("./utils.js");
|
||||||
|
const Impl = require(".//URL-impl.js");
|
||||||
|
|
||||||
|
const impl = utils.implSymbol;
|
||||||
|
|
||||||
|
function URL(url) {
|
||||||
|
if (!this || this[impl] || !(this instanceof URL)) {
|
||||||
|
throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
|
||||||
|
}
|
||||||
|
if (arguments.length < 1) {
|
||||||
|
throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present.");
|
||||||
|
}
|
||||||
|
const args = [];
|
||||||
|
for (let i = 0; i < arguments.length && i < 2; ++i) {
|
||||||
|
args[i] = arguments[i];
|
||||||
|
}
|
||||||
|
args[0] = conversions["USVString"](args[0]);
|
||||||
|
if (args[1] !== undefined) {
|
||||||
|
args[1] = conversions["USVString"](args[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports.setup(this, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
URL.prototype.toJSON = function toJSON() {
|
||||||
|
if (!this || !module.exports.is(this)) {
|
||||||
|
throw new TypeError("Illegal invocation");
|
||||||
|
}
|
||||||
|
const args = [];
|
||||||
|
for (let i = 0; i < arguments.length && i < 0; ++i) {
|
||||||
|
args[i] = arguments[i];
|
||||||
|
}
|
||||||
|
return this[impl].toJSON.apply(this[impl], args);
|
||||||
|
};
|
||||||
|
Object.defineProperty(URL.prototype, "href", {
|
||||||
|
get() {
|
||||||
|
return this[impl].href;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].href = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
URL.prototype.toString = function () {
|
||||||
|
if (!this || !module.exports.is(this)) {
|
||||||
|
throw new TypeError("Illegal invocation");
|
||||||
|
}
|
||||||
|
return this.href;
|
||||||
|
};
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "origin", {
|
||||||
|
get() {
|
||||||
|
return this[impl].origin;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "protocol", {
|
||||||
|
get() {
|
||||||
|
return this[impl].protocol;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].protocol = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "username", {
|
||||||
|
get() {
|
||||||
|
return this[impl].username;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].username = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "password", {
|
||||||
|
get() {
|
||||||
|
return this[impl].password;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].password = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "host", {
|
||||||
|
get() {
|
||||||
|
return this[impl].host;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].host = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "hostname", {
|
||||||
|
get() {
|
||||||
|
return this[impl].hostname;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].hostname = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "port", {
|
||||||
|
get() {
|
||||||
|
return this[impl].port;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].port = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "pathname", {
|
||||||
|
get() {
|
||||||
|
return this[impl].pathname;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].pathname = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "search", {
|
||||||
|
get() {
|
||||||
|
return this[impl].search;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].search = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.defineProperty(URL.prototype, "hash", {
|
||||||
|
get() {
|
||||||
|
return this[impl].hash;
|
||||||
|
},
|
||||||
|
set(V) {
|
||||||
|
V = conversions["USVString"](V);
|
||||||
|
this[impl].hash = V;
|
||||||
|
},
|
||||||
|
enumerable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
is(obj) {
|
||||||
|
return !!obj && obj[impl] instanceof Impl.implementation;
|
||||||
|
},
|
||||||
|
create(constructorArgs, privateData) {
|
||||||
|
let obj = Object.create(URL.prototype);
|
||||||
|
this.setup(obj, constructorArgs, privateData);
|
||||||
|
return obj;
|
||||||
|
},
|
||||||
|
setup(obj, constructorArgs, privateData) {
|
||||||
|
if (!privateData) privateData = {};
|
||||||
|
privateData.wrapper = obj;
|
||||||
|
|
||||||
|
obj[impl] = new Impl.implementation(constructorArgs, privateData);
|
||||||
|
obj[impl][utils.wrapperSymbol] = obj;
|
||||||
|
},
|
||||||
|
interface: URL,
|
||||||
|
expose: {
|
||||||
|
Window: { URL: URL },
|
||||||
|
Worker: { URL: URL }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
11
node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js
generated
vendored
Normal file
11
node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
exports.URL = require("./URL").interface;
|
||||||
|
exports.serializeURL = require("./url-state-machine").serializeURL;
|
||||||
|
exports.serializeURLOrigin = require("./url-state-machine").serializeURLOrigin;
|
||||||
|
exports.basicURLParse = require("./url-state-machine").basicURLParse;
|
||||||
|
exports.setTheUsername = require("./url-state-machine").setTheUsername;
|
||||||
|
exports.setThePassword = require("./url-state-machine").setThePassword;
|
||||||
|
exports.serializeHost = require("./url-state-machine").serializeHost;
|
||||||
|
exports.serializeInteger = require("./url-state-machine").serializeInteger;
|
||||||
|
exports.parseURL = require("./url-state-machine").parseURL;
|
1297
node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js
generated
vendored
Normal file
1297
node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
20
node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js
generated
vendored
Normal file
20
node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
module.exports.mixin = function mixin(target, source) {
|
||||||
|
const keys = Object.getOwnPropertyNames(source);
|
||||||
|
for (let i = 0; i < keys.length; ++i) {
|
||||||
|
Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.wrapperSymbol = Symbol("wrapper");
|
||||||
|
module.exports.implSymbol = Symbol("impl");
|
||||||
|
|
||||||
|
module.exports.wrapperForImpl = function (impl) {
|
||||||
|
return impl[module.exports.wrapperSymbol];
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.implForWrapper = function (wrapper) {
|
||||||
|
return wrapper[module.exports.implSymbol];
|
||||||
|
};
|
||||||
|
|
32
node_modules/node-fetch/node_modules/whatwg-url/package.json
generated
vendored
Normal file
32
node_modules/node-fetch/node_modules/whatwg-url/package.json
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "whatwg-url",
|
||||||
|
"version": "5.0.0",
|
||||||
|
"description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery",
|
||||||
|
"main": "lib/public-api.js",
|
||||||
|
"files": [
|
||||||
|
"lib/"
|
||||||
|
],
|
||||||
|
"author": "Sebastian Mayr <github@smayr.name>",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "jsdom/whatwg-url",
|
||||||
|
"dependencies": {
|
||||||
|
"tr46": "~0.0.3",
|
||||||
|
"webidl-conversions": "^3.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"eslint": "^2.6.0",
|
||||||
|
"istanbul": "~0.4.3",
|
||||||
|
"mocha": "^2.2.4",
|
||||||
|
"recast": "~0.10.29",
|
||||||
|
"request": "^2.55.0",
|
||||||
|
"webidl2js": "^3.0.2"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build": "node scripts/transform.js && node scripts/convert-idl.js",
|
||||||
|
"coverage": "istanbul cover node_modules/mocha/bin/_mocha",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"prepublish": "npm run build",
|
||||||
|
"pretest": "node scripts/get-latest-platform-tests.js && npm run build",
|
||||||
|
"test": "mocha"
|
||||||
|
}
|
||||||
|
}
|
22
node_modules/node-fetch/package.json
generated
vendored
22
node_modules/node-fetch/package.json
generated
vendored
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "node-fetch",
|
"name": "node-fetch",
|
||||||
"version": "2.6.1",
|
"version": "2.6.7",
|
||||||
"description": "A light-weight module that brings window.fetch to node.js",
|
"description": "A light-weight module that brings window.fetch to node.js",
|
||||||
"main": "lib/index",
|
"main": "lib/index.js",
|
||||||
"browser": "./browser.js",
|
"browser": "./browser.js",
|
||||||
"module": "lib/index.mjs",
|
"module": "lib/index.mjs",
|
||||||
"files": [
|
"files": [
|
||||||
@ -36,6 +36,17 @@
|
|||||||
"url": "https://github.com/bitinn/node-fetch/issues"
|
"url": "https://github.com/bitinn/node-fetch/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/bitinn/node-fetch",
|
"homepage": "https://github.com/bitinn/node-fetch",
|
||||||
|
"dependencies": {
|
||||||
|
"whatwg-url": "^5.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"encoding": "^0.1.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"encoding": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ungap/url-search-params": "^0.1.2",
|
"@ungap/url-search-params": "^0.1.2",
|
||||||
"abort-controller": "^1.1.0",
|
"abort-controller": "^1.1.0",
|
||||||
@ -48,7 +59,7 @@
|
|||||||
"chai-as-promised": "^7.1.1",
|
"chai-as-promised": "^7.1.1",
|
||||||
"chai-iterator": "^1.1.1",
|
"chai-iterator": "^1.1.1",
|
||||||
"chai-string": "~1.3.0",
|
"chai-string": "~1.3.0",
|
||||||
"codecov": "^3.3.0",
|
"codecov": "3.3.0",
|
||||||
"cross-env": "^5.2.0",
|
"cross-env": "^5.2.0",
|
||||||
"form-data": "^2.3.3",
|
"form-data": "^2.3.3",
|
||||||
"is-builtin-module": "^1.0.0",
|
"is-builtin-module": "^1.0.0",
|
||||||
@ -60,7 +71,6 @@
|
|||||||
"rollup": "^0.63.4",
|
"rollup": "^0.63.4",
|
||||||
"rollup-plugin-babel": "^3.0.7",
|
"rollup-plugin-babel": "^3.0.7",
|
||||||
"string-to-arraybuffer": "^1.0.2",
|
"string-to-arraybuffer": "^1.0.2",
|
||||||
"whatwg-url": "^5.0.0"
|
"teeny-request": "3.7.0"
|
||||||
},
|
}
|
||||||
"dependencies": {}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user