UNPKG

28.8 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.node.es6.js","sources":["../src/json.ts","../src/mime.ts","../src/promise.ts","../src/token.ts","../src/random.ts","../src/random.node.ts","../src/uuid.ts","../src/uuid.node.ts"],"sourcesContent":["// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A type alias for a JSON primitive.\n */\nexport type JSONPrimitive = boolean | number | string | null;\n\n/**\n * A type alias for a JSON value.\n */\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray;\n\n/**\n * A type definition for a JSON object.\n */\nexport interface JSONObject {\n [key: string]: JSONValue;\n}\n\n/**\n * A type definition for a JSON array.\n */\nexport interface JSONArray extends Array<JSONValue> {}\n\n/**\n * A type definition for a readonly JSON object.\n */\nexport interface ReadonlyJSONObject {\n readonly [key: string]: ReadonlyJSONValue;\n}\n\n/**\n * A type definition for a readonly JSON array.\n */\nexport interface ReadonlyJSONArray extends ReadonlyArray<ReadonlyJSONValue> {}\n\n/**\n * A type alias for a readonly JSON value.\n */\nexport type ReadonlyJSONValue =\n | JSONPrimitive\n | ReadonlyJSONObject\n | ReadonlyJSONArray;\n\n/**\n * A type alias for a partial JSON value.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport type PartialJSONValue =\n | JSONPrimitive\n | PartialJSONObject\n | PartialJSONArray;\n\n/**\n * A type definition for a partial JSON object.\n *\n * Note: Partial here means that the JSON object attributes can be `undefined`.\n */\nexport interface PartialJSONObject {\n [key: string]: PartialJSONValue | undefined;\n}\n\n/**\n * A type definition for a partial JSON array.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface PartialJSONArray extends Array<PartialJSONValue> {}\n\n/**\n * A type definition for a readonly partial JSON object.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface ReadonlyPartialJSONObject {\n readonly [key: string]: ReadonlyPartialJSONValue | undefined;\n}\n\n/**\n * A type definition for a readonly partial JSON array.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport interface ReadonlyPartialJSONArray\n extends ReadonlyArray<ReadonlyPartialJSONValue> {}\n\n/**\n * A type alias for a readonly partial JSON value.\n *\n * Note: Partial here means that JSON object attributes can be `undefined`.\n */\nexport type ReadonlyPartialJSONValue =\n | JSONPrimitive\n | ReadonlyPartialJSONObject\n | ReadonlyPartialJSONArray;\n\n/**\n * The namespace for JSON-specific functions.\n */\nexport namespace JSONExt {\n /**\n * A shared frozen empty JSONObject\n */\n export const emptyObject = Object.freeze({}) as ReadonlyJSONObject;\n\n /**\n * A shared frozen empty JSONArray\n */\n export const emptyArray = Object.freeze([]) as ReadonlyJSONArray;\n\n /**\n * Test whether a JSON value is a primitive.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a primitive,`false` otherwise.\n */\n export function isPrimitive(\n value: ReadonlyPartialJSONValue\n ): value is JSONPrimitive {\n return (\n value === null ||\n typeof value === 'boolean' ||\n typeof value === 'number' ||\n typeof value === 'string'\n );\n }\n\n /**\n * Test whether a JSON value is an array.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a an array, `false` otherwise.\n */\n export function isArray(value: JSONValue): value is JSONArray;\n export function isArray(value: ReadonlyJSONValue): value is ReadonlyJSONArray;\n export function isArray(value: PartialJSONValue): value is PartialJSONArray;\n export function isArray(\n value: ReadonlyPartialJSONValue\n ): value is ReadonlyPartialJSONArray;\n export function isArray(value: ReadonlyPartialJSONValue): boolean {\n return Array.isArray(value);\n }\n\n /**\n * Test whether a JSON value is an object.\n *\n * @param value - The JSON value of interest.\n *\n * @returns `true` if the value is a an object, `false` otherwise.\n */\n export function isObject(value: JSONValue): value is JSONObject;\n export function isObject(\n value: ReadonlyJSONValue\n ): value is ReadonlyJSONObject;\n export function isObject(value: PartialJSONValue): value is PartialJSONObject;\n export function isObject(\n value: ReadonlyPartialJSONValue\n ): value is ReadonlyPartialJSONObject;\n export function isObject(value: ReadonlyPartialJSONValue): boolean {\n return !isPrimitive(value) && !isArray(value);\n }\n\n /**\n * Compare two JSON values for deep equality.\n *\n * @param first - The first JSON value of interest.\n *\n * @param second - The second JSON value of interest.\n *\n * @returns `true` if the values are equivalent, `false` otherwise.\n */\n export function deepEqual(\n first: ReadonlyPartialJSONValue,\n second: ReadonlyPartialJSONValue\n ): boolean {\n // Check referential and primitive equality first.\n if (first === second) {\n return true;\n }\n\n // If one is a primitive, the `===` check ruled out the other.\n if (isPrimitive(first) || isPrimitive(second)) {\n return false;\n }\n\n // Test whether they are arrays.\n let a1 = isArray(first);\n let a2 = isArray(second);\n\n // Bail if the types are different.\n if (a1 !== a2) {\n return false;\n }\n\n // If they are both arrays, compare them.\n if (a1 && a2) {\n return deepArrayEqual(\n first as ReadonlyPartialJSONArray,\n second as ReadonlyPartialJSONArray\n );\n }\n\n // At this point, they must both be objects.\n return deepObjectEqual(\n first as ReadonlyPartialJSONObject,\n second as ReadonlyPartialJSONObject\n );\n }\n\n /**\n * Create a deep copy of a JSON value.\n *\n * @param value - The JSON value to copy.\n *\n * @returns A deep copy of the given JSON value.\n */\n export function deepCopy<T extends ReadonlyPartialJSONValue>(value: T): T {\n // Do nothing for primitive values.\n if (isPrimitive(value)) {\n return value;\n }\n\n // Deep copy an array.\n if (isArray(value)) {\n return deepArrayCopy(value);\n }\n\n // Deep copy an object.\n return deepObjectCopy(value);\n }\n\n /**\n * Compare two JSON arrays for deep equality.\n */\n function deepArrayEqual(\n first: ReadonlyPartialJSONArray,\n second: ReadonlyPartialJSONArray\n ): boolean {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n\n // Test the arrays for equal length.\n if (first.length !== second.length) {\n return false;\n }\n\n // Compare the values for equality.\n for (let i = 0, n = first.length; i < n; ++i) {\n if (!deepEqual(first[i], second[i])) {\n return false;\n }\n }\n\n // At this point, the arrays are equal.\n return true;\n }\n\n /**\n * Compare two JSON objects for deep equality.\n */\n function deepObjectEqual(\n first: ReadonlyPartialJSONObject,\n second: ReadonlyPartialJSONObject\n ): boolean {\n // Check referential equality first.\n if (first === second) {\n return true;\n }\n\n // Check for the first object's keys in the second object.\n for (let key in first) {\n if (first[key] !== undefined && !(key in second)) {\n return false;\n }\n }\n\n // Check for the second object's keys in the first object.\n for (let key in second) {\n if (second[key] !== undefined && !(key in first)) {\n return false;\n }\n }\n\n // Compare the values for equality.\n for (let key in first) {\n // Get the values.\n let firstValue = first[key];\n let secondValue = second[key];\n\n // If both are undefined, ignore the key.\n if (firstValue === undefined && secondValue === undefined) {\n continue;\n }\n\n // If only one value is undefined, the objects are not equal.\n if (firstValue === undefined || secondValue === undefined) {\n return false;\n }\n\n // Compare the values.\n if (!deepEqual(firstValue, secondValue)) {\n return false;\n }\n }\n\n // At this point, the objects are equal.\n return true;\n }\n\n /**\n * Create a deep copy of a JSON array.\n */\n function deepArrayCopy(value: any): any {\n let result = new Array<any>(value.length);\n for (let i = 0, n = value.length; i < n; ++i) {\n result[i] = deepCopy(value[i]);\n }\n return result;\n }\n\n /**\n * Create a deep copy of a JSON object.\n */\n function deepObjectCopy(value: any): any {\n let result: any = {};\n for (let key in value) {\n // Ignore undefined values.\n let subvalue = value[key];\n if (subvalue === undefined) {\n continue;\n }\n result[key] = deepCopy(subvalue);\n }\n return result;\n }\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * An object which stores MIME data for general application use.\n *\n * #### Notes\n * This class does not attempt to enforce \"correctness\" of MIME types\n * and their associated data. Since this class is designed to transfer\n * arbitrary data and objects within the same application, it assumes\n * that the user provides correct and accurate data.\n */\nexport class MimeData {\n /**\n * Get an array of the MIME types contained within the dataset.\n *\n * @returns A new array of the MIME types, in order of insertion.\n */\n types(): string[] {\n return this._types.slice();\n }\n\n /**\n * Test whether the dataset has an entry for the given type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns `true` if the dataset contains a value for the given\n * MIME type, `false` otherwise.\n */\n hasData(mime: string): boolean {\n return this._types.indexOf(mime) !== -1;\n }\n\n /**\n * Get the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @returns The value for the given MIME type, or `undefined` if\n * the dataset does not contain a value for the type.\n */\n getData(mime: string): any | undefined {\n let i = this._types.indexOf(mime);\n return i !== -1 ? this._values[i] : undefined;\n }\n\n /**\n * Set the data value for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * @param data - The data value for the given MIME type.\n *\n * #### Notes\n * This will overwrite any previous entry for the MIME type.\n */\n setData(mime: string, data: any): void {\n this.clearData(mime);\n this._types.push(mime);\n this._values.push(data);\n }\n\n /**\n * Remove the data entry for the given MIME type.\n *\n * @param mime - The MIME type of interest.\n *\n * #### Notes\n * This is a no-op if there is no entry for the given MIME type.\n */\n clearData(mime: string): void {\n let i = this._types.indexOf(mime);\n if (i !== -1) {\n this._types.splice(i, 1);\n this._values.splice(i, 1);\n }\n }\n\n /**\n * Remove all data entries from the dataset.\n */\n clear(): void {\n this._types.length = 0;\n this._values.length = 0;\n }\n\n private _types: string[] = [];\n private _values: any[] = [];\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A class which wraps a promise into a delegate object.\n *\n * #### Notes\n * This class is useful when the logic to resolve or reject a promise\n * cannot be defined at the point where the promise is created.\n */\nexport class PromiseDelegate<T> {\n /**\n * Construct a new promise delegate.\n */\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n /**\n * The promise wrapped by the delegate.\n */\n readonly promise: Promise<T>;\n\n /**\n * Resolve the wrapped promise with the given value.\n *\n * @param value - The value to use for resolving the promise.\n */\n resolve(value: T | PromiseLike<T>): void {\n let resolve = this._resolve;\n resolve(value);\n }\n\n /**\n * Reject the wrapped promise with the given value.\n *\n * @reason - The reason for rejecting the promise.\n */\n reject(reason: any): void {\n let reject = this._reject;\n reject(reason);\n }\n\n private _resolve: (value: T | PromiseLike<T>) => void;\n private _reject: (reason: any) => void;\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n/**\n * A runtime object which captures compile-time type information.\n *\n * #### Notes\n * A token captures the compile-time type of an interface or class in\n * an object which can be used at runtime in a type-safe fashion.\n */\nexport class Token<T> {\n /**\n * Construct a new token.\n *\n * @param name - A human readable name for the token.\n */\n constructor(name: string) {\n this.name = name;\n this._tokenStructuralPropertyT = null!;\n }\n\n /**\n * The human readable name for the token.\n *\n * #### Notes\n * This can be useful for debugging and logging.\n */\n readonly name: string;\n\n // @ts-ignore\n private _tokenStructuralPropertyT: T;\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\n// Fallback\nexport function fallbackRandomValues(buffer: Uint8Array): void {\n let value = 0;\n for (let i = 0, n = buffer.length; i < n; ++i) {\n if (i % 4 === 0) {\n value = (Math.random() * 0xffffffff) >>> 0;\n }\n buffer[i] = value & 0xff;\n value >>>= 8;\n }\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n\nimport { fallbackRandomValues } from './random';\n\n// Declare ambient variables for `window` and `require` to avoid a\n// hard dependency on both. This package must run on node.\ndeclare let require: any;\n\n/**\n * The namespace for random number related functionality.\n */\nexport namespace Random {\n /**\n * A function which generates random bytes.\n *\n * @param buffer - The `Uint8Array` to fill with random bytes.\n *\n * #### Notes\n * A cryptographically strong random number generator will be used if\n * available. Otherwise, `Math.random` will be used as a fallback for\n * randomness.\n *\n * The following RNGs are supported, listed in order of precedence:\n * - `window.crypto.getRandomValues`\n * - `window.msCrypto.getRandomValues`\n * - `require('crypto').randomFillSync\n * - `require('crypto').randomBytes\n * - `Math.random`\n */\n export const getRandomValues = (() => {\n // Look up the crypto module if available.\n const crypto: any =\n (typeof require !== 'undefined' && require('crypto')) || null;\n\n // Node 7+\n if (crypto && typeof crypto.randomFillSync === 'function') {\n return function getRandomValues(buffer: Uint8Array): void {\n return crypto.randomFillSync(buffer);\n };\n }\n\n // Node 0.10+\n if (crypto && typeof crypto.randomBytes === 'function') {\n return function getRandomValues(buffer: Uint8Array): void {\n let bytes = crypto.randomBytes(buffer.length);\n for (let i = 0, n = bytes.length; i < n; ++i) {\n buffer[i] = bytes[i];\n }\n };\n }\n\n // Fallback\n return fallbackRandomValues;\n })();\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\n/**\n * A function which creates a function that generates UUID v4 identifiers.\n *\n * @returns A new function that creates a UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\nexport function uuid4Factory(\n getRandomValues: (bytes: Uint8Array) => void\n): () => string {\n // Create a 16 byte array to hold the random values.\n const bytes = new Uint8Array(16);\n\n // Create a look up table from bytes to hex strings.\n const lut = new Array<string>(256);\n\n // Pad the single character hex digits with a leading zero.\n for (let i = 0; i < 16; ++i) {\n lut[i] = '0' + i.toString(16);\n }\n\n // Populate the rest of the hex digits.\n for (let i = 16; i < 256; ++i) {\n lut[i] = i.toString(16);\n }\n\n // Return a function which generates the UUID.\n return function uuid4(): string {\n // Get a new batch of random values.\n getRandomValues(bytes);\n\n // Set the UUID version number to 4.\n bytes[6] = 0x40 | (bytes[6] & 0x0f);\n\n // Set the clock sequence bit to the RFC spec.\n bytes[8] = 0x80 | (bytes[8] & 0x3f);\n\n // Assemble the UUID string.\n return (\n lut[bytes[0]] +\n lut[bytes[1]] +\n lut[bytes[2]] +\n lut[bytes[3]] +\n '-' +\n lut[bytes[4]] +\n lut[bytes[5]] +\n '-' +\n lut[bytes[6]] +\n lut[bytes[7]] +\n '-' +\n lut[bytes[8]] +\n lut[bytes[9]] +\n '-' +\n lut[bytes[10]] +\n lut[bytes[11]] +\n lut[bytes[12]] +\n lut[bytes[13]] +\n lut[bytes[14]] +\n lut[bytes[15]]\n );\n };\n}\n","// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/*-----------------------------------------------------------------------------\n| Copyright (c) 2014-2017, PhosphorJS Contributors\n|\n| Distributed under the terms of the BSD 3-Clause License.\n|\n| The full license is in the file LICENSE, distributed with this software.\n|----------------------------------------------------------------------------*/\nimport { Random } from './random.node';\nimport { uuid4Factory } from './uuid';\n\n/**\n * The namespace for UUID related functionality.\n */\nexport namespace UUID {\n /**\n * A function which generates UUID v4 identifiers.\n *\n * @returns A new UUID v4 string.\n *\n * #### Notes\n * This implementation complies with RFC 4122.\n *\n * This uses `Random.getRandomValues()` for random bytes, which in\n * turn will use the underlying `crypto` module of the platform if\n * it is available. The fallback for randomness is `Math.random`.\n */\n export const uuid4 = uuid4Factory(Random.getRandomValues);\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;;;;;;;AAuGA;;;IAGiB,QAgPhB;AAhPD,WAAiB,OAAO;;;;IAIT,mBAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAuB,CAAC;;;;IAKtD,kBAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAsB,CAAC;;;;;;;;IASjE,SAAgB,WAAW,CACzB,KAA+B;QAE/B,QACE,KAAK,KAAK,IAAI;YACd,OAAO,KAAK,KAAK,SAAS;YAC1B,OAAO,KAAK,KAAK,QAAQ;YACzB,OAAO,KAAK,KAAK,QAAQ,EACzB;KACH;IATe,mBAAW,cAS1B,CAAA;IAeD,SAAgB,OAAO,CAAC,KAA+B;QACrD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7B;IAFe,eAAO,UAEtB,CAAA;IAiBD,SAAgB,QAAQ,CAAC,KAA+B;QACtD,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC/C;IAFe,gBAAQ,WAEvB,CAAA;;;;;;;;;;IAWD,SAAgB,SAAS,CACvB,KAA+B,EAC/B,MAAgC;;QAGhC,IAAI,KAAK,KAAK,MAAM,EAAE;YACpB,OAAO,IAAI,CAAC;SACb;;QAGD,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE;YAC7C,OAAO,KAAK,CAAC;SACd;;QAGD,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QACxB,IAAI,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA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