This commit is contained in:
2025-05-09 05:30:08 +02:00
parent 7bb10e7df4
commit 73367bad9e
5322 changed files with 1266973 additions and 313 deletions

View File

@@ -0,0 +1,125 @@
'use strict';
/*eslint-disable no-bitwise*/
var Type = require('../type');
// [ 64, 65, 66 ] -> [ padding, CR, LF ]
var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
function resolveYamlBinary(data) {
if (data === null) return false;
var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
// Convert one by one.
for (idx = 0; idx < max; idx++) {
code = map.indexOf(data.charAt(idx));
// Skip CR/LF
if (code > 64) continue;
// Fail on illegal characters
if (code < 0) return false;
bitlen += 6;
}
// If there are any bits left, source was corrupted
return (bitlen % 8) === 0;
}
function constructYamlBinary(data) {
var idx, tailbits,
input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
max = input.length,
map = BASE64_MAP,
bits = 0,
result = [];
// Collect by 6*4 bits (3 bytes)
for (idx = 0; idx < max; idx++) {
if ((idx % 4 === 0) && idx) {
result.push((bits >> 16) & 0xFF);
result.push((bits >> 8) & 0xFF);
result.push(bits & 0xFF);
}
bits = (bits << 6) | map.indexOf(input.charAt(idx));
}
// Dump tail
tailbits = (max % 4) * 6;
if (tailbits === 0) {
result.push((bits >> 16) & 0xFF);
result.push((bits >> 8) & 0xFF);
result.push(bits & 0xFF);
} else if (tailbits === 18) {
result.push((bits >> 10) & 0xFF);
result.push((bits >> 2) & 0xFF);
} else if (tailbits === 12) {
result.push((bits >> 4) & 0xFF);
}
return new Uint8Array(result);
}
function representYamlBinary(object /*, style*/) {
var result = '', bits = 0, idx, tail,
max = object.length,
map = BASE64_MAP;
// Convert every three bytes to 4 ASCII characters.
for (idx = 0; idx < max; idx++) {
if ((idx % 3 === 0) && idx) {
result += map[(bits >> 18) & 0x3F];
result += map[(bits >> 12) & 0x3F];
result += map[(bits >> 6) & 0x3F];
result += map[bits & 0x3F];
}
bits = (bits << 8) + object[idx];
}
// Dump tail
tail = max % 3;
if (tail === 0) {
result += map[(bits >> 18) & 0x3F];
result += map[(bits >> 12) & 0x3F];
result += map[(bits >> 6) & 0x3F];
result += map[bits & 0x3F];
} else if (tail === 2) {
result += map[(bits >> 10) & 0x3F];
result += map[(bits >> 4) & 0x3F];
result += map[(bits << 2) & 0x3F];
result += map[64];
} else if (tail === 1) {
result += map[(bits >> 2) & 0x3F];
result += map[(bits << 4) & 0x3F];
result += map[64];
result += map[64];
}
return result;
}
function isBinary(obj) {
return Object.prototype.toString.call(obj) === '[object Uint8Array]';
}
module.exports = new Type('tag:yaml.org,2002:binary', {
kind: 'scalar',
resolve: resolveYamlBinary,
construct: constructYamlBinary,
predicate: isBinary,
represent: representYamlBinary
});

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P","66":"Q H R S T U V W X"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC"},D:{"1":"0 9 Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC","66":"DC Q H R S T U V W X"},E:{"2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"1":"0 BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 4C 5C 6C 7C FC kC 8C GC","66":"1B 2B 3B 4B 5B 6B 7B 8B 9B AC"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"2":"LC J I XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"2":"A B C H FC kC GC"},L:{"2":"I"},M:{"2":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"2":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"2":"oD"},R:{"2":"pD"},S:{"2":"qD rD"}},B:7,C:"WebHID API",D:true};

View File

