id
int64
0
1.29M
original_id
stringlengths
32
32
swhid
stringlengths
100
170
sha1
stringlengths
40
40
repo_name
stringlengths
2
45
repo_group
stringclasses
12 values
filepath
stringlengths
5
153
name
stringlengths
1
14.9k
type
stringclasses
3 values
code
stringlengths
7
2.12M
1,286,400
8ddc671bc374bc1dfbd478b8a3b2e01e
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=377-389/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
tryParseToken
function
function tryParseToken(cxt: ParseCxt, tok: string, fail: GenParse, success?: GenParse): void { const {gen} = cxt const n = tok.length skipWhitespace(cxt) gen.if( _`${jsonSlice(n)} === ${tok}`, () => { gen.add(N.jsonPos, n) success?.(cxt) }, () => fail(cxt) ) }
1,286,401
de39d4b7727e8b4e0c68b6cd3a9627d8
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=86-104/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parserFunction
function
function parserFunction(cxt: ParseCxt): void { const {gen, parseName, char} = cxt gen.func(parseName, _`${N.json}, ${N.jsonPos}, ${N.jsonPart}`, false, () => { gen.let(N.data) gen.let(char) gen.assign(_`${parseName}.message`, undef) gen.assign(_`${parseName}.position`, undef) gen.assign(N.jsonPo...
1,286,402
65821a5eb276aa481e437b0ccf7c4192
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=145-148/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseItems
function
function parseItems(cxt: ParseCxt, endToken: string, block: () => void): void { tryParseItems(cxt, endToken, block) parseToken(cxt, endToken) }
1,286,403
b7ce8cec595b0b2eeaefefbd625252cd
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=255-295/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseType
function
function parseType(cxt: ParseCxt): void { const {gen, schema, data, self} = cxt switch (schema.type) { case "boolean": parseBoolean(cxt) break case "string": parseString(cxt) break case "timestamp": { parseString(cxt) const vts = useFunc(gen, validTimestamp) con...
1,286,404
3632f38bc8d3cf084a4dd4a0d8a8b823
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=329-339/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseBooleanToken
function
function parseBooleanToken(bool: boolean, fail: GenParse): GenParse { return (cxt) => { const {gen, data} = cxt tryParseToken( cxt, `${bool}`, () => fail(cxt), () => gen.assign(data, bool) ) } }
1,286,405
066dd31b147e3273b52c6a036a6ff021
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=341-350/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseRef
function
function parseRef(cxt: ParseCxt): void { const {gen, self, definitions, schema, schemaEnv} = cxt const {ref} = schema const refSchema = definitions[ref] if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) if (!hasRef(refSchema)) return parseCode({...cxt, schema: r...
1,286,406
9957981ea67523fe5e30d6ee4ec62798
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=391-395/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
skipWhitespace
function
function skipWhitespace({gen, char: c}: ParseCxt): void { gen.code( _`while((${c}=${N.json}[${N.jsonPos}],${c}===" "||${c}==="\\n"||${c}==="\\r"||${c}==="\\t"))${N.jsonPos}++;` ) }
1,286,407
231b95f1814954f3e3632d19f93a5724
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=403-405/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
jsonSyntaxError
function
function jsonSyntaxError(cxt: ParseCxt): void { parsingError(cxt, _`"unexpected token " + ${N.json}[${N.jsonPos}]`) }
1,286,408
0a2d19f828bec63b734bc63fadca6165
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=407-411/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parsingError
function
function parsingError({gen, parseName}: ParseCxt, msg: Code): void { gen.assign(_`${parseName}.message`, msg) gen.assign(_`${parseName}.position`, N.jsonPos) gen.return(undef) }
1,286,409
5631e6f276ca2a6c46ce549d65482425
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=126-136/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseElements
function
function parseElements(cxt: ParseCxt): void { const {gen, schema, data} = cxt parseToken(cxt, "[") const ix = gen.let("i", 0) gen.assign(data, _`[]`) parseItems(cxt, "]", () => { const el = gen.let("el") parseCode({...cxt, schema: schema.elements, data: el}) gen.assign(_`${data}[${ix}++]`, el) }...
1,286,410
c4ff0aeefbeabafe6f5cbdde268861c7
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=150-160/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
tryParseItems
function
function tryParseItems(cxt: ParseCxt, endToken: string, block: () => void): void { const {gen} = cxt gen.for(_`;${N.jsonPos}<${N.jsonLen} && ${jsonSlice(1)}!==${endToken};`, () => { block() tryParseToken(cxt, ",", () => gen.break(), hasItem) }) function hasItem(): void { tryParseToken(cxt, endToken...
1,286,411
4dc97daf5eb28a1b9ce1f0892c987086
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=157-159/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
tryParseItems::hasItem
function
function hasItem(): void { tryParseToken(cxt, endToken, () => {}, jsonSyntaxError) }
1,286,412
48df4c6b7450a3fdbd37257fb59a263e
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=297-300/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseString
function
function parseString(cxt: ParseCxt): void { parseToken(cxt, '"') parseWith(cxt, parseJsonString) }
1,286,413
c32e175ea0f07c0d508e541536c6559d
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=362-364/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseWith
function
function parseWith(cxt: ParseCxt, parseFunc: {code: string}, args?: SafeExpr): void { partialParse(cxt, useFunc(cxt.gen, parseFunc), args) }
1,286,414
6b4b0e42fa0fb10b0a6415db92c5c59b
swh:1:cnt:a0141c770c7029ce1d41db61bcd9a19fbd0c08d5;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=373-375/
6be8f226291084b775e1a99ea60dbbd42b3c66d0
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/parse.ts
parseToken
function
function parseToken(cxt: ParseCxt, tok: string): void { tryParseToken(cxt, tok, jsonSyntaxError) }
1,286,415
65979569e545fc8ee1b9d3a1b4cc486a
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=24-31/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
SerializeCxt
type
interface SerializeCxt { readonly gen: CodeGen readonly self: Ajv // current Ajv instance readonly schemaEnv: SchemaEnv readonly definitions: SchemaObjectMap schema: SchemaObject data: Code }
1,286,416
d908b0ee1c5e0efe8e00a8db64a20901
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=129-143/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeDiscriminator
function
function serializeDiscriminator(cxt: SerializeCxt): void { const {gen, schema, data} = cxt const {discriminator} = schema gen.add(N.json, str`{${JSON.stringify(discriminator)}:`) const tag = gen.const("tag", _`${data}${getProperty(discriminator)}`) serializeString({...cxt, data: tag}) gen.if(false) for (c...
1,286,417
2bf2c7960d44e4aae389b424bf903f9a
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=145-150/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeProperties
function
function serializeProperties(cxt: SerializeCxt): void { const {gen} = cxt gen.add(N.json, str`{`) serializeSchemaProperties(cxt) gen.add(N.json, str`}`) }
1,286,418
1bc1c56d3b552cb9eccf08b5199c0b3e
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=184-190/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeSchemaProperties::allProperties
function
function allProperties(ps: string[]): string[] { if (discriminator) ps.push(discriminator) if (new Set(ps).size !== ps.length) { throw new Error("JTD: properties/optionalProperties/disciminator overlap") } return ps }
1,286,419
bde1946efe7c8b019a2379635a6dd926
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=196-199/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeSchemaProperties::serializeProperty
function
function serializeProperty(key: string, propSchema: SchemaObject, value: Name): void { gen.add(N.json, str`${JSON.stringify(key)}:`) serializeCode({...cxt, schema: propSchema, data: value}) }
1,286,420
17489d3fa6868eb9674a5ea6988efb13
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=231-244/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeNumber
function
function serializeNumber({gen, data, self}: SerializeCxt): void { const condition = _`${data} === Infinity || ${data} === -Infinity || ${data} !== ${data}` if (self.opts.specialNumbers === undefined || self.opts.specialNumbers === "fast") { gen.add(N.json, _`"" + ${data}`) } else { // specialNumbers === ...
1,286,421
405aa52ed5788b60f76c1df708896f0a
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=267-277/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
addComma
function
function addComma({gen}: SerializeCxt, first?: Name): void { if (first) { gen.if( first, () => gen.assign(first, false), () => gen.add(N.json, str`,`) ) } else { gen.add(N.json, str`,`) } }
1,286,422
c1550fa9e6a34fc42b0b442a299a6054
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=33-78/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
compileSerializer
function
function compileSerializer( this: Ajv, sch: SchemaEnv, definitions: SchemaObjectMap ): SchemaEnv { const _sch = getCompilingSchema.call(this, sch) if (_sch) return _sch const {es5, lines} = this.opts.code const {ownProperties} = this.opts const gen = new CodeGen(this.scope, {es5, lines, ownProperties}) ...
1,286,423
c24eda1ec2f4c5e281a5400aa38d3e8c
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=101-110/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeElements
function
function serializeElements(cxt: SerializeCxt): void { const {gen, schema, data} = cxt gen.add(N.json, str`[`) const first = gen.let("first", true) gen.forOf("el", data, (el) => { addComma(cxt, first) serializeCode({...cxt, schema: schema.elements, data: el}) }) gen.add(N.json, str`]`) }
1,286,424
c0c0f63db509f2510574196ecf7d527a
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=152-204/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeSchemaProperties
function
function serializeSchemaProperties(cxt: SerializeCxt, discriminator?: string): void { const {gen, schema, data} = cxt const {properties, optionalProperties} = schema const props = keys(properties) const optProps = keys(optionalProperties) const allProps = allProperties(props.concat(optProps)) let first = !d...
1,286,425
1606c02c8aa1cf1c8f43ae832bcaf998
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=180-182/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeSchemaProperties::keys
function
function keys(ps?: SchemaObjectMap): string[] { return ps ? Object.keys(ps) : [] }
1,286,426
0fc84b193d5610a55399d10a4c6b2958
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=206-225/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeType
function
function serializeType(cxt: SerializeCxt): void { const {gen, schema, data} = cxt switch (schema.type) { case "boolean": gen.add(N.json, _`${data} ? "true" : "false"`) break case "string": serializeString(cxt) break case "timestamp": gen.if( _`${data} instanceof Dat...
1,286,427
c4e0ef6b72458e35b1c209ab34804d2a
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=227-229/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeString
function
function serializeString({gen, data}: SerializeCxt): void { gen.add(N.json, _`${useFunc(gen, quote)}(${data})`) }
1,286,428
933cc0b796346452a590d8a259b1256b
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=263-265/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeEmpty
function
function serializeEmpty({gen, data}: SerializeCxt): void { gen.add(N.json, _`JSON.stringify(${data})`) }
1,286,429
8c09e7092907e7c1310c47ebff4f06d1
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=91-99/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeNullable
function
function serializeNullable(cxt: SerializeCxt, serializeForm: (_cxt: SerializeCxt) => void): void { const {gen, schema, data} = cxt if (!schema.nullable) return serializeForm(cxt) gen.if( _`${data} === undefined || ${data} === null`, () => gen.add(N.json, _`"null"`), () => serializeForm(cxt) ) }
1,286,430
40d40d1f0582c1f76ced7b4f1f0ae652
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=120-127/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeKeyValue
function
function serializeKeyValue(cxt: SerializeCxt, key: Name, schema: SchemaObject, first?: Name): void { const {gen, data} = cxt addComma(cxt, first) serializeString({...cxt, data: key}) gen.add(N.json, str`:`) const value = gen.const("value", _`${data}${getProperty(key)}`) serializeCode({...cxt, schema, data: ...
1,286,431
708a48642c86f50705257908f3862a56
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=192-194/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeSchemaProperties::keyValue
function
function keyValue(key: string): Name { return gen.const("value", _`${data}${getProperty(key)}`) }
1,286,432
ce7cdb7da9397173a29bd40f52aa96e1
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=201-203/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeSchemaProperties::isAdditional
function
function isAdditional(key: Name, ps: string[]): Code | true { return ps.length ? and(...ps.map((p) => _`${key} !== ${p}`)) : true }
1,286,433
d426a449fac210172f127a454c993fd1
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=246-255/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeRef
function
function serializeRef(cxt: SerializeCxt): void { const {gen, self, data, definitions, schema, schemaEnv} = cxt const {ref} = schema const refSchema = definitions[ref] if (!refSchema) throw new MissingRefError(self.opts.uriResolver, "", ref, `No definition ${ref}`) if (!hasRef(refSchema)) return serializeCode(...
1,286,434
023cf6e7f5087038b07b2479345cc8cb
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=80-89/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeCode
function
function serializeCode(cxt: SerializeCxt): void { let form: JTDForm | undefined for (const key of jtdForms) { if (key in cxt.schema) { form = key break } } serializeNullable(cxt, form ? genSerialize[form] : serializeEmpty) }
1,286,435
586560572cde7648478d8e3cabed440a
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=112-118/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
serializeValues
function
function serializeValues(cxt: SerializeCxt): void { const {gen, schema, data} = cxt gen.add(N.json, str`{`) const first = gen.let("first", true) gen.forIn("key", data, (key) => serializeKeyValue(cxt, key, schema.values, first)) gen.add(N.json, str`}`) }
1,286,436
ab7f0ea3a9671e204ff50284eb3f658b
swh:1:cnt:42a47cffc1d2e1461212f9feeee08fbde02c0c2a;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=257-261/
283aec0a51a7d1d97fe301a254ec50feb89f4385
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/serialize.ts
getSerialize
function
function getSerialize(gen: CodeGen, sch: SchemaEnv): Code { return sch.serialize ? gen.scopeValue("serialize", {ref: sch.serialize}) : _`${gen.scopeValue("wrapper", {ref: sch})}.serialize` }
1,286,437
685f71e947d6380748587d7ad166622f
swh:1:cnt:1258050fdf426a085097c3858c513b95447ded94;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=3-3/
51a7075a3293d172643102bfe6baf666462eb667
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/types.ts
SchemaObjectMap
type
type SchemaObjectMap = {[Ref in string]?: SchemaObject}
1,286,438
cab77645c5708716500c5fd135d8af8b
swh:1:cnt:1258050fdf426a085097c3858c513b95447ded94;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=16-16/
51a7075a3293d172643102bfe6baf666462eb667
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/jtd/types.ts
JTDForm
type
type JTDForm = (typeof jtdForms)[number]
1,286,439
161967be35de7a688f1b3b5e15b2ae97
swh:1:cnt:478b704ac571d7b34deb19ef84aa0e2dd08973e3;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=5-11/
e598885f89cea9a50f32068f1c02da4c469b0cb7
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/applicability.ts
schemaHasRulesForType
function
function schemaHasRulesForType( {schema, self}: SchemaObjCxt, type: JSONType ): boolean | undefined { const group = self.RULES.types[type] return group && group !== true && shouldUseGroup(schema, group) }
1,286,440
5b537bbd78b937062b02477c7bda995d
swh:1:cnt:478b704ac571d7b34deb19ef84aa0e2dd08973e3;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=13-15/
e598885f89cea9a50f32068f1c02da4c469b0cb7
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/applicability.ts
shouldUseGroup
function
function shouldUseGroup(schema: AnySchemaObject, group: RuleGroup): boolean { return group.rules.some((rule) => shouldUseRule(schema, rule)) }
1,286,441
b10e5d248137bee14d4c5941dba85288
swh:1:cnt:478b704ac571d7b34deb19ef84aa0e2dd08973e3;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=17-22/
e598885f89cea9a50f32068f1c02da4c469b0cb7
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/applicability.ts
shouldUseRule
function
function shouldUseRule(schema: AnySchemaObject, rule: Rule): boolean | undefined { return ( schema[rule.keyword] !== undefined || rule.definition.implements?.some((kwd) => schema[kwd] !== undefined) ) }
1,286,442
31b7d215ef94792edf253e1a71fc4215
swh:1:cnt:156355016d62249d16c6dc19a89c28b5ff6972c7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=11-21/
3e02ec5bc0f9fc7284ed0cb3e671a018969cee6c
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/boolSchema.ts
topBoolOrEmptySchema
function
function topBoolOrEmptySchema(it: SchemaCxt): void { const {gen, schema, validateName} = it if (schema === false) { falseSchemaError(it, false) } else if (typeof schema == "object" && schema.$async === true) { gen.return(N.data) } else { gen.assign(_`${validateName}.errors`, null) gen.return(tru...
1,286,443
49560ed0fad169de3e92e03b461bbb9e
swh:1:cnt:156355016d62249d16c6dc19a89c28b5ff6972c7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=23-31/
3e02ec5bc0f9fc7284ed0cb3e671a018969cee6c
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/boolSchema.ts
boolOrEmptySchema
function
function boolOrEmptySchema(it: SchemaCxt, valid: Name): void { const {gen, schema} = it if (schema === false) { gen.var(valid, false) // TODO var falseSchemaError(it) } else { gen.var(valid, true) // TODO var } }
1,286,444
850a33cc459ee26f9b5594bcd76d2a04
swh:1:cnt:156355016d62249d16c6dc19a89c28b5ff6972c7;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=33-47/
3e02ec5bc0f9fc7284ed0cb3e671a018969cee6c
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/boolSchema.ts
falseSchemaError
function
function falseSchemaError(it: SchemaCxt, overrideAllErrors?: boolean): void { const {gen, data} = it // TODO maybe some other interface should be used for non-keyword validation errors... const cxt: KeywordErrorCxt = { gen, keyword: "false schema", data, schema: false, schemaCode: false, s...
1,286,445
d95a845d8277789c3c358dd6a8cef9bb
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=14-17/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
DataType
type
enum DataType { Correct, Wrong, }
1,286,446
fadb904dc7de9060420a1b959fbba738
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=203-203/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
TypeError
type
type TypeError = ErrorObject<"type", {type: string}>
1,286,447
063853a0aa9303421989bc319cdcb7e3
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=19-31/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
getSchemaTypes
function
function getSchemaTypes(schema: AnySchemaObject): JSONType[] { const types = getJSONTypes(schema.type) const hasNull = types.includes("null") if (hasNull) { if (schema.nullable === false) throw new Error("type: null contradicts nullable: false") } else { if (!types.length && schema.nullable !== undefine...
1,286,448
c24ac1a4fadae828f8b0807aaa0ccd4e
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=63-136/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
coerceData
function
function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void { const {gen, data, opts} = it const dataType = gen.let("dataType", _`typeof ${data}`) const coerced = gen.let("coerced", _`undefined`) if (opts.coerceTypes === "array") { gen.if(_`${dataType} == 'object' && Array.isArray($...
1,286,449
c0e31d0385f8e5632d4cc39af84b3621
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=40-54/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
coerceAndCheckDataType
function
function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean { const {gen, data, opts} = it const coerceTo = coerceToTypes(types, opts.coerceTypes) const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0])) if (checkTypes...
1,286,450
4fdfc6e2ba07482e153cab7357403572
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=34-38/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
getJSONTypes
function
function getJSONTypes(ts: unknown | unknown[]): JSONType[] { const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : [] if (types.every(isJSONType)) return types throw new Error("type must be JSONType or JSONType[]: " + types.join(",")) }
1,286,451
51f471248a63978b6c9f089538cc25ea
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=57-61/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
coerceToTypes
function
function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] { return coerceTypes ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array")) : [] }
1,286,452
3570cad409565c69252bfd4621452649
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=90-135/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
coerceData::coerceSpecificType
function
function coerceSpecificType(t: string): void { switch (t) { case "string": gen .elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`) .assign(coerced, _`"" + ${data}`) .elseIf(_`${data} === null`) .assign(coerced, _`""`) return case "numbe...
1,286,453
c808f2fd1af27150fca3228bdbe6a9e2
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=138-143/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
assignParentData
function
function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void { // TODO use gen.property gen.if(_`${parentData} !== undefined`, () => gen.assign(_`${parentData}[${parentDataProperty}]`, expr) ) }
1,286,454
e498558afb5e80cd80f0c8f4b5655661
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=145-176/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
checkDataType
function
function checkDataType( dataType: JSONType, data: Name, strictNums?: boolean | "log", correct = DataType.Correct ): Code { const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ let cond: Code switch (dataType) { case "null": return _`${data} ${EQ} null` case "array": c...
1,286,455
7aabc085a9e0fc60dd258ef1293d40fa
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=173-175/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
checkDataType::numCond
function
function numCond(_cond: Code = nil): Code { return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil) }
1,286,456
8a23062d47222a801063a1702db2feda
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=178-201/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
checkDataTypes
function
function checkDataTypes( dataTypes: JSONType[], data: Name, strictNums?: boolean | "log", correct?: DataType ): Code { if (dataTypes.length === 1) { return checkDataType(dataTypes[0], data, strictNums, correct) } let cond: Code const types = toHash(dataTypes) if (types.array && types.object) { ...
1,286,457
f0557cba1611a5e57377ea6f521fee3e
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=216-230/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
getTypeErrorContext
function
function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt { const {gen, data, schema} = it const schemaCode = schemaRefOrVal(it, schema, "type") return { gen, keyword: "type", data, schema: schema.type, schemaCode, schemaValue: schemaCode, parentSchema: schema, params: {}, ...
1,286,458
de655c5d5532eba44c36887986ba7ddf
swh:1:cnt:d8142b3e1f55194a06de0ab489ee01e00136df25;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=211-214/
a28000a74378871611bd8104fe32334cb249a7aa
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/dataType.ts
reportTypeError
function
function reportTypeError(it: SchemaObjCxt): void { const cxt = getTypeErrorContext(it) reportError(cxt, typeError) }
1,286,459
34ade8c830bff0eac1d266b3f49a0555
swh:1:cnt:2ad3d4df8291bdfd7aec74833bec4b0b4c91f36f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=5-14/
111d99684068fb5666a97967e6ee42ac3f676b4d
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/defaults.ts
assignDefaults
function
function assignDefaults(it: SchemaObjCxt, ty?: string): void { const {properties, items} = it.schema if (ty === "object" && properties) { for (const key in properties) { assignDefault(it, key, properties[key].default) } } else if (ty === "array" && Array.isArray(items)) { items.forEach((sch, i: ...
1,286,460
12b5fc1e90fed710548725811cde4366
swh:1:cnt:2ad3d4df8291bdfd7aec74833bec4b0b4c91f36f;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=16-32/
111d99684068fb5666a97967e6ee42ac3f676b4d
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/defaults.ts
assignDefault
function
function assignDefault(it: SchemaObjCxt, prop: string | number, defaultValue: unknown): void { const {gen, compositeRule, data, opts} = it if (defaultValue === undefined) return const childData = _`${data}${getProperty(prop)}` if (compositeRule) { checkStrictMode(it, `default is ignored for: ${childData}`) ...
1,286,461
e23c40b123e27c8d04983e3c5295c796
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=72-90/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
destructureValCxtES5
function
function destructureValCxtES5(gen: CodeGen, opts: InstanceOptions): void { gen.if( N.valCxt, () => { gen.var(N.instancePath, _`${N.valCxt}.${N.instancePath}`) gen.var(N.parentData, _`${N.valCxt}.${N.parentData}`) gen.var(N.parentDataProperty, _`${N.valCxt}.${N.parentDataProperty}`) gen...
1,286,462
67efb2763897ea3ac6f723d8e091e795
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=119-129/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
subschemaCode
function
// schema compilation - this function is used recursively to generate code for sub-schemas function subschemaCode(it: SchemaCxt, valid: Name): void { if (isSchemaObj(it)) { checkKeywords(it) if (schemaCxtHasRules(it)) { subSchemaObjCode(it, valid) return } } boolOrEmptySchema(it, valid) }
1,286,463
6dbe79590592e68f307b6a7dbd8112a0
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=137-139/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
isSchemaObj
function
function isSchemaObj(it: SchemaCxt): it is SchemaObjCxt { return typeof it.schema != "boolean" }
1,286,464
42cdd560cce33e397a7007944b0a82ff
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=171-176/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkNoDefault
function
function checkNoDefault(it: SchemaObjCxt): void { const {schema, opts} = it if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { checkStrictMode(it, "default is ignored in the schema root") } }
1,286,465
e39dd2ae027306dc393b1ab54312b370
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=214-217/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
assignEvaluated
function
function assignEvaluated({gen, evaluated, props, items}: SchemaCxt): void { if (props instanceof Name) gen.assign(_`${evaluated}.props`, props) if (items instanceof Name) gen.assign(_`${evaluated}.items`, items) }
1,286,466
70530dd8c55f53bc550c9b885e5bbf90
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=219-253/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
schemaKeywords
function
function schemaKeywords( it: SchemaObjCxt, types: JSONType[], typeErrors: boolean, errsCount?: Name ): void { const {gen, schema, data, allErrors, opts, self} = it const {RULES} = self if (schema.$ref && (opts.ignoreKeywordsWithRef || !schemaHasRulesButRef(schema, RULES))) { gen.block(() => keywordCod...
1,286,467
5cf767bdaa4eeab06857ad445ab297a5
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=237-252/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
schemaKeywords::groupKeywords
function
function groupKeywords(group: RuleGroup): void { if (!shouldUseGroup(schema, group)) return if (group.type) { gen.if(checkDataType(group.type, data, opts.strictNumbers)) iterateKeywords(it, group) if (types.length === 1 && types[0] === group.type && typeErrors) { gen.else() rep...
1,286,468
86a8301f3401fc4d6ddbc733a1ebfdbc
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=271-276/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkStrictTypes
function
function checkStrictTypes(it: SchemaObjCxt, types: JSONType[]): void { if (it.schemaEnv.meta || !it.opts.strictTypes) return checkContextTypes(it, types) if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types) checkKeywordTypes(it, it.dataTypes) }
1,286,469
66cbea06ed11f750fc77bf4d82aa863f
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=328-332/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
strictTypesError
function
function strictTypesError(it: SchemaObjCxt, msg: string): void { const schemaPath = it.schemaEnv.baseId + it.errSchemaPath msg += ` at "${schemaPath}" (strictTypes)` checkStrictMode(it, msg, it.opts.strictTypes) }
1,286,470
52d32abc03e8701c19e24e989d1caf93
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=351-378/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::constructor
function
constructor(it: SchemaObjCxt, def: AddedKeywordDefinition, keyword: string) { validateKeywordUsage(it, def, keyword) this.gen = it.gen this.allErrors = it.allErrors this.keyword = keyword this.data = it.data this.schema = it.schema[keyword] this.$data = def.$data && it.opts.$data && this.sch...
1,286,471
84517a6271c0d0614ea411999b324d40
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=486-492/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::invalid$data::invalid$DataSchema
function
function invalid$DataSchema(): Code { if (def.validateSchema) { const validateSchemaRef = gen.scopeValue("validate$data", {ref: def.validateSchema}) // TODO value.code for standalone return _`!${validateSchemaRef}(${schemaCode})` } return nil }
1,286,472
654b174aa1f2128e315f4b6c36936af9
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=452-457/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::block$data
function
block$data(valid: Name, codeBlock: () => void, $dataValid: Code = nil): void { this.gen.block(() => { this.check$data(valid, $dataValid) codeBlock() }) }
1,286,473
7097a8725543bd62aa863178c6a7aae6
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=38-47/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
validateFunctionCode
function
function validateFunctionCode(it: SchemaCxt): void { if (isSchemaObj(it)) { checkKeywords(it) if (schemaCxtHasRules(it)) { topSchemaObjCode(it) return } } validateFunction(it, () => topBoolOrEmptySchema(it)) }
1,286,474
afd1f79cb4cff811fffd94277ee21f4f
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=66-70/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
destructureValCxt
function
function destructureValCxt(opts: InstanceOptions): Code { return _`{${N.instancePath}="", ${N.parentData}, ${N.parentDataProperty}, ${N.rootData}=${ N.data }${opts.dynamicRef ? _`, ${N.dynamicAnchors}={}` : nil}}={}` }
1,286,475
783fd939530ac35280b0368ae2b271f6
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=49-64/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
validateFunction
function
function validateFunction( {gen, validateName, schema, schemaEnv, opts}: SchemaCxt, body: Block ): void { if (opts.code.es5) { gen.func(validateName, _`${N.data}, ${N.valCxt}`, schemaEnv.$async, () => { gen.code(_`"use strict"; ${funcSourceUrl(schema, opts)}`) destructureValCxtES5(gen, opts) ...
1,286,476
aeb79b162dfedfc30a9dc9fd89aea12d
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=131-135/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
schemaCxtHasRules
function
function schemaCxtHasRules({schema, self}: SchemaCxt): boolean { if (typeof schema == "boolean") return !schema for (const key in schema) if (self.RULES.all[key]) return true return false }
1,286,477
5cfc632098a1f74646b0eeaaf25d4b90
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=141-150/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
subSchemaObjCode
function
function subSchemaObjCode(it: SchemaObjCxt, valid: Name): void { const {schema, gen, opts} = it if (opts.$comment && schema.$comment) commentKeyword(it) updateContext(it) checkAsyncSchema(it) const errsCount = gen.const("_errs", N.errors) typeAndKeywords(it, errsCount) // TODO var gen.var(valid, _`${err...
1,286,478
6bf706b93bc49960496861d2a1547894
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=152-155/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkKeywords
function
function checkKeywords(it: SchemaObjCxt): void { checkUnknownRules(it) checkRefsAndKeywords(it) }
1,286,479
8360c13faa351c98f7eb1ff678c5aca1
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=157-162/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
typeAndKeywords
function
function typeAndKeywords(it: SchemaObjCxt, errsCount?: Name): void { if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount) const types = getSchemaTypes(it.schema) const checkedTypes = coerceAndCheckDataType(it, types) schemaKeywords(it, types, !checkedTypes, errsCount) }
1,286,480
8e47c6eb054d4911abf8b8950286bbcd
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=278-290/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkContextTypes
function
function checkContextTypes(it: SchemaObjCxt, types: JSONType[]): void { if (!types.length) return if (!it.dataTypes.length) { it.dataTypes = types return } types.forEach((t) => { if (!includesType(it.dataTypes, t)) { strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join...
1,286,481
ad1a3e9902890b3714c486899e575ff3
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=292-296/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkMultipleTypes
function
function checkMultipleTypes(it: SchemaObjCxt, ts: JSONType[]): void { if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { strictTypesError(it, "use allowUnionTypes to allow union type keyword") } }
1,286,482
d0e089a2d931dfd1a43a0535bfac30ed
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=402-412/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::fail
function
fail(condition?: Code): void { if (condition === undefined) { this.error() if (!this.allErrors) this.gen.if(false) // this branch will be removed by gen.optimize return } this.gen.if(condition) this.error() if (this.allErrors) this.gen.endIf() else this.gen.else() }
1,286,483
29112414bc83bac51579a1ed1d13222b
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=447-450/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::setParams
function
setParams(obj: KeywordCxtParams, assign?: true): void { if (assign) Object.assign(this.params, obj) else this.params = obj }
1,286,484
adf8b4c64d4818ed38d672b7db914074
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=414-418/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::fail$data
function
fail$data(condition: Code): void { if (!this.$data) return this.fail(condition) const {schemaCode} = this this.fail(_`${schemaCode} !== undefined && (${or(this.invalid$data(), condition)})`) }
1,286,485
1e164821fdb36dc1daf0672e9e6b7c78
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=398-400/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::pass
function
pass(condition: Code, failAction?: () => void): void { this.failResult(not(condition), undefined, failAction) }
1,286,486
59527c1e8bf22cab047025c5055006c1
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=430-432/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::_error
function
private _error(append?: boolean, errorPaths?: ErrorPaths): void { ;(append ? reportExtraError : reportError)(this, this.def.error, errorPaths) }
1,286,487
74c1bd31c5e06e83b2445af45e900269
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=544-582/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
getData
function
function getData( $data: string, {dataLevel, dataNames, dataPathArr}: SchemaCxt ): Code | number { let jsonPointer let data: Code if ($data === "") return N.rootData if ($data[0] === "/") { if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`) jsonPointer = $data data ...
1,286,488
bf657b2d9a7993b7f2fb216e9bfa37fe
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=92-104/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
topSchemaObjCode
function
function topSchemaObjCode(it: SchemaObjCxt): void { const {schema, opts, gen} = it validateFunction(it, () => { if (opts.$comment && schema.$comment) commentKeyword(it) checkNoDefault(it) gen.let(N.vErrors, null) gen.let(N.errors, 0) if (opts.unevaluated) resetEvaluated(it) typeAndKeywords(i...
1,286,489
756ae7c5b9e355dd9b968eff998fd2cb
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=106-112/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
resetEvaluated
function
function resetEvaluated(it: SchemaObjCxt): void { // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated const {gen, validateName} = it it.evaluated = gen.const("evaluated", _`${validateName}.evaluated`) gen.if(_`${it.evaluated}.dynamicProps`, () => gen.ass...
1,286,490
0713ff8d6c8a1a75473d08c1a0e85e3f
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=114-117/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
funcSourceUrl
function
function funcSourceUrl(schema: AnySchema, opts: InstanceOptions): Code { const schId = typeof schema == "object" && schema[opts.schemaId] return schId && (opts.code.source || opts.code.process) ? _`/*# sourceURL=${schId} */` : nil }
1,286,491
010466d0375f53a05d22fa646fc4838b
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=164-169/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkRefsAndKeywords
function
function checkRefsAndKeywords(it: SchemaObjCxt): void { const {schema, errSchemaPath, opts, self} = it if (schema.$ref && opts.ignoreKeywordsWithRef && schemaHasRulesButRef(schema, self.RULES)) { self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`) } }
1,286,492
c85e74d14c20b3a94d2343ef3a3ccee8
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=178-181/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
updateContext
function
function updateContext(it: SchemaObjCxt): void { const schId = it.schema[it.opts.schemaId] if (schId) it.baseId = resolveUrl(it.opts.uriResolver, it.baseId, schId) }
1,286,493
b10e346691d1d96107559e9f32623fdd
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=183-185/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkAsyncSchema
function
function checkAsyncSchema(it: SchemaObjCxt): void { if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema") }
1,286,494
cd55b0c6e7fcbd6ba46f8a95cd36646b
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=255-269/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
iterateKeywords
function
function iterateKeywords(it: SchemaObjCxt, group: RuleGroup): void { const { gen, schema, opts: {useDefaults}, } = it if (useDefaults) assignDefaults(it, group.type) gen.block(() => { for (const rule of group.rules) { if (shouldUseRule(schema, rule)) { keywordCode(it, rule.keyword,...
1,286,495
f0532a7eddc056197b7ff1c1ad9c4ce6
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=298-309/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
checkKeywordTypes
function
function checkKeywordTypes(it: SchemaObjCxt, ts: JSONType[]): void { const rules = it.self.RULES.all for (const keyword in rules) { const rule = rules[keyword] if (typeof rule == "object" && shouldUseRule(it.schema, rule)) { const {type} = rule.definition if (type.length && !type.some((t) => has...
1,286,496
96ed6e8356e9e38812edfa27471ffbde
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=311-313/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
hasApplicableType
function
function hasApplicableType(schTs: JSONType[], kwdT: JSONType): boolean { return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer")) }
1,286,497
2914a9b821de68c60ab522bbb6d3c2ad
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=315-317/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
includesType
function
function includesType(ts: JSONType[], t: JSONType): boolean { return ts.includes(t) || (t === "integer" && ts.includes("number")) }
1,286,498
9af369bdb9b05fd21627a0bbc395fb08
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=504-513/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::mergeEvaluated
function
mergeEvaluated(schemaCxt: SchemaCxt, toName?: typeof Name): void { const {it, gen} = this if (!it.opts.unevaluated) return if (it.props !== true && schemaCxt.props !== undefined) { it.props = mergeEvaluated.props(gen, schemaCxt.props, it.props, toName) } if (it.items !== true && schemaCxt.item...
1,286,499
e3a755c104314034c44c3d1ab1e3d935
swh:1:cnt:15ecabd85169e3f19b56b7547982643383068552;origin=https://gitlab.wikimedia.org/toolforge-repos/wlbdashboard.git;lines=459-470/
b19a1c8fefc9d676f89f81e4165e2fdb15d290b6
wlbdashboard
wmcs
node_modules/workbox-build/node_modules/ajv/lib/compile/validate/index.ts
KeywordCxt::check$data
function
check$data(valid: Name = nil, $dataValid: Code = nil): void { if (!this.$data) return const {gen, schemaCode, schemaType, def} = this gen.if(or(_`${schemaCode} === undefined`, $dataValid)) if (valid !== nil) gen.assign(valid, true) if (schemaType.length || def.validateSchema) { gen.elseIf(this...