WIP: bootstrap and partial real Solana watcher implementation
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
/// <reference types="node" resolution-mode="require"/>
|
||||
/**
|
||||
* A class representing the Node.js implementation of Hfs.
|
||||
* @implements {HfsImpl}
|
||||
*/
|
||||
export class NodeHfsImpl implements HfsImpl {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {object} [options] The options for the instance.
|
||||
* @param {Fsp} [options.fsp] The file system module to use.
|
||||
*/
|
||||
constructor({ fsp }?: {
|
||||
fsp?: Fsp;
|
||||
});
|
||||
/**
|
||||
* Reads a file and returns the contents as a string. Assumes UTF-8 encoding.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<string|undefined>} A promise that resolves with the contents of
|
||||
* the file or undefined if the file doesn't exist.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
* @throws {RangeError} If the file path is empty.
|
||||
* @throws {RangeError} If the file path is not absolute.
|
||||
* @throws {RangeError} If the file path is not a file.
|
||||
* @throws {RangeError} If the file path is not readable.
|
||||
*/
|
||||
text(filePath: string): Promise<string | undefined>;
|
||||
/**
|
||||
* Reads a file and returns the contents as a JSON object. Assumes UTF-8 encoding.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<object|undefined>} A promise that resolves with the contents of
|
||||
* the file or undefined if the file doesn't exist.
|
||||
* @throws {SyntaxError} If the file contents are not valid JSON.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
*/
|
||||
json(filePath: string): Promise<object | undefined>;
|
||||
/**
|
||||
* Reads a file and returns the contents as an ArrayBuffer.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<ArrayBuffer|undefined>} A promise that resolves with the contents
|
||||
* of the file or undefined if the file doesn't exist.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
* @deprecated Use bytes() instead.
|
||||
*/
|
||||
arrayBuffer(filePath: string): Promise<ArrayBuffer | undefined>;
|
||||
/**
|
||||
* Reads a file and returns the contents as an Uint8Array.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<Uint8Array|undefined>} A promise that resolves with the contents
|
||||
* of the file or undefined if the file doesn't exist.
|
||||
* @throws {Error} If the file cannot be read.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
*/
|
||||
bytes(filePath: string): Promise<Uint8Array | undefined>;
|
||||
/**
|
||||
* Writes a value to a file. If the value is a string, UTF-8 encoding is used.
|
||||
* @param {string} filePath The path to the file to write.
|
||||
* @param {string|ArrayBuffer|ArrayBufferView} contents The contents to write to the
|
||||
* file.
|
||||
* @returns {Promise<void>} A promise that resolves when the file is
|
||||
* written.
|
||||
* @throws {TypeError} If the file path is not a string.
|
||||
* @throws {Error} If the file cannot be written.
|
||||
*/
|
||||
write(filePath: string, contents: string | ArrayBuffer | ArrayBufferView): Promise<void>;
|
||||
/**
|
||||
* Checks if a file exists.
|
||||
* @param {string} filePath The path to the file to check.
|
||||
* @returns {Promise<boolean>} A promise that resolves with true if the
|
||||
* file exists or false if it does not.
|
||||
* @throws {Error} If the operation fails with a code other than ENOENT.
|
||||
*/
|
||||
isFile(filePath: string): Promise<boolean>;
|
||||
/**
|
||||
* Checks if a directory exists.
|
||||
* @param {string} dirPath The path to the directory to check.
|
||||
* @returns {Promise<boolean>} A promise that resolves with true if the
|
||||
* directory exists or false if it does not.
|
||||
* @throws {Error} If the operation fails with a code other than ENOENT.
|
||||
*/
|
||||
isDirectory(dirPath: string): Promise<boolean>;
|
||||
/**
|
||||
* Creates a directory recursively.
|
||||
* @param {string} dirPath The path to the directory to create.
|
||||
* @returns {Promise<void>} A promise that resolves when the directory is
|
||||
* created.
|
||||
*/
|
||||
createDirectory(dirPath: string): Promise<void>;
|
||||
/**
|
||||
* Deletes a file or empty directory.
|
||||
* @param {string} fileOrDirPath The path to the file or directory to
|
||||
* delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the file or
|
||||
* directory is deleted.
|
||||
* @throws {TypeError} If the file or directory path is not a string.
|
||||
* @throws {Error} If the file or directory cannot be deleted.
|
||||
* @throws {Error} If the file or directory is not found.
|
||||
*/
|
||||
delete(fileOrDirPath: string): Promise<void>;
|
||||
/**
|
||||
* Deletes a file or directory recursively.
|
||||
* @param {string} fileOrDirPath The path to the file or directory to
|
||||
* delete.
|
||||
* @returns {Promise<void>} A promise that resolves when the file or
|
||||
* directory is deleted.
|
||||
* @throws {TypeError} If the file or directory path is not a string.
|
||||
* @throws {Error} If the file or directory cannot be deleted.
|
||||
* @throws {Error} If the file or directory is not found.
|
||||
*/
|
||||
deleteAll(fileOrDirPath: string): Promise<void>;
|
||||
/**
|
||||
* Returns a list of directory entries for the given path.
|
||||
* @param {string} dirPath The path to the directory to read.
|
||||
* @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
|
||||
* directory entries.
|
||||
* @throws {TypeError} If the directory path is not a string.
|
||||
* @throws {Error} If the directory cannot be read.
|
||||
*/
|
||||
list(dirPath: string): AsyncIterable<HfsDirectoryEntry>;
|
||||
/**
|
||||
* Returns the size of a file.
|
||||
* @param {string} filePath The path to the file to read.
|
||||
* @returns {Promise<number|undefined>} A promise that resolves with the size of the
|
||||
* file in bytes or undefined if the file doesn't exist.
|
||||
*/
|
||||
size(filePath: string): Promise<number | undefined>;
|
||||
#private;
|
||||
}
|
||||
/**
|
||||
* A class representing a file system utility library.
|
||||
* @implements {HfsImpl}
|
||||
*/
|
||||
export class NodeHfs extends Hfs implements HfsImpl {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {object} [options] The options for the instance.
|
||||
* @param {Fsp} [options.fsp] The file system module to use.
|
||||
*/
|
||||
constructor({ fsp }?: {
|
||||
fsp?: Fsp;
|
||||
});
|
||||
}
|
||||
export const hfs: NodeHfs;
|
||||
export type HfsImpl = import("@humanfs/types").HfsImpl;
|
||||
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
|
||||
export type Fsp = typeof nativeFsp;
|
||||
export type Dirent = import("fs").Dirent;
|
||||
import { Hfs } from "@humanfs/core";
|
||||
import nativeFsp from "node:fs/promises";
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"misc.js","sourceRoot":"","sources":["src/misc.ts"],"names":[],"mappings":";;;AA6DA,4CAUC;AAKD,oDAWC;AAvFD;;;;GAIG;AACH,sEAAsE;AACtE,uDAAmD;AACnD,uDAAkD;AAClD,mDAAuD;AACvD,qDAAkE;AAClE,sDAK+B;AAC/B,sDAAmD;AACnD,8DAAkF;AAClF,iDAA8C;AAC9C,yCAAsC;AAEtC,6FAA6F;AAC7F,8CAA8C;AAC9C,oDAAoD;AACpD,MAAM,YAAY,GAAgB;IAChC,CAAC,EAAE,2BAAY,CAAC,KAAK;IACrB,CAAC,EAAE,MAAM,CAAC,mEAAmE,CAAC;IAC9E,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAChF,EAAE,EAAE,MAAM,CAAC,oEAAoE,CAAC;CACjF,CAAC;AACF,8DAA8D;AACjD,QAAA,MAAM,GAA4B,IAAA,2BAAc,EAAC;IAC5D,GAAG,YAAY;IACf,EAAE,EAAE,2BAAY;IAChB,IAAI,EAAE,gBAAM;CACb,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAgB;IACpC,CAAC,EAAE,mBAAQ,CAAC,KAAK;IACjB,CAAC,EAAE,MAAM,CAAC,oEAAoE,CAAC;IAC/E,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC,mEAAmE,CAAC;IAC/E,EAAE,EAAE,MAAM,CAAC,mEAAmE,CAAC;CAChF,CAAC;AACF,gEAAgE;AACnD,QAAA,UAAU,GAA4B,IAAA,2BAAc,EAAC;IAChE,GAAG,gBAAgB;IACnB,EAAE,EAAE,mBAAQ;IACZ,IAAI,EAAE,oBAAQ;CACf,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,IAAA,sBAAW,EACvC,kEAAkE,CACnE,CAAC;AAEF,kEAAkE;AAClE,SAAgB,gBAAgB,CAAC,GAAe,EAAE,eAA2B;IAC3E,MAAM,CAAC,GAAG,mBAAO,CAAC,MAAM,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;IAChC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACd,mEAAmE;IACnE,IAAI,CAAC,GAAG,cAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3C,0DAA0D;IAC1D,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,MAAM,CAAC,cAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC1E,OAAO,CAAC,CAAC;AACX,CAAC;AAED,wCAAwC;AACxC,gCAAgC;AAChC,iFAAiF;AACjF,SAAgB,oBAAoB,CAAC,CAAa,EAAE,eAA2B;IAC7E,MAAM,GAAG,GAAG,IAAA,sBAAW,EAAC,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7B,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,sFAAsF;AAEzE,QAAA,OAAO,GAAW,MAAM,CACnC,oEAAoE,CACrE,CAAC;AACW,QAAA,OAAO,GAAW,MAAM,CACnC,oEAAoE,CACrE,CAAC;AAEF;;GAEG;AACU,QAAA,MAAM,GAAa,IAAA,4BAAW,EAAC;IAC1C,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,IAAA,kBAAK,EAAC,eAAO,CAAC;IAClB,CAAC,EAAE,eAAO;IACV,EAAE,EAAE,IAAA,gBAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,eAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,gBAAM;CACb,CAAC,CAAC;AACH;;GAEG;AACU,QAAA,KAAK,GAAa,IAAA,4BAAW,EAAC;IACzC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,EAAE,EAAE,IAAA,kBAAK,EAAC,eAAO,CAAC;IAClB,CAAC,EAAE,eAAO;IACV,EAAE,EAAE,IAAA,gBAAG,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,eAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACb,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IACZ,IAAI,EAAE,gBAAM;CACb,CAAC,CAAC"}
|
||||
@@ -0,0 +1,346 @@
|
||||
// These types are not exported, and are only used internally
|
||||
import { BufferSource } from 'node:stream/web'
|
||||
import * as undici from './index'
|
||||
|
||||
/**
|
||||
* Take in an unknown value and return one that is of type T
|
||||
*/
|
||||
type Converter<T> = (object: unknown) => T
|
||||
|
||||
type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
|
||||
|
||||
type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
|
||||
|
||||
interface WebidlErrors {
|
||||
/**
|
||||
* @description Instantiate an error
|
||||
*/
|
||||
exception (opts: { header: string, message: string }): TypeError
|
||||
/**
|
||||
* @description Instantiate an error when conversion from one type to another has failed
|
||||
*/
|
||||
conversionFailed (opts: {
|
||||
prefix: string
|
||||
argument: string
|
||||
types: string[]
|
||||
}): TypeError
|
||||
/**
|
||||
* @description Throw an error when an invalid argument is provided
|
||||
*/
|
||||
invalidArgument (opts: {
|
||||
prefix: string
|
||||
value: string
|
||||
type: string
|
||||
}): TypeError
|
||||
}
|
||||
|
||||
interface WebIDLTypes {
|
||||
UNDEFINED: 1,
|
||||
BOOLEAN: 2,
|
||||
STRING: 3,
|
||||
SYMBOL: 4,
|
||||
NUMBER: 5,
|
||||
BIGINT: 6,
|
||||
NULL: 7
|
||||
OBJECT: 8
|
||||
}
|
||||
|
||||
interface WebidlUtil {
|
||||
/**
|
||||
* @see https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values
|
||||
*/
|
||||
Type (object: unknown): WebIDLTypes[keyof WebIDLTypes]
|
||||
|
||||
TypeValueToString (o: unknown):
|
||||
| 'Undefined'
|
||||
| 'Boolean'
|
||||
| 'String'
|
||||
| 'Symbol'
|
||||
| 'Number'
|
||||
| 'BigInt'
|
||||
| 'Null'
|
||||
| 'Object'
|
||||
|
||||
Types: WebIDLTypes
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
||||
*/
|
||||
ConvertToInt (
|
||||
V: unknown,
|
||||
bitLength: number,
|
||||
signedness: 'signed' | 'unsigned',
|
||||
flags?: number
|
||||
): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#abstract-opdef-integerpart
|
||||
*/
|
||||
IntegerPart (N: number): number
|
||||
|
||||
/**
|
||||
* Stringifies {@param V}
|
||||
*/
|
||||
Stringify (V: any): string
|
||||
|
||||
MakeTypeAssertion <I>(I: I): (arg: any) => arg is I
|
||||
|
||||
/**
|
||||
* Mark a value as uncloneable for Node.js.
|
||||
*/
|
||||
markAsUncloneable (V: any): void
|
||||
|
||||
IsResizableArrayBuffer (V: ArrayBufferLike): boolean
|
||||
|
||||
HasFlag (flag: number, attributes: number): boolean
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#dfn-get-buffer-source-copy
|
||||
*/
|
||||
getCopyOfBytesHeldByBufferSource (bufferSource: BufferSource): Uint8Array
|
||||
}
|
||||
|
||||
interface WebidlConverters {
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-DOMString
|
||||
*/
|
||||
DOMString (V: unknown, prefix: string, argument: string, flags?: number): string
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-ByteString
|
||||
*/
|
||||
ByteString (V: unknown, prefix: string, argument: string): string
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-USVString
|
||||
*/
|
||||
USVString (V: unknown): string
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-boolean
|
||||
*/
|
||||
boolean (V: unknown): boolean
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-any
|
||||
*/
|
||||
any <Value>(V: Value): Value
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-long-long
|
||||
*/
|
||||
['long long'] (V: unknown): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-unsigned-long-long
|
||||
*/
|
||||
['unsigned long long'] (V: unknown): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-unsigned-long
|
||||
*/
|
||||
['unsigned long'] (V: unknown): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-unsigned-short
|
||||
*/
|
||||
['unsigned short'] (V: unknown, flags?: number): number
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#idl-ArrayBuffer
|
||||
*/
|
||||
ArrayBuffer (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
options?: { allowResizable: boolean }
|
||||
): ArrayBuffer
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#idl-SharedArrayBuffer
|
||||
*/
|
||||
SharedArrayBuffer (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
options?: { allowResizable: boolean }
|
||||
): SharedArrayBuffer
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
||||
*/
|
||||
TypedArray (
|
||||
V: unknown,
|
||||
T: new () => NodeJS.TypedArray,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): NodeJS.TypedArray
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
||||
*/
|
||||
DataView (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): DataView
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-buffer-source-types
|
||||
*/
|
||||
ArrayBufferView (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): NodeJS.ArrayBufferView
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#BufferSource
|
||||
*/
|
||||
BufferSource (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): ArrayBuffer | NodeJS.ArrayBufferView
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#AllowSharedBufferSource
|
||||
*/
|
||||
AllowSharedBufferSource (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string,
|
||||
flags?: number
|
||||
): ArrayBuffer | SharedArrayBuffer | NodeJS.ArrayBufferView
|
||||
|
||||
['sequence<ByteString>']: SequenceConverter<string>
|
||||
|
||||
['sequence<sequence<ByteString>>']: SequenceConverter<string[]>
|
||||
|
||||
['record<ByteString, ByteString>']: RecordConverter<string, string>
|
||||
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#requestinfo
|
||||
*/
|
||||
RequestInfo (V: unknown): undici.Request | string
|
||||
|
||||
/**
|
||||
* @see https://fetch.spec.whatwg.org/#requestinit
|
||||
*/
|
||||
RequestInit (V: unknown): undici.RequestInit
|
||||
|
||||
/**
|
||||
* @see https://html.spec.whatwg.org/multipage/webappapis.html#eventhandlernonnull
|
||||
*/
|
||||
EventHandlerNonNull (V: unknown): Function | null
|
||||
|
||||
WebSocketStreamWrite (V: unknown): ArrayBuffer | NodeJS.TypedArray | string
|
||||
|
||||
[Key: string]: (...args: any[]) => unknown
|
||||
}
|
||||
|
||||
type WebidlIsFunction<T> = (arg: any) => arg is T
|
||||
|
||||
interface WebidlIs {
|
||||
Request: WebidlIsFunction<undici.Request>
|
||||
Response: WebidlIsFunction<undici.Response>
|
||||
ReadableStream: WebidlIsFunction<ReadableStream>
|
||||
Blob: WebidlIsFunction<Blob>
|
||||
URLSearchParams: WebidlIsFunction<URLSearchParams>
|
||||
File: WebidlIsFunction<File>
|
||||
FormData: WebidlIsFunction<undici.FormData>
|
||||
URL: WebidlIsFunction<URL>
|
||||
WebSocketError: WebidlIsFunction<undici.WebSocketError>
|
||||
AbortSignal: WebidlIsFunction<AbortSignal>
|
||||
MessagePort: WebidlIsFunction<MessagePort>
|
||||
USVString: WebidlIsFunction<string>
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#BufferSource
|
||||
*/
|
||||
BufferSource: WebidlIsFunction<ArrayBuffer | NodeJS.TypedArray>
|
||||
}
|
||||
|
||||
export interface Webidl {
|
||||
errors: WebidlErrors
|
||||
util: WebidlUtil
|
||||
converters: WebidlConverters
|
||||
is: WebidlIs
|
||||
attributes: WebIDLExtendedAttributes
|
||||
|
||||
/**
|
||||
* @description Performs a brand-check on {@param V} to ensure it is a
|
||||
* {@param cls} object.
|
||||
*/
|
||||
brandCheck <Interface extends new () => unknown>(V: unknown, cls: Interface): asserts V is Interface
|
||||
|
||||
brandCheckMultiple <Interfaces extends (new () => unknown)[]> (list: Interfaces): (V: any) => asserts V is Interfaces[number]
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-sequence
|
||||
* @description Convert a value, V, to a WebIDL sequence type.
|
||||
*/
|
||||
sequenceConverter <Type>(C: Converter<Type>): SequenceConverter<Type>
|
||||
|
||||
illegalConstructor (): never
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#es-to-record
|
||||
* @description Convert a value, V, to a WebIDL record type.
|
||||
*/
|
||||
recordConverter <K extends string, V>(
|
||||
keyConverter: Converter<K>,
|
||||
valueConverter: Converter<V>
|
||||
): RecordConverter<K, V>
|
||||
|
||||
/**
|
||||
* Similar to {@link Webidl.brandCheck} but allows skipping the check if third party
|
||||
* interfaces are allowed.
|
||||
*/
|
||||
interfaceConverter <Interface>(typeCheck: WebidlIsFunction<Interface>, name: string): (
|
||||
V: unknown,
|
||||
prefix: string,
|
||||
argument: string
|
||||
) => asserts V is Interface
|
||||
|
||||
// TODO(@KhafraDev): a type could likely be implemented that can infer the return type
|
||||
// from the converters given?
|
||||
/**
|
||||
* Converts a value, V, to a WebIDL dictionary types. Allows limiting which keys are
|
||||
* allowed, values allowed, optional and required keys. Auto converts the value to
|
||||
* a type given a converter.
|
||||
*/
|
||||
dictionaryConverter (converters: {
|
||||
key: string,
|
||||
defaultValue?: () => unknown,
|
||||
required?: boolean,
|
||||
converter: (...args: unknown[]) => unknown,
|
||||
allowedValues?: unknown[]
|
||||
}[]): (V: unknown) => Record<string, unknown>
|
||||
|
||||
/**
|
||||
* @see https://webidl.spec.whatwg.org/#idl-nullable-type
|
||||
* @description allows a type, V, to be null
|
||||
*/
|
||||
nullableConverter <T>(
|
||||
converter: Converter<T>
|
||||
): (V: unknown) => ReturnType<typeof converter> | null
|
||||
|
||||
argumentLengthCheck (args: { length: number }, min: number, context: string): void
|
||||
}
|
||||
|
||||
interface WebIDLExtendedAttributes {
|
||||
/** https://webidl.spec.whatwg.org/#Clamp */
|
||||
Clamp: number
|
||||
/** https://webidl.spec.whatwg.org/#EnforceRange */
|
||||
EnforceRange: number
|
||||
/** https://webidl.spec.whatwg.org/#AllowShared */
|
||||
AllowShared: number
|
||||
/** https://webidl.spec.whatwg.org/#AllowResizable */
|
||||
AllowResizable: number
|
||||
/** https://webidl.spec.whatwg.org/#LegacyNullToEmptyString */
|
||||
LegacyNullToEmptyString: number
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# picocolors
|
||||
|
||||
The tiniest and the fastest library for terminal output formatting with ANSI colors.
|
||||
|
||||
```javascript
|
||||
import pc from "picocolors"
|
||||
|
||||
console.log(
|
||||
pc.green(`How are ${pc.italic(`you`)} doing?`)
|
||||
)
|
||||
```
|
||||
|
||||
- **No dependencies.**
|
||||
- **14 times** smaller and **2 times** faster than chalk.
|
||||
- Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
|
||||
- Node.js v6+ & browsers support. Support for both CJS and ESM projects.
|
||||
- TypeScript type declarations included.
|
||||
- [`NO_COLOR`](https://no-color.org/) friendly.
|
||||
|
||||
## Docs
|
||||
Read **[full docs](https://github.com/alexeyraspopov/picocolors#readme)** on GitHub.
|
||||
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
invokeCallback,
|
||||
subscribe,
|
||||
FULFILLED,
|
||||
REJECTED,
|
||||
noop,
|
||||
makePromise,
|
||||
PROMISE_ID
|
||||
} from './-internal';
|
||||
|
||||
import { asap } from './asap';
|
||||
|
||||
export default function then(onFulfillment, onRejection) {
|
||||
const parent = this;
|
||||
|
||||
const child = new this.constructor(noop);
|
||||
|
||||
if (child[PROMISE_ID] === undefined) {
|
||||
makePromise(child);
|
||||
}
|
||||
|
||||
const { _state } = parent;
|
||||
|
||||
if (_state) {
|
||||
const callback = arguments[_state - 1];
|
||||
asap(() => invokeCallback(_state, child, callback, parent._result));
|
||||
} else {
|
||||
subscribe(parent, child, onFulfillment, onRejection);
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
import { expectTypeOf, test } from "vitest";
|
||||
import * as z from "zod/v4";
|
||||
import type * as core from "zod/v4/core";
|
||||
|
||||
test("first party switch", () => {
|
||||
const myType = z.string() as core.$ZodTypes;
|
||||
const def = myType._zod.def;
|
||||
switch (def.type) {
|
||||
case "string":
|
||||
break;
|
||||
case "number":
|
||||
break;
|
||||
case "bigint":
|
||||
break;
|
||||
case "boolean":
|
||||
break;
|
||||
case "date":
|
||||
break;
|
||||
case "symbol":
|
||||
break;
|
||||
case "undefined":
|
||||
break;
|
||||
case "null":
|
||||
break;
|
||||
case "any":
|
||||
break;
|
||||
case "unknown":
|
||||
break;
|
||||
case "never":
|
||||
break;
|
||||
case "void":
|
||||
break;
|
||||
case "array":
|
||||
break;
|
||||
case "object":
|
||||
break;
|
||||
case "union":
|
||||
break;
|
||||
case "intersection":
|
||||
break;
|
||||
case "tuple":
|
||||
break;
|
||||
case "record":
|
||||
break;
|
||||
case "map":
|
||||
break;
|
||||
case "set":
|
||||
break;
|
||||
case "literal":
|
||||
break;
|
||||
case "enum":
|
||||
break;
|
||||
case "promise":
|
||||
break;
|
||||
case "optional":
|
||||
break;
|
||||
case "nonoptional":
|
||||
break;
|
||||
case "nullable":
|
||||
break;
|
||||
case "default":
|
||||
break;
|
||||
case "prefault":
|
||||
break;
|
||||
case "template_literal":
|
||||
break;
|
||||
case "custom":
|
||||
break;
|
||||
case "transform":
|
||||
break;
|
||||
case "readonly":
|
||||
break;
|
||||
case "nan":
|
||||
break;
|
||||
case "pipe":
|
||||
break;
|
||||
case "success":
|
||||
break;
|
||||
case "catch":
|
||||
break;
|
||||
case "file":
|
||||
break;
|
||||
case "lazy":
|
||||
break;
|
||||
case "function":
|
||||
break;
|
||||
default:
|
||||
expectTypeOf(def).toEqualTypeOf<never>();
|
||||
}
|
||||
});
|
||||
|
||||
test("$ZodSchemaTypes", () => {
|
||||
const type = "string" as core.$ZodTypeDef["type"];
|
||||
switch (type) {
|
||||
case "string":
|
||||
break;
|
||||
case "number":
|
||||
break;
|
||||
case "int":
|
||||
break;
|
||||
case "bigint":
|
||||
break;
|
||||
case "boolean":
|
||||
break;
|
||||
case "date":
|
||||
break;
|
||||
case "symbol":
|
||||
break;
|
||||
case "undefined":
|
||||
break;
|
||||
case "null":
|
||||
break;
|
||||
case "any":
|
||||
break;
|
||||
case "unknown":
|
||||
break;
|
||||
case "never":
|
||||
break;
|
||||
case "void":
|
||||
break;
|
||||
case "array":
|
||||
break;
|
||||
case "object":
|
||||
break;
|
||||
case "union":
|
||||
break;
|
||||
case "intersection":
|
||||
break;
|
||||
case "tuple":
|
||||
break;
|
||||
case "record":
|
||||
break;
|
||||
case "map":
|
||||
break;
|
||||
case "set":
|
||||
break;
|
||||
case "literal":
|
||||
break;
|
||||
case "enum":
|
||||
break;
|
||||
case "promise":
|
||||
break;
|
||||
case "optional":
|
||||
break;
|
||||
case "nonoptional":
|
||||
break;
|
||||
case "nullable":
|
||||
break;
|
||||
case "default":
|
||||
break;
|
||||
case "prefault":
|
||||
break;
|
||||
case "template_literal":
|
||||
break;
|
||||
case "custom":
|
||||
break;
|
||||
case "transform":
|
||||
break;
|
||||
case "readonly":
|
||||
break;
|
||||
case "nan":
|
||||
break;
|
||||
case "pipe":
|
||||
break;
|
||||
case "success":
|
||||
break;
|
||||
case "catch":
|
||||
break;
|
||||
case "file":
|
||||
break;
|
||||
case "lazy":
|
||||
break;
|
||||
case "function":
|
||||
break;
|
||||
|
||||
default:
|
||||
expectTypeOf(type).toEqualTypeOf<never>();
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { _ as _class_apply_descriptor_destructure } from "./_class_apply_descriptor_destructure.js";
|
||||
import { _ as _class_check_private_static_access } from "./_class_check_private_static_access.js";
|
||||
import { _ as _class_check_private_static_field_descriptor } from "./_class_check_private_static_field_descriptor.js";
|
||||
|
||||
function _class_static_private_field_destructure(receiver, classConstructor, descriptor) {
|
||||
_class_check_private_static_access(receiver, classConstructor);
|
||||
_class_check_private_static_field_descriptor(descriptor, "set");
|
||||
|
||||
return _class_apply_descriptor_destructure(receiver, descriptor);
|
||||
}
|
||||
export { _class_static_private_field_destructure as _ };
|
||||
@@ -0,0 +1,121 @@
|
||||
import type { $ZodStringFormats } from "../core/checks.js";
|
||||
import type * as errors from "../core/errors.js";
|
||||
import * as util from "../core/util.js";
|
||||
|
||||
const error: () => errors.$ZodErrorMap = () => {
|
||||
const Sizable: Record<string, { unit: string; verb: string }> = {
|
||||
string: { unit: "tekens", verb: "heeft" },
|
||||
file: { unit: "bytes", verb: "heeft" },
|
||||
array: { unit: "elementen", verb: "heeft" },
|
||||
set: { unit: "elementen", verb: "heeft" },
|
||||
};
|
||||
|
||||
function getSizing(origin: string): { unit: string; verb: string } | null {
|
||||
return Sizable[origin] ?? null;
|
||||
}
|
||||
|
||||
const FormatDictionary: {
|
||||
[k in $ZodStringFormats | (string & {})]?: string;
|
||||
} = {
|
||||
regex: "invoer",
|
||||
email: "emailadres",
|
||||
url: "URL",
|
||||
emoji: "emoji",
|
||||
uuid: "UUID",
|
||||
uuidv4: "UUIDv4",
|
||||
uuidv6: "UUIDv6",
|
||||
nanoid: "nanoid",
|
||||
guid: "GUID",
|
||||
cuid: "cuid",
|
||||
cuid2: "cuid2",
|
||||
ulid: "ULID",
|
||||
xid: "XID",
|
||||
ksuid: "KSUID",
|
||||
datetime: "ISO datum en tijd",
|
||||
date: "ISO datum",
|
||||
time: "ISO tijd",
|
||||
duration: "ISO duur",
|
||||
ipv4: "IPv4-adres",
|
||||
ipv6: "IPv6-adres",
|
||||
cidrv4: "IPv4-bereik",
|
||||
cidrv6: "IPv6-bereik",
|
||||
base64: "base64-gecodeerde tekst",
|
||||
base64url: "base64 URL-gecodeerde tekst",
|
||||
json_string: "JSON string",
|
||||
e164: "E.164-nummer",
|
||||
jwt: "JWT",
|
||||
template_literal: "invoer",
|
||||
};
|
||||
|
||||
const TypeDictionary: {
|
||||
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
|
||||
} = {
|
||||
nan: "NaN",
|
||||
number: "getal",
|
||||
};
|
||||
|
||||
return (issue) => {
|
||||
switch (issue.code) {
|
||||
case "invalid_type": {
|
||||
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
||||
const receivedType = util.parsedType(issue.input);
|
||||
const received = TypeDictionary[receivedType] ?? receivedType;
|
||||
if (/^[A-Z]/.test(issue.expected)) {
|
||||
return `Ongeldige invoer: verwacht instanceof ${issue.expected}, ontving ${received}`;
|
||||
}
|
||||
return `Ongeldige invoer: verwacht ${expected}, ontving ${received}`;
|
||||
}
|
||||
case "invalid_value":
|
||||
if (issue.values.length === 1) return `Ongeldige invoer: verwacht ${util.stringifyPrimitive(issue.values[0])}`;
|
||||
return `Ongeldige optie: verwacht één van ${util.joinValues(issue.values, "|")}`;
|
||||
case "too_big": {
|
||||
const adj = issue.inclusive ? "<=" : "<";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const longName = issue.origin === "date" ? "laat" : issue.origin === "string" ? "lang" : "groot";
|
||||
|
||||
if (sizing)
|
||||
return `Te ${longName}: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"} ${sizing.verb}`;
|
||||
return `Te ${longName}: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
|
||||
}
|
||||
case "too_small": {
|
||||
const adj = issue.inclusive ? ">=" : ">";
|
||||
const sizing = getSizing(issue.origin);
|
||||
const shortName = issue.origin === "date" ? "vroeg" : issue.origin === "string" ? "kort" : "klein";
|
||||
|
||||
if (sizing) {
|
||||
return `Te ${shortName}: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} ${sizing.verb}`;
|
||||
}
|
||||
|
||||
return `Te ${shortName}: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
|
||||
}
|
||||
case "invalid_format": {
|
||||
const _issue = issue as errors.$ZodStringFormatIssues;
|
||||
if (_issue.format === "starts_with") {
|
||||
return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`;
|
||||
}
|
||||
if (_issue.format === "ends_with") return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`;
|
||||
if (_issue.format === "includes") return `Ongeldige tekst: moet "${_issue.includes}" bevatten`;
|
||||
if (_issue.format === "regex") return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`;
|
||||
return `Ongeldig: ${FormatDictionary[_issue.format] ?? issue.format}`;
|
||||
}
|
||||
case "not_multiple_of":
|
||||
return `Ongeldig getal: moet een veelvoud van ${issue.divisor} zijn`;
|
||||
case "unrecognized_keys":
|
||||
return `Onbekende key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
|
||||
case "invalid_key":
|
||||
return `Ongeldige key in ${issue.origin}`;
|
||||
case "invalid_union":
|
||||
return "Ongeldige invoer";
|
||||
case "invalid_element":
|
||||
return `Ongeldige waarde in ${issue.origin}`;
|
||||
default:
|
||||
return `Ongeldige invoer`;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default function (): { localeError: errors.$ZodErrorMap } {
|
||||
return {
|
||||
localeError: error(),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
import { SolanaError, SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE } from '@solana/errors';
|
||||
import { combineCodec, createDecoder, createEncoder, assertByteArrayIsNotEmptyForCodec, assertByteArrayHasEnoughBytesForCodec } from '@solana/codecs-core';
|
||||
|
||||
// src/assertions.ts
|
||||
function assertNumberIsBetweenForCodec(codecDescription, min, max, value) {
|
||||
if (value < min || value > max) {
|
||||
throw new SolanaError(SOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE, {
|
||||
codecDescription,
|
||||
max,
|
||||
min,
|
||||
value
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// src/common.ts
|
||||
var Endian = /* @__PURE__ */ ((Endian2) => {
|
||||
Endian2[Endian2["Little"] = 0] = "Little";
|
||||
Endian2[Endian2["Big"] = 1] = "Big";
|
||||
return Endian2;
|
||||
})(Endian || {});
|
||||
function isLittleEndian(config) {
|
||||
return config?.endian === 1 /* Big */ ? false : true;
|
||||
}
|
||||
function numberEncoderFactory(input) {
|
||||
return createEncoder({
|
||||
fixedSize: input.size,
|
||||
write(value, bytes, offset) {
|
||||
if (input.range) {
|
||||
assertNumberIsBetweenForCodec(input.name, input.range[0], input.range[1], value);
|
||||
}
|
||||
const arrayBuffer = new ArrayBuffer(input.size);
|
||||
input.set(new DataView(arrayBuffer), value, isLittleEndian(input.config));
|
||||
bytes.set(new Uint8Array(arrayBuffer), offset);
|
||||
return offset + input.size;
|
||||
}
|
||||
});
|
||||
}
|
||||
function numberDecoderFactory(input) {
|
||||
return createDecoder({
|
||||
fixedSize: input.size,
|
||||
read(bytes, offset = 0) {
|
||||
assertByteArrayIsNotEmptyForCodec(input.name, bytes, offset);
|
||||
assertByteArrayHasEnoughBytesForCodec(input.name, input.size, bytes, offset);
|
||||
const view = new DataView(toArrayBuffer(bytes, offset, input.size));
|
||||
return [input.get(view, isLittleEndian(input.config)), offset + input.size];
|
||||
}
|
||||
});
|
||||
}
|
||||
function toArrayBuffer(bytes, offset, length) {
|
||||
const bytesOffset = bytes.byteOffset + (offset ?? 0);
|
||||
const bytesLength = length ?? bytes.byteLength;
|
||||
return bytes.buffer.slice(bytesOffset, bytesOffset + bytesLength);
|
||||
}
|
||||
|
||||
// src/f32.ts
|
||||
var getF32Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "f32",
|
||||
set: (view, value, le) => view.setFloat32(0, Number(value), le),
|
||||
size: 4
|
||||
});
|
||||
var getF32Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getFloat32(0, le),
|
||||
name: "f32",
|
||||
size: 4
|
||||
});
|
||||
var getF32Codec = (config = {}) => combineCodec(getF32Encoder(config), getF32Decoder(config));
|
||||
var getF64Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "f64",
|
||||
set: (view, value, le) => view.setFloat64(0, Number(value), le),
|
||||
size: 8
|
||||
});
|
||||
var getF64Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getFloat64(0, le),
|
||||
name: "f64",
|
||||
size: 8
|
||||
});
|
||||
var getF64Codec = (config = {}) => combineCodec(getF64Encoder(config), getF64Decoder(config));
|
||||
var getI128Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "i128",
|
||||
range: [-BigInt("0x7fffffffffffffffffffffffffffffff") - 1n, BigInt("0x7fffffffffffffffffffffffffffffff")],
|
||||
set: (view, value, le) => {
|
||||
const leftOffset = le ? 8 : 0;
|
||||
const rightOffset = le ? 0 : 8;
|
||||
const rightMask = 0xffffffffffffffffn;
|
||||
view.setBigInt64(leftOffset, BigInt(value) >> 64n, le);
|
||||
view.setBigUint64(rightOffset, BigInt(value) & rightMask, le);
|
||||
},
|
||||
size: 16
|
||||
});
|
||||
var getI128Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => {
|
||||
const leftOffset = le ? 8 : 0;
|
||||
const rightOffset = le ? 0 : 8;
|
||||
const left = view.getBigInt64(leftOffset, le);
|
||||
const right = view.getBigUint64(rightOffset, le);
|
||||
return (left << 64n) + right;
|
||||
},
|
||||
name: "i128",
|
||||
size: 16
|
||||
});
|
||||
var getI128Codec = (config = {}) => combineCodec(getI128Encoder(config), getI128Decoder(config));
|
||||
var getI16Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "i16",
|
||||
range: [-Number("0x7fff") - 1, Number("0x7fff")],
|
||||
set: (view, value, le) => view.setInt16(0, Number(value), le),
|
||||
size: 2
|
||||
});
|
||||
var getI16Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getInt16(0, le),
|
||||
name: "i16",
|
||||
size: 2
|
||||
});
|
||||
var getI16Codec = (config = {}) => combineCodec(getI16Encoder(config), getI16Decoder(config));
|
||||
var getI32Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "i32",
|
||||
range: [-Number("0x7fffffff") - 1, Number("0x7fffffff")],
|
||||
set: (view, value, le) => view.setInt32(0, Number(value), le),
|
||||
size: 4
|
||||
});
|
||||
var getI32Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getInt32(0, le),
|
||||
name: "i32",
|
||||
size: 4
|
||||
});
|
||||
var getI32Codec = (config = {}) => combineCodec(getI32Encoder(config), getI32Decoder(config));
|
||||
var getI64Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "i64",
|
||||
range: [-BigInt("0x7fffffffffffffff") - 1n, BigInt("0x7fffffffffffffff")],
|
||||
set: (view, value, le) => view.setBigInt64(0, BigInt(value), le),
|
||||
size: 8
|
||||
});
|
||||
var getI64Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getBigInt64(0, le),
|
||||
name: "i64",
|
||||
size: 8
|
||||
});
|
||||
var getI64Codec = (config = {}) => combineCodec(getI64Encoder(config), getI64Decoder(config));
|
||||
var getI8Encoder = () => numberEncoderFactory({
|
||||
name: "i8",
|
||||
range: [-Number("0x7f") - 1, Number("0x7f")],
|
||||
set: (view, value) => view.setInt8(0, Number(value)),
|
||||
size: 1
|
||||
});
|
||||
var getI8Decoder = () => numberDecoderFactory({
|
||||
get: (view) => view.getInt8(0),
|
||||
name: "i8",
|
||||
size: 1
|
||||
});
|
||||
var getI8Codec = () => combineCodec(getI8Encoder(), getI8Decoder());
|
||||
var getShortU16Encoder = () => createEncoder({
|
||||
getSizeFromValue: (value) => {
|
||||
if (value <= 127) return 1;
|
||||
if (value <= 16383) return 2;
|
||||
return 3;
|
||||
},
|
||||
maxSize: 3,
|
||||
write: (value, bytes, offset) => {
|
||||
assertNumberIsBetweenForCodec("shortU16", 0, 65535, value);
|
||||
const shortU16Bytes = [0];
|
||||
for (let ii = 0; ; ii += 1) {
|
||||
const alignedValue = Number(value) >> ii * 7;
|
||||
if (alignedValue === 0) {
|
||||
break;
|
||||
}
|
||||
const nextSevenBits = 127 & alignedValue;
|
||||
shortU16Bytes[ii] = nextSevenBits;
|
||||
if (ii > 0) {
|
||||
shortU16Bytes[ii - 1] |= 128;
|
||||
}
|
||||
}
|
||||
bytes.set(shortU16Bytes, offset);
|
||||
return offset + shortU16Bytes.length;
|
||||
}
|
||||
});
|
||||
var getShortU16Decoder = () => createDecoder({
|
||||
maxSize: 3,
|
||||
read: (bytes, offset) => {
|
||||
let value = 0;
|
||||
let byteCount = 0;
|
||||
while (++byteCount) {
|
||||
const byteIndex = byteCount - 1;
|
||||
const currentByte = bytes[offset + byteIndex];
|
||||
const nextSevenBits = 127 & currentByte;
|
||||
value |= nextSevenBits << byteIndex * 7;
|
||||
if ((currentByte & 128) === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [value, offset + byteCount];
|
||||
}
|
||||
});
|
||||
var getShortU16Codec = () => combineCodec(getShortU16Encoder(), getShortU16Decoder());
|
||||
var getU128Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "u128",
|
||||
range: [0n, BigInt("0xffffffffffffffffffffffffffffffff")],
|
||||
set: (view, value, le) => {
|
||||
const leftOffset = le ? 8 : 0;
|
||||
const rightOffset = le ? 0 : 8;
|
||||
const rightMask = 0xffffffffffffffffn;
|
||||
view.setBigUint64(leftOffset, BigInt(value) >> 64n, le);
|
||||
view.setBigUint64(rightOffset, BigInt(value) & rightMask, le);
|
||||
},
|
||||
size: 16
|
||||
});
|
||||
var getU128Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => {
|
||||
const leftOffset = le ? 8 : 0;
|
||||
const rightOffset = le ? 0 : 8;
|
||||
const left = view.getBigUint64(leftOffset, le);
|
||||
const right = view.getBigUint64(rightOffset, le);
|
||||
return (left << 64n) + right;
|
||||
},
|
||||
name: "u128",
|
||||
size: 16
|
||||
});
|
||||
var getU128Codec = (config = {}) => combineCodec(getU128Encoder(config), getU128Decoder(config));
|
||||
var getU16Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "u16",
|
||||
range: [0, Number("0xffff")],
|
||||
set: (view, value, le) => view.setUint16(0, Number(value), le),
|
||||
size: 2
|
||||
});
|
||||
var getU16Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getUint16(0, le),
|
||||
name: "u16",
|
||||
size: 2
|
||||
});
|
||||
var getU16Codec = (config = {}) => combineCodec(getU16Encoder(config), getU16Decoder(config));
|
||||
var getU32Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "u32",
|
||||
range: [0, Number("0xffffffff")],
|
||||
set: (view, value, le) => view.setUint32(0, Number(value), le),
|
||||
size: 4
|
||||
});
|
||||
var getU32Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getUint32(0, le),
|
||||
name: "u32",
|
||||
size: 4
|
||||
});
|
||||
var getU32Codec = (config = {}) => combineCodec(getU32Encoder(config), getU32Decoder(config));
|
||||
var getU64Encoder = (config = {}) => numberEncoderFactory({
|
||||
config,
|
||||
name: "u64",
|
||||
range: [0n, BigInt("0xffffffffffffffff")],
|
||||
set: (view, value, le) => view.setBigUint64(0, BigInt(value), le),
|
||||
size: 8
|
||||
});
|
||||
var getU64Decoder = (config = {}) => numberDecoderFactory({
|
||||
config,
|
||||
get: (view, le) => view.getBigUint64(0, le),
|
||||
name: "u64",
|
||||
size: 8
|
||||
});
|
||||
var getU64Codec = (config = {}) => combineCodec(getU64Encoder(config), getU64Decoder(config));
|
||||
var getU8Encoder = () => numberEncoderFactory({
|
||||
name: "u8",
|
||||
range: [0, Number("0xff")],
|
||||
set: (view, value) => view.setUint8(0, Number(value)),
|
||||
size: 1
|
||||
});
|
||||
var getU8Decoder = () => numberDecoderFactory({
|
||||
get: (view) => view.getUint8(0),
|
||||
name: "u8",
|
||||
size: 1
|
||||
});
|
||||
var getU8Codec = () => combineCodec(getU8Encoder(), getU8Decoder());
|
||||
|
||||
export { Endian, assertNumberIsBetweenForCodec, getF32Codec, getF32Decoder, getF32Encoder, getF64Codec, getF64Decoder, getF64Encoder, getI128Codec, getI128Decoder, getI128Encoder, getI16Codec, getI16Decoder, getI16Encoder, getI32Codec, getI32Decoder, getI32Encoder, getI64Codec, getI64Decoder, getI64Encoder, getI8Codec, getI8Decoder, getI8Encoder, getShortU16Codec, getShortU16Decoder, getShortU16Encoder, getU128Codec, getU128Decoder, getU128Encoder, getU16Codec, getU16Decoder, getU16Encoder, getU32Codec, getU32Decoder, getU32Encoder, getU64Codec, getU64Decoder, getU64Encoder, getU8Codec, getU8Decoder, getU8Encoder };
|
||||
//# sourceMappingURL=index.browser.mjs.map
|
||||
//# sourceMappingURL=index.browser.mjs.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"moduleResolutionKind.enum.js","sourceRoot":"","sources":["../../src/enums/moduleResolutionKind.enum.ts"],"names":[],"mappings":"AAAA,sGAAsG;AAEtG,MAAM,CAAN,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC5B,qEAAW,CAAA;IACX,qEAAW,CAAA;IACX,mEAAU,CAAA;IACV,mEAAU,CAAA;IACV,wEAAa,CAAA;IACb,uEAAa,CAAA;AACjB,CAAC,EAPW,oBAAoB,KAApB,oBAAoB,QAO/B"}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* NIST secp521r1 aka p521.
|
||||
* @module
|
||||
*/
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
import { type H2CMethod } from './abstract/hash-to-curve.ts';
|
||||
import { p521_hasher, p521 as p521n } from './nist.ts';
|
||||
/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */
|
||||
export const p521: typeof p521n = p521n;
|
||||
/** @deprecated use `import { p521 } from '@noble/curves/nist.js';` */
|
||||
export const secp521r1: typeof p521n = p521n;
|
||||
/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */
|
||||
export const hashToCurve: H2CMethod<bigint> = /* @__PURE__ */ (() => p521_hasher.hashToCurve)();
|
||||
/** @deprecated use `import { p521_hasher } from '@noble/curves/nist.js';` */
|
||||
export const encodeToCurve: H2CMethod<bigint> = /* @__PURE__ */ (() => p521_hasher.encodeToCurve)();
|
||||
@@ -0,0 +1,248 @@
|
||||
/**
|
||||
* @fileoverview Rule to flag numbers that will lose significant figure precision at runtime
|
||||
* @author Jacob Moore
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** Class representing a number in scientific notation. */
|
||||
class ScientificNotation {
|
||||
/** @type {string} The digits of the coefficient. A decimal point is implied after the first digit. */
|
||||
coefficient;
|
||||
|
||||
/** @type {number} The order of magnitude. */
|
||||
magnitude;
|
||||
|
||||
constructor(coefficient, magnitude) {
|
||||
this.coefficient = coefficient;
|
||||
this.magnitude = magnitude;
|
||||
}
|
||||
|
||||
/* c8 ignore start -- debug only */
|
||||
toString() {
|
||||
return `${this.coefficient[0]}${this.coefficient.length > 1 ? `.${this.coefficient.slice(1)}` : ""}e${this.magnitude}`;
|
||||
}
|
||||
/* c8 ignore stop */
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the node is number literal
|
||||
* @param {Node} node the node literal being evaluated
|
||||
* @returns {boolean} true if the node is a number literal
|
||||
*/
|
||||
function isNumber(node) {
|
||||
return typeof node.value === "number";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source code of the given number literal. Removes `_` numeric separators from the result.
|
||||
* @param {Node} node the number `Literal` node
|
||||
* @returns {string} raw source code of the literal, without numeric separators
|
||||
*/
|
||||
function getRaw(node) {
|
||||
return node.raw.replace(/_/gu, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the number is base ten
|
||||
* @param {ASTNode} node the node being evaluated
|
||||
* @returns {boolean} true if the node is in base ten
|
||||
*/
|
||||
function isBaseTen(node) {
|
||||
const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"];
|
||||
|
||||
return (
|
||||
prefixes.every(prefix => !node.raw.startsWith(prefix)) &&
|
||||
!/^0[0-7]+$/u.test(node.raw)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type
|
||||
* @param {Node} node the node being evaluated
|
||||
* @returns {boolean} true if they do not match
|
||||
*/
|
||||
function notBaseTenLosesPrecision(node) {
|
||||
const rawString = getRaw(node).toUpperCase();
|
||||
let base;
|
||||
|
||||
if (rawString.startsWith("0B")) {
|
||||
base = 2;
|
||||
} else if (rawString.startsWith("0X")) {
|
||||
base = 16;
|
||||
} else {
|
||||
base = 8;
|
||||
}
|
||||
|
||||
return !rawString.endsWith(node.value.toString(base).toUpperCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number stripped of leading zeros
|
||||
* @param {string} numberAsString the string representation of the number
|
||||
* @returns {string} the stripped string
|
||||
*/
|
||||
function removeLeadingZeros(numberAsString) {
|
||||
for (let i = 0; i < numberAsString.length; i++) {
|
||||
if (numberAsString[i] !== "0") {
|
||||
return numberAsString.slice(i);
|
||||
}
|
||||
}
|
||||
return numberAsString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number stripped of trailing zeros
|
||||
* @param {string} numberAsString the string representation of the number
|
||||
* @returns {string} the stripped string
|
||||
*/
|
||||
function removeTrailingZeros(numberAsString) {
|
||||
for (let i = numberAsString.length - 1; i >= 0; i--) {
|
||||
if (numberAsString[i] !== "0") {
|
||||
return numberAsString.slice(0, i + 1);
|
||||
}
|
||||
}
|
||||
return numberAsString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an integer to an object containing the integer's coefficient and order of magnitude
|
||||
* @param {string} stringInteger the string representation of the integer being converted
|
||||
* @returns {ScientificNotation} the object containing the integer's coefficient and order of magnitude
|
||||
*/
|
||||
function normalizeInteger(stringInteger) {
|
||||
const trimmedInteger = removeLeadingZeros(stringInteger);
|
||||
const significantDigits = removeTrailingZeros(trimmedInteger);
|
||||
|
||||
return new ScientificNotation(significantDigits, trimmedInteger.length - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a float to an object containing the float's coefficient and order of magnitude
|
||||
* @param {string} stringFloat the string representation of the float being converted
|
||||
* @returns {ScientificNotation} the object containing the float's coefficient and order of magnitude
|
||||
*/
|
||||
function normalizeFloat(stringFloat) {
|
||||
const trimmedFloat = removeLeadingZeros(stringFloat);
|
||||
const indexOfDecimalPoint = trimmedFloat.indexOf(".");
|
||||
|
||||
switch (indexOfDecimalPoint) {
|
||||
case 0: {
|
||||
const significantDigits = removeLeadingZeros(trimmedFloat.slice(1));
|
||||
|
||||
return new ScientificNotation(
|
||||
significantDigits,
|
||||
significantDigits.length - trimmedFloat.length,
|
||||
);
|
||||
}
|
||||
case -1:
|
||||
return new ScientificNotation(
|
||||
trimmedFloat,
|
||||
trimmedFloat.length - 1,
|
||||
);
|
||||
default:
|
||||
return new ScientificNotation(
|
||||
trimmedFloat.replace(".", ""),
|
||||
indexOfDecimalPoint - 1,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a base ten number to proper scientific notation
|
||||
* @param {string} stringNumber the string representation of the base ten number to be converted
|
||||
* @param {boolean} parseAsFloat if true, the coefficient will be always parsed as a float, regardless of whether a decimal point is present
|
||||
* @returns {ScientificNotation} the object containing the number's coefficient and order of magnitude
|
||||
*/
|
||||
function convertNumberToScientificNotation(stringNumber, parseAsFloat) {
|
||||
const splitNumber = stringNumber.split("e");
|
||||
const originalCoefficient = splitNumber[0];
|
||||
const normalizedNumber =
|
||||
parseAsFloat || stringNumber.includes(".")
|
||||
? normalizeFloat(originalCoefficient)
|
||||
: normalizeInteger(originalCoefficient);
|
||||
if (splitNumber.length > 1) {
|
||||
normalizedNumber.magnitude += parseInt(splitNumber[1], 10);
|
||||
}
|
||||
|
||||
return normalizedNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type
|
||||
* @param {Node} node the node being evaluated
|
||||
* @returns {boolean} true if they do not match
|
||||
*/
|
||||
function baseTenLosesPrecision(node) {
|
||||
const rawNumber = getRaw(node).toLowerCase();
|
||||
const normalizedRawNumber = convertNumberToScientificNotation(
|
||||
rawNumber,
|
||||
false,
|
||||
);
|
||||
const requestedPrecision = normalizedRawNumber.coefficient.length;
|
||||
|
||||
if (requestedPrecision > 100) {
|
||||
return true;
|
||||
}
|
||||
const storedNumber = node.value.toPrecision(requestedPrecision);
|
||||
const normalizedStoredNumber = convertNumberToScientificNotation(
|
||||
storedNumber,
|
||||
true,
|
||||
);
|
||||
|
||||
return (
|
||||
normalizedRawNumber.magnitude !== normalizedStoredNumber.magnitude ||
|
||||
normalizedRawNumber.coefficient !== normalizedStoredNumber.coefficient
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks that the user-intended number equals the actual number after is has been converted to the Number type
|
||||
* @param {Node} node the node being evaluated
|
||||
* @returns {boolean} true if they do not match
|
||||
*/
|
||||
function losesPrecision(node) {
|
||||
return isBaseTen(node)
|
||||
? baseTenLosesPrecision(node)
|
||||
: notBaseTenLosesPrecision(node);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../types').Rule.RuleModule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "problem",
|
||||
|
||||
docs: {
|
||||
description: "Disallow literal numbers that lose precision",
|
||||
dialects: ["JavaScript", "TypeScript"],
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-loss-of-precision",
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
noLossOfPrecision:
|
||||
"This number literal will lose precision at runtime.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
Literal(node) {
|
||||
if (node.value && isNumber(node) && losesPrecision(node)) {
|
||||
context.report({
|
||||
messageId: "noLossOfPrecision",
|
||||
node,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,648 @@
|
||||
'use strict';
|
||||
|
||||
const { Writable } = require('stream');
|
||||
|
||||
const PerMessageDeflate = require('./permessage-deflate');
|
||||
const {
|
||||
BINARY_TYPES,
|
||||
EMPTY_BUFFER,
|
||||
kStatusCode,
|
||||
kWebSocket
|
||||
} = require('./constants');
|
||||
const { concat, toArrayBuffer, unmask } = require('./buffer-util');
|
||||
const { isValidStatusCode, isValidUTF8 } = require('./validation');
|
||||
|
||||
const GET_INFO = 0;
|
||||
const GET_PAYLOAD_LENGTH_16 = 1;
|
||||
const GET_PAYLOAD_LENGTH_64 = 2;
|
||||
const GET_MASK = 3;
|
||||
const GET_DATA = 4;
|
||||
const INFLATING = 5;
|
||||
|
||||
/**
|
||||
* HyBi Receiver implementation.
|
||||
*
|
||||
* @extends Writable
|
||||
*/
|
||||
class Receiver extends Writable {
|
||||
/**
|
||||
* Creates a Receiver instance.
|
||||
*
|
||||
* @param {String} [binaryType=nodebuffer] The type for binary data
|
||||
* @param {Object} [extensions] An object containing the negotiated extensions
|
||||
* @param {Boolean} [isServer=false] Specifies whether to operate in client or
|
||||
* server mode
|
||||
* @param {Number} [maxPayload=0] The maximum allowed message length
|
||||
* @param {Number} [maxBufferedChunks=0] The maximum number of
|
||||
* buffered data chunks
|
||||
* @param {Number} [maxFragments=0] The maximum number of message
|
||||
* fragments
|
||||
*/
|
||||
constructor(
|
||||
binaryType,
|
||||
extensions,
|
||||
isServer,
|
||||
maxPayload,
|
||||
maxBufferedChunks,
|
||||
maxFragments
|
||||
) {
|
||||
super();
|
||||
|
||||
this._binaryType = binaryType || BINARY_TYPES[0];
|
||||
this[kWebSocket] = undefined;
|
||||
this._extensions = extensions || {};
|
||||
this._isServer = !!isServer;
|
||||
this._maxBufferedChunks = maxBufferedChunks | 0;
|
||||
this._maxFragments = maxFragments | 0;
|
||||
this._maxPayload = maxPayload | 0;
|
||||
|
||||
this._bufferedBytes = 0;
|
||||
this._buffers = [];
|
||||
|
||||
this._compressed = false;
|
||||
this._payloadLength = 0;
|
||||
this._mask = undefined;
|
||||
this._fragmented = 0;
|
||||
this._masked = false;
|
||||
this._fin = false;
|
||||
this._opcode = 0;
|
||||
|
||||
this._totalPayloadLength = 0;
|
||||
this._messageLength = 0;
|
||||
this._numFragments = 0;
|
||||
this._fragments = [];
|
||||
|
||||
this._state = GET_INFO;
|
||||
this._loop = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements `Writable.prototype._write()`.
|
||||
*
|
||||
* @param {Buffer} chunk The chunk of data to write
|
||||
* @param {String} encoding The character encoding of `chunk`
|
||||
* @param {Function} cb Callback
|
||||
* @private
|
||||
*/
|
||||
_write(chunk, encoding, cb) {
|
||||
if (this._opcode === 0x08 && this._state == GET_INFO) return cb();
|
||||
|
||||
if (
|
||||
this._maxBufferedChunks > 0 &&
|
||||
this._buffers.length >= this._maxBufferedChunks
|
||||
) {
|
||||
return cb(
|
||||
error(
|
||||
RangeError,
|
||||
'Too many buffered chunks',
|
||||
false,
|
||||
1008,
|
||||
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
this._bufferedBytes += chunk.length;
|
||||
this._buffers.push(chunk);
|
||||
this.startLoop(cb);
|
||||
}
|
||||
|
||||
/**
|
||||
* Consumes `n` bytes from the buffered data.
|
||||
*
|
||||
* @param {Number} n The number of bytes to consume
|
||||
* @return {Buffer} The consumed bytes
|
||||
* @private
|
||||
*/
|
||||
consume(n) {
|
||||
this._bufferedBytes -= n;
|
||||
|
||||
if (n === this._buffers[0].length) return this._buffers.shift();
|
||||
|
||||
if (n < this._buffers[0].length) {
|
||||
const buf = this._buffers[0];
|
||||
this._buffers[0] = buf.slice(n);
|
||||
return buf.slice(0, n);
|
||||
}
|
||||
|
||||
const dst = Buffer.allocUnsafe(n);
|
||||
|
||||
do {
|
||||
const buf = this._buffers[0];
|
||||
const offset = dst.length - n;
|
||||
|
||||
if (n >= buf.length) {
|
||||
dst.set(this._buffers.shift(), offset);
|
||||
} else {
|
||||
dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);
|
||||
this._buffers[0] = buf.slice(n);
|
||||
}
|
||||
|
||||
n -= buf.length;
|
||||
} while (n > 0);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the parsing loop.
|
||||
*
|
||||
* @param {Function} cb Callback
|
||||
* @private
|
||||
*/
|
||||
startLoop(cb) {
|
||||
let err;
|
||||
this._loop = true;
|
||||
|
||||
do {
|
||||
switch (this._state) {
|
||||
case GET_INFO:
|
||||
err = this.getInfo();
|
||||
break;
|
||||
case GET_PAYLOAD_LENGTH_16:
|
||||
err = this.getPayloadLength16();
|
||||
break;
|
||||
case GET_PAYLOAD_LENGTH_64:
|
||||
err = this.getPayloadLength64();
|
||||
break;
|
||||
case GET_MASK:
|
||||
this.getMask();
|
||||
break;
|
||||
case GET_DATA:
|
||||
err = this.getData(cb);
|
||||
break;
|
||||
default:
|
||||
// `INFLATING`
|
||||
this._loop = false;
|
||||
return;
|
||||
}
|
||||
} while (this._loop);
|
||||
|
||||
cb(err);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the first two bytes of a frame.
|
||||
*
|
||||
* @return {(RangeError|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
getInfo() {
|
||||
if (this._bufferedBytes < 2) {
|
||||
this._loop = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const buf = this.consume(2);
|
||||
|
||||
if ((buf[0] & 0x30) !== 0x00) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'RSV2 and RSV3 must be clear',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_UNEXPECTED_RSV_2_3'
|
||||
);
|
||||
}
|
||||
|
||||
const compressed = (buf[0] & 0x40) === 0x40;
|
||||
|
||||
if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'RSV1 must be clear',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_UNEXPECTED_RSV_1'
|
||||
);
|
||||
}
|
||||
|
||||
this._fin = (buf[0] & 0x80) === 0x80;
|
||||
this._opcode = buf[0] & 0x0f;
|
||||
this._payloadLength = buf[1] & 0x7f;
|
||||
|
||||
if (this._opcode === 0x00) {
|
||||
if (compressed) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'RSV1 must be clear',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_UNEXPECTED_RSV_1'
|
||||
);
|
||||
}
|
||||
|
||||
if (!this._fragmented) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'invalid opcode 0',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_INVALID_OPCODE'
|
||||
);
|
||||
}
|
||||
|
||||
this._opcode = this._fragmented;
|
||||
} else if (this._opcode === 0x01 || this._opcode === 0x02) {
|
||||
if (this._fragmented) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
`invalid opcode ${this._opcode}`,
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_INVALID_OPCODE'
|
||||
);
|
||||
}
|
||||
|
||||
this._compressed = compressed;
|
||||
} else if (this._opcode > 0x07 && this._opcode < 0x0b) {
|
||||
if (!this._fin) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'FIN must be set',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_EXPECTED_FIN'
|
||||
);
|
||||
}
|
||||
|
||||
if (compressed) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'RSV1 must be clear',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_UNEXPECTED_RSV_1'
|
||||
);
|
||||
}
|
||||
|
||||
if (this._payloadLength > 0x7d) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
`invalid payload length ${this._payloadLength}`,
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
`invalid opcode ${this._opcode}`,
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_INVALID_OPCODE'
|
||||
);
|
||||
}
|
||||
|
||||
if (!this._fin && !this._fragmented) this._fragmented = this._opcode;
|
||||
this._masked = (buf[1] & 0x80) === 0x80;
|
||||
|
||||
if (this._isServer) {
|
||||
if (!this._masked) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'MASK must be set',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_EXPECTED_MASK'
|
||||
);
|
||||
}
|
||||
} else if (this._masked) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'MASK must be clear',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_UNEXPECTED_MASK'
|
||||
);
|
||||
}
|
||||
|
||||
if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;
|
||||
else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;
|
||||
else return this.haveLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets extended payload length (7+16).
|
||||
*
|
||||
* @return {(RangeError|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
getPayloadLength16() {
|
||||
if (this._bufferedBytes < 2) {
|
||||
this._loop = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this._payloadLength = this.consume(2).readUInt16BE(0);
|
||||
return this.haveLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets extended payload length (7+64).
|
||||
*
|
||||
* @return {(RangeError|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
getPayloadLength64() {
|
||||
if (this._bufferedBytes < 8) {
|
||||
this._loop = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const buf = this.consume(8);
|
||||
const num = buf.readUInt32BE(0);
|
||||
|
||||
//
|
||||
// The maximum safe integer in JavaScript is 2^53 - 1. An error is returned
|
||||
// if payload length is greater than this number.
|
||||
//
|
||||
if (num > Math.pow(2, 53 - 32) - 1) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'Unsupported WebSocket frame: payload length > 2^53 - 1',
|
||||
false,
|
||||
1009,
|
||||
'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'
|
||||
);
|
||||
}
|
||||
|
||||
this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);
|
||||
return this.haveLength();
|
||||
}
|
||||
|
||||
/**
|
||||
* Payload length has been read.
|
||||
*
|
||||
* @return {(RangeError|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
haveLength() {
|
||||
if (this._payloadLength && this._opcode < 0x08) {
|
||||
this._totalPayloadLength += this._payloadLength;
|
||||
if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'Max payload size exceeded',
|
||||
false,
|
||||
1009,
|
||||
'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (this._masked) this._state = GET_MASK;
|
||||
else this._state = GET_DATA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads mask bytes.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
getMask() {
|
||||
if (this._bufferedBytes < 4) {
|
||||
this._loop = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this._mask = this.consume(4);
|
||||
this._state = GET_DATA;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads data bytes.
|
||||
*
|
||||
* @param {Function} cb Callback
|
||||
* @return {(Error|RangeError|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
getData(cb) {
|
||||
let data = EMPTY_BUFFER;
|
||||
|
||||
if (this._payloadLength) {
|
||||
if (this._bufferedBytes < this._payloadLength) {
|
||||
this._loop = false;
|
||||
return;
|
||||
}
|
||||
|
||||
data = this.consume(this._payloadLength);
|
||||
if (this._masked) unmask(data, this._mask);
|
||||
}
|
||||
|
||||
if (this._opcode > 0x07) return this.controlMessage(data);
|
||||
|
||||
if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
RangeError,
|
||||
'Too many message fragments',
|
||||
false,
|
||||
1008,
|
||||
'WS_ERR_TOO_MANY_BUFFERED_PARTS'
|
||||
);
|
||||
}
|
||||
|
||||
if (this._compressed) {
|
||||
this._state = INFLATING;
|
||||
this.decompress(data, cb);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.length) {
|
||||
//
|
||||
// This message is not compressed so its lenght is the sum of the payload
|
||||
// length of all fragments.
|
||||
//
|
||||
this._messageLength = this._totalPayloadLength;
|
||||
this._fragments.push(data);
|
||||
}
|
||||
|
||||
return this.dataMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompresses data.
|
||||
*
|
||||
* @param {Buffer} data Compressed data
|
||||
* @param {Function} cb Callback
|
||||
* @private
|
||||
*/
|
||||
decompress(data, cb) {
|
||||
const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];
|
||||
|
||||
perMessageDeflate.decompress(data, this._fin, (err, buf) => {
|
||||
if (err) return cb(err);
|
||||
|
||||
if (buf.length) {
|
||||
this._messageLength += buf.length;
|
||||
if (this._messageLength > this._maxPayload && this._maxPayload > 0) {
|
||||
return cb(
|
||||
error(
|
||||
RangeError,
|
||||
'Max payload size exceeded',
|
||||
false,
|
||||
1009,
|
||||
'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
this._fragments.push(buf);
|
||||
}
|
||||
|
||||
const er = this.dataMessage();
|
||||
if (er) return cb(er);
|
||||
|
||||
this.startLoop(cb);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a data message.
|
||||
*
|
||||
* @return {(Error|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
dataMessage() {
|
||||
if (this._fin) {
|
||||
const messageLength = this._messageLength;
|
||||
const fragments = this._fragments;
|
||||
|
||||
this._totalPayloadLength = 0;
|
||||
this._messageLength = 0;
|
||||
this._fragmented = 0;
|
||||
this._numFragments = 0;
|
||||
this._fragments = [];
|
||||
|
||||
if (this._opcode === 2) {
|
||||
let data;
|
||||
|
||||
if (this._binaryType === 'nodebuffer') {
|
||||
data = concat(fragments, messageLength);
|
||||
} else if (this._binaryType === 'arraybuffer') {
|
||||
data = toArrayBuffer(concat(fragments, messageLength));
|
||||
} else {
|
||||
data = fragments;
|
||||
}
|
||||
|
||||
this.emit('message', data);
|
||||
} else {
|
||||
const buf = concat(fragments, messageLength);
|
||||
|
||||
if (!isValidUTF8(buf)) {
|
||||
this._loop = false;
|
||||
return error(
|
||||
Error,
|
||||
'invalid UTF-8 sequence',
|
||||
true,
|
||||
1007,
|
||||
'WS_ERR_INVALID_UTF8'
|
||||
);
|
||||
}
|
||||
|
||||
this.emit('message', buf.toString());
|
||||
}
|
||||
}
|
||||
|
||||
this._state = GET_INFO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles a control message.
|
||||
*
|
||||
* @param {Buffer} data Data to handle
|
||||
* @return {(Error|RangeError|undefined)} A possible error
|
||||
* @private
|
||||
*/
|
||||
controlMessage(data) {
|
||||
if (this._opcode === 0x08) {
|
||||
this._loop = false;
|
||||
|
||||
if (data.length === 0) {
|
||||
this.emit('conclude', 1005, '');
|
||||
this.end();
|
||||
} else if (data.length === 1) {
|
||||
return error(
|
||||
RangeError,
|
||||
'invalid payload length 1',
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'
|
||||
);
|
||||
} else {
|
||||
const code = data.readUInt16BE(0);
|
||||
|
||||
if (!isValidStatusCode(code)) {
|
||||
return error(
|
||||
RangeError,
|
||||
`invalid status code ${code}`,
|
||||
true,
|
||||
1002,
|
||||
'WS_ERR_INVALID_CLOSE_CODE'
|
||||
);
|
||||
}
|
||||
|
||||
const buf = data.slice(2);
|
||||
|
||||
if (!isValidUTF8(buf)) {
|
||||
return error(
|
||||
Error,
|
||||
'invalid UTF-8 sequence',
|
||||
true,
|
||||
1007,
|
||||
'WS_ERR_INVALID_UTF8'
|
||||
);
|
||||
}
|
||||
|
||||
this.emit('conclude', code, buf.toString());
|
||||
this.end();
|
||||
}
|
||||
} else if (this._opcode === 0x09) {
|
||||
this.emit('ping', data);
|
||||
} else {
|
||||
this.emit('pong', data);
|
||||
}
|
||||
|
||||
this._state = GET_INFO;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Receiver;
|
||||
|
||||
/**
|
||||
* Builds an error object.
|
||||
*
|
||||
* @param {function(new:Error|RangeError)} ErrorCtor The error constructor
|
||||
* @param {String} message The error message
|
||||
* @param {Boolean} prefix Specifies whether or not to add a default prefix to
|
||||
* `message`
|
||||
* @param {Number} statusCode The status code
|
||||
* @param {String} errorCode The exposed error code
|
||||
* @return {(Error|RangeError)} The error
|
||||
* @private
|
||||
*/
|
||||
function error(ErrorCtor, message, prefix, statusCode, errorCode) {
|
||||
const err = new ErrorCtor(
|
||||
prefix ? `Invalid WebSocket frame: ${message}` : message
|
||||
);
|
||||
|
||||
Error.captureStackTrace(err, error);
|
||||
err.code = errorCode;
|
||||
err[kStatusCode] = statusCode;
|
||||
return err;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
function _regeneratorKeys(e) {
|
||||
var n = Object(e),
|
||||
r = [];
|
||||
for (var t in n) r.unshift(t);
|
||||
return function e() {
|
||||
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
|
||||
return e.done = !0, e;
|
||||
};
|
||||
}
|
||||
export { _regeneratorKeys as default };
|
||||
@@ -0,0 +1,189 @@
|
||||
import Document from './document.js'
|
||||
import { SourceMap } from './postcss.js'
|
||||
import Processor from './processor.js'
|
||||
import Result, { Message, ResultOptions } from './result.js'
|
||||
import Root from './root.js'
|
||||
import Warning from './warning.js'
|
||||
|
||||
declare namespace LazyResult {
|
||||
export { LazyResult_ as default }
|
||||
}
|
||||
|
||||
/**
|
||||
* A Promise proxy for the result of PostCSS transformations.
|
||||
*
|
||||
* A `LazyResult` instance is returned by `Processor#process`.
|
||||
*
|
||||
* ```js
|
||||
* const lazy = postcss([autoprefixer]).process(css)
|
||||
* ```
|
||||
*/
|
||||
declare class LazyResult_<RootNode = Document | Root> implements PromiseLike<
|
||||
Result<RootNode>
|
||||
> {
|
||||
/**
|
||||
* Processes input CSS through synchronous and asynchronous plugins
|
||||
* and calls onRejected for each error thrown in any plugin.
|
||||
*
|
||||
* It implements standard Promise API.
|
||||
*
|
||||
* ```js
|
||||
* postcss([autoprefixer]).process(css).then(result => {
|
||||
* console.log(result.css)
|
||||
* }).catch(error => {
|
||||
* console.error(error)
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
catch: Promise<Result<RootNode>>['catch']
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous and asynchronous plugins
|
||||
* and calls onFinally on any error or when all plugins will finish work.
|
||||
*
|
||||
* It implements standard Promise API.
|
||||
*
|
||||
* ```js
|
||||
* postcss([autoprefixer]).process(css).finally(() => {
|
||||
* console.log('processing ended')
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
finally: Promise<Result<RootNode>>['finally']
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous and asynchronous plugins
|
||||
* and calls `onFulfilled` with a Result instance. If a plugin throws
|
||||
* an error, the `onRejected` callback will be executed.
|
||||
*
|
||||
* It implements standard Promise API.
|
||||
*
|
||||
* ```js
|
||||
* postcss([autoprefixer]).process(css, { from: cssPath }).then(result => {
|
||||
* console.log(result.css)
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
then: Promise<Result<RootNode>>['then']
|
||||
|
||||
/**
|
||||
* An alias for the `css` property. Use it with syntaxes
|
||||
* that generate non-CSS output.
|
||||
*
|
||||
* This property will only work with synchronous plugins.
|
||||
* If the processor contains any asynchronous plugins
|
||||
* it will throw an error.
|
||||
*
|
||||
* PostCSS runners should always use `LazyResult#then`.
|
||||
*/
|
||||
get content(): string
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous plugins, converts `Root`
|
||||
* to a CSS string and returns `Result#css`.
|
||||
*
|
||||
* This property will only work with synchronous plugins.
|
||||
* If the processor contains any asynchronous plugins
|
||||
* it will throw an error.
|
||||
*
|
||||
* PostCSS runners should always use `LazyResult#then`.
|
||||
*/
|
||||
get css(): string
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous plugins
|
||||
* and returns `Result#map`.
|
||||
*
|
||||
* This property will only work with synchronous plugins.
|
||||
* If the processor contains any asynchronous plugins
|
||||
* it will throw an error.
|
||||
*
|
||||
* PostCSS runners should always use `LazyResult#then`.
|
||||
*/
|
||||
get map(): SourceMap
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous plugins
|
||||
* and returns `Result#messages`.
|
||||
*
|
||||
* This property will only work with synchronous plugins. If the processor
|
||||
* contains any asynchronous plugins it will throw an error.
|
||||
*
|
||||
* PostCSS runners should always use `LazyResult#then`.
|
||||
*/
|
||||
get messages(): Message[]
|
||||
|
||||
/**
|
||||
* Options from the `Processor#process` call.
|
||||
*/
|
||||
get opts(): ResultOptions
|
||||
|
||||
/**
|
||||
* Returns a `Processor` instance, which will be used
|
||||
* for CSS transformations.
|
||||
*/
|
||||
get processor(): Processor
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous plugins
|
||||
* and returns `Result#root`.
|
||||
*
|
||||
* This property will only work with synchronous plugins. If the processor
|
||||
* contains any asynchronous plugins it will throw an error.
|
||||
*
|
||||
* PostCSS runners should always use `LazyResult#then`.
|
||||
*/
|
||||
get root(): RootNode
|
||||
|
||||
/**
|
||||
* Returns the default string description of an object.
|
||||
* Required to implement the Promise interface.
|
||||
*/
|
||||
get [Symbol.toStringTag](): string
|
||||
|
||||
/**
|
||||
* @param processor Processor used for this transformation.
|
||||
* @param css CSS to parse and transform.
|
||||
* @param opts Options from the `Processor#process` or `Root#toResult`.
|
||||
*/
|
||||
constructor(processor: Processor, css: string, opts: ResultOptions)
|
||||
|
||||
/**
|
||||
* Run plugin in async way and return `Result`.
|
||||
*
|
||||
* @return Result with output content.
|
||||
*/
|
||||
async(): Promise<Result<RootNode>>
|
||||
|
||||
/**
|
||||
* Run plugin in sync way and return `Result`.
|
||||
*
|
||||
* @return Result with output content.
|
||||
*/
|
||||
sync(): Result<RootNode>
|
||||
|
||||
/**
|
||||
* Alias for the `LazyResult#css` property.
|
||||
*
|
||||
* ```js
|
||||
* lazy + '' === lazy.css
|
||||
* ```
|
||||
*
|
||||
* @return Output CSS.
|
||||
*/
|
||||
toString(): string
|
||||
|
||||
/**
|
||||
* Processes input CSS through synchronous plugins
|
||||
* and calls `Result#warnings`.
|
||||
*
|
||||
* @return Warnings from plugins.
|
||||
*/
|
||||
warnings(): Warning[]
|
||||
}
|
||||
|
||||
declare class LazyResult<
|
||||
RootNode = Document | Root
|
||||
> extends LazyResult_<RootNode> {}
|
||||
|
||||
export = LazyResult
|
||||
@@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
const warning = require('process-warning')()
|
||||
module.exports = warning
|
||||
|
||||
// const warnName = 'PinoWarning'
|
||||
|
||||
// warning.create(warnName, 'PINODEP010', 'A new deprecation')
|
||||
@@ -0,0 +1 @@
|
||||
export { _ as default } from "../esm/_class_static_private_field_destructure.js";
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hkdf.js","sourceRoot":"","sources":["src/hkdf.ts"],"names":[],"mappings":";;;AAeA,0BAOC;AAYD,wBA4BC;AA9DD;;;;GAIG;AACH,uCAAiC;AACjC,yCAAoF;AAEpF;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY;IAC3D,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,kEAAkE;IAClE,sDAAsD;IACtD,+CAA+C;IAC/C,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,IAAA,cAAI,EAAC,IAAI,EAAE,IAAA,kBAAO,EAAC,IAAI,CAAC,EAAE,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1D,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;AAErD;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,IAAW,EAAE,GAAU,EAAE,IAAY,EAAE,SAAiB,EAAE;IAC/E,IAAA,gBAAK,EAAC,IAAI,CAAC,CAAC;IACZ,IAAA,kBAAO,EAAC,MAAM,CAAC,CAAC;IAChB,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5B,IAAI,MAAM,GAAG,GAAG,GAAG,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAC5E,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,IAAI,IAAI,KAAK,SAAS;QAAE,IAAI,GAAG,YAAY,CAAC;IAC5C,6BAA6B;IAC7B,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,sCAAsC;IACtC,MAAM,IAAI,GAAG,cAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;IAClC,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QAClD,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC,CAAC;QAC9B,oCAAoC;QACpC,2CAA2C;QAC3C,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aAC7C,MAAM,CAAC,IAAI,CAAC;aACZ,MAAM,CAAC,YAAY,CAAC;aACpB,UAAU,CAAC,CAAC,CAAC,CAAC;QACjB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC,OAAO,EAAE,CAAC;IACf,OAAO,CAAC,OAAO,EAAE,CAAC;IAClB,IAAA,gBAAK,EAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IACvB,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACI,MAAM,IAAI,GAAG,CAClB,IAAW,EACX,GAAU,EACV,IAAuB,EACvB,IAAuB,EACvB,MAAc,EACF,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AANzD,QAAA,IAAI,QAMqD"}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABILITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
/// <reference lib="es2015.iterable" />
|
||||
|
||||
interface Generator<T = unknown, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
||||
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
||||
next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
|
||||
return(value: TReturn): IteratorResult<T, TReturn>;
|
||||
throw(e: any): IteratorResult<T, TReturn>;
|
||||
[Symbol.iterator](): Generator<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
interface GeneratorFunction {
|
||||
/**
|
||||
* Creates a new Generator object.
|
||||
* @param args A list of arguments the function accepts.
|
||||
*/
|
||||
new (...args: any[]): Generator;
|
||||
/**
|
||||
* Creates a new Generator object.
|
||||
* @param args A list of arguments the function accepts.
|
||||
*/
|
||||
(...args: any[]): Generator;
|
||||
/**
|
||||
* The length of the arguments.
|
||||
*/
|
||||
readonly length: number;
|
||||
/**
|
||||
* Returns the name of the function.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* A reference to the prototype.
|
||||
*/
|
||||
readonly prototype: Generator;
|
||||
}
|
||||
|
||||
interface GeneratorFunctionConstructor {
|
||||
/**
|
||||
* Creates a new Generator function.
|
||||
* @param args A list of arguments the function accepts.
|
||||
*/
|
||||
new (...args: string[]): GeneratorFunction;
|
||||
/**
|
||||
* Creates a new Generator function.
|
||||
* @param args A list of arguments the function accepts.
|
||||
*/
|
||||
(...args: string[]): GeneratorFunction;
|
||||
/**
|
||||
* The length of the arguments.
|
||||
*/
|
||||
readonly length: number;
|
||||
/**
|
||||
* Returns the name of the function.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* A reference to the prototype.
|
||||
*/
|
||||
readonly prototype: GeneratorFunction;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*! *****************************************************************************
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
this file except in compliance with the License. You may obtain a copy of the
|
||||
License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
||||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
||||
MERCHANTABLITY OR NON-INFRINGEMENT.
|
||||
|
||||
See the Apache Version 2.0 License for specific language governing permissions
|
||||
and limitations under the License.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
interface Int8ArrayConstructor {
|
||||
new (): Int8Array;
|
||||
}
|
||||
|
||||
interface Uint8ArrayConstructor {
|
||||
new (): Uint8Array;
|
||||
}
|
||||
|
||||
interface Uint8ClampedArrayConstructor {
|
||||
new (): Uint8ClampedArray;
|
||||
}
|
||||
|
||||
interface Int16ArrayConstructor {
|
||||
new (): Int16Array;
|
||||
}
|
||||
|
||||
interface Uint16ArrayConstructor {
|
||||
new (): Uint16Array;
|
||||
}
|
||||
|
||||
interface Int32ArrayConstructor {
|
||||
new (): Int32Array;
|
||||
}
|
||||
|
||||
interface Uint32ArrayConstructor {
|
||||
new (): Uint32Array;
|
||||
}
|
||||
|
||||
interface Float32ArrayConstructor {
|
||||
new (): Float32Array;
|
||||
}
|
||||
|
||||
interface Float64ArrayConstructor {
|
||||
new (): Float64Array;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import { t as require_binding } from "./binding-Zhafd14U.mjs";
|
||||
//#region src/types/sourcemap.ts
|
||||
function bindingifySourcemap(map) {
|
||||
if (map == null) return;
|
||||
return { inner: typeof map === "string" ? map : {
|
||||
file: map.file ?? void 0,
|
||||
mappings: map.mappings,
|
||||
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
||||
sources: map.sources?.map((s) => s ?? void 0),
|
||||
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
||||
names: map.names,
|
||||
x_google_ignoreList: map.x_google_ignoreList,
|
||||
debugId: "debugId" in map ? map.debugId : void 0
|
||||
} };
|
||||
}
|
||||
require_binding();
|
||||
function unwrapBindingResult(container) {
|
||||
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
||||
return container;
|
||||
}
|
||||
function normalizeBindingResult(container) {
|
||||
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
||||
return container;
|
||||
}
|
||||
function normalizeBindingError(e) {
|
||||
return e.type === "JsError" ? e.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
||||
code: e.field0.kind,
|
||||
kind: e.field0.kind,
|
||||
message: e.field0.message,
|
||||
id: e.field0.id,
|
||||
exporter: e.field0.exporter,
|
||||
loc: e.field0.loc,
|
||||
pos: e.field0.pos,
|
||||
stack: void 0
|
||||
});
|
||||
}
|
||||
function aggregateBindingErrorsIntoJsError(rawErrors) {
|
||||
const errors = rawErrors.map(normalizeBindingError);
|
||||
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
||||
for (let i = 0; i < errors.length; i++) {
|
||||
summary += "\n";
|
||||
if (i >= 5) {
|
||||
summary += "...";
|
||||
break;
|
||||
}
|
||||
summary += getErrorMessage(errors[i]);
|
||||
}
|
||||
const wrapper = new Error(summary);
|
||||
Object.defineProperty(wrapper, "errors", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => errors,
|
||||
set: (value) => Object.defineProperty(wrapper, "errors", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value
|
||||
})
|
||||
});
|
||||
return wrapper;
|
||||
}
|
||||
function getErrorMessage(e) {
|
||||
if (Object.hasOwn(e, "kind")) return e.message;
|
||||
let s = "";
|
||||
if (e.plugin) s += `[plugin ${e.plugin}]`;
|
||||
const id = e.id ?? e.loc?.file;
|
||||
if (id) {
|
||||
s += " " + id;
|
||||
if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
|
||||
}
|
||||
if (s) s += "\n";
|
||||
const message = `${e.name ?? "Error"}: ${e.message}`;
|
||||
s += message;
|
||||
if (e.frame) s = joinNewLine(s, e.frame);
|
||||
if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
|
||||
if (e.cause) {
|
||||
s = joinNewLine(s, "Caused by:");
|
||||
s = joinNewLine(s, getErrorMessage(e.cause).split("\n").map((line) => " " + line).join("\n"));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
function joinNewLine(s1, s2) {
|
||||
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
||||
}
|
||||
//#endregion
|
||||
export { bindingifySourcemap as a, unwrapBindingResult as i, normalizeBindingError as n, normalizeBindingResult as r, aggregateBindingErrorsIntoJsError as t };
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "json-buffer",
|
||||
"description": "JSON parse & stringify that supports binary via bops & base64",
|
||||
"version": "3.0.1",
|
||||
"homepage": "https://github.com/dominictarr/json-buffer",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/dominictarr/json-buffer.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tape": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "set -e; for t in test/*.js; do node $t; done"
|
||||
},
|
||||
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)",
|
||||
"license": "MIT",
|
||||
"testling": {
|
||||
"files": "test/*.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/17..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/22..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"main": "../../cjs/_is_native_function.cjs",
|
||||
"module": "../../esm/_is_native_function.js"
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
'use strict'
|
||||
|
||||
// We do not expect amazing numbers from `pino-pretty` as the whole purpose
|
||||
// of the module is a very slow operation. However, this benchmark should give
|
||||
// us some guidance on how features, or code changes, will affect the
|
||||
// performance of the module.
|
||||
|
||||
const bench = require('fastbench')
|
||||
const {
|
||||
prettyFactory
|
||||
} = require('./index')
|
||||
|
||||
const max = 10
|
||||
const tstampMillis = 1693401358754
|
||||
|
||||
/* eslint-disable no-var */
|
||||
const run = bench([
|
||||
function basicLog (cb) {
|
||||
const pretty = prettyFactory({})
|
||||
const input = `{"time":${tstampMillis},"pid":1,"hostname":"foo","msg":"benchmark","foo":"foo","bar":{"bar":"bar"}}\n`
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
},
|
||||
|
||||
function objectLog (cb) {
|
||||
const pretty = prettyFactory({})
|
||||
const input = {
|
||||
time: tstampMillis,
|
||||
pid: 1,
|
||||
hostname: 'foo',
|
||||
msg: 'benchmark',
|
||||
foo: 'foo',
|
||||
bar: { bar: 'bar' }
|
||||
}
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
},
|
||||
|
||||
function coloredLog (cb) {
|
||||
const pretty = prettyFactory({ colorize: true })
|
||||
const input = `{"time":${tstampMillis},"pid":1,"hostname":"foo","msg":"benchmark","foo":"foo","bar":{"bar":"bar"}}\n`
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
},
|
||||
|
||||
function customPrettifiers (cb) {
|
||||
const pretty = prettyFactory({
|
||||
customPrettifiers: {
|
||||
time (tstamp) {
|
||||
return tstamp
|
||||
},
|
||||
pid () {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
})
|
||||
const input = `{"time":${tstampMillis},"pid":1,"hostname":"foo","msg":"benchmark","foo":"foo","bar":{"bar":"bar"}}\n`
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
},
|
||||
|
||||
function logWithErrorObject (cb) {
|
||||
const pretty = prettyFactory({})
|
||||
const err = Error('boom')
|
||||
const input = `{"time":${tstampMillis},"pid":1,"hostname":"foo","msg":"benchmark","foo":"foo","bar":{"bar":"bar"},"err":{"message":"${err.message}","stack":"${err.stack}"}}\n`
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
},
|
||||
|
||||
function logRemappedMsgErrKeys (cb) {
|
||||
const pretty = prettyFactory({
|
||||
messageKey: 'message',
|
||||
errorLikeObjectKeys: ['myError']
|
||||
})
|
||||
const err = Error('boom')
|
||||
const input = `{"time":${tstampMillis},"pid":1,"hostname":"foo","message":"benchmark","foo":"foo","bar":{"bar":"bar"},"myError":{"message":"${err.message}","stack":"${err.stack}"}}\n`
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
},
|
||||
|
||||
function messageFormatString (cb) {
|
||||
const pretty = prettyFactory({
|
||||
messageFormat: '{levelLabel}{if pid} {pid} - {end}{msg}'
|
||||
})
|
||||
const input = `{"time":${tstampMillis},"pid":1,"hostname":"foo","msg":"benchmark","foo":"foo","bar":{"bar":"bar"}}\n`
|
||||
for (var i = 0; i < max; i += 1) {
|
||||
pretty(input)
|
||||
}
|
||||
setImmediate(cb)
|
||||
}
|
||||
], 10000)
|
||||
|
||||
run(run)
|
||||
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* @fileoverview Common error classes
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
/**
|
||||
* Error thrown when a file or directory is not found.
|
||||
*/
|
||||
export class NotFoundError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Error thrown when an operation is not permitted.
|
||||
*/
|
||||
export class PermissionError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Error thrown when an operation is not allowed on a directory.
|
||||
*/
|
||||
export class DirectoryError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
/**
|
||||
* Error thrown when a directory is not empty.
|
||||
*/
|
||||
export class NotEmptyError extends Error {
|
||||
/**
|
||||
* Creates a new instance.
|
||||
* @param {string} message The error message.
|
||||
*/
|
||||
constructor(message: string);
|
||||
/**
|
||||
* Error code.
|
||||
* @type {string}
|
||||
*/
|
||||
code: string;
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
declare module "node:readline/promises" {
|
||||
import { Abortable } from "node:events";
|
||||
import {
|
||||
CompleterResult,
|
||||
Direction,
|
||||
Interface as _Interface,
|
||||
ReadLineOptions as _ReadLineOptions,
|
||||
} from "node:readline";
|
||||
/**
|
||||
* Instances of the `readlinePromises.Interface` class are constructed using the `readlinePromises.createInterface()` method. Every instance is associated with a
|
||||
* single `input` `Readable` stream and a single `output` `Writable` stream.
|
||||
* The `output` stream is used to print prompts for user input that arrives on,
|
||||
* and is read from, the `input` stream.
|
||||
* @since v17.0.0
|
||||
*/
|
||||
class Interface extends _Interface {
|
||||
/**
|
||||
* The `rl.question()` method displays the `query` by writing it to the `output`,
|
||||
* waits for user input to be provided on `input`, then invokes the `callback` function passing the provided input as the first argument.
|
||||
*
|
||||
* When called, `rl.question()` will resume the `input` stream if it has been
|
||||
* paused.
|
||||
*
|
||||
* If the `Interface` was created with `output` set to `null` or `undefined` the `query` is not written.
|
||||
*
|
||||
* If the question is called after `rl.close()`, it returns a rejected promise.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* ```js
|
||||
* const answer = await rl.question('What is your favorite food? ');
|
||||
* console.log(`Oh, so your favorite food is ${answer}`);
|
||||
* ```
|
||||
*
|
||||
* Using an `AbortSignal` to cancel a question.
|
||||
*
|
||||
* ```js
|
||||
* const signal = AbortSignal.timeout(10_000);
|
||||
*
|
||||
* signal.addEventListener('abort', () => {
|
||||
* console.log('The food question timed out');
|
||||
* }, { once: true });
|
||||
*
|
||||
* const answer = await rl.question('What is your favorite food? ', { signal });
|
||||
* console.log(`Oh, so your favorite food is ${answer}`);
|
||||
* ```
|
||||
* @since v17.0.0
|
||||
* @param query A statement or query to write to `output`, prepended to the prompt.
|
||||
* @return A promise that is fulfilled with the user's input in response to the `query`.
|
||||
*/
|
||||
question(query: string): Promise<string>;
|
||||
question(query: string, options: Abortable): Promise<string>;
|
||||
}
|
||||
/**
|
||||
* @since v17.0.0
|
||||
*/
|
||||
class Readline {
|
||||
/**
|
||||
* @param stream A TTY stream.
|
||||
*/
|
||||
constructor(
|
||||
stream: NodeJS.WritableStream,
|
||||
options?: {
|
||||
autoCommit?: boolean | undefined;
|
||||
},
|
||||
);
|
||||
/**
|
||||
* The `rl.clearLine()` method adds to the internal list of pending action an
|
||||
* action that clears current line of the associated `stream` in a specified
|
||||
* direction identified by `dir`.
|
||||
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
|
||||
* @since v17.0.0
|
||||
* @return this
|
||||
*/
|
||||
clearLine(dir: Direction): this;
|
||||
/**
|
||||
* The `rl.clearScreenDown()` method adds to the internal list of pending action an
|
||||
* action that clears the associated stream from the current position of the
|
||||
* cursor down.
|
||||
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
|
||||
* @since v17.0.0
|
||||
* @return this
|
||||
*/
|
||||
clearScreenDown(): this;
|
||||
/**
|
||||
* The `rl.commit()` method sends all the pending actions to the associated `stream` and clears the internal list of pending actions.
|
||||
* @since v17.0.0
|
||||
*/
|
||||
commit(): Promise<void>;
|
||||
/**
|
||||
* The `rl.cursorTo()` method adds to the internal list of pending action an action
|
||||
* that moves cursor to the specified position in the associated `stream`.
|
||||
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
|
||||
* @since v17.0.0
|
||||
* @return this
|
||||
*/
|
||||
cursorTo(x: number, y?: number): this;
|
||||
/**
|
||||
* The `rl.moveCursor()` method adds to the internal list of pending action an
|
||||
* action that moves the cursor _relative_ to its current position in the
|
||||
* associated `stream`.
|
||||
* Call `rl.commit()` to see the effect of this method, unless `autoCommit: true` was passed to the constructor.
|
||||
* @since v17.0.0
|
||||
* @return this
|
||||
*/
|
||||
moveCursor(dx: number, dy: number): this;
|
||||
/**
|
||||
* The `rl.rollback` methods clears the internal list of pending actions without
|
||||
* sending it to the associated `stream`.
|
||||
* @since v17.0.0
|
||||
* @return this
|
||||
*/
|
||||
rollback(): this;
|
||||
}
|
||||
type Completer = (line: string) => CompleterResult | Promise<CompleterResult>;
|
||||
interface ReadLineOptions extends Omit<_ReadLineOptions, "completer"> {
|
||||
/**
|
||||
* An optional function used for Tab autocompletion.
|
||||
*/
|
||||
completer?: Completer | undefined;
|
||||
}
|
||||
/**
|
||||
* The `readlinePromises.createInterface()` method creates a new `readlinePromises.Interface` instance.
|
||||
*
|
||||
* ```js
|
||||
* import readlinePromises from 'node:readline/promises';
|
||||
* const rl = readlinePromises.createInterface({
|
||||
* input: process.stdin,
|
||||
* output: process.stdout,
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Once the `readlinePromises.Interface` instance is created, the most common case
|
||||
* is to listen for the `'line'` event:
|
||||
*
|
||||
* ```js
|
||||
* rl.on('line', (line) => {
|
||||
* console.log(`Received: ${line}`);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* If `terminal` is `true` for this instance then the `output` stream will get
|
||||
* the best compatibility if it defines an `output.columns` property and emits
|
||||
* a `'resize'` event on the `output` if or when the columns ever change
|
||||
* (`process.stdout` does this automatically when it is a TTY).
|
||||
* @since v17.0.0
|
||||
*/
|
||||
function createInterface(
|
||||
input: NodeJS.ReadableStream,
|
||||
output?: NodeJS.WritableStream,
|
||||
completer?: Completer,
|
||||
terminal?: boolean,
|
||||
): Interface;
|
||||
function createInterface(options: ReadLineOptions): Interface;
|
||||
}
|
||||
declare module "readline/promises" {
|
||||
export * from "node:readline/promises";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
var test = require('tape');
|
||||
var stringify = require('../');
|
||||
|
||||
test('custom comparison function', function (t) {
|
||||
t.plan(1);
|
||||
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
|
||||
var s = stringify(obj, function (a, b) {
|
||||
return a.key < b.key ? 1 : -1;
|
||||
});
|
||||
t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}');
|
||||
});
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* @fileoverview Define the cursor which iterates tokens and comments in reverse.
|
||||
* @author Toru Nagashima
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const Cursor = require("./cursor");
|
||||
const utils = require("./utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Exports
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* The cursor which iterates tokens and comments in reverse.
|
||||
*/
|
||||
module.exports = class BackwardTokenCommentCursor extends Cursor {
|
||||
/**
|
||||
* Initializes this cursor.
|
||||
* @param {Token[]} tokens The array of tokens.
|
||||
* @param {Comment[]} comments The array of comments.
|
||||
* @param {Object} indexMap The map from locations to indices in `tokens`.
|
||||
* @param {number} startLoc The start location of the iteration range.
|
||||
* @param {number} endLoc The end location of the iteration range.
|
||||
*/
|
||||
constructor(tokens, comments, indexMap, startLoc, endLoc) {
|
||||
super();
|
||||
this.tokens = tokens;
|
||||
this.comments = comments;
|
||||
this.tokenIndex = utils.getLastIndex(tokens, indexMap, endLoc);
|
||||
this.commentIndex = utils.search(comments, endLoc) - 1;
|
||||
this.border = startLoc;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
moveNext() {
|
||||
const token =
|
||||
this.tokenIndex >= 0 ? this.tokens[this.tokenIndex] : null;
|
||||
const comment =
|
||||
this.commentIndex >= 0 ? this.comments[this.commentIndex] : null;
|
||||
|
||||
if (token && (!comment || token.range[1] > comment.range[1])) {
|
||||
this.current = token;
|
||||
this.tokenIndex -= 1;
|
||||
} else if (comment) {
|
||||
this.current = comment;
|
||||
this.commentIndex -= 1;
|
||||
} else {
|
||||
this.current = null;
|
||||
}
|
||||
|
||||
return (
|
||||
Boolean(this.current) &&
|
||||
(this.border === -1 || this.current.range[0] >= this.border)
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
import * as core from "../core/index.js";
|
||||
import { $ZodError } from "../core/index.js";
|
||||
import * as util from "../core/util.js";
|
||||
|
||||
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
|
||||
export type ZodIssue = core.$ZodIssue;
|
||||
|
||||
/** An Error-like class used to store Zod validation issues. */
|
||||
export interface ZodError<T = unknown> extends $ZodError<T> {
|
||||
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
||||
format(): core.$ZodFormattedError<T>;
|
||||
format<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFormattedError<T, U>;
|
||||
/** @deprecated Use the `z.treeifyError(err)` function instead. */
|
||||
flatten(): core.$ZodFlattenedError<T>;
|
||||
flatten<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFlattenedError<T, U>;
|
||||
/** @deprecated Push directly to `.issues` instead. */
|
||||
addIssue(issue: core.$ZodIssue): void;
|
||||
/** @deprecated Push directly to `.issues` instead. */
|
||||
addIssues(issues: core.$ZodIssue[]): void;
|
||||
|
||||
/** @deprecated Check `err.issues.length === 0` instead. */
|
||||
isEmpty: boolean;
|
||||
}
|
||||
|
||||
const initializer = (inst: ZodError, issues: core.$ZodIssue[]) => {
|
||||
$ZodError.init(inst, issues);
|
||||
inst.name = "ZodError";
|
||||
Object.defineProperties(inst, {
|
||||
format: {
|
||||
value: (mapper: any) => core.formatError(inst, mapper),
|
||||
// enumerable: false,
|
||||
},
|
||||
flatten: {
|
||||
value: (mapper: any) => core.flattenError(inst, mapper),
|
||||
// enumerable: false,
|
||||
},
|
||||
addIssue: {
|
||||
value: (issue: any) => {
|
||||
inst.issues.push(issue);
|
||||
inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);
|
||||
},
|
||||
// enumerable: false,
|
||||
},
|
||||
addIssues: {
|
||||
value: (issues: any) => {
|
||||
inst.issues.push(...issues);
|
||||
inst.message = JSON.stringify(inst.issues, util.jsonStringifyReplacer, 2);
|
||||
},
|
||||
// enumerable: false,
|
||||
},
|
||||
isEmpty: {
|
||||
get() {
|
||||
return inst.issues.length === 0;
|
||||
},
|
||||
// enumerable: false,
|
||||
},
|
||||
});
|
||||
// Object.defineProperty(inst, "isEmpty", {
|
||||
// get() {
|
||||
// return inst.issues.length === 0;
|
||||
// },
|
||||
// });
|
||||
};
|
||||
export const ZodError: core.$constructor<ZodError> = /*@__PURE__*/ core.$constructor("ZodError", initializer);
|
||||
export const ZodRealError: core.$constructor<ZodError> = /*@__PURE__*/ core.$constructor("ZodError", initializer, {
|
||||
Parent: Error,
|
||||
});
|
||||
|
||||
export type {
|
||||
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
|
||||
$ZodFlattenedError as ZodFlattenedError,
|
||||
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
|
||||
$ZodFormattedError as ZodFormattedError,
|
||||
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
|
||||
$ZodErrorMap as ZodErrorMap,
|
||||
} from "../core/index.js";
|
||||
|
||||
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
|
||||
export type IssueData = core.$ZodRawIssue;
|
||||
|
||||
// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
|
||||
// export type ErrorMapCtx = core.$ZodErrorMapCtx;
|
||||
@@ -0,0 +1 @@
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).uuidValidate=t()}(this,(function(){"use strict";var e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;return function(t){return"string"==typeof t&&e.test(t)}}));
|
||||
@@ -0,0 +1,842 @@
|
||||
"use strict";
|
||||
// THIS CODE WAS AUTOMATICALLY GENERATED
|
||||
// DO NOT EDIT THIS CODE BY HAND
|
||||
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
|
||||
// npx nx generate-lib repo
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.webworker = void 0;
|
||||
const base_config_1 = require("./base-config");
|
||||
const es2015_1 = require("./es2015");
|
||||
const es2018_asynciterable_1 = require("./es2018.asynciterable");
|
||||
exports.webworker = {
|
||||
libs: [es2015_1.es2015, es2018_asynciterable_1.es2018_asynciterable],
|
||||
variables: [
|
||||
['AacEncoderConfig', base_config_1.TYPE],
|
||||
['AddEventListenerOptions', base_config_1.TYPE],
|
||||
['AesCbcParams', base_config_1.TYPE],
|
||||
['AesCtrParams', base_config_1.TYPE],
|
||||
['AesDerivedKeyParams', base_config_1.TYPE],
|
||||
['AesGcmParams', base_config_1.TYPE],
|
||||
['AesKeyAlgorithm', base_config_1.TYPE],
|
||||
['AesKeyGenParams', base_config_1.TYPE],
|
||||
['Algorithm', base_config_1.TYPE],
|
||||
['AudioConfiguration', base_config_1.TYPE],
|
||||
['AudioDataCopyToOptions', base_config_1.TYPE],
|
||||
['AudioDataInit', base_config_1.TYPE],
|
||||
['AudioDecoderConfig', base_config_1.TYPE],
|
||||
['AudioDecoderInit', base_config_1.TYPE],
|
||||
['AudioDecoderSupport', base_config_1.TYPE],
|
||||
['AudioEncoderConfig', base_config_1.TYPE],
|
||||
['AudioEncoderInit', base_config_1.TYPE],
|
||||
['AudioEncoderSupport', base_config_1.TYPE],
|
||||
['AvcEncoderConfig', base_config_1.TYPE],
|
||||
['BlobPropertyBag', base_config_1.TYPE],
|
||||
['CSSMatrixComponentOptions', base_config_1.TYPE],
|
||||
['CSSNumericType', base_config_1.TYPE],
|
||||
['CacheQueryOptions', base_config_1.TYPE],
|
||||
['ClientQueryOptions', base_config_1.TYPE],
|
||||
['CloseEventInit', base_config_1.TYPE],
|
||||
['CookieInit', base_config_1.TYPE],
|
||||
['CookieListItem', base_config_1.TYPE],
|
||||
['CookieStoreDeleteOptions', base_config_1.TYPE],
|
||||
['CookieStoreGetOptions', base_config_1.TYPE],
|
||||
['CryptoKeyPair', base_config_1.TYPE],
|
||||
['CustomEventInit', base_config_1.TYPE],
|
||||
['DOMMatrix2DInit', base_config_1.TYPE],
|
||||
['DOMMatrixInit', base_config_1.TYPE],
|
||||
['DOMPointInit', base_config_1.TYPE],
|
||||
['DOMQuadInit', base_config_1.TYPE],
|
||||
['DOMRectInit', base_config_1.TYPE],
|
||||
['EcKeyGenParams', base_config_1.TYPE],
|
||||
['EcKeyImportParams', base_config_1.TYPE],
|
||||
['EcdhKeyDeriveParams', base_config_1.TYPE],
|
||||
['EcdsaParams', base_config_1.TYPE],
|
||||
['EncodedAudioChunkInit', base_config_1.TYPE],
|
||||
['EncodedAudioChunkMetadata', base_config_1.TYPE],
|
||||
['EncodedVideoChunkInit', base_config_1.TYPE],
|
||||
['EncodedVideoChunkMetadata', base_config_1.TYPE],
|
||||
['ErrorEventInit', base_config_1.TYPE],
|
||||
['EventInit', base_config_1.TYPE],
|
||||
['EventListenerOptions', base_config_1.TYPE],
|
||||
['EventSourceInit', base_config_1.TYPE],
|
||||
['ExtendableCookieChangeEventInit', base_config_1.TYPE],
|
||||
['ExtendableEventInit', base_config_1.TYPE],
|
||||
['ExtendableMessageEventInit', base_config_1.TYPE],
|
||||
['FetchEventInit', base_config_1.TYPE],
|
||||
['FilePropertyBag', base_config_1.TYPE],
|
||||
['FileSystemCreateWritableOptions', base_config_1.TYPE],
|
||||
['FileSystemGetDirectoryOptions', base_config_1.TYPE],
|
||||
['FileSystemGetFileOptions', base_config_1.TYPE],
|
||||
['FileSystemReadWriteOptions', base_config_1.TYPE],
|
||||
['FileSystemRemoveOptions', base_config_1.TYPE],
|
||||
['FontFaceDescriptors', base_config_1.TYPE],
|
||||
['FontFaceSetLoadEventInit', base_config_1.TYPE],
|
||||
['GPUBindGroupDescriptor', base_config_1.TYPE],
|
||||
['GPUBindGroupEntry', base_config_1.TYPE],
|
||||
['GPUBindGroupLayoutDescriptor', base_config_1.TYPE],
|
||||
['GPUBindGroupLayoutEntry', base_config_1.TYPE],
|
||||
['GPUBlendComponent', base_config_1.TYPE],
|
||||
['GPUBlendState', base_config_1.TYPE],
|
||||
['GPUBufferBinding', base_config_1.TYPE],
|
||||
['GPUBufferBindingLayout', base_config_1.TYPE],
|
||||
['GPUBufferDescriptor', base_config_1.TYPE],
|
||||
['GPUCanvasConfiguration', base_config_1.TYPE],
|
||||
['GPUCanvasToneMapping', base_config_1.TYPE],
|
||||
['GPUColorDict', base_config_1.TYPE],
|
||||
['GPUColorTargetState', base_config_1.TYPE],
|
||||
['GPUCommandBufferDescriptor', base_config_1.TYPE],
|
||||
['GPUCommandEncoderDescriptor', base_config_1.TYPE],
|
||||
['GPUComputePassDescriptor', base_config_1.TYPE],
|
||||
['GPUComputePassTimestampWrites', base_config_1.TYPE],
|
||||
['GPUComputePipelineDescriptor', base_config_1.TYPE],
|
||||
['GPUCopyExternalImageDestInfo', base_config_1.TYPE],
|
||||
['GPUCopyExternalImageSourceInfo', base_config_1.TYPE],
|
||||
['GPUDepthStencilState', base_config_1.TYPE],
|
||||
['GPUDeviceDescriptor', base_config_1.TYPE],
|
||||
['GPUExtent3DDict', base_config_1.TYPE],
|
||||
['GPUExternalTextureBindingLayout', base_config_1.TYPE],
|
||||
['GPUExternalTextureDescriptor', base_config_1.TYPE],
|
||||
['GPUFragmentState', base_config_1.TYPE],
|
||||
['GPUMultisampleState', base_config_1.TYPE],
|
||||
['GPUObjectDescriptorBase', base_config_1.TYPE],
|
||||
['GPUOrigin2DDict', base_config_1.TYPE],
|
||||
['GPUOrigin3DDict', base_config_1.TYPE],
|
||||
['GPUPipelineDescriptorBase', base_config_1.TYPE],
|
||||
['GPUPipelineErrorInit', base_config_1.TYPE],
|
||||
['GPUPipelineLayoutDescriptor', base_config_1.TYPE],
|
||||
['GPUPrimitiveState', base_config_1.TYPE],
|
||||
['GPUProgrammableStage', base_config_1.TYPE],
|
||||
['GPUQuerySetDescriptor', base_config_1.TYPE],
|
||||
['GPUQueueDescriptor', base_config_1.TYPE],
|
||||
['GPURenderBundleDescriptor', base_config_1.TYPE],
|
||||
['GPURenderBundleEncoderDescriptor', base_config_1.TYPE],
|
||||
['GPURenderPassColorAttachment', base_config_1.TYPE],
|
||||
['GPURenderPassDepthStencilAttachment', base_config_1.TYPE],
|
||||
['GPURenderPassDescriptor', base_config_1.TYPE],
|
||||
['GPURenderPassLayout', base_config_1.TYPE],
|
||||
['GPURenderPassTimestampWrites', base_config_1.TYPE],
|
||||
['GPURenderPipelineDescriptor', base_config_1.TYPE],
|
||||
['GPURequestAdapterOptions', base_config_1.TYPE],
|
||||
['GPUSamplerBindingLayout', base_config_1.TYPE],
|
||||
['GPUSamplerDescriptor', base_config_1.TYPE],
|
||||
['GPUShaderModuleDescriptor', base_config_1.TYPE],
|
||||
['GPUStencilFaceState', base_config_1.TYPE],
|
||||
['GPUStorageTextureBindingLayout', base_config_1.TYPE],
|
||||
['GPUTexelCopyBufferInfo', base_config_1.TYPE],
|
||||
['GPUTexelCopyBufferLayout', base_config_1.TYPE],
|
||||
['GPUTexelCopyTextureInfo', base_config_1.TYPE],
|
||||
['GPUTextureBindingLayout', base_config_1.TYPE],
|
||||
['GPUTextureDescriptor', base_config_1.TYPE],
|
||||
['GPUTextureViewDescriptor', base_config_1.TYPE],
|
||||
['GPUUncapturedErrorEventInit', base_config_1.TYPE],
|
||||
['GPUVertexAttribute', base_config_1.TYPE],
|
||||
['GPUVertexBufferLayout', base_config_1.TYPE],
|
||||
['GPUVertexState', base_config_1.TYPE],
|
||||
['GetNotificationOptions', base_config_1.TYPE],
|
||||
['HkdfParams', base_config_1.TYPE],
|
||||
['HmacImportParams', base_config_1.TYPE],
|
||||
['HmacKeyGenParams', base_config_1.TYPE],
|
||||
['IDBDatabaseInfo', base_config_1.TYPE],
|
||||
['IDBIndexParameters', base_config_1.TYPE],
|
||||
['IDBObjectStoreParameters', base_config_1.TYPE],
|
||||
['IDBTransactionOptions', base_config_1.TYPE],
|
||||
['IDBVersionChangeEventInit', base_config_1.TYPE],
|
||||
['ImageBitmapOptions', base_config_1.TYPE],
|
||||
['ImageBitmapRenderingContextSettings', base_config_1.TYPE],
|
||||
['ImageDataSettings', base_config_1.TYPE],
|
||||
['ImageDecodeOptions', base_config_1.TYPE],
|
||||
['ImageDecodeResult', base_config_1.TYPE],
|
||||
['ImageDecoderInit', base_config_1.TYPE],
|
||||
['ImageEncodeOptions', base_config_1.TYPE],
|
||||
['JsonWebKey', base_config_1.TYPE],
|
||||
['KeyAlgorithm', base_config_1.TYPE],
|
||||
['KeySystemTrackConfiguration', base_config_1.TYPE],
|
||||
['LockInfo', base_config_1.TYPE],
|
||||
['LockManagerSnapshot', base_config_1.TYPE],
|
||||
['LockOptions', base_config_1.TYPE],
|
||||
['MediaCapabilitiesDecodingInfo', base_config_1.TYPE],
|
||||
['MediaCapabilitiesEncodingInfo', base_config_1.TYPE],
|
||||
['MediaCapabilitiesInfo', base_config_1.TYPE],
|
||||
['MediaCapabilitiesKeySystemConfiguration', base_config_1.TYPE],
|
||||
['MediaConfiguration', base_config_1.TYPE],
|
||||
['MediaDecodingConfiguration', base_config_1.TYPE],
|
||||
['MediaEncodingConfiguration', base_config_1.TYPE],
|
||||
['MediaStreamTrackProcessorInit', base_config_1.TYPE],
|
||||
['MessageEventInit', base_config_1.TYPE],
|
||||
['MultiCacheQueryOptions', base_config_1.TYPE],
|
||||
['NavigationPreloadState', base_config_1.TYPE],
|
||||
['NotificationEventInit', base_config_1.TYPE],
|
||||
['NotificationOptions', base_config_1.TYPE],
|
||||
['OpusEncoderConfig', base_config_1.TYPE],
|
||||
['Pbkdf2Params', base_config_1.TYPE],
|
||||
['PerformanceMarkOptions', base_config_1.TYPE],
|
||||
['PerformanceMeasureOptions', base_config_1.TYPE],
|
||||
['PerformanceObserverInit', base_config_1.TYPE],
|
||||
['PermissionDescriptor', base_config_1.TYPE],
|
||||
['PlaneLayout', base_config_1.TYPE],
|
||||
['ProgressEventInit', base_config_1.TYPE],
|
||||
['PromiseRejectionEventInit', base_config_1.TYPE],
|
||||
['PushEventInit', base_config_1.TYPE],
|
||||
['PushSubscriptionChangeEventInit', base_config_1.TYPE],
|
||||
['PushSubscriptionJSON', base_config_1.TYPE],
|
||||
['PushSubscriptionOptionsInit', base_config_1.TYPE],
|
||||
['QueuingStrategy', base_config_1.TYPE],
|
||||
['QueuingStrategyInit', base_config_1.TYPE],
|
||||
['RTCEncodedAudioFrameMetadata', base_config_1.TYPE],
|
||||
['RTCEncodedFrameMetadata', base_config_1.TYPE],
|
||||
['RTCEncodedVideoFrameMetadata', base_config_1.TYPE],
|
||||
['ReadableStreamBYOBReaderReadOptions', base_config_1.TYPE],
|
||||
['ReadableStreamGetReaderOptions', base_config_1.TYPE],
|
||||
['ReadableStreamIteratorOptions', base_config_1.TYPE],
|
||||
['ReadableStreamReadDoneResult', base_config_1.TYPE],
|
||||
['ReadableStreamReadValueResult', base_config_1.TYPE],
|
||||
['ReadableWritablePair', base_config_1.TYPE],
|
||||
['RegistrationOptions', base_config_1.TYPE],
|
||||
['Report', base_config_1.TYPE],
|
||||
['ReportBody', base_config_1.TYPE],
|
||||
['ReportingObserverOptions', base_config_1.TYPE],
|
||||
['RequestInit', base_config_1.TYPE],
|
||||
['ResponseInit', base_config_1.TYPE],
|
||||
['RsaHashedImportParams', base_config_1.TYPE],
|
||||
['RsaHashedKeyGenParams', base_config_1.TYPE],
|
||||
['RsaKeyGenParams', base_config_1.TYPE],
|
||||
['RsaOaepParams', base_config_1.TYPE],
|
||||
['RsaOtherPrimesInfo', base_config_1.TYPE],
|
||||
['RsaPssParams', base_config_1.TYPE],
|
||||
['SchedulerPostTaskOptions', base_config_1.TYPE],
|
||||
['SecurityPolicyViolationEventInit', base_config_1.TYPE],
|
||||
['StorageEstimate', base_config_1.TYPE],
|
||||
['StreamPipeOptions', base_config_1.TYPE],
|
||||
['StructuredSerializeOptions', base_config_1.TYPE],
|
||||
['SvcOutputMetadata', base_config_1.TYPE],
|
||||
['TaskControllerInit', base_config_1.TYPE],
|
||||
['TaskPriorityChangeEventInit', base_config_1.TYPE],
|
||||
['TaskSignalAnyInit', base_config_1.TYPE],
|
||||
['TextDecodeOptions', base_config_1.TYPE],
|
||||
['TextDecoderOptions', base_config_1.TYPE],
|
||||
['TextEncoderEncodeIntoResult', base_config_1.TYPE],
|
||||
['Transformer', base_config_1.TYPE],
|
||||
['URLPatternComponentResult', base_config_1.TYPE],
|
||||
['URLPatternInit', base_config_1.TYPE],
|
||||
['URLPatternOptions', base_config_1.TYPE],
|
||||
['URLPatternResult', base_config_1.TYPE],
|
||||
['UnderlyingByteSource', base_config_1.TYPE],
|
||||
['UnderlyingDefaultSource', base_config_1.TYPE],
|
||||
['UnderlyingSink', base_config_1.TYPE],
|
||||
['UnderlyingSource', base_config_1.TYPE],
|
||||
['VideoColorSpaceInit', base_config_1.TYPE],
|
||||
['VideoConfiguration', base_config_1.TYPE],
|
||||
['VideoDecoderConfig', base_config_1.TYPE],
|
||||
['VideoDecoderInit', base_config_1.TYPE],
|
||||
['VideoDecoderSupport', base_config_1.TYPE],
|
||||
['VideoEncoderConfig', base_config_1.TYPE],
|
||||
['VideoEncoderEncodeOptions', base_config_1.TYPE],
|
||||
['VideoEncoderEncodeOptionsForAvc', base_config_1.TYPE],
|
||||
['VideoEncoderInit', base_config_1.TYPE],
|
||||
['VideoEncoderSupport', base_config_1.TYPE],
|
||||
['VideoFrameBufferInit', base_config_1.TYPE],
|
||||
['VideoFrameCopyToOptions', base_config_1.TYPE],
|
||||
['VideoFrameInit', base_config_1.TYPE],
|
||||
['WebGLContextAttributes', base_config_1.TYPE],
|
||||
['WebGLContextEventInit', base_config_1.TYPE],
|
||||
['WebTransportCloseInfo', base_config_1.TYPE],
|
||||
['WebTransportErrorOptions', base_config_1.TYPE],
|
||||
['WebTransportHash', base_config_1.TYPE],
|
||||
['WebTransportOptions', base_config_1.TYPE],
|
||||
['WebTransportSendOptions', base_config_1.TYPE],
|
||||
['WebTransportSendStreamOptions', base_config_1.TYPE],
|
||||
['WorkerOptions', base_config_1.TYPE],
|
||||
['WriteParams', base_config_1.TYPE],
|
||||
['ANGLE_instanced_arrays', base_config_1.TYPE],
|
||||
['AbortController', base_config_1.TYPE_VALUE],
|
||||
['AbortSignalEventMap', base_config_1.TYPE],
|
||||
['AbortSignal', base_config_1.TYPE_VALUE],
|
||||
['AbstractWorkerEventMap', base_config_1.TYPE],
|
||||
['AbstractWorker', base_config_1.TYPE],
|
||||
['AnimationFrameProvider', base_config_1.TYPE],
|
||||
['AudioData', base_config_1.TYPE_VALUE],
|
||||
['AudioDecoderEventMap', base_config_1.TYPE],
|
||||
['AudioDecoder', base_config_1.TYPE_VALUE],
|
||||
['AudioEncoderEventMap', base_config_1.TYPE],
|
||||
['AudioEncoder', base_config_1.TYPE_VALUE],
|
||||
['Blob', base_config_1.TYPE_VALUE],
|
||||
['Body', base_config_1.TYPE],
|
||||
['BroadcastChannelEventMap', base_config_1.TYPE],
|
||||
['BroadcastChannel', base_config_1.TYPE_VALUE],
|
||||
['ByteLengthQueuingStrategy', base_config_1.TYPE_VALUE],
|
||||
['CSSImageValue', base_config_1.TYPE_VALUE],
|
||||
['CSSKeywordValue', base_config_1.TYPE_VALUE],
|
||||
['CSSMathClamp', base_config_1.TYPE_VALUE],
|
||||
['CSSMathInvert', base_config_1.TYPE_VALUE],
|
||||
['CSSMathMax', base_config_1.TYPE_VALUE],
|
||||
['CSSMathMin', base_config_1.TYPE_VALUE],
|
||||
['CSSMathNegate', base_config_1.TYPE_VALUE],
|
||||
['CSSMathProduct', base_config_1.TYPE_VALUE],
|
||||
['CSSMathSum', base_config_1.TYPE_VALUE],
|
||||
['CSSMathValue', base_config_1.TYPE_VALUE],
|
||||
['CSSMatrixComponent', base_config_1.TYPE_VALUE],
|
||||
['CSSNumericArray', base_config_1.TYPE_VALUE],
|
||||
['CSSNumericValue', base_config_1.TYPE_VALUE],
|
||||
['CSSPerspective', base_config_1.TYPE_VALUE],
|
||||
['CSSRotate', base_config_1.TYPE_VALUE],
|
||||
['CSSScale', base_config_1.TYPE_VALUE],
|
||||
['CSSSkew', base_config_1.TYPE_VALUE],
|
||||
['CSSSkewX', base_config_1.TYPE_VALUE],
|
||||
['CSSSkewY', base_config_1.TYPE_VALUE],
|
||||
['CSSStyleValue', base_config_1.TYPE_VALUE],
|
||||
['CSSTransformComponent', base_config_1.TYPE_VALUE],
|
||||
['CSSTransformValue', base_config_1.TYPE_VALUE],
|
||||
['CSSTranslate', base_config_1.TYPE_VALUE],
|
||||
['CSSUnitValue', base_config_1.TYPE_VALUE],
|
||||
['CSSUnparsedValue', base_config_1.TYPE_VALUE],
|
||||
['CSSVariableReferenceValue', base_config_1.TYPE_VALUE],
|
||||
['Cache', base_config_1.TYPE_VALUE],
|
||||
['CacheStorage', base_config_1.TYPE_VALUE],
|
||||
['CanvasCompositing', base_config_1.TYPE],
|
||||
['CanvasDrawImage', base_config_1.TYPE],
|
||||
['CanvasDrawPath', base_config_1.TYPE],
|
||||
['CanvasFillStrokeStyles', base_config_1.TYPE],
|
||||
['CanvasFilters', base_config_1.TYPE],
|
||||
['CanvasGradient', base_config_1.TYPE_VALUE],
|
||||
['CanvasImageData', base_config_1.TYPE],
|
||||
['CanvasImageSmoothing', base_config_1.TYPE],
|
||||
['CanvasPath', base_config_1.TYPE],
|
||||
['CanvasPathDrawingStyles', base_config_1.TYPE],
|
||||
['CanvasPattern', base_config_1.TYPE_VALUE],
|
||||
['CanvasRect', base_config_1.TYPE],
|
||||
['CanvasShadowStyles', base_config_1.TYPE],
|
||||
['CanvasState', base_config_1.TYPE],
|
||||
['CanvasText', base_config_1.TYPE],
|
||||
['CanvasTextDrawingStyles', base_config_1.TYPE],
|
||||
['CanvasTransform', base_config_1.TYPE],
|
||||
['Client', base_config_1.TYPE_VALUE],
|
||||
['Clients', base_config_1.TYPE_VALUE],
|
||||
['CloseEvent', base_config_1.TYPE_VALUE],
|
||||
['CompressionStream', base_config_1.TYPE_VALUE],
|
||||
['CookieStore', base_config_1.TYPE_VALUE],
|
||||
['CookieStoreManager', base_config_1.TYPE_VALUE],
|
||||
['CountQueuingStrategy', base_config_1.TYPE_VALUE],
|
||||
['Crypto', base_config_1.TYPE_VALUE],
|
||||
['CryptoKey', base_config_1.TYPE_VALUE],
|
||||
['CustomEvent', base_config_1.TYPE_VALUE],
|
||||
['DOMException', base_config_1.TYPE_VALUE],
|
||||
['DOMMatrix', base_config_1.TYPE_VALUE],
|
||||
['DOMMatrixReadOnly', base_config_1.TYPE_VALUE],
|
||||
['DOMPoint', base_config_1.TYPE_VALUE],
|
||||
['DOMPointReadOnly', base_config_1.TYPE_VALUE],
|
||||
['DOMQuad', base_config_1.TYPE_VALUE],
|
||||
['DOMRect', base_config_1.TYPE_VALUE],
|
||||
['DOMRectReadOnly', base_config_1.TYPE_VALUE],
|
||||
['DOMStringList', base_config_1.TYPE_VALUE],
|
||||
['DecompressionStream', base_config_1.TYPE_VALUE],
|
||||
['DedicatedWorkerGlobalScopeEventMap', base_config_1.TYPE],
|
||||
['DedicatedWorkerGlobalScope', base_config_1.TYPE_VALUE],
|
||||
['EXT_blend_minmax', base_config_1.TYPE],
|
||||
['EXT_color_buffer_float', base_config_1.TYPE],
|
||||
['EXT_color_buffer_half_float', base_config_1.TYPE],
|
||||
['EXT_float_blend', base_config_1.TYPE],
|
||||
['EXT_frag_depth', base_config_1.TYPE],
|
||||
['EXT_sRGB', base_config_1.TYPE],
|
||||
['EXT_shader_texture_lod', base_config_1.TYPE],
|
||||
['EXT_texture_compression_bptc', base_config_1.TYPE],
|
||||
['EXT_texture_compression_rgtc', base_config_1.TYPE],
|
||||
['EXT_texture_filter_anisotropic', base_config_1.TYPE],
|
||||
['EXT_texture_norm16', base_config_1.TYPE],
|
||||
['EncodedAudioChunk', base_config_1.TYPE_VALUE],
|
||||
['EncodedVideoChunk', base_config_1.TYPE_VALUE],
|
||||
['ErrorEvent', base_config_1.TYPE_VALUE],
|
||||
['Event', base_config_1.TYPE_VALUE],
|
||||
['EventListener', base_config_1.TYPE],
|
||||
['EventListenerObject', base_config_1.TYPE],
|
||||
['EventSourceEventMap', base_config_1.TYPE],
|
||||
['EventSource', base_config_1.TYPE_VALUE],
|
||||
['EventTarget', base_config_1.TYPE_VALUE],
|
||||
['ExtendableCookieChangeEvent', base_config_1.TYPE_VALUE],
|
||||
['ExtendableEvent', base_config_1.TYPE_VALUE],
|
||||
['ExtendableMessageEvent', base_config_1.TYPE_VALUE],
|
||||
['FetchEvent', base_config_1.TYPE_VALUE],
|
||||
['File', base_config_1.TYPE_VALUE],
|
||||
['FileList', base_config_1.TYPE_VALUE],
|
||||
['FileReaderEventMap', base_config_1.TYPE],
|
||||
['FileReader', base_config_1.TYPE_VALUE],
|
||||
['FileReaderSync', base_config_1.TYPE_VALUE],
|
||||
['FileSystemDirectoryHandle', base_config_1.TYPE_VALUE],
|
||||
['FileSystemFileHandle', base_config_1.TYPE_VALUE],
|
||||
['FileSystemHandle', base_config_1.TYPE_VALUE],
|
||||
['FileSystemSyncAccessHandle', base_config_1.TYPE_VALUE],
|
||||
['FileSystemWritableFileStream', base_config_1.TYPE_VALUE],
|
||||
['FontFace', base_config_1.TYPE_VALUE],
|
||||
['FontFaceSetEventMap', base_config_1.TYPE],
|
||||
['FontFaceSet', base_config_1.TYPE_VALUE],
|
||||
['FontFaceSetLoadEvent', base_config_1.TYPE_VALUE],
|
||||
['FontFaceSource', base_config_1.TYPE],
|
||||
['FormData', base_config_1.TYPE_VALUE],
|
||||
['GPU', base_config_1.TYPE_VALUE],
|
||||
['GPUAdapter', base_config_1.TYPE_VALUE],
|
||||
['GPUAdapterInfo', base_config_1.TYPE_VALUE],
|
||||
['GPUBindGroup', base_config_1.TYPE_VALUE],
|
||||
['GPUBindGroupLayout', base_config_1.TYPE_VALUE],
|
||||
['GPUBindingCommandsMixin', base_config_1.TYPE],
|
||||
['GPUBuffer', base_config_1.TYPE_VALUE],
|
||||
['GPUCanvasContext', base_config_1.TYPE_VALUE],
|
||||
['GPUCommandBuffer', base_config_1.TYPE_VALUE],
|
||||
['GPUCommandEncoder', base_config_1.TYPE_VALUE],
|
||||
['GPUCompilationInfo', base_config_1.TYPE_VALUE],
|
||||
['GPUCompilationMessage', base_config_1.TYPE_VALUE],
|
||||
['GPUComputePassEncoder', base_config_1.TYPE_VALUE],
|
||||
['GPUComputePipeline', base_config_1.TYPE_VALUE],
|
||||
['GPUDebugCommandsMixin', base_config_1.TYPE],
|
||||
['GPUDeviceEventMap', base_config_1.TYPE],
|
||||
['GPUDevice', base_config_1.TYPE_VALUE],
|
||||
['GPUDeviceLostInfo', base_config_1.TYPE_VALUE],
|
||||
['GPUError', base_config_1.TYPE_VALUE],
|
||||
['GPUExternalTexture', base_config_1.TYPE_VALUE],
|
||||
['GPUInternalError', base_config_1.TYPE_VALUE],
|
||||
['GPUObjectBase', base_config_1.TYPE],
|
||||
['GPUOutOfMemoryError', base_config_1.TYPE_VALUE],
|
||||
['GPUPipelineBase', base_config_1.TYPE],
|
||||
['GPUPipelineError', base_config_1.TYPE_VALUE],
|
||||
['GPUPipelineLayout', base_config_1.TYPE_VALUE],
|
||||
['GPUQuerySet', base_config_1.TYPE_VALUE],
|
||||
['GPUQueue', base_config_1.TYPE_VALUE],
|
||||
['GPURenderBundle', base_config_1.TYPE_VALUE],
|
||||
['GPURenderBundleEncoder', base_config_1.TYPE_VALUE],
|
||||
['GPURenderCommandsMixin', base_config_1.TYPE],
|
||||
['GPURenderPassEncoder', base_config_1.TYPE_VALUE],
|
||||
['GPURenderPipeline', base_config_1.TYPE_VALUE],
|
||||
['GPUSampler', base_config_1.TYPE_VALUE],
|
||||
['GPUShaderModule', base_config_1.TYPE_VALUE],
|
||||
['GPUSupportedFeatures', base_config_1.TYPE_VALUE],
|
||||
['GPUSupportedLimits', base_config_1.TYPE_VALUE],
|
||||
['GPUTexture', base_config_1.TYPE_VALUE],
|
||||
['GPUTextureView', base_config_1.TYPE_VALUE],
|
||||
['GPUUncapturedErrorEvent', base_config_1.TYPE_VALUE],
|
||||
['GPUValidationError', base_config_1.TYPE_VALUE],
|
||||
['GenericTransformStream', base_config_1.TYPE],
|
||||
['Headers', base_config_1.TYPE_VALUE],
|
||||
['IDBCursor', base_config_1.TYPE_VALUE],
|
||||
['IDBCursorWithValue', base_config_1.TYPE_VALUE],
|
||||
['IDBDatabaseEventMap', base_config_1.TYPE],
|
||||
['IDBDatabase', base_config_1.TYPE_VALUE],
|
||||
['IDBFactory', base_config_1.TYPE_VALUE],
|
||||
['IDBIndex', base_config_1.TYPE_VALUE],
|
||||
['IDBKeyRange', base_config_1.TYPE_VALUE],
|
||||
['IDBObjectStore', base_config_1.TYPE_VALUE],
|
||||
['IDBOpenDBRequestEventMap', base_config_1.TYPE],
|
||||
['IDBOpenDBRequest', base_config_1.TYPE_VALUE],
|
||||
['IDBRequestEventMap', base_config_1.TYPE],
|
||||
['IDBRequest', base_config_1.TYPE_VALUE],
|
||||
['IDBTransactionEventMap', base_config_1.TYPE],
|
||||
['IDBTransaction', base_config_1.TYPE_VALUE],
|
||||
['IDBVersionChangeEvent', base_config_1.TYPE_VALUE],
|
||||
['ImageBitmap', base_config_1.TYPE_VALUE],
|
||||
['ImageBitmapRenderingContext', base_config_1.TYPE_VALUE],
|
||||
['ImageData', base_config_1.TYPE_VALUE],
|
||||
['ImageDecoder', base_config_1.TYPE_VALUE],
|
||||
['ImageTrack', base_config_1.TYPE_VALUE],
|
||||
['ImageTrackList', base_config_1.TYPE_VALUE],
|
||||
['ImportMeta', base_config_1.TYPE],
|
||||
['KHR_parallel_shader_compile', base_config_1.TYPE],
|
||||
['Lock', base_config_1.TYPE_VALUE],
|
||||
['LockManager', base_config_1.TYPE_VALUE],
|
||||
['MediaCapabilities', base_config_1.TYPE_VALUE],
|
||||
['MediaSourceHandle', base_config_1.TYPE_VALUE],
|
||||
['MediaStreamTrackProcessor', base_config_1.TYPE_VALUE],
|
||||
['MessageChannel', base_config_1.TYPE_VALUE],
|
||||
['MessageEvent', base_config_1.TYPE_VALUE],
|
||||
['MessageEventTargetEventMap', base_config_1.TYPE],
|
||||
['MessageEventTarget', base_config_1.TYPE],
|
||||
['MessagePortEventMap', base_config_1.TYPE],
|
||||
['MessagePort', base_config_1.TYPE_VALUE],
|
||||
['NavigationPreloadManager', base_config_1.TYPE_VALUE],
|
||||
['NavigatorBadge', base_config_1.TYPE],
|
||||
['NavigatorConcurrentHardware', base_config_1.TYPE],
|
||||
['NavigatorGPU', base_config_1.TYPE],
|
||||
['NavigatorID', base_config_1.TYPE],
|
||||
['NavigatorLanguage', base_config_1.TYPE],
|
||||
['NavigatorLocks', base_config_1.TYPE],
|
||||
['NavigatorOnLine', base_config_1.TYPE],
|
||||
['NavigatorStorage', base_config_1.TYPE],
|
||||
['NotificationEventMap', base_config_1.TYPE],
|
||||
['Notification', base_config_1.TYPE_VALUE],
|
||||
['NotificationEvent', base_config_1.TYPE_VALUE],
|
||||
['OES_draw_buffers_indexed', base_config_1.TYPE],
|
||||
['OES_element_index_uint', base_config_1.TYPE],
|
||||
['OES_fbo_render_mipmap', base_config_1.TYPE],
|
||||
['OES_standard_derivatives', base_config_1.TYPE],
|
||||
['OES_texture_float', base_config_1.TYPE],
|
||||
['OES_texture_float_linear', base_config_1.TYPE],
|
||||
['OES_texture_half_float', base_config_1.TYPE],
|
||||
['OES_texture_half_float_linear', base_config_1.TYPE],
|
||||
['OES_vertex_array_object', base_config_1.TYPE],
|
||||
['OVR_multiview2', base_config_1.TYPE],
|
||||
['OffscreenCanvasEventMap', base_config_1.TYPE],
|
||||
['OffscreenCanvas', base_config_1.TYPE_VALUE],
|
||||
['OffscreenCanvasRenderingContext2D', base_config_1.TYPE_VALUE],
|
||||
['Path2D', base_config_1.TYPE_VALUE],
|
||||
['PerformanceEventMap', base_config_1.TYPE],
|
||||
['Performance', base_config_1.TYPE_VALUE],
|
||||
['PerformanceEntry', base_config_1.TYPE_VALUE],
|
||||
['PerformanceMark', base_config_1.TYPE_VALUE],
|
||||
['PerformanceMeasure', base_config_1.TYPE_VALUE],
|
||||
['PerformanceObserver', base_config_1.TYPE_VALUE],
|
||||
['PerformanceObserverEntryList', base_config_1.TYPE_VALUE],
|
||||
['PerformanceResourceTiming', base_config_1.TYPE_VALUE],
|
||||
['PerformanceServerTiming', base_config_1.TYPE_VALUE],
|
||||
['PermissionStatusEventMap', base_config_1.TYPE],
|
||||
['PermissionStatus', base_config_1.TYPE_VALUE],
|
||||
['Permissions', base_config_1.TYPE_VALUE],
|
||||
['ProgressEvent', base_config_1.TYPE_VALUE],
|
||||
['PromiseRejectionEvent', base_config_1.TYPE_VALUE],
|
||||
['PushEvent', base_config_1.TYPE_VALUE],
|
||||
['PushManager', base_config_1.TYPE_VALUE],
|
||||
['PushManagerAttribute', base_config_1.TYPE],
|
||||
['PushMessageData', base_config_1.TYPE_VALUE],
|
||||
['PushSubscription', base_config_1.TYPE_VALUE],
|
||||
['PushSubscriptionChangeEvent', base_config_1.TYPE_VALUE],
|
||||
['PushSubscriptionOptions', base_config_1.TYPE_VALUE],
|
||||
['RTCDataChannelEventMap', base_config_1.TYPE],
|
||||
['RTCDataChannel', base_config_1.TYPE_VALUE],
|
||||
['RTCEncodedAudioFrame', base_config_1.TYPE_VALUE],
|
||||
['RTCEncodedVideoFrame', base_config_1.TYPE_VALUE],
|
||||
['RTCRtpScriptTransformer', base_config_1.TYPE_VALUE],
|
||||
['RTCTransformEvent', base_config_1.TYPE_VALUE],
|
||||
['ReadableByteStreamController', base_config_1.TYPE_VALUE],
|
||||
['ReadableStream', base_config_1.TYPE_VALUE],
|
||||
['ReadableStreamBYOBReader', base_config_1.TYPE_VALUE],
|
||||
['ReadableStreamBYOBRequest', base_config_1.TYPE_VALUE],
|
||||
['ReadableStreamDefaultController', base_config_1.TYPE_VALUE],
|
||||
['ReadableStreamDefaultReader', base_config_1.TYPE_VALUE],
|
||||
['ReadableStreamGenericReader', base_config_1.TYPE],
|
||||
['ReportingObserver', base_config_1.TYPE_VALUE],
|
||||
['Request', base_config_1.TYPE_VALUE],
|
||||
['Response', base_config_1.TYPE_VALUE],
|
||||
['Scheduler', base_config_1.TYPE_VALUE],
|
||||
['SecurityPolicyViolationEvent', base_config_1.TYPE_VALUE],
|
||||
['ServiceWorkerEventMap', base_config_1.TYPE],
|
||||
['ServiceWorker', base_config_1.TYPE_VALUE],
|
||||
['ServiceWorkerContainerEventMap', base_config_1.TYPE],
|
||||
['ServiceWorkerContainer', base_config_1.TYPE_VALUE],
|
||||
['ServiceWorkerGlobalScopeEventMap', base_config_1.TYPE],
|
||||
['ServiceWorkerGlobalScope', base_config_1.TYPE_VALUE],
|
||||
['ServiceWorkerRegistrationEventMap', base_config_1.TYPE],
|
||||
['ServiceWorkerRegistration', base_config_1.TYPE_VALUE],
|
||||
['SharedWorkerGlobalScopeEventMap', base_config_1.TYPE],
|
||||
['SharedWorkerGlobalScope', base_config_1.TYPE_VALUE],
|
||||
['StorageManager', base_config_1.TYPE_VALUE],
|
||||
['StylePropertyMapReadOnly', base_config_1.TYPE_VALUE],
|
||||
['SubtleCrypto', base_config_1.TYPE_VALUE],
|
||||
['TaskController', base_config_1.TYPE_VALUE],
|
||||
['TaskPriorityChangeEvent', base_config_1.TYPE_VALUE],
|
||||
['TaskSignalEventMap', base_config_1.TYPE],
|
||||
['TaskSignal', base_config_1.TYPE_VALUE],
|
||||
['TextDecoder', base_config_1.TYPE_VALUE],
|
||||
['TextDecoderCommon', base_config_1.TYPE],
|
||||
['TextDecoderStream', base_config_1.TYPE_VALUE],
|
||||
['TextEncoder', base_config_1.TYPE_VALUE],
|
||||
['TextEncoderCommon', base_config_1.TYPE],
|
||||
['TextEncoderStream', base_config_1.TYPE_VALUE],
|
||||
['TextMetrics', base_config_1.TYPE_VALUE],
|
||||
['TransformStream', base_config_1.TYPE_VALUE],
|
||||
['TransformStreamDefaultController', base_config_1.TYPE_VALUE],
|
||||
['URL', base_config_1.TYPE_VALUE],
|
||||
['URLPattern', base_config_1.TYPE_VALUE],
|
||||
['URLSearchParams', base_config_1.TYPE_VALUE],
|
||||
['VideoColorSpace', base_config_1.TYPE_VALUE],
|
||||
['VideoDecoderEventMap', base_config_1.TYPE],
|
||||
['VideoDecoder', base_config_1.TYPE_VALUE],
|
||||
['VideoEncoderEventMap', base_config_1.TYPE],
|
||||
['VideoEncoder', base_config_1.TYPE_VALUE],
|
||||
['VideoFrame', base_config_1.TYPE_VALUE],
|
||||
['WEBGL_color_buffer_float', base_config_1.TYPE],
|
||||
['WEBGL_compressed_texture_astc', base_config_1.TYPE],
|
||||
['WEBGL_compressed_texture_etc', base_config_1.TYPE],
|
||||
['WEBGL_compressed_texture_etc1', base_config_1.TYPE],
|
||||
['WEBGL_compressed_texture_pvrtc', base_config_1.TYPE],
|
||||
['WEBGL_compressed_texture_s3tc', base_config_1.TYPE],
|
||||
['WEBGL_compressed_texture_s3tc_srgb', base_config_1.TYPE],
|
||||
['WEBGL_debug_renderer_info', base_config_1.TYPE],
|
||||
['WEBGL_debug_shaders', base_config_1.TYPE],
|
||||
['WEBGL_depth_texture', base_config_1.TYPE],
|
||||
['WEBGL_draw_buffers', base_config_1.TYPE],
|
||||
['WEBGL_lose_context', base_config_1.TYPE],
|
||||
['WEBGL_multi_draw', base_config_1.TYPE],
|
||||
['WGSLLanguageFeatures', base_config_1.TYPE_VALUE],
|
||||
['WebGL2RenderingContext', base_config_1.TYPE_VALUE],
|
||||
['WebGL2RenderingContextBase', base_config_1.TYPE],
|
||||
['WebGL2RenderingContextOverloads', base_config_1.TYPE],
|
||||
['WebGLActiveInfo', base_config_1.TYPE_VALUE],
|
||||
['WebGLBuffer', base_config_1.TYPE_VALUE],
|
||||
['WebGLContextEvent', base_config_1.TYPE_VALUE],
|
||||
['WebGLFramebuffer', base_config_1.TYPE_VALUE],
|
||||
['WebGLProgram', base_config_1.TYPE_VALUE],
|
||||
['WebGLQuery', base_config_1.TYPE_VALUE],
|
||||
['WebGLRenderbuffer', base_config_1.TYPE_VALUE],
|
||||
['WebGLRenderingContext', base_config_1.TYPE_VALUE],
|
||||
['WebGLRenderingContextBase', base_config_1.TYPE],
|
||||
['WebGLRenderingContextOverloads', base_config_1.TYPE],
|
||||
['WebGLSampler', base_config_1.TYPE_VALUE],
|
||||
['WebGLShader', base_config_1.TYPE_VALUE],
|
||||
['WebGLShaderPrecisionFormat', base_config_1.TYPE_VALUE],
|
||||
['WebGLSync', base_config_1.TYPE_VALUE],
|
||||
['WebGLTexture', base_config_1.TYPE_VALUE],
|
||||
['WebGLTransformFeedback', base_config_1.TYPE_VALUE],
|
||||
['WebGLUniformLocation', base_config_1.TYPE_VALUE],
|
||||
['WebGLVertexArrayObject', base_config_1.TYPE_VALUE],
|
||||
['WebGLVertexArrayObjectOES', base_config_1.TYPE],
|
||||
['WebSocketEventMap', base_config_1.TYPE],
|
||||
['WebSocket', base_config_1.TYPE_VALUE],
|
||||
['WebTransport', base_config_1.TYPE_VALUE],
|
||||
['WebTransportBidirectionalStream', base_config_1.TYPE_VALUE],
|
||||
['WebTransportDatagramDuplexStream', base_config_1.TYPE_VALUE],
|
||||
['WebTransportError', base_config_1.TYPE_VALUE],
|
||||
['WindowClient', base_config_1.TYPE_VALUE],
|
||||
['WindowOrWorkerGlobalScope', base_config_1.TYPE],
|
||||
['WorkerEventMap', base_config_1.TYPE],
|
||||
['Worker', base_config_1.TYPE_VALUE],
|
||||
['WorkerGlobalScopeEventMap', base_config_1.TYPE],
|
||||
['WorkerGlobalScope', base_config_1.TYPE_VALUE],
|
||||
['WorkerLocation', base_config_1.TYPE_VALUE],
|
||||
['WorkerNavigator', base_config_1.TYPE_VALUE],
|
||||
['WritableStream', base_config_1.TYPE_VALUE],
|
||||
['WritableStreamDefaultController', base_config_1.TYPE_VALUE],
|
||||
['WritableStreamDefaultWriter', base_config_1.TYPE_VALUE],
|
||||
['XMLHttpRequestEventMap', base_config_1.TYPE],
|
||||
['XMLHttpRequest', base_config_1.TYPE_VALUE],
|
||||
['XMLHttpRequestEventTargetEventMap', base_config_1.TYPE],
|
||||
['XMLHttpRequestEventTarget', base_config_1.TYPE_VALUE],
|
||||
['XMLHttpRequestUpload', base_config_1.TYPE_VALUE],
|
||||
['WebAssembly', base_config_1.TYPE_VALUE],
|
||||
['Console', base_config_1.TYPE],
|
||||
['AudioDataOutputCallback', base_config_1.TYPE],
|
||||
['EncodedAudioChunkOutputCallback', base_config_1.TYPE],
|
||||
['EncodedVideoChunkOutputCallback', base_config_1.TYPE],
|
||||
['FrameRequestCallback', base_config_1.TYPE],
|
||||
['LockGrantedCallback', base_config_1.TYPE],
|
||||
['OnErrorEventHandlerNonNull', base_config_1.TYPE],
|
||||
['PerformanceObserverCallback', base_config_1.TYPE],
|
||||
['QueuingStrategySize', base_config_1.TYPE],
|
||||
['ReportingObserverCallback', base_config_1.TYPE],
|
||||
['SchedulerPostTaskCallback', base_config_1.TYPE],
|
||||
['TransformerFlushCallback', base_config_1.TYPE],
|
||||
['TransformerStartCallback', base_config_1.TYPE],
|
||||
['TransformerTransformCallback', base_config_1.TYPE],
|
||||
['UnderlyingSinkAbortCallback', base_config_1.TYPE],
|
||||
['UnderlyingSinkCloseCallback', base_config_1.TYPE],
|
||||
['UnderlyingSinkStartCallback', base_config_1.TYPE],
|
||||
['UnderlyingSinkWriteCallback', base_config_1.TYPE],
|
||||
['UnderlyingSourceCancelCallback', base_config_1.TYPE],
|
||||
['UnderlyingSourcePullCallback', base_config_1.TYPE],
|
||||
['UnderlyingSourceStartCallback', base_config_1.TYPE],
|
||||
['VideoFrameOutputCallback', base_config_1.TYPE],
|
||||
['VoidFunction', base_config_1.TYPE],
|
||||
['WebCodecsErrorCallback', base_config_1.TYPE],
|
||||
['AlgorithmIdentifier', base_config_1.TYPE],
|
||||
['AllowSharedBufferSource', base_config_1.TYPE],
|
||||
['BigInteger', base_config_1.TYPE],
|
||||
['BlobPart', base_config_1.TYPE],
|
||||
['BodyInit', base_config_1.TYPE],
|
||||
['BufferSource', base_config_1.TYPE],
|
||||
['CSSKeywordish', base_config_1.TYPE],
|
||||
['CSSNumberish', base_config_1.TYPE],
|
||||
['CSSPerspectiveValue', base_config_1.TYPE],
|
||||
['CSSUnparsedSegment', base_config_1.TYPE],
|
||||
['CanvasImageSource', base_config_1.TYPE],
|
||||
['CookieList', base_config_1.TYPE],
|
||||
['DOMHighResTimeStamp', base_config_1.TYPE],
|
||||
['EpochTimeStamp', base_config_1.TYPE],
|
||||
['EventListenerOrEventListenerObject', base_config_1.TYPE],
|
||||
['FileSystemWriteChunkType', base_config_1.TYPE],
|
||||
['Float32List', base_config_1.TYPE],
|
||||
['FormDataEntryValue', base_config_1.TYPE],
|
||||
['GLbitfield', base_config_1.TYPE],
|
||||
['GLboolean', base_config_1.TYPE],
|
||||
['GLclampf', base_config_1.TYPE],
|
||||
['GLenum', base_config_1.TYPE],
|
||||
['GLfloat', base_config_1.TYPE],
|
||||
['GLint', base_config_1.TYPE],
|
||||
['GLint64', base_config_1.TYPE],
|
||||
['GLintptr', base_config_1.TYPE],
|
||||
['GLsizei', base_config_1.TYPE],
|
||||
['GLsizeiptr', base_config_1.TYPE],
|
||||
['GLuint', base_config_1.TYPE],
|
||||
['GLuint64', base_config_1.TYPE],
|
||||
['GPUBindingResource', base_config_1.TYPE],
|
||||
['GPUBufferDynamicOffset', base_config_1.TYPE],
|
||||
['GPUBufferUsageFlags', base_config_1.TYPE],
|
||||
['GPUColor', base_config_1.TYPE],
|
||||
['GPUColorWriteFlags', base_config_1.TYPE],
|
||||
['GPUCopyExternalImageSource', base_config_1.TYPE],
|
||||
['GPUDepthBias', base_config_1.TYPE],
|
||||
['GPUExtent3D', base_config_1.TYPE],
|
||||
['GPUFlagsConstant', base_config_1.TYPE],
|
||||
['GPUIndex32', base_config_1.TYPE],
|
||||
['GPUIntegerCoordinate', base_config_1.TYPE],
|
||||
['GPUIntegerCoordinateOut', base_config_1.TYPE],
|
||||
['GPUMapModeFlags', base_config_1.TYPE],
|
||||
['GPUOrigin2D', base_config_1.TYPE],
|
||||
['GPUOrigin3D', base_config_1.TYPE],
|
||||
['GPUPipelineConstantValue', base_config_1.TYPE],
|
||||
['GPUSampleMask', base_config_1.TYPE],
|
||||
['GPUShaderStageFlags', base_config_1.TYPE],
|
||||
['GPUSignedOffset32', base_config_1.TYPE],
|
||||
['GPUSize32', base_config_1.TYPE],
|
||||
['GPUSize32Out', base_config_1.TYPE],
|
||||
['GPUSize64', base_config_1.TYPE],
|
||||
['GPUSize64Out', base_config_1.TYPE],
|
||||
['GPUStencilValue', base_config_1.TYPE],
|
||||
['GPUTextureUsageFlags', base_config_1.TYPE],
|
||||
['HashAlgorithmIdentifier', base_config_1.TYPE],
|
||||
['HeadersInit', base_config_1.TYPE],
|
||||
['IDBValidKey', base_config_1.TYPE],
|
||||
['ImageBitmapSource', base_config_1.TYPE],
|
||||
['ImageBufferSource', base_config_1.TYPE],
|
||||
['ImageDataArray', base_config_1.TYPE],
|
||||
['Int32List', base_config_1.TYPE],
|
||||
['MessageEventSource', base_config_1.TYPE],
|
||||
['NamedCurve', base_config_1.TYPE],
|
||||
['OffscreenRenderingContext', base_config_1.TYPE],
|
||||
['OnErrorEventHandler', base_config_1.TYPE],
|
||||
['PerformanceEntryList', base_config_1.TYPE],
|
||||
['PushMessageDataInit', base_config_1.TYPE],
|
||||
['ReadableStreamController', base_config_1.TYPE],
|
||||
['ReadableStreamReadResult', base_config_1.TYPE],
|
||||
['ReadableStreamReader', base_config_1.TYPE],
|
||||
['ReportList', base_config_1.TYPE],
|
||||
['RequestInfo', base_config_1.TYPE],
|
||||
['TexImageSource', base_config_1.TYPE],
|
||||
['TimerHandler', base_config_1.TYPE],
|
||||
['Transferable', base_config_1.TYPE],
|
||||
['URLPatternInput', base_config_1.TYPE],
|
||||
['Uint32List', base_config_1.TYPE],
|
||||
['XMLHttpRequestBodyInit', base_config_1.TYPE],
|
||||
['AacBitstreamFormat', base_config_1.TYPE],
|
||||
['AlphaOption', base_config_1.TYPE],
|
||||
['AudioSampleFormat', base_config_1.TYPE],
|
||||
['AvcBitstreamFormat', base_config_1.TYPE],
|
||||
['BinaryType', base_config_1.TYPE],
|
||||
['BitrateMode', base_config_1.TYPE],
|
||||
['CSSMathOperator', base_config_1.TYPE],
|
||||
['CSSNumericBaseType', base_config_1.TYPE],
|
||||
['CanvasDirection', base_config_1.TYPE],
|
||||
['CanvasFillRule', base_config_1.TYPE],
|
||||
['CanvasFontKerning', base_config_1.TYPE],
|
||||
['CanvasFontStretch', base_config_1.TYPE],
|
||||
['CanvasFontVariantCaps', base_config_1.TYPE],
|
||||
['CanvasLineCap', base_config_1.TYPE],
|
||||
['CanvasLineJoin', base_config_1.TYPE],
|
||||
['CanvasTextAlign', base_config_1.TYPE],
|
||||
['CanvasTextBaseline', base_config_1.TYPE],
|
||||
['CanvasTextRendering', base_config_1.TYPE],
|
||||
['ClientTypes', base_config_1.TYPE],
|
||||
['CodecState', base_config_1.TYPE],
|
||||
['ColorGamut', base_config_1.TYPE],
|
||||
['ColorSpaceConversion', base_config_1.TYPE],
|
||||
['CompressionFormat', base_config_1.TYPE],
|
||||
['CookieSameSite', base_config_1.TYPE],
|
||||
['DocumentVisibilityState', base_config_1.TYPE],
|
||||
['EncodedAudioChunkType', base_config_1.TYPE],
|
||||
['EncodedVideoChunkType', base_config_1.TYPE],
|
||||
['EndingType', base_config_1.TYPE],
|
||||
['FileSystemHandleKind', base_config_1.TYPE],
|
||||
['FontDisplay', base_config_1.TYPE],
|
||||
['FontFaceLoadStatus', base_config_1.TYPE],
|
||||
['FontFaceSetLoadStatus', base_config_1.TYPE],
|
||||
['FrameType', base_config_1.TYPE],
|
||||
['GPUAddressMode', base_config_1.TYPE],
|
||||
['GPUAutoLayoutMode', base_config_1.TYPE],
|
||||
['GPUBlendFactor', base_config_1.TYPE],
|
||||
['GPUBlendOperation', base_config_1.TYPE],
|
||||
['GPUBufferBindingType', base_config_1.TYPE],
|
||||
['GPUBufferMapState', base_config_1.TYPE],
|
||||
['GPUCanvasAlphaMode', base_config_1.TYPE],
|
||||
['GPUCanvasToneMappingMode', base_config_1.TYPE],
|
||||
['GPUCompareFunction', base_config_1.TYPE],
|
||||
['GPUCompilationMessageType', base_config_1.TYPE],
|
||||
['GPUCullMode', base_config_1.TYPE],
|
||||
['GPUDeviceLostReason', base_config_1.TYPE],
|
||||
['GPUErrorFilter', base_config_1.TYPE],
|
||||
['GPUFeatureName', base_config_1.TYPE],
|
||||
['GPUFilterMode', base_config_1.TYPE],
|
||||
['GPUFrontFace', base_config_1.TYPE],
|
||||
['GPUIndexFormat', base_config_1.TYPE],
|
||||
['GPULoadOp', base_config_1.TYPE],
|
||||
['GPUMipmapFilterMode', base_config_1.TYPE],
|
||||
['GPUPipelineErrorReason', base_config_1.TYPE],
|
||||
['GPUPowerPreference', base_config_1.TYPE],
|
||||
['GPUPrimitiveTopology', base_config_1.TYPE],
|
||||
['GPUQueryType', base_config_1.TYPE],
|
||||
['GPUSamplerBindingType', base_config_1.TYPE],
|
||||
['GPUStencilOperation', base_config_1.TYPE],
|
||||
['GPUStorageTextureAccess', base_config_1.TYPE],
|
||||
['GPUStoreOp', base_config_1.TYPE],
|
||||
['GPUTextureAspect', base_config_1.TYPE],
|
||||
['GPUTextureDimension', base_config_1.TYPE],
|
||||
['GPUTextureFormat', base_config_1.TYPE],
|
||||
['GPUTextureSampleType', base_config_1.TYPE],
|
||||
['GPUTextureViewDimension', base_config_1.TYPE],
|
||||
['GPUVertexFormat', base_config_1.TYPE],
|
||||
['GPUVertexStepMode', base_config_1.TYPE],
|
||||
['GlobalCompositeOperation', base_config_1.TYPE],
|
||||
['HardwareAcceleration', base_config_1.TYPE],
|
||||
['HdrMetadataType', base_config_1.TYPE],
|
||||
['IDBCursorDirection', base_config_1.TYPE],
|
||||
['IDBRequestReadyState', base_config_1.TYPE],
|
||||
['IDBTransactionDurability', base_config_1.TYPE],
|
||||
['IDBTransactionMode', base_config_1.TYPE],
|
||||
['ImageDataPixelFormat', base_config_1.TYPE],
|
||||
['ImageOrientation', base_config_1.TYPE],
|
||||
['ImageSmoothingQuality', base_config_1.TYPE],
|
||||
['KeyFormat', base_config_1.TYPE],
|
||||
['KeyType', base_config_1.TYPE],
|
||||
['KeyUsage', base_config_1.TYPE],
|
||||
['LatencyMode', base_config_1.TYPE],
|
||||
['LockMode', base_config_1.TYPE],
|
||||
['MediaDecodingType', base_config_1.TYPE],
|
||||
['MediaEncodingType', base_config_1.TYPE],
|
||||
['MediaKeysRequirement', base_config_1.TYPE],
|
||||
['NotificationDirection', base_config_1.TYPE],
|
||||
['NotificationPermission', base_config_1.TYPE],
|
||||
['OffscreenRenderingContextId', base_config_1.TYPE],
|
||||
['OpusBitstreamFormat', base_config_1.TYPE],
|
||||
['PermissionName', base_config_1.TYPE],
|
||||
['PermissionState', base_config_1.TYPE],
|
||||
['PredefinedColorSpace', base_config_1.TYPE],
|
||||
['PremultiplyAlpha', base_config_1.TYPE],
|
||||
['PushEncryptionKeyName', base_config_1.TYPE],
|
||||
['RTCDataChannelState', base_config_1.TYPE],
|
||||
['ReadableStreamReaderMode', base_config_1.TYPE],
|
||||
['ReadableStreamType', base_config_1.TYPE],
|
||||
['ReferrerPolicy', base_config_1.TYPE],
|
||||
['RequestCache', base_config_1.TYPE],
|
||||
['RequestCredentials', base_config_1.TYPE],
|
||||
['RequestDestination', base_config_1.TYPE],
|
||||
['RequestMode', base_config_1.TYPE],
|
||||
['RequestPriority', base_config_1.TYPE],
|
||||
['RequestRedirect', base_config_1.TYPE],
|
||||
['ResizeQuality', base_config_1.TYPE],
|
||||
['ResponseType', base_config_1.TYPE],
|
||||
['SecurityPolicyViolationEventDisposition', base_config_1.TYPE],
|
||||
['ServiceWorkerState', base_config_1.TYPE],
|
||||
['ServiceWorkerUpdateViaCache', base_config_1.TYPE],
|
||||
['TaskPriority', base_config_1.TYPE],
|
||||
['TransferFunction', base_config_1.TYPE],
|
||||
['VideoColorPrimaries', base_config_1.TYPE],
|
||||
['VideoEncoderBitrateMode', base_config_1.TYPE],
|
||||
['VideoMatrixCoefficients', base_config_1.TYPE],
|
||||
['VideoPixelFormat', base_config_1.TYPE],
|
||||
['VideoTransferCharacteristics', base_config_1.TYPE],
|
||||
['WebGLPowerPreference', base_config_1.TYPE],
|
||||
['WebTransportCongestionControl', base_config_1.TYPE],
|
||||
['WebTransportErrorSource', base_config_1.TYPE],
|
||||
['WorkerType', base_config_1.TYPE],
|
||||
['WriteCommandType', base_config_1.TYPE],
|
||||
['XMLHttpRequestResponseType', base_config_1.TYPE],
|
||||
['FormDataIterator', base_config_1.TYPE],
|
||||
['HeadersIterator', base_config_1.TYPE],
|
||||
['StylePropertyMapReadOnlyIterator', base_config_1.TYPE],
|
||||
['URLSearchParamsIterator', base_config_1.TYPE],
|
||||
['FileSystemDirectoryHandleAsyncIterator', base_config_1.TYPE],
|
||||
['ReadableStreamAsyncIterator', base_config_1.TYPE],
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user