@@ -0,0 +1,96 @@
'use strict';
// undocumented cb() API, needed for core, not for public API
function destroy(err, cb) {
var _this = this;
var readableDestroyed = this._readableState && this._readableState.destroyed;
var writableDestroyed = this._writableState && this._writableState.destroyed;
if (readableDestroyed || writableDestroyed) {
if (cb) {
cb(err);
} else if (err) {
if (!this._writableState) {
process.nextTick(emitErrorNT, this, err);
} else if (!this._writableState.errorEmitted) {
this._writableState.errorEmitted = true;
process.nextTick(emitErrorNT, this, err);
}
}
return this;
}
// we set destroyed to true before firing error callbacks in order
// to make it re-entrance safe in case destroy() is called within callbacks
if (this._readableState) {
this._readableState.destroyed = true;
}
// if this is a duplex stream mark the writable part as destroyed as well
if (this._writableState) {
this._writableState.destroyed = true;
}
this._destroy(err || null, function (err) {
if (!cb && err) {
if (!_this._writableState) {
process.nextTick(emitErrorAndCloseNT, _this, err);
} else if (!_this._writableState.errorEmitted) {
_this._writableState.errorEmitted = true;
process.nextTick(emitErrorAndCloseNT, _this, err);
} else {
process.nextTick(emitCloseNT, _this);
}
} else if (cb) {
process.nextTick(emitCloseNT, _this);
cb(err);
} else {
process.nextTick(emitCloseNT, _this);
}
});
return this;
}
function emitErrorAndCloseNT(self, err) {
emitErrorNT(self, err);
emitCloseNT(self);
}
function emitCloseNT(self) {
if (self._writableState && !self._writableState.emitClose) return;
if (self._readableState && !self._readableState.emitClose) return;
self.emit('close');
}
function undestroy() {
if (this._readableState) {
this._readableState.destroyed = false;
this._readableState.reading = false;
this._readableState.ended = false;
this._readableState.endEmitted = false;
}
if (this._writableState) {
this._writableState.destroyed = false;
this._writableState.ended = false;
this._writableState.ending = false;
this._writableState.finalCalled = false;
this._writableState.prefinished = false;
this._writableState.finished = false;
this._writableState.errorEmitted = false;
}
}
function emitErrorNT(self, err) {
self.emit('error', err);
}
function errorOrDestroy(stream, err) {
// We have tests that rely on errors being emitted
// in the same tick, so changing this is semver major.
// For now when you opt-in to autoDestroy we allow
// the error to be emitted nextTick. In a future
// semver major update we should change the default to this.
var rState = stream._readableState;
var wState = stream._writableState;
if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err);else stream.emit('error', err);
}
module.exports = {
destroy: destroy,
undestroy: undestroy,
errorOrDestroy: errorOrDestroy
};

View File

@@ -0,0 +1,78 @@
/**
* @fileoverview Rule to disallow a duplicate case label.
* @author Dieter Oberkofler
* @author Burak Yigit Kaya
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow duplicate case labels",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-duplicate-case",
},
schema: [],
messages: {
unexpected: "Duplicate case label.",
},
},
create(context) {
const sourceCode = context.sourceCode;
/**
* Determines whether the two given nodes are considered to be equal.
* @param {ASTNode} a First node.
* @param {ASTNode} b Second node.
* @returns {boolean} `true` if the nodes are considered to be equal.
*/
function equal(a, b) {
if (a.type !== b.type) {
return false;
}
return astUtils.equalTokens(a, b, sourceCode);
}
return {
SwitchStatement(node) {
const previousTests = [];
for (const switchCase of node.cases) {
if (switchCase.test) {
const test = switchCase.test;
if (
previousTests.some(previousTest =>
equal(previousTest, test),
)
) {
context.report({
node: switchCase,
messageId: "unexpected",
});
} else {
previousTests.push(test);
}
}
}
},
};
},
};

View File

@@ -0,0 +1,14 @@
import { useMatch } from "./useMatch.js";
function useLoaderDeps(opts) {
const { select, ...rest } = opts;
return useMatch({
...rest,
select: (s) => {
return select ? select(s.loaderDeps) : s.loaderDeps;
}
});
}
export {
useLoaderDeps
};
//# sourceMappingURL=useLoaderDeps.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_classNameTDZError","name","ReferenceError"],"sources":["../../src/helpers/classNameTDZError.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _classNameTDZError(name) {\n throw new ReferenceError(\n 'Class \"' + name + '\" cannot be referenced in computed property keys.',\n );\n}\n"],"mappings":";;;;;;AAEe,SAASA,kBAAkBA,CAACC,IAAI,EAAE;EAC/C,MAAM,IAAIC,cAAc,CACtB,SAAS,GAAGD,IAAI,GAAG,mDACrB,CAAC;AACH","ignoreList":[]}

View File

@@ -0,0 +1,42 @@
{
"name": "strip-json-comments",
"version": "2.0.1",
"description": "Strip comments from JSON. Lets you use comments in your JSON files!",
"license": "MIT",
"repository": "sindresorhus/strip-json-comments",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"json",
"strip",
"remove",
"delete",
"trim",
"comments",
"multiline",
"parse",
"config",
"configuration",
"conf",
"settings",
"util",
"env",
"environment"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
}

View File

@@ -0,0 +1,20 @@
import type { AllLoaderData, RouteById } from './routeInfo'
import type { AnyRouter } from './router'
import type { Expand } from './utils'
export type ResolveUseLoaderData<
TRouter extends AnyRouter,
TFrom,
TStrict extends boolean,
> = TStrict extends false
? AllLoaderData<TRouter['routeTree']>
: Expand<RouteById<TRouter['routeTree'], TFrom>['types']['loaderData']>
export type UseLoaderDataResult<
TRouter extends AnyRouter,
TFrom,
TStrict extends boolean,
TSelected,
> = unknown extends TSelected
? ResolveUseLoaderData<TRouter, TFrom, TStrict>
: TSelected

