UNPKG

29.9 kBSource Map (JSON)View Raw
1{"version":3,"file":"index.es6.js","sources":["../src/json.ts","../src/mime.ts","../src/promise.ts","../src/token.ts","../src/random.ts","../src/random.browser.ts","../src/uuid.ts","../src/uuid.browser.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: unknown): 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: unknown): 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 * @param description - Token purpose description for documentation.\n */\n constructor(name: string, description?: string) {\n this.name = name;\n this.description = description ?? '';\n this._tokenStructuralPropertyT = null!;\n }\n\n /**\n * Token purpose description.\n */\n readonly description?: string; // FIXME remove `?` for the next major version\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 // eslint-disable-next-line @typescript-eslint/ban-ts-comment\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 window: 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 window !== 'undefined' && (window.crypto || window.msCrypto)) ||\n null;\n\n // Modern browsers and IE 11\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return function getRandomValues(buffer: Uint8Array): void {\n return crypto.getRandomValues(buffer);\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.browser';\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;;;;;;AAM+E;AAiG/E;;AAEG;AACG,IAAW,QAgPhB;AAhPD,CAAA,UAAiB,OAAO,EAAA;AACtB;;AAEG;AACU,IAAA,OAAA,CAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAuB,CAAC;AAEnE;;AAEG;AACU,IAAA,OAAA,CAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAsB,CAAC;AAEjE;;;;;;AAMG;IACH,SAAgB,WAAW,CACzB,KAA+B,EAAA;QAE/B,QACE,KAAK,KAAK,IAAI;YACd,OAAO,KAAK,KAAK,SAAS;YAC1B,OAAO,KAAK,KAAK,QAAQ;AACzB,YAAA,OAAO,KAAK,KAAK,QAAQ,EACzB;KACH;AATe,IAAA,OAAA,CAAA,WAAW,cAS1B,CAAA;IAeD,SAAgB,OAAO,CAAC,KAA+B,EAAA;AACrD,QAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7B;AAFe,IAAA,OAAA,CAAA,OAAO,UAEtB,CAAA;IAiBD,SAAgB,QAAQ,CAAC,KAA+B,EAAA;QACtD,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC/C;AAFe,IAAA,OAAA,CAAA,QAAQ,WAEvB,CAAA;AAED;;;;;;;;AAQG;AACH,IAAA,SAAgB,SAAS,CACvB,KAA+B,EAC/B,MAAgC,EAAA;;QAGhC,IAAI,KAAK,KAAK,MAAM,EAAE;AACpB,YAAA,OAAO,IAAI,CAAC;AACb,SAAA;;QAGD,IAAI,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