id int64 0 3.78k | code stringlengths 13 37.9k | declarations stringlengths 16 64.6k |
|---|---|---|
2,900 | (
argv: Arguments,
_yargs: YargsInstance
): Partial<Arguments> | Promise<Partial<Arguments>> => {
return maybeAsyncResult<
Partial<Arguments> | Promise<Partial<Arguments>> | any
>(
() => {
return f(argv, _yargs.getOptions());
},
(... | class YargsInstance {
$0: string;
argv?: Arguments;
customScriptName = false;
parsed: DetailedArguments | false = false;
#command: CommandInstance;
#cwd: string;
// use context object to keep track of resets, subcommand execution, etc.,
// submodules should modify and check the state of context as nece... |
2,901 | (
argv: Arguments,
yargs: YargsInstance
): Partial<Arguments> | Promise<Partial<Arguments>> => {
let aliases: Dictionary<string[]>;
// Skip coerce logic if related arg was not provided
const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys);
if (!shou... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,902 | (
argv: Arguments,
yargs: YargsInstance
): Partial<Arguments> | Promise<Partial<Arguments>> => {
let aliases: Dictionary<string[]>;
// Skip coerce logic if related arg was not provided
const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys);
if (!shou... | interface Arguments {
/** The script name or node command */
$0: string;
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,903 | (
argv: Arguments,
yargs: YargsInstance
): Partial<Arguments> | Promise<Partial<Arguments>> => {
let aliases: Dictionary<string[]>;
// Skip coerce logic if related arg was not provided
const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys);
if (!shou... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,904 | (
argv: Arguments,
yargs: YargsInstance
): Partial<Arguments> | Promise<Partial<Arguments>> => {
let aliases: Dictionary<string[]>;
// Skip coerce logic if related arg was not provided
const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys);
if (!shou... | class YargsInstance {
$0: string;
argv?: Arguments;
customScriptName = false;
parsed: DetailedArguments | false = false;
#command: CommandInstance;
#cwd: string;
// use context object to keep track of resets, subcommand execution, etc.,
// submodules should modify and check the state of context as nece... |
2,905 | parserConfiguration(config: Configuration) {
argsert('<object>', [config], arguments.length);
this.#parserConfig = config;
return this;
} | interface Configuration extends Partial<ParserConfiguration> {
/** Should a config object be deep-merged with the object config it extends? */
'deep-merge-config'?: boolean;
/** Should commands be sorted in help? */
'sort-commands'?: boolean;
} |
2,906 | parserConfiguration(config: Configuration) {
argsert('<object>', [config], arguments.length);
this.#parserConfig = config;
return this;
} | interface Configuration {
/** Should variables prefixed with --no be treated as negations? Default is `true` */
'boolean-negation': boolean;
/** Should hyphenated arguments be expanded into camel-case aliases? Default is `true` */
'camel-case-expansion': boolean;
/** Should arrays be combined when provided by... |
2,907 | usageConfiguration(config: UsageConfiguration) {
argsert('<object>', [config], arguments.length);
this.#usageConfig = config;
return this;
} | interface UsageConfiguration {
/** Should types be hidden when usage is displayed */
'hide-types'?: boolean;
} |
2,908 | [kCopyDoubleDash](argv: Arguments): any {
if (!argv._ || !argv['--']) return argv;
// eslint-disable-next-line prefer-spread
argv._.push.apply(argv._, argv['--']);
// We catch an error here, in case someone has called Object.seal()
// on the parsed object, see: https://github.com/babel/babel/pull/1... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,909 | [kCopyDoubleDash](argv: Arguments): any {
if (!argv._ || !argv['--']) return argv;
// eslint-disable-next-line prefer-spread
argv._.push.apply(argv._, argv['--']);
// We catch an error here, in case someone has called Object.seal()
// on the parsed object, see: https://github.com/babel/babel/pull/1... | interface Arguments {
/** The script name or node command */
$0: string;
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,910 | [kCopyDoubleDash](argv: Arguments): any {
if (!argv._ || !argv['--']) return argv;
// eslint-disable-next-line prefer-spread
argv._.push.apply(argv._, argv['--']);
// We catch an error here, in case someone has called Object.seal()
// on the parsed object, see: https://github.com/babel/babel/pull/1... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,911 | [kParsePositionalNumbers](argv: Arguments): any {
const args: (string | number)[] = argv['--'] ? argv['--'] : argv._;
for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
if (
this.#shim.Parser.looksLikeNumber(arg) &&
Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))
) {
... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,912 | [kParsePositionalNumbers](argv: Arguments): any {
const args: (string | number)[] = argv['--'] ? argv['--'] : argv._;
for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
if (
this.#shim.Parser.looksLikeNumber(arg) &&
Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))
) {
... | interface Arguments {
/** The script name or node command */
$0: string;
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,913 | [kParsePositionalNumbers](argv: Arguments): any {
const args: (string | number)[] = argv['--'] ? argv['--'] : argv._;
for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
if (
this.#shim.Parser.looksLikeNumber(arg) &&
Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))
) {
... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,914 | [kReset](aliases: Aliases = {}): YargsInstance {
this.#options = this.#options || ({} as Options);
const tmpOptions = {} as Options;
tmpOptions.local = this.#options.local || [];
tmpOptions.configObjects = this.#options.configObjects || [];
// if a key has been explicitly set as local,
// we sh... | interface Aliases {
[key: string]: Array<string>;
} |
2,915 | (argv: Arguments) => {
if (parseErrors) throw new YError(parseErrors.message);
this.#validation.nonOptionCount(argv);
this.#validation.requiredArguments(argv, demandedOptions);
let failedStrictCommands = false;
if (this.#strictCommands) {
failedStrictCommands = this.#validation.unk... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,916 | (argv: Arguments) => {
if (parseErrors) throw new YError(parseErrors.message);
this.#validation.nonOptionCount(argv);
this.#validation.requiredArguments(argv, demandedOptions);
let failedStrictCommands = false;
if (this.#strictCommands) {
failedStrictCommands = this.#validation.unk... | interface Arguments {
/** The script name or node command */
$0: string;
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,917 | (argv: Arguments) => {
if (parseErrors) throw new YError(parseErrors.message);
this.#validation.nonOptionCount(argv);
this.#validation.requiredArguments(argv, demandedOptions);
let failedStrictCommands = false;
if (this.#strictCommands) {
failedStrictCommands = this.#validation.unk... | interface Arguments {
/** Non-option arguments */
_: ArgsOutput;
/** Arguments after the end-of-options flag `--` */
'--'?: ArgsOutput;
/** All remaining options */
[argName: string]: any;
} |
2,918 | (args: ArgsInput, opts?: Partial<Options>): Arguments | type ArgsInput = string | any[]; |
2,919 | detailed(args: ArgsInput, opts?: Partial<Options>): DetailedArguments | type ArgsInput = string | any[]; |
2,920 | function applyExtends(
config: Dictionary,
cwd: string,
mergeExtends: boolean,
_shim: PlatformShim
): Dictionary {
shim = _shim;
let defaultConfig = {};
if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
if (typeof config.extends !== 'string') return defaultConfig;
const isPath = /\.j... | type Dictionary<T = any> = {[key: string]: T}; |
2,921 | function applyExtends(
config: Dictionary,
cwd: string,
mergeExtends: boolean,
_shim: PlatformShim
): Dictionary {
shim = _shim;
let defaultConfig = {};
if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
if (typeof config.extends !== 'string') return defaultConfig;
const isPath = /\.j... | interface PlatformShim {
cwd: Function;
format: Function;
normalize: Function;
require: Function;
resolve: Function;
env: Function;
} |
2,922 | function applyExtends(
config: Dictionary,
cwd: string,
mergeExtends: boolean,
_shim: PlatformShim
): Dictionary {
shim = _shim;
let defaultConfig = {};
if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
if (typeof config.extends !== 'string') return defaultConfig;
const isPath = /\.j... | interface PlatformShim {
assert: {
notStrictEqual: (
expected: any,
observed: any,
message?: string | Error
) => void;
strictEqual: (
expected: any,
observed: any,
message?: string | Error
) => void;
};
findUp: (
startDir: string,
fn: (dir: string[], nam... |
2,923 | function mergeDeep(config1: Dictionary, config2: Dictionary) {
const target: Dictionary = {};
function isObject(obj: Dictionary | any): obj is Dictionary {
return obj && typeof obj === 'object' && !Array.isArray(obj);
}
Object.assign(target, config1);
for (const key of Object.keys(config2)) {
if (isOb... | type Dictionary<T = any> = {[key: string]: T}; |
2,924 | function renderNode(node: AnyNode, options: DomSerializerOptions): string {
switch (node.type) {
case ElementType.Root:
return render(node.children, options);
// @ts-expect-error We don't use `Doctype` yet
case ElementType.Doctype:
case ElementType.Directive:
return renderDirective(node);
... | interface DomSerializerOptions {
/**
* Print an empty attribute's value.
*
* @default xmlMode
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
*/
emptyAttrs?: boolean;
/**
* ... |
2,925 | function renderTag(elem: Element, opts: DomSerializerOptions) {
// Handle SVG / MathML in HTML
if (opts.xmlMode === "foreign") {
/* Fix up mixed-case element names */
elem.name = elementNames.get(elem.name) ?? elem.name;
/* Exit foreign mode at integration points */
if (
elem.parent &&
f... | interface DomSerializerOptions {
/**
* Print an empty attribute's value.
*
* @default xmlMode
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
*/
emptyAttrs?: boolean;
/**
* ... |
2,926 | function renderText(elem: Text, opts: DomSerializerOptions) {
let data = elem.data || "";
// If entities weren't decoded, no need to encode them back
if (
(opts.encodeEntities ?? opts.decodeEntities) !== false &&
!(
!opts.xmlMode &&
elem.parent &&
unencodedElements.has((elem.parent as E... | interface DomSerializerOptions {
/**
* Print an empty attribute's value.
*
* @default xmlMode
* @example With <code>emptyAttrs: false</code>: <code><input checked></code>
* @example With <code>emptyAttrs: true</code>: <code><input checked=""></code>
*/
emptyAttrs?: boolean;
/**
* ... |
2,927 | function html(
preset: CheerioOptions,
str: string,
options: CheerioOptions = {}
) {
const opts = { ...defaultOpts, ...preset, ...options };
const dom = parse(str, opts, true) as Document;
return render(dom, opts);
} | interface CheerioOptions extends DomSerializerOptions {
_useHtmlParser2?: boolean;
} |
2,928 | (ctx: Context, rec: Recogniser, confidence: number): Match => ({
confidence,
name: rec.name(ctx),
lang: rec.language ? rec.language() : undefined,
}) | interface Recogniser {
match(input: Context): Match | null;
name(input?: Context): string;
language?(): string | undefined;
} |
2,929 | (ctx: Context, rec: Recogniser, confidence: number): Match => ({
confidence,
name: rec.name(ctx),
lang: rec.language ? rec.language() : undefined,
}) | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,930 | match(input: Context): Match | null | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,931 | name(input?: Context): string | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,932 | nextByte(det: Context) {
if (this.nextIndex >= det.rawLen) {
this.done = true;
return -1;
}
const byteValue = det.rawInput[this.nextIndex++] & 0x00ff;
return byteValue;
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,933 | match(det: Context): Match | null {
let doubleByteCharCount = 0,
commonCharCount = 0,
badCharCount = 0,
totalCharCount = 0,
confidence = 0;
const iter = new IteratedChar();
detectBlock: {
for (iter.reset(); this.nextChar(iter, det); ) {
totalCharCount++;
if (i... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,934 | nextChar(_iter: IteratedChar, _det: Context): boolean {
return true;
} | class IteratedChar {
charValue: number; // 1-4 bytes from the raw input data
index: number;
nextIndex: number;
error: boolean;
done: boolean;
constructor() {
this.charValue = 0; // 1-4 bytes from the raw input data
this.index = 0;
this.nextIndex = 0;
this.error = false;
this.done = fals... |
2,935 | nextChar(_iter: IteratedChar, _det: Context): boolean {
return true;
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,936 | nextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
const firstByte = (iter.charValue = iter.nextByte(det));
if (firstByte < 0) return false;
if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf))
return true;
const secondByte = iter.... | class IteratedChar {
charValue: number; // 1-4 bytes from the raw input data
index: number;
nextIndex: number;
error: boolean;
done: boolean;
constructor() {
this.charValue = 0; // 1-4 bytes from the raw input data
this.index = 0;
this.nextIndex = 0;
this.error = false;
this.done = fals... |
2,937 | nextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
const firstByte = (iter.charValue = iter.nextByte(det));
if (firstByte < 0) return false;
if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf))
return true;
const secondByte = iter.... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,938 | nextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
const firstByte = (iter.charValue = iter.nextByte(det));
if (firstByte < 0) return false;
// single byte character.
if (firstByte <= 0x7f || firstByte == 0xff) return true;
const secondByte = it... | class IteratedChar {
charValue: number; // 1-4 bytes from the raw input data
index: number;
nextIndex: number;
error: boolean;
done: boolean;
constructor() {
this.charValue = 0; // 1-4 bytes from the raw input data
this.index = 0;
this.nextIndex = 0;
this.error = false;
this.done = fals... |
2,939 | nextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
const firstByte = (iter.charValue = iter.nextByte(det));
if (firstByte < 0) return false;
// single byte character.
if (firstByte <= 0x7f || firstByte == 0xff) return true;
const secondByte = it... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,940 | function eucNextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
let firstByte = 0;
let secondByte = 0;
let thirdByte = 0;
//int fourthByte = 0;
buildChar: {
firstByte = iter.charValue = iter.nextByte(det);
if (firstByte < 0) {
// Ran off the end of t... | class IteratedChar {
charValue: number; // 1-4 bytes from the raw input data
index: number;
nextIndex: number;
error: boolean;
done: boolean;
constructor() {
this.charValue = 0; // 1-4 bytes from the raw input data
this.index = 0;
this.nextIndex = 0;
this.error = false;
this.done = fals... |
2,941 | function eucNextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
let firstByte = 0;
let secondByte = 0;
let thirdByte = 0;
//int fourthByte = 0;
buildChar: {
firstByte = iter.charValue = iter.nextByte(det);
if (firstByte < 0) {
// Ran off the end of t... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,942 | nextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
let firstByte = 0;
let secondByte = 0;
let thirdByte = 0;
let fourthByte = 0;
buildChar: {
firstByte = iter.charValue = iter.nextByte(det);
if (firstByte < 0) {
// Ran off the en... | class IteratedChar {
charValue: number; // 1-4 bytes from the raw input data
index: number;
nextIndex: number;
error: boolean;
done: boolean;
constructor() {
this.charValue = 0; // 1-4 bytes from the raw input data
this.index = 0;
this.nextIndex = 0;
this.error = false;
this.done = fals... |
2,943 | nextChar(iter: IteratedChar, det: Context) {
iter.index = iter.nextIndex;
iter.error = false;
let firstByte = 0;
let secondByte = 0;
let thirdByte = 0;
let fourthByte = 0;
buildChar: {
firstByte = iter.charValue = iter.nextByte(det);
if (firstByte < 0) {
// Ran off the en... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,944 | match(det: Context): Match | null {
const input = det.rawInput;
if (
input.length >= 2 &&
(input[0] & 0xff) == 0xfe &&
(input[1] & 0xff) == 0xff
) {
return match(det, this, 100); // confidence = 100
}
// TODO: Do some statistics to check for unsigned UTF-16BE
return nul... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,945 | match(det: Context): Match | null {
const input = det.rawInput;
if (
input.length >= 2 &&
(input[0] & 0xff) == 0xff &&
(input[1] & 0xff) == 0xfe
) {
// LE BOM is present.
if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) {
// It is probably UTF-32 LE, not ... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,946 | match(det: Context): Match | null {
let numValid = 0,
numInvalid = 0,
hasBOM = false,
confidence = 0;
const limit = (det.rawLen / 4) * 4;
const input = det.rawInput;
if (limit == 0) {
return null;
}
if (this.getChar(input, 0) == 0x0000feff) {
hasBOM = true;
}
... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,947 | match(det: Context): Match | null {
let hasBOM = false,
numValid = 0,
numInvalid = 0,
trailBytes = 0,
confidence;
const input = det.rawInput;
if (
det.rawLen >= 3 &&
(input[0] & 0xff) == 0xef &&
(input[1] & 0xff) == 0xbb &&
(input[2] & 0xff) == 0xbf
) {
... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,948 | match(det: Context): Match | null {
/**
* Matching function shared among the 2022 detectors JP, CN and KR
* Counts up the number of legal an unrecognized escape sequences in
* the sample of text, and computes a score based on the total number &
* the proportion that fit the encoding.
*
... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,949 | nextByte(det: Context) {
if (this.byteIndex >= det.inputLen) return -1;
return det.inputBytes[this.byteIndex++] & 0xff;
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,950 | parse(det: Context, spaceCh: number) {
let b,
ignoreSpace = false;
this.spaceChar = spaceCh;
while ((b = this.nextByte(det)) >= 0) {
const mb = this.byteMap[b];
// TODO: 0x20 might not be a space in all character sets...
if (mb != 0) {
if (!(mb == this.spaceChar && ignoreSp... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,951 | name(_input: Context): string {
return 'sbcs';
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,952 | match(det: Context): Match | null {
// This feels a bit dirty. Simpler alternative would be
// splitting classes ISO_8859_1 etc into language-specific ones
// with hardcoded languages like ISO_8859_9.
this.nGramLang = undefined;
const ngrams = this.ngrams();
if (isFlatNgrams(ngrams)) {
c... | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,953 | name(input: Context): string {
return input && input.c1Bytes ? 'windows-1252' : 'ISO-8859-1';
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,954 | name(det: Context): string {
return det && det.c1Bytes ? 'windows-1250' : 'ISO-8859-2';
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,955 | name(det: Context): string {
return det && det.c1Bytes ? 'windows-1253' : 'ISO-8859-7';
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,956 | name(det: Context): string {
return det && det.c1Bytes ? 'windows-1255' : 'ISO-8859-8';
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,957 | name(det: Context): string {
return det && det.c1Bytes ? 'windows-1254' : 'ISO-8859-9';
} | interface Context {
byteStats: number[];
c1Bytes: boolean;
rawInput: Uint8Array;
rawLen: number;
inputBytes: Uint8Array;
inputLen: number;
} |
2,958 | indexForLocation(location: SourceLocation): number | null {
const { line, column } = location
if (line < 0 || line >= this.offsets.length) {
return null
}
if (column < 0 || column > this.lengthOfLine(line)) {
return null
}
return this.offsets[line] + column
} | interface SourceLocation {
line: number
column: number
} |
2,959 | function makeTests(re: RegExp, testCase: Case): void {
describe("matches", () => {
for (const matchingCase of testCase.matching) {
if (!ALL_FIXTURES.has(matchingCase)) {
throw new Error(
`fixture ${matchingCase.name} is missing from ALL_FIXTURES`);
}
it(matchingCase.name, () =>... | interface Case {
matching: Fixture[];
} |
2,960 | function isGlobalType(n: Node): boolean; | type Node = false | NodeOptions; |
2,961 | function isTable(n: Node): boolean; | type Node = false | NodeOptions; |
2,962 | function isMemory(n: Node): boolean; | type Node = false | NodeOptions; |
2,963 | function isFuncImportDescr(n: Node): boolean; | type Node = false | NodeOptions; |
2,964 | map(options?: MapOptions): Object | type MapOptions = { columns?: boolean; module?: boolean }; |
2,965 | map(options?: MapOptions): Object | interface MapOptions {
columns?: boolean;
module?: boolean;
} |
2,966 | sourceAndMap(options?: MapOptions): {
source: string | Buffer;
map: Object;
} | type MapOptions = { columns?: boolean; module?: boolean }; |
2,967 | sourceAndMap(options?: MapOptions): {
source: string | Buffer;
map: Object;
} | interface MapOptions {
columns?: boolean;
module?: boolean;
} |
2,968 | constructor(source: Source, name?: string) | class Source {
constructor();
size(): number;
map(options?: MapOptions): Object;
sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
updateHash(hash: Hash): void;
source(): string | Buffer;
buffer(): Buffer;
} |
2,969 | constructor(source: Source) | class Source {
constructor();
size(): number;
map(options?: MapOptions): Object;
sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
updateHash(hash: Hash): void;
source(): string | Buffer;
buffer(): Buffer;
} |
2,970 | constructor(sourceLike: SourceLike) | interface SourceLike {
source(): string | Buffer;
} |
2,971 | static from(sourceLike: SourceLike): Source | interface SourceLike {
source(): string | Buffer;
} |
2,972 | (info: HotEvent) => void | type HotEvent =
| {
type: "disposed";
/** The module in question. */
moduleId: number;
}
| {
type: "self-declined" | "unaccepted";
/** The module in question. */
moduleId: number;
/** the chain from where the update was propagated. */
chain: number[];
}
| {
type: "decli... |
2,973 | apply(compiler: Compiler): void | class Compiler {
constructor(context: string, options?: WebpackOptionsNormalized);
hooks: Readonly<{
initialize: SyncHook<[]>;
shouldEmit: SyncBailHook<[Compilation], boolean>;
done: AsyncSeriesHook<[Stats]>;
afterDone: SyncHook<[Stats]>;
additionalPass: AsyncSeriesHook<[]>;
beforeRun: AsyncSeriesHook<[Co... |
2,974 | parseOptions(library: LibraryOptions): false | T | interface LibraryOptions {
/**
* Add a comment in the UMD wrapper.
*/
auxiliaryComment?: string | LibraryCustomUmdCommentObject;
/**
* Specify which export should be exposed as library.
*/
export?: string | string[];
/**
* The name of the library (some types allow unnamed libraries too).
*/
name?: s... |
2,975 | parseOptions(library: LibraryOptions): false | T | interface LibraryOptions {
/**
* Add a comment in the UMD wrapper.
*/
auxiliaryComment?: AuxiliaryComment;
/**
* Specify which export should be exposed as library.
*/
export?: LibraryExport;
/**
* The name of the library (some types allow unnamed libraries too).
*/
name?: LibraryName;
/**
* Type of... |
2,976 | parseOptions(library: LibraryOptions): false | T | interface LibraryOptions {
/**
* Add a comment in the UMD wrapper.
*/
auxiliaryComment?: AuxiliaryComment;
/**
* Specify which export should be exposed as library.
*/
export?: LibraryExport;
/**
* The name of the library (some types allow unnamed libraries too).
*/
name?: LibraryName;
/**
* Type of... |
2,977 | parseOptions(library: LibraryOptions): false | T | interface LibraryOptions {
/**
* Add a comment in the UMD wrapper.
*/
auxiliaryComment?: AuxiliaryComment;
/**
* Specify which export should be exposed as library.
*/
export?: LibraryExport;
/**
* The name of the library (some types allow unnamed libraries too).
*/
name?: LibraryName;
/**
* Type of... |
2,978 | finishEntryModule(
module: Module,
entryName: string,
libraryContext: LibraryContext<T>
): void | interface Module {
hot: webpack.Hot;
} |
2,979 | finishEntryModule(
module: Module,
entryName: string,
libraryContext: LibraryContext<T>
): void | class Module extends DependenciesBlock {
constructor(type: string, context?: string, layer?: string);
type: string;
context: null | string;
layer: null | string;
needId: boolean;
debugId: number;
resolveOptions: ResolveOptionsWebpackOptions;
factoryMeta?: object;
useSourceMap: boolean;
useSimpleSourceMap: boo... |
2,980 | embedInRuntimeBailout(
module: Module,
renderContext: RenderContext,
libraryContext: LibraryContext<T>
): undefined | string | interface RenderContext {
/**
* the chunk
*/
chunk: Chunk;
/**
* the dependency templates
*/
dependencyTemplates: DependencyTemplates;
/**
* the runtime template
*/
runtimeTemplate: RuntimeTemplate;
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph... |
2,981 | embedInRuntimeBailout(
module: Module,
renderContext: RenderContext,
libraryContext: LibraryContext<T>
): undefined | string | interface Module {
hot: webpack.Hot;
} |
2,982 | embedInRuntimeBailout(
module: Module,
renderContext: RenderContext,
libraryContext: LibraryContext<T>
): undefined | string | class Module extends DependenciesBlock {
constructor(type: string, context?: string, layer?: string);
type: string;
context: null | string;
layer: null | string;
needId: boolean;
debugId: number;
resolveOptions: ResolveOptionsWebpackOptions;
factoryMeta?: object;
useSourceMap: boolean;
useSimpleSourceMap: boo... |
2,983 | strictRuntimeBailout(
renderContext: RenderContext,
libraryContext: LibraryContext<T>
): undefined | string | interface RenderContext {
/**
* the chunk
*/
chunk: Chunk;
/**
* the dependency templates
*/
dependencyTemplates: DependencyTemplates;
/**
* the runtime template
*/
runtimeTemplate: RuntimeTemplate;
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph... |
2,984 | runtimeRequirements(
chunk: Chunk,
set: Set<string>,
libraryContext: LibraryContext<T>
): void | class Chunk {
constructor(name?: string, backCompat?: boolean);
id: null | string | number;
ids: null | (string | number)[];
debugId: number;
name: string;
idNameHints: SortableSet<string>;
preventIntegration: boolean;
filenameTemplate:
| null
| string
| ((arg0: PathData, arg1?: AssetInfo) => string);
cs... |
2,985 | render(
source: Source,
renderContext: RenderContext,
libraryContext: LibraryContext<T>
): Source | interface RenderContext {
/**
* the chunk
*/
chunk: Chunk;
/**
* the dependency templates
*/
dependencyTemplates: DependencyTemplates;
/**
* the runtime template
*/
runtimeTemplate: RuntimeTemplate;
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph... |
2,986 | render(
source: Source,
renderContext: RenderContext,
libraryContext: LibraryContext<T>
): Source | class Source {
constructor();
size(): number;
map(options?: MapOptions): Object;
sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
updateHash(hash: Hash): void;
source(): string | Buffer;
buffer(): Buffer;
} |
2,987 | renderStartup(
source: Source,
module: Module,
renderContext: StartupRenderContext,
libraryContext: LibraryContext<T>
): Source | type StartupRenderContext = RenderContext & { inlined: boolean }; |
2,988 | renderStartup(
source: Source,
module: Module,
renderContext: StartupRenderContext,
libraryContext: LibraryContext<T>
): Source | interface Module {
hot: webpack.Hot;
} |
2,989 | renderStartup(
source: Source,
module: Module,
renderContext: StartupRenderContext,
libraryContext: LibraryContext<T>
): Source | class Module extends DependenciesBlock {
constructor(type: string, context?: string, layer?: string);
type: string;
context: null | string;
layer: null | string;
needId: boolean;
debugId: number;
resolveOptions: ResolveOptionsWebpackOptions;
factoryMeta?: object;
useSourceMap: boolean;
useSimpleSourceMap: boo... |
2,990 | renderStartup(
source: Source,
module: Module,
renderContext: StartupRenderContext,
libraryContext: LibraryContext<T>
): Source | class Source {
constructor();
size(): number;
map(options?: MapOptions): Object;
sourceAndMap(options?: MapOptions): { source: string | Buffer; map: Object };
updateHash(hash: Hash): void;
source(): string | Buffer;
buffer(): Buffer;
} |
2,991 | chunkHash(
chunk: Chunk,
hash: Hash,
chunkHashContext: ChunkHashContext,
libraryContext: LibraryContext<T>
): void | interface ChunkHashContext {
/**
* results of code generation
*/
codeGenerationResults: CodeGenerationResults;
/**
* the runtime template
*/
runtimeTemplate: RuntimeTemplate;
/**
* the module graph
*/
moduleGraph: ModuleGraph;
/**
* the chunk graph
*/
chunkGraph: ChunkGraph;
} |
2,992 | chunkHash(
chunk: Chunk,
hash: Hash,
chunkHashContext: ChunkHashContext,
libraryContext: LibraryContext<T>
): void | class Hash {
constructor();
/**
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
*/
update(data: string | Buffer, inputEncoding?: string): Hash;
/**
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
*/
digest(encod... |
2,993 | chunkHash(
chunk: Chunk,
hash: Hash,
chunkHashContext: ChunkHashContext,
libraryContext: LibraryContext<T>
): void | class Chunk {
constructor(name?: string, backCompat?: boolean);
id: null | string | number;
ids: null | (string | number)[];
debugId: number;
name: string;
idNameHints: SortableSet<string>;
preventIntegration: boolean;
filenameTemplate:
| null
| string
| ((arg0: PathData, arg1?: AssetInfo) => string);
cs... |
2,994 | constructor(options?: AggressiveSplittingPluginOptions) | interface AggressiveSplittingPluginOptions {
/**
* Extra cost for each chunk (Default: 9.8kiB).
*/
chunkOverhead?: number;
/**
* Extra cost multiplicator for entry chunks (Default: 10).
*/
entryChunkMultiplicator?: number;
/**
* Byte, max size of per file (Default: 50kiB).
*/
maxSize?: number;
/**... |
2,995 | constructor(options?: AggressiveSplittingPluginOptions) | interface AggressiveSplittingPluginOptions {
/**
* Extra cost for each chunk (Default: 9.8kiB).
*/
chunkOverhead?: number;
/**
* Extra cost multiplicator for entry chunks (Default: 10).
*/
entryChunkMultiplicator?: number;
/**
* Byte, max size of per file (Default: 50kiB).
*/
maxSize?: number;
/**
... |
2,996 | static wasChunkRecorded(chunk: Chunk): boolean | class Chunk {
constructor(name?: string, backCompat?: boolean);
id: null | string | number;
ids: null | (string | number)[];
debugId: number;
name: string;
idNameHints: SortableSet<string>;
preventIntegration: boolean;
filenameTemplate:
| null
| string
| ((arg0: PathData, arg1?: AssetInfo) => string);
cs... |
2,997 | (pathData: PathData, assetInfo?: AssetInfo) => string | interface PathData {
chunkGraph?: ChunkGraph;
hash?: string;
hashWithLength?: (arg0: number) => string;
chunk?: Chunk | ChunkPathData;
module?: Module | ModulePathData;
runtime?: RuntimeSpec;
filename?: string;
basename?: string;
query?: string;
contentHashType?: string;
contentHash?: string;
contentHashWit... |
2,998 | (pathData: PathData, assetInfo?: AssetInfo) => string | type AssetInfo = KnownAssetInfo & Record<string, any>; |
2,999 | static getCompilationHooks(
compilation: Compilation
): CompilationHooksAsyncWebAssemblyModulesPlugin | class Compilation {
/**
* Creates an instance of Compilation.
*/
constructor(compiler: Compiler, params: CompilationParams);
hooks: Readonly<{
buildModule: SyncHook<[Module]>;
rebuildModule: SyncHook<[Module]>;
failedModule: SyncHook<[Module, WebpackError]>;
succeedModule: SyncHook<[Module]>;
stillVali... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.