View File

@@ -0,0 +1,97 @@
const conversions = require('./conversions');
/*
This function routes a model to all other models.
all functions that are routed have a property `.conversion` attached
to the returned synthetic function. This property is an array
of strings, each with the steps in between the 'from' and 'to'
color models (inclusive).
conversions that are not possible simply are not included.
*/
function buildGraph() {
const graph = {};
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
const models = Object.keys(conversions);
for (let len = models.length, i = 0; i < len; i++) {
graph[models[i]] = {
// http://jsperf.com/1-vs-infinity
// micro-opt, but this is simple.
distance: -1,
parent: null
};
}
return graph;
}
// https://en.wikipedia.org/wiki/Breadth-first_search
function deriveBFS(fromModel) {
const graph = buildGraph();
const queue = [fromModel]; // Unshift -> queue -> pop
graph[fromModel].distance = 0;
while (queue.length) {
const current = queue.pop();
const adjacents = Object.keys(conversions[current]);
for (let len = adjacents.length, i = 0; i < len; i++) {
const adjacent = adjacents[i];
const node = graph[adjacent];
if (node.distance === -1) {
node.distance = graph[current].distance + 1;
node.parent = current;
queue.unshift(adjacent);
}
}
}
return graph;
}
function link(from, to) {
return function (args) {
return to(from(args));
};
}
function wrapConversion(toModel, graph) {
const path = [graph[toModel].parent, toModel];
let fn = conversions[graph[toModel].parent][toModel];
let cur = graph[toModel].parent;
while (graph[cur].parent) {
path.unshift(graph[cur].parent);
fn = link(conversions[graph[cur].parent][cur], fn);
cur = graph[cur].parent;
}
fn.conversion = path;
return fn;
}
module.exports = function (fromModel) {
const graph = deriveBFS(fromModel);
const conversion = {};
const models = Object.keys(graph);
for (let len = models.length, i = 0; i < len; i++) {
const toModel = models[i];
const node = graph[toModel];
if (node.parent === null) {
// No possible conversion, or this node is the source model.
continue;
}
conversion[toModel] = wrapConversion(toModel, graph);
}
return conversion;
};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E mC","132":"F","260":"A B"},B:{"1":"0 9 N O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","260":"C L M G"},C:{"1":"0 1 2 3 4 5 6 7 8 9 QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC J PB K D E F A B C L M G N O P qC rC"},D:{"1":"0 7 8 9 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"J PB K D E F A B C L M G N O P QB","260":"1 2 3 4 5 6"},E:{"1":"D E F A B C L M G uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB sC SC tC","260":"K"},F:{"1":"0 1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"F B C 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"E DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"SC 9C lC AD","516":"CD","772":"BD"},H:{"2":"WD"},I:{"1":"I bD cD","2":"LC J XD YD ZD aD lC"},J:{"1":"A","2":"D"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"260":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"qD rD"}},B:4,C:"Viewport units: vw, vh, vmin, vmax",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"names":["_isNativeFunction","fn","Function","toString","call","indexOf","_e"],"sources":["../../src/helpers/isNativeFunction.ts"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n\nexport default function _isNativeFunction(fn: unknown): fn is Function {\n // Note: This function returns \"true\" for core-js functions.\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (_e) {\n // Firefox 31 throws when \"toString\" is applied to an HTMLElement\n return typeof fn === \"function\";\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,iBAAiBA,CAACC,EAAW,EAAkB;EAErE,IAAI;IACF,OAAOC,QAAQ,CAACC,QAAQ,CAACC,IAAI,CAACH,EAAE,CAAC,CAACI,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;EACnE,CAAC,CAAC,OAAOC,EAAE,EAAE;IAEX,OAAO,OAAOL,EAAE,KAAK,UAAU;EACjC;AACF","ignoreList":[]}

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const warning = require("tiny-warning");
const routerContext = require("./routerContext.cjs");
function _interopNamespaceDefault(e) {
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
if (e) {
for (const k in e) {
if (k !== "default") {
const d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: () => e[k]
});
}
}
}
n.default = e;
return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
function useRouter(opts) {
const value = React__namespace.useContext(routerContext.getRouterContext());
warning(
!(((opts == null ? void 0 : opts.warn) ?? true) && !value),
"useRouter must be used inside a <RouterProvider> component!"
);
return value;
}
exports.useRouter = useRouter;
//# sourceMappingURL=useRouter.cjs.map

View File

@@ -0,0 +1,158 @@
/**
* @fileoverview Rule to disallow unused labels.
* @author Toru Nagashima
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Disallow unused labels",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-unused-labels",
},
schema: [],
fixable: "code",
messages: {
unused: "'{{name}}:' is defined but never used.",
},
},
create(context) {
const sourceCode = context.sourceCode;
let scopeInfo = null;
/**
* Adds a scope info to the stack.
* @param {ASTNode} node A node to add. This is a LabeledStatement.
* @returns {void}
*/
function enterLabeledScope(node) {
scopeInfo = {
label: node.label.name,
used: false,
upper: scopeInfo,
};
}
/**
* Checks if a `LabeledStatement` node is fixable.
* For a node to be fixable, there must be no comments between the label and the body.
* Furthermore, is must be possible to remove the label without turning the body statement into a
* directive after other fixes are applied.
* @param {ASTNode} node The node to evaluate.
* @returns {boolean} Whether or not the node is fixable.
*/
function isFixable(node) {
/*
* Only perform a fix if there are no comments between the label and the body. This will be the case
* when there is exactly one token/comment (the ":") between the label and the body.
*/
if (
sourceCode.getTokenAfter(node.label, {
includeComments: true,
}) !==
sourceCode.getTokenBefore(node.body, { includeComments: true })
) {
return false;
}
// Looking for the node's deepest ancestor which is not a `LabeledStatement`.
let ancestor = node.parent;
while (ancestor.type === "LabeledStatement") {
ancestor = ancestor.parent;
}
if (
ancestor.type === "Program" ||
(ancestor.type === "BlockStatement" &&
astUtils.isFunction(ancestor.parent))
) {
const { body } = node;
if (
body.type === "ExpressionStatement" &&
((body.expression.type === "Literal" &&
typeof body.expression.value === "string") ||
astUtils.isStaticTemplateLiteral(body.expression))
) {
return false; // potential directive
}
}
return true;
}
/**
* Removes the top of the stack.
* At the same time, this reports the label if it's never used.
* @param {ASTNode} node A node to report. This is a LabeledStatement.
* @returns {void}
*/
function exitLabeledScope(node) {
if (!scopeInfo.used) {
context.report({
node: node.label,
messageId: "unused",
data: node.label,
fix: isFixable(node)
? fixer =>
fixer.removeRange([
node.range[0],
node.body.range[0],
])
: null,
});
}
scopeInfo = scopeInfo.upper;
}
/**
* Marks the label of a given node as used.
* @param {ASTNode} node A node to mark. This is a BreakStatement or
* ContinueStatement.
* @returns {void}
*/
function markAsUsed(node) {
if (!node.label) {
return;
}
const label = node.label.name;
let info = scopeInfo;
while (info) {
if (info.label === label) {
info.used = true;
break;
}
info = info.upper;
}
}
return {
LabeledStatement: enterLabeledScope,
"LabeledStatement:exit": exitLabeledScope,
BreakStatement: markAsUsed,
ContinueStatement: markAsUsed,
};
},
};

View File

@@ -0,0 +1,10 @@
'use client';
import { createContext } from 'react';
import type { DocumentContextType } from './shared/types.js';
const documentContext: React.Context<DocumentContextType> =
createContext<DocumentContextType>(null);
export default documentContext;

View File

@@ -0,0 +1 @@
module.exports={C:{"52":0.0083,"86":0.00277,"105":0.00277,"106":0.00553,"107":0.0083,"108":0.00553,"109":0.00553,"110":0.00553,"111":0.00553,"112":0.00553,"115":0.15219,"123":0.00277,"125":0.00277,"126":0.00277,"127":0.00277,"128":0.01107,"129":0.00277,"130":0.00277,"131":0.00277,"132":0.00277,"133":0.00553,"134":0.00553,"135":0.08578,"136":0.33481,"137":0.00553,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 113 114 116 117 118 119 120 121 122 124 138 139 140 3.5 3.6"},D:{"43":0.00277,"47":0.00277,"48":0.00553,"49":0.00277,"50":0.00277,"56":0.00553,"57":0.00277,"58":0.00277,"60":0.00277,"62":0.00277,"64":0.00277,"65":0.00277,"66":0.00277,"68":0.0083,"69":0.00553,"70":0.00277,"71":0.00553,"72":0.00553,"73":0.00553,"74":0.0083,"75":0.01107,"76":0.0083,"77":0.0083,"78":0.00277,"79":0.0083,"80":0.01384,"81":0.00553,"83":0.00553,"84":0.00553,"85":0.00277,"86":0.01107,"87":0.0249,"88":0.00553,"89":0.0083,"90":0.00277,"91":0.01937,"92":0.00277,"93":0.0249,"94":0.00277,"95":0.01107,"96":0.00277,"97":0.00277,"98":0.00553,"99":0.01384,"100":0.0083,"101":0.00277,"102":0.0166,"103":0.11621,"104":0.14112,"105":0.01937,"106":0.07471,"107":0.08578,"108":0.09685,"109":1.95627,"110":0.05257,"111":0.05534,"112":0.05257,"113":0.00277,"114":0.0166,"115":0.00277,"116":0.05257,"117":0.00277,"118":0.01107,"119":0.02767,"120":0.02214,"121":0.01384,"122":0.02767,"123":0.01937,"124":0.03597,"125":0.04704,"126":0.09961,"127":0.02214,"128":0.05257,"129":0.04427,"130":0.05257,"131":0.20753,"132":0.21859,"133":5.2905,"134":11.01819,"135":0.02767,"136":0.0083,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 45 46 51 52 53 54 55 59 61 63 67 137 138"},F:{"44":0.00277,"79":0.00277,"86":0.00277,"87":0.03044,"88":0.01384,"90":0.00277,"91":0.00277,"92":0.00277,"93":0.00277,"94":0.00553,"95":0.04427,"96":0.00277,"114":0.01937,"115":0.00277,"116":0.05257,"117":0.50083,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 89 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"12":0.00277,"14":0.00277,"15":0.00277,"16":0.00277,"18":0.00553,"84":0.00277,"89":0.00277,"92":0.01937,"100":0.00277,"102":0.00277,"103":0.00277,"105":0.00277,"106":0.0083,"107":0.01384,"108":0.01107,"109":0.0166,"110":0.01107,"111":0.00553,"112":0.00277,"114":0.02214,"122":0.00277,"124":0.00277,"125":0.00277,"126":0.00277,"127":0.00277,"128":0.00277,"129":0.00277,"130":0.00277,"131":0.0166,"132":0.02214,"133":0.32651,"134":0.72219,_:"13 17 79 80 81 83 85 86 87 88 90 91 93 94 95 96 97 98 99 101 104 113 115 116 117 118 119 120 121 123"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 16.0 16.4 17.0","5.1":0.00277,"13.1":0.00553,"14.1":0.00277,"15.4":0.00277,"15.5":0.00277,"15.6":0.02767,"16.1":0.00553,"16.2":0.01384,"16.3":0.00553,"16.5":0.00277,"16.6":0.02214,"17.1":0.0083,"17.2":0.00277,"17.3":0.00277,"17.4":0.0083,"17.5":0.00553,"17.6":0.03044,"18.0":0.00553,"18.1":0.01384,"18.2":0.0083,"18.3":0.09131,"18.4":0.00277},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00069,"5.0-5.1":0,"6.0-6.1":0.00207,"7.0-7.1":0.00138,"8.1-8.4":0,"9.0-9.2":0.00104,"9.3":0.00484,"10.0-10.2":0.00035,"10.3":0.00795,"11.0-11.2":0.03665,"11.3-11.4":0.00242,"12.0-12.1":0.00138,"12.2-12.5":0.03423,"13.0-13.1":0.00069,"13.2":0.00104,"13.3":0.00138,"13.4-13.7":0.00484,"14.0-14.4":0.0121,"14.5-14.8":0.01452,"15.0-15.1":0.00795,"15.2-15.3":0.00795,"15.4":0.00968,"15.5":0.01106,"15.6-15.8":0.13622,"16.0":0.01936,"16.1":0.03976,"16.2":0.02074,"16.3":0.03596,"16.4":0.00795,"16.5":0.01487,"16.6-16.7":0.16146,"17.0":0.00968,"17.1":0.01729,"17.2":0.01314,"17.3":0.01832,"17.4":0.03665,"17.5":0.08159,"17.6-17.7":0.23683,"18.0":0.06638,"18.1":0.21712,"18.2":0.09715,"18.3":2.03052,"18.4":0.03008},P:{"4":0.09475,"21":0.02106,"22":0.01053,"23":0.01053,"24":0.02106,"25":0.05264,"26":0.06317,"27":0.61063,_:"20 5.0-5.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 16.0 18.0 19.0","6.2-6.4":0.01053,"7.2-7.4":0.03158,"11.1-11.2":0.01053,"17.0":0.01053},I:{"0":0.05774,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00006},K:{"0":1.22213,_:"10 11 12 11.1 11.5 12.1"},A:{"8":0.00592,"9":0.00296,"10":0.00296,"11":0.11544,_:"6 7 5.5"},S:{"2.5":0.07956,_:"3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.0651},Q:{_:"14.9"},O:{"0":3.51524},H:{"0":0.21},L:{"0":66.68784}};

View File

@@ -0,0 +1,137 @@
[
{
"_id": "59ef4a83ee8364808d761beb",
"index": 0,
"guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d",
"isActive": false,
"balance": "$2,341.81",
"picture": "http://placehold.it/32x32",
"age": 28,
"eyeColor": "brown",
"name": "Carey Savage",
"gender": "female",
"company": "VERAQ",
"email": "careysavage@veraq.com",
"phone": "+1 (897) 574-3014",
"address": "458 Willow Street, Henrietta, California, 7234",
"about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n",
"registered": "2014-05-21T01:56:51 -01:00",
"latitude": 63.89502,
"longitude": 62.369807,
"tags": [
"nostrud",
"nisi",
"consectetur",
"ullamco",
"cupidatat",
"culpa",
"commodo"
],
"friends": [
{
"id": 0,
"name": "Henry Walls"
},
{
"id": 1,
"name": "Janice Baker"
},
{
"id": 2,
"name": "Russell Bush"
}
],
"greeting": "Hello, Carey Savage! You have 4 unread messages.",
"favoriteFruit": "banana"
},
{
"_id": "59ef4a83ff5774a691454e89",
"index": 1,
"guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d",
"isActive": true,
"balance": "$1,618.15",
"picture": "http://placehold.it/32x32",
"age": 35,
"eyeColor": "blue",
"name": "Elinor Pearson",
"gender": "female",
"company": "FLEXIGEN",
"email": "elinorpearson@flexigen.com",
"phone": "+1 (923) 548-3751",
"address": "600 Bayview Avenue, Draper, Montana, 3088",
"about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n",
"registered": "2017-04-22T07:58:41 -01:00",
"latitude": -87.824919,
"longitude": 69.538927,
"tags": [
"fugiat",
"labore",
"proident",
"quis",
"eiusmod",
"qui",
"est"
],
"friends": [
{
"id": 0,
"name": "Massey Wagner"
},
{
"id": 1,
"name": "Marcella Ferrell"
},
{
"id": 2,
"name": "Evans Mckee"
}
],
"greeting": "Hello, Elinor Pearson! You have 3 unread messages.",
"favoriteFruit": "strawberry"
},
{
"_id": "59ef4a839ec8a4be4430b36b",
"index": 2,
"guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809",
"isActive": false,
"balance": "$2,046.95",
"picture": "http://placehold.it/32x32",
"age": 40,
"eyeColor": "green",
"name": "Irwin Davidson",
"gender": "male",
"company": "DANJA",
"email": "irwindavidson@danja.com",
"phone": "+1 (883) 537-2041",
"address": "439 Cook Street, Chapin, Kentucky, 7398",
"about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n",
"registered": "2016-09-01T07:49:08 -01:00",
"latitude": -49.803812,
"longitude": 104.93279,
"tags": [
"consequat",
"enim",
"quis",
"magna",
"est",
"culpa",
"tempor"
],
"friends": [
{
"id": 0,
"name": "Ruth Hansen"
},
{
"id": 1,
"name": "Kathrine Austin"
},
{
"id": 2,
"name": "Rivera Munoz"
}
],
"greeting": "Hello, Irwin Davidson! You have 2 unread messages.",
"favoriteFruit": "banana"
}
]

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"0 9 O P Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N"},C:{"1":"0 9 oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB qC rC"},D:{"1":"0 9 dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB"},E:{"1":"B C L M G TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C","2":"J PB K D E F A sC SC tC uC vC wC"},F:{"1":"0 8 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 F B C G N O P QB 4C 5C 6C 7C FC kC 8C GC"},G:{"1":"HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC","2":"E SC 9C lC AD BD CD DD ED FD GD"},H:{"2":"WD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"},J:{"2":"D A"},K:{"1":"H","2":"A B C FC kC GC"},L:{"1":"I"},M:{"1":"EC"},N:{"2":"A B"},O:{"1":"HC"},P:{"1":"1 2 3 4 5 6 7 8 dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J"},Q:{"1":"oD"},R:{"1":"pD"},S:{"1":"rD","2":"qD"}},B:1,C:"Minimum length attribute for input fields",D:true};

View File

@@ -0,0 +1,59 @@
/**
* @fileoverview A rule to disallow negated left operands of the `in` operator
* @author Michael Ficarra
* @deprecated in ESLint v3.3.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../shared/types').Rule} */
module.exports = {
meta: {
type: "problem",
docs: {
description:
"Disallow negating the left operand in `in` expressions",
recommended: false,
url: "https://eslint.org/docs/latest/rules/no-negated-in-lhs",
},
deprecated: {
message: "Renamed rule.",
url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
deprecatedSince: "3.3.0",
availableUntil: null,
replacedBy: [
{
rule: {
name: "no-unsafe-negation",
url: "https://eslint.org/docs/rules/no-unsafe-negation",
},
},
],
},
schema: [],
messages: {
negatedLHS: "The 'in' expression's left operand is negated.",
},
},
create(context) {
return {
BinaryExpression(node) {
if (
node.operator === "in" &&
node.left.type === "UnaryExpression" &&
node.left.operator === "!"
) {
context.report({ node, messageId: "negatedLHS" });
}
},
};
},
};

View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toBlock;
var _index = require("../validators/generated/index.js");
var _index2 = require("../builders/generated/index.js");
function toBlock(node, parent) {
if ((0, _index.isBlockStatement)(node)) {
return node;
}
let blockNodes = [];
if ((0, _index.isEmptyStatement)(node)) {
blockNodes = [];
} else {
if (!(0, _index.isStatement)(node)) {
if ((0, _index.isFunction)(parent)) {
node = (0, _index2.returnStatement)(node);
} else {
node = (0, _index2.expressionStatement)(node);
}
}
blockNodes = [node];
}
return (0, _index2.blockStatement)(blockNodes);
}
//# sourceMappingURL=toBlock.js.map

View File

@@ -0,0 +1,9 @@
# `scheduler`
This is a package for cooperative scheduling in a browser environment. It is currently used internally by React, but we plan to make it more generic.
The public API for this package is not yet finalized.
### Thanks
The React team thanks [Anton Podviaznikov](https://podviaznikov.com/) for donating the `scheduler` package name.

View File

@@ -0,0 +1 @@
export default function useCachedValue<T>(getter: () => T): () => T;

View File

@@ -0,0 +1,234 @@
{
'conditions': [
['OS=="win"', {
'variables': {
'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle
'with_jpeg%': 'false',
'with_gif%': 'false',
'with_rsvg%': 'false',
'variables': { # Nest jpeg_root to evaluate it before with_jpeg
'jpeg_root%': '<!(node ./util/win_jpeg_lookup)'
},
'jpeg_root%': '<(jpeg_root)', # Take value of nested variable
'conditions': [
['jpeg_root==""', {
'with_jpeg%': 'false'
}, {
'with_jpeg%': 'true'
}]
]
}
}, { # 'OS!="win"'
'variables': {
'with_jpeg%': '<!(node ./util/has_lib.js jpeg)',
'with_gif%': '<!(node ./util/has_lib.js gif)',
'with_rsvg%': '<!(node ./util/has_lib.js rsvg)'
}
}]
],
'targets': [
{
'target_name': 'canvas-postbuild',
'dependencies': ['canvas'],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(GTK_Root)/bin/zlib1.dll',
'<(GTK_Root)/bin/libintl-8.dll',
'<(GTK_Root)/bin/libpng14-14.dll',
'<(GTK_Root)/bin/libpangocairo-1.0-0.dll',
'<(GTK_Root)/bin/libpango-1.0-0.dll',
'<(GTK_Root)/bin/libpangoft2-1.0-0.dll',
'<(GTK_Root)/bin/libpangowin32-1.0-0.dll',
'<(GTK_Root)/bin/libcairo-2.dll',
'<(GTK_Root)/bin/libfontconfig-1.dll',
'<(GTK_Root)/bin/libfreetype-6.dll',
'<(GTK_Root)/bin/libglib-2.0-0.dll',
'<(GTK_Root)/bin/libgobject-2.0-0.dll',
'<(GTK_Root)/bin/libgmodule-2.0-0.dll',
'<(GTK_Root)/bin/libgthread-2.0-0.dll',
'<(GTK_Root)/bin/libexpat-1.dll'
]
}]
}]
]
},
{
'target_name': 'canvas',
'include_dirs': ["<!(node -p \"require('node-addon-api').include_dir\")"],
'defines': [ 'NAPI_DISABLE_CPP_EXCEPTIONS', 'NODE_ADDON_API_ENABLE_MAYBE' ],
'sources': [
'src/backend/Backend.cc',
'src/backend/ImageBackend.cc',
'src/backend/PdfBackend.cc',
'src/backend/SvgBackend.cc',
'src/bmp/BMPParser.cc',
'src/Backends.cc',
'src/Canvas.cc',
'src/CanvasGradient.cc',
'src/CanvasPattern.cc',
'src/CanvasRenderingContext2d.cc',
'src/closure.cc',
'src/color.cc',
'src/Image.cc',
'src/ImageData.cc',
'src/init.cc',
'src/register_font.cc',
'src/FontParser.cc'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/cairo.lib',
'-l<(GTK_Root)/lib/libpng.lib',
'-l<(GTK_Root)/lib/pangocairo-1.0.lib',
'-l<(GTK_Root)/lib/pango-1.0.lib',
'-l<(GTK_Root)/lib/freetype.lib',
'-l<(GTK_Root)/lib/glib-2.0.lib',
'-l<(GTK_Root)/lib/gobject-2.0.lib'
],
'include_dirs': [
'<(GTK_Root)/include',
'<(GTK_Root)/include/cairo',
'<(GTK_Root)/include/pango-1.0',
'<(GTK_Root)/include/glib-2.0',
'<(GTK_Root)/include/freetype2',
'<(GTK_Root)/lib/glib-2.0/include'
],
'defines': [
'_USE_MATH_DEFINES', # for M_PI
'NOMINMAX' # allow std::min/max to work
],
'configurations': {
'Debug': {
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings': [
4100, 4611
]
}
}
},
'Release': {
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': 4,
'ExceptionHandling': 1,
'DisableSpecificWarnings': [
4100, 4611
]
}
}
}
}
}, { # 'OS!="win"'
'libraries': [
'<!@(pkg-config pixman-1 --libs)',
'<!@(pkg-config cairo --libs)',
'<!@(pkg-config libpng --libs)',
'<!@(pkg-config pangocairo --libs)',
'<!@(pkg-config freetype2 --libs)'
],
'include_dirs': [
'<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',
'<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)'
],
'cflags': ['-Wno-cast-function-type'],
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions']
}],
['OS=="mac"', {
'cflags+': ['-fvisibility=hidden'],
'xcode_settings': {
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
}
}],
['with_jpeg=="true"', {
'defines': [
'HAVE_JPEG'
],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(jpeg_root)/bin/jpeg62.dll',
]
}],
'include_dirs': [
'<(jpeg_root)/include'
],
'libraries': [
'-l<(jpeg_root)/lib/jpeg.lib',
]
}, {
'include_dirs': [
'<!@(pkg-config libjpeg --cflags-only-I | sed s/-I//g)'
],
'libraries': [
'<!@(pkg-config libjpeg --libs)'
]
}]
]
}],
['with_gif=="true"', {
'defines': [
'HAVE_GIF'
],
'conditions': [
['OS=="win"', {
'libraries': [
'-l<(GTK_Root)/lib/gif.lib'
]
}, {
'include_dirs': [
'/opt/homebrew/include'
],
'libraries': [
'-L/opt/homebrew/lib',
'-lgif'
]
}]
]
}],
['with_rsvg=="true"', {
'defines': [
'HAVE_RSVG'
],
'conditions': [
['OS=="win"', {
'copies': [{
'destination': '<(PRODUCT_DIR)',
'files': [
'<(GTK_Root)/bin/librsvg-2-2.dll',
'<(GTK_Root)/bin/libgdk_pixbuf-2.0-0.dll',
'<(GTK_Root)/bin/libgio-2.0-0.dll',
'<(GTK_Root)/bin/libcroco-0.6-3.dll',
'<(GTK_Root)/bin/libgsf-1-114.dll',
'<(GTK_Root)/bin/libxml2-2.dll'
]
}],
'libraries': [
'-l<(GTK_Root)/lib/librsvg-2-2.lib'
]
}, {
'include_dirs': [
'<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'
],
'libraries': [
'<!@(pkg-config librsvg-2.0 --libs)'
]
}]
]
}]
]
}
]
}

View File

@@ -0,0 +1,73 @@
'use strict';
module.exports = function generate_oneOf(it, $keyword, $ruleType) {
var out = ' ';
var $lvl = it.level;
var $dataLvl = it.dataLevel;
var $schema = it.schema[$keyword];
var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $data = 'data' + ($dataLvl || '');
var $valid = 'valid' + $lvl;
var $errs = 'errs__' + $lvl;
var $it = it.util.copy(it);
var $closingBraces = '';
$it.level++;
var $nextValid = 'valid' + $it.level;
var $currentBaseId = $it.baseId,
$prevValid = 'prevValid' + $lvl,
$passingSchemas = 'passingSchemas' + $lvl;
out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';
var $wasComposite = it.compositeRule;
it.compositeRule = $it.compositeRule = true;
var arr1 = $schema;
if (arr1) {
var $sch, $i = -1,
l1 = arr1.length - 1;
while ($i < l1) {
$sch = arr1[$i += 1];
if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
out += ' ' + (it.validate($it)) + ' ';
$it.baseId = $currentBaseId;
} else {
out += ' var ' + ($nextValid) + ' = true; ';
}
if ($i) {
out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';
$closingBraces += '}';
}
out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';
}
}
it.compositeRule = $it.compositeRule = $wasComposite;
out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
if (it.createErrors !== false) {
out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';
if (it.opts.messages !== false) {
out += ' , message: \'should match exactly one schema in oneOf\' ';
}
if (it.opts.verbose) {
out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
}
out += ' } ';
} else {
out += ' {} ';
}
out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
if (!it.compositeRule && $breakOnError) {
/* istanbul ignore if */
if (it.async) {
out += ' throw new ValidationError(vErrors); ';
} else {
out += ' validate.errors = vErrors; return false; ';
}
}
out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';
if (it.opts.allErrors) {
out += ' } ';
}
return out;
}