parent
b0352e4c5f
commit
d864ed501a
2
front_page/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
generated
vendored
2
front_page/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -1,73 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
// Always use the latest available version of Unicode!
|
||||
// https://tc39.github.io/ecma262/#sec-conformance
|
||||
const version = "15.1.0";
|
||||
|
||||
const start = require(
|
||||
"@unicode/unicode-" + version + "/Binary_Property/ID_Start/code-points.js"
|
||||
).filter(function (ch) {
|
||||
return ch > 0x7f;
|
||||
});
|
||||
let last = -1;
|
||||
const cont = require(
|
||||
"@unicode/unicode-" + version + "/Binary_Property/ID_Continue/code-points.js"
|
||||
).filter(function (ch) {
|
||||
return ch > 0x7f && search(start, ch, last + 1) === -1;
|
||||
});
|
||||
|
||||
function search(arr, ch, starting) {
|
||||
for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
|
||||
if (arr[i] === ch) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function pad(str, width) {
|
||||
while (str.length < width) str = "0" + str;
|
||||
return str;
|
||||
}
|
||||
|
||||
function esc(code) {
|
||||
const hex = code.toString(16);
|
||||
if (hex.length <= 2) return "\\x" + pad(hex, 2);
|
||||
else return "\\u" + pad(hex, 4);
|
||||
}
|
||||
|
||||
function generate(chars) {
|
||||
const astral = [];
|
||||
let re = "";
|
||||
for (let i = 0, at = 0x10000; i < chars.length; i++) {
|
||||
const from = chars[i];
|
||||
let to = from;
|
||||
while (i < chars.length - 1 && chars[i + 1] === to + 1) {
|
||||
i++;
|
||||
to++;
|
||||
}
|
||||
if (to <= 0xffff) {
|
||||
if (from === to) re += esc(from);
|
||||
else if (from + 1 === to) re += esc(from) + esc(to);
|
||||
else re += esc(from) + "-" + esc(to);
|
||||
} else {
|
||||
astral.push(from - at, to - from);
|
||||
at = to;
|
||||
}
|
||||
}
|
||||
return { nonASCII: re, astral: astral };
|
||||
}
|
||||
|
||||
const startData = generate(start);
|
||||
const contData = generate(cont);
|
||||
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log(
|
||||
"const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
|
||||
);
|
||||
console.log("/* prettier-ignore */");
|
||||
console.log(
|
||||
"const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
|
||||
);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"names":["_validate","require","_index","validateNode","node","keys","BUILDER_KEYS","type","key","validate"],"sources":["../../src/builders/validateNode.ts"],"sourcesContent":["import validate from \"../validators/validate.ts\";\nimport type * as t from \"../index.ts\";\nimport { BUILDER_KEYS } from \"../index.ts\";\n\nexport default function validateNode<N extends t.Node>(node: N) {\n // todo: because keys not in BUILDER_KEYS are not validated - this actually allows invalid nodes in some cases\n const keys = BUILDER_KEYS[node.type] as (keyof N & string)[];\n for (const key of keys) {\n validate(node, key, node[key]);\n }\n return node;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEe,SAASE,YAAYA,CAAmBC,IAAO,EAAE;EAE9D,MAAMC,IAAI,GAAGC,mBAAY,CAACF,IAAI,CAACG,IAAI,CAAyB;EAC5D,KAAK,MAAMC,GAAG,IAAIH,IAAI,EAAE;IACtB,IAAAI,iBAAQ,EAACL,IAAI,EAAEI,GAAG,EAAEJ,IAAI,CAACI,GAAG,CAAC,CAAC;EAChC;EACA,OAAOJ,IAAI;AACb","ignoreList":[]}
|
||||
{"version":3,"names":["_validate","require","_index","validateNode","node","fields","NODE_FIELDS","type","keys","BUILDER_KEYS","key","field","validateInternal"],"sources":["../../src/builders/validateNode.ts"],"sourcesContent":["import { validateInternal } from \"../validators/validate.ts\";\nimport type * as t from \"../index.ts\";\nimport { BUILDER_KEYS, NODE_FIELDS } from \"../index.ts\";\n\nexport default function validateNode<N extends t.Node>(node: N) {\n if (node == null || typeof node !== \"object\") return;\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n // todo: because keys not in BUILDER_KEYS are not validated - this actually allows invalid nodes in some cases\n const keys = BUILDER_KEYS[node.type] as (keyof N & string)[];\n for (const key of keys) {\n const field = fields[key];\n if (field != null) validateInternal(field, node, key, node[key]);\n }\n return node;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEe,SAASE,YAAYA,CAAmBC,IAAO,EAAE;EAC9D,IAAIA,IAAI,IAAI,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;EAC9C,MAAMC,MAAM,GAAGC,kBAAW,CAACF,IAAI,CAACG,IAAI,CAAC;EACrC,IAAI,CAACF,MAAM,EAAE;EAGb,MAAMG,IAAI,GAAGC,mBAAY,CAACL,IAAI,CAACG,IAAI,CAAyB;EAC5D,KAAK,MAAMG,GAAG,IAAIF,IAAI,EAAE;IACtB,MAAMG,KAAK,GAAGN,MAAM,CAACK,GAAG,CAAC;IACzB,IAAIC,KAAK,IAAI,IAAI,EAAE,IAAAC,0BAAgB,EAACD,KAAK,EAAEP,IAAI,EAAEM,GAAG,EAAEN,IAAI,CAACM,GAAG,CAAC,CAAC;EAClE;EACA,OAAON,IAAI;AACb","ignoreList":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"names":["_toFastProperties","require","_utils","_placeholders","_deprecatedAliases","Object","keys","DEPRECATED_ALIASES","forEach","deprecatedAlias","FLIPPED_ALIAS_KEYS","toFastProperties","VISITOR_KEYS","ALIAS_KEYS","NODE_FIELDS","BUILDER_KEYS","DEPRECATED_KEYS","PLACEHOLDERS_ALIAS","PLACEHOLDERS_FLIPPED_ALIAS","TYPES","exports","concat"],"sources":["../../src/definitions/index.ts"],"sourcesContent":["import toFastProperties from \"to-fast-properties\";\nimport \"./core.ts\";\nimport \"./flow.ts\";\nimport \"./jsx.ts\";\nimport \"./misc.ts\";\nimport \"./experimental.ts\";\nimport \"./typescript.ts\";\nimport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n} from \"./utils.ts\";\nimport {\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n} from \"./placeholders.ts\";\nimport { DEPRECATED_ALIASES } from \"./deprecated-aliases.ts\";\n\n(\n Object.keys(DEPRECATED_ALIASES) as (keyof typeof DEPRECATED_ALIASES)[]\n).forEach(deprecatedAlias => {\n FLIPPED_ALIAS_KEYS[deprecatedAlias] =\n FLIPPED_ALIAS_KEYS[DEPRECATED_ALIASES[deprecatedAlias]];\n});\n\n// We do this here, because at this point the visitor keys should be ready and setup\ntoFastProperties(VISITOR_KEYS);\ntoFastProperties(ALIAS_KEYS);\ntoFastProperties(FLIPPED_ALIAS_KEYS);\ntoFastProperties(NODE_FIELDS);\ntoFastProperties(BUILDER_KEYS);\ntoFastProperties(DEPRECATED_KEYS);\n\ntoFastProperties(PLACEHOLDERS_ALIAS);\ntoFastProperties(PLACEHOLDERS_FLIPPED_ALIAS);\n\nconst TYPES: Array<string> = [].concat(\n Object.keys(VISITOR_KEYS),\n Object.keys(FLIPPED_ALIAS_KEYS),\n Object.keys(DEPRECATED_KEYS),\n);\n\nexport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_ALIASES,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n TYPES,\n};\n\nexport type { FieldOptions } from \"./utils.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,kBAAA,GAAAH,OAAA;AAGEI,MAAM,CAACC,IAAI,CAACC,qCAAkB,CAAC,CAC/BC,OAAO,CAACC,eAAe,IAAI;EAC3BC,yBAAkB,CAACD,eAAe,CAAC,GACjCC,yBAAkB,CAACH,qCAAkB,CAACE,eAAe,CAAC,CAAC;AAC3D,CAAC,CAAC;AAGFE,iBAAgB,CAACC,mBAAY,CAAC;AAC9BD,iBAAgB,CAACE,iBAAU,CAAC;AAC5BF,iBAAgB,CAACD,yBAAkB,CAAC;AACpCC,iBAAgB,CAACG,kBAAW,CAAC;AAC7BH,iBAAgB,CAACI,mBAAY,CAAC;AAC9BJ,iBAAgB,CAACK,sBAAe,CAAC;AAEjCL,iBAAgB,CAACM,gCAAkB,CAAC;AACpCN,iBAAgB,CAACO,wCAA0B,CAAC;AAE5C,MAAMC,KAAoB,GAAAC,OAAA,CAAAD,KAAA,GAAG,EAAE,CAACE,MAAM,CACpChB,MAAM,CAACC,IAAI,CAACM,mBAAY,CAAC,EACzBP,MAAM,CAACC,IAAI,CAACI,yBAAkB,CAAC,EAC/BL,MAAM,CAACC,IAAI,CAACU,sBAAe,CAC7B,CAAC","ignoreList":[]}
|
||||
{"version":3,"names":["require","_utils","_placeholders","_deprecatedAliases","Object","keys","DEPRECATED_ALIASES","forEach","deprecatedAlias","FLIPPED_ALIAS_KEYS","TYPES","exports","concat","VISITOR_KEYS","DEPRECATED_KEYS"],"sources":["../../src/definitions/index.ts"],"sourcesContent":["import \"./core.ts\";\nimport \"./flow.ts\";\nimport \"./jsx.ts\";\nimport \"./misc.ts\";\nimport \"./experimental.ts\";\nimport \"./typescript.ts\";\nimport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n} from \"./utils.ts\";\nimport {\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n} from \"./placeholders.ts\";\nimport { DEPRECATED_ALIASES } from \"./deprecated-aliases.ts\";\n\n(\n Object.keys(DEPRECATED_ALIASES) as (keyof typeof DEPRECATED_ALIASES)[]\n).forEach(deprecatedAlias => {\n FLIPPED_ALIAS_KEYS[deprecatedAlias] =\n FLIPPED_ALIAS_KEYS[DEPRECATED_ALIASES[deprecatedAlias]];\n});\n\nconst TYPES: Array<string> = [].concat(\n Object.keys(VISITOR_KEYS),\n Object.keys(FLIPPED_ALIAS_KEYS),\n Object.keys(DEPRECATED_KEYS),\n);\n\nexport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_ALIASES,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n TYPES,\n};\n\nexport type { FieldOptions } from \"./utils.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACAA,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,kBAAA,GAAAH,OAAA;AAGEI,MAAM,CAACC,IAAI,CAACC,qCAAkB,CAAC,CAC/BC,OAAO,CAACC,eAAe,IAAI;EAC3BC,yBAAkB,CAACD,eAAe,CAAC,GACjCC,yBAAkB,CAACH,qCAAkB,CAACE,eAAe,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAME,KAAoB,GAAAC,OAAA,CAAAD,KAAA,GAAG,EAAE,CAACE,MAAM,CACpCR,MAAM,CAACC,IAAI,CAACQ,mBAAY,CAAC,EACzBT,MAAM,CAACC,IAAI,CAACI,yBAAkB,CAAC,EAC/BL,MAAM,CAACC,IAAI,CAACS,sBAAe,CAC7B,CAAC","ignoreList":[]}
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"names":["_utils","require","_placeholders","defineType","defineAliasedType","visitor","builder","fields","name","validate","assertNodeType","expectedNode","assertOneOf","PLACEHOLDERS","assertValueType"],"sources":["../../src/definitions/misc.ts"],"sourcesContent":["import {\n defineAliasedType,\n assertNodeType,\n assertOneOf,\n assertValueType,\n} from \"./utils.ts\";\nimport { PLACEHOLDERS } from \"./placeholders.ts\";\n\nconst defineType = defineAliasedType(\"Miscellaneous\");\n\nif (!process.env.BABEL_8_BREAKING) {\n defineType(\"Noop\", {\n visitor: [],\n });\n}\n\ndefineType(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n // aliases: [], defined in placeholders.js\n fields: {\n name: {\n validate: assertNodeType(\"Identifier\"),\n },\n expectedNode: {\n validate: assertOneOf(...PLACEHOLDERS),\n },\n },\n});\n\ndefineType(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,aAAA,GAAAD,OAAA;AAEA,MAAME,UAAU,GAAG,IAAAC,wBAAiB,EAAC,eAAe,CAAC;AAElB;EACjCD,UAAU,CAAC,MAAM,EAAE;IACjBE,OAAO,EAAE;EACX,CAAC,CAAC;AACJ;AAEAF,UAAU,CAAC,aAAa,EAAE;EACxBE,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC;EAEjCC,MAAM,EAAE;IACNC,IAAI,EAAE;MACJC,QAAQ,EAAE,IAAAC,qBAAc,EAAC,YAAY;IACvC,CAAC;IACDC,YAAY,EAAE;MACZF,QAAQ,EAAE,IAAAG,kBAAW,EAAC,GAAGC,0BAAY;IACvC;EACF;AACF,CAAC,CAAC;AAEFV,UAAU,CAAC,uBAAuB,EAAE;EAClCG,OAAO,EAAE,CAAC,MAAM,CAAC;EACjBC,MAAM,EAAE;IACNC,IAAI,EAAE;MACJC,QAAQ,EAAE,IAAAK,sBAAe,EAAC,QAAQ;IACpC;EACF;AACF,CAAC,CAAC","ignoreList":[]}
|
||||
{"version":3,"names":["_utils","require","_placeholders","_core","defineType","defineAliasedType","visitor","builder","fields","Object","assign","name","validate","assertNodeType","expectedNode","assertOneOf","PLACEHOLDERS","patternLikeCommon","assertValueType"],"sources":["../../src/definitions/misc.ts"],"sourcesContent":["import {\n defineAliasedType,\n assertNodeType,\n assertOneOf,\n assertValueType,\n} from \"./utils.ts\";\nimport { PLACEHOLDERS } from \"./placeholders.ts\";\nimport { patternLikeCommon } from \"./core.ts\";\n\nconst defineType = defineAliasedType(\"Miscellaneous\");\n\nif (!process.env.BABEL_8_BREAKING) {\n defineType(\"Noop\", {\n visitor: [],\n });\n}\n\ndefineType(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n // aliases: [], defined in placeholders.js\n fields: {\n name: {\n validate: assertNodeType(\"Identifier\"),\n },\n expectedNode: {\n validate: assertOneOf(...PLACEHOLDERS),\n },\n ...patternLikeCommon(),\n },\n});\n\ndefineType(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEA,MAAMG,UAAU,GAAG,IAAAC,wBAAiB,EAAC,eAAe,CAAC;AAElB;EACjCD,UAAU,CAAC,MAAM,EAAE;IACjBE,OAAO,EAAE;EACX,CAAC,CAAC;AACJ;AAEAF,UAAU,CAAC,aAAa,EAAE;EACxBE,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC;EAEjCC,MAAM,EAAAC,MAAA,CAAAC,MAAA;IACJC,IAAI,EAAE;MACJC,QAAQ,EAAE,IAAAC,qBAAc,EAAC,YAAY;IACvC,CAAC;IACDC,YAAY,EAAE;MACZF,QAAQ,EAAE,IAAAG,kBAAW,EAAC,GAAGC,0BAAY;IACvC;EAAC,GACE,IAAAC,uBAAiB,EAAC,CAAC;AAE1B,CAAC,CAAC;AAEFb,UAAU,CAAC,uBAAuB,EAAE;EAClCG,OAAO,EAAE,CAAC,MAAM,CAAC;EACjBC,MAAM,EAAE;IACNG,IAAI,EAAE;MACJC,QAAQ,EAAE,IAAAM,sBAAe,EAAC,QAAQ;IACpC;EACF;AACF,CAAC,CAAC","ignoreList":[]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
{"version":3,"names":["_shallowEqual","require","_isType","_isPlaceholderType","_index","is","type","node","opts","matches","isType","FLIPPED_ALIAS_KEYS","isPlaceholderType","expectedNode","shallowEqual"],"sources":["../../src/validators/is.ts"],"sourcesContent":["import shallowEqual from \"../utils/shallowEqual.ts\";\nimport isType from \"./isType.ts\";\nimport isPlaceholderType from \"./isPlaceholderType.ts\";\nimport { FLIPPED_ALIAS_KEYS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function is<T extends t.Node[\"type\"]>(\n type: T,\n node: t.Node | null | undefined,\n opts?: undefined,\n): node is Extract<t.Node, { type: T }>;\n\nexport default function is<\n T extends t.Node[\"type\"],\n P extends Extract<t.Node, { type: T }>,\n>(type: T, n: t.Node | null | undefined, required: Partial<P>): n is P;\n\nexport default function is<P extends t.Node>(\n type: string,\n node: t.Node | null | undefined,\n opts: Partial<P>,\n): node is P;\n\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial<t.Node>,\n): node is t.Node;\n/**\n * Returns whether `node` is of given `type`.\n *\n * For better performance, use this instead of `is[Type]` when `type` is unknown.\n */\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial<t.Node>,\n): node is t.Node {\n if (!node) return false;\n\n const matches = isType(node.type, type);\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in FLIPPED_ALIAS_KEYS) {\n // We can only return true if the placeholder doesn't replace a real node,\n // but it replaces a category of nodes (an alias).\n //\n // t.is(\"Identifier\", node) gives some guarantees about node's shape, so we\n // can't say that Placeholder(expectedNode: \"Identifier\") is an identifier\n // because it doesn't have the same properties.\n // On the other hand, t.is(\"Expression\", node) doesn't say anything about\n // the shape of node because Expression can be many different nodes: we can,\n // and should, safely report expression placeholders as Expressions.\n return isPlaceholderType(node.expectedNode, type);\n }\n return false;\n }\n\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AA8Be,SAASI,EAAEA,CACxBC,IAAY,EACZC,IAA+B,EAC/BC,IAAsB,EACN;EAChB,IAAI,CAACD,IAAI,EAAE,OAAO,KAAK;EAEvB,MAAME,OAAO,GAAG,IAAAC,eAAM,EAACH,IAAI,CAACD,IAAI,EAAEA,IAAI,CAAC;EACvC,IAAI,CAACG,OAAO,EAAE;IACZ,IAAI,CAACD,IAAI,IAAID,IAAI,CAACD,IAAI,KAAK,aAAa,IAAIA,IAAI,IAAIK,yBAAkB,EAAE;MAUtE,OAAO,IAAAC,0BAAiB,EAACL,IAAI,CAACM,YAAY,EAAEP,IAAI,CAAC;IACnD;IACA,OAAO,KAAK;EACd;EAEA,IAAI,OAAOE,IAAI,KAAK,WAAW,EAAE;IAC/B,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAO,IAAAM,qBAAY,EAACP,IAAI,EAAEC,IAAI,CAAC;EACjC;AACF","ignoreList":[]}
|
||||
{"version":3,"names":["_shallowEqual","require","_isType","_isPlaceholderType","_index","is","type","node","opts","matches","isType","FLIPPED_ALIAS_KEYS","isPlaceholderType","expectedNode","undefined","shallowEqual"],"sources":["../../src/validators/is.ts"],"sourcesContent":["import shallowEqual from \"../utils/shallowEqual.ts\";\nimport isType from \"./isType.ts\";\nimport isPlaceholderType from \"./isPlaceholderType.ts\";\nimport { FLIPPED_ALIAS_KEYS } from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function is<T extends t.Node[\"type\"]>(\n type: T,\n node: t.Node | null | undefined,\n opts?: undefined,\n): node is Extract<t.Node, { type: T }>;\n\nexport default function is<\n T extends t.Node[\"type\"],\n P extends Extract<t.Node, { type: T }>,\n>(type: T, n: t.Node | null | undefined, required: Partial<P>): n is P;\n\nexport default function is<P extends t.Node>(\n type: string,\n node: t.Node | null | undefined,\n opts: Partial<P>,\n): node is P;\n\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial<t.Node>,\n): node is t.Node;\n/**\n * Returns whether `node` is of given `type`.\n *\n * For better performance, use this instead of `is[Type]` when `type` is unknown.\n */\nexport default function is(\n type: string,\n node: t.Node | null | undefined,\n opts?: Partial<t.Node>,\n): node is t.Node {\n if (!node) return false;\n\n const matches = isType(node.type, type);\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in FLIPPED_ALIAS_KEYS) {\n // We can only return true if the placeholder doesn't replace a real node,\n // but it replaces a category of nodes (an alias).\n //\n // t.is(\"Identifier\", node) gives some guarantees about node's shape, so we\n // can't say that Placeholder(expectedNode: \"Identifier\") is an identifier\n // because it doesn't have the same properties.\n // On the other hand, t.is(\"Expression\", node) doesn't say anything about\n // the shape of node because Expression can be many different nodes: we can,\n // and should, safely report expression placeholders as Expressions.\n return isPlaceholderType(node.expectedNode, type);\n }\n return false;\n }\n\n if (opts === undefined) {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AA8Be,SAASI,EAAEA,CACxBC,IAAY,EACZC,IAA+B,EAC/BC,IAAsB,EACN;EAChB,IAAI,CAACD,IAAI,EAAE,OAAO,KAAK;EAEvB,MAAME,OAAO,GAAG,IAAAC,eAAM,EAACH,IAAI,CAACD,IAAI,EAAEA,IAAI,CAAC;EACvC,IAAI,CAACG,OAAO,EAAE;IACZ,IAAI,CAACD,IAAI,IAAID,IAAI,CAACD,IAAI,KAAK,aAAa,IAAIA,IAAI,IAAIK,yBAAkB,EAAE;MAUtE,OAAO,IAAAC,0BAAiB,EAACL,IAAI,CAACM,YAAY,EAAEP,IAAI,CAAC;IACnD;IACA,OAAO,KAAK;EACd;EAEA,IAAIE,IAAI,KAAKM,SAAS,EAAE;IACtB,OAAO,IAAI;EACb,CAAC,MAAM;IACL,OAAO,IAAAC,qBAAY,EAACR,IAAI,EAAEC,IAAI,CAAC;EACjC;AACF","ignoreList":[]}
|
@ -1 +1 @@
|
||||
{"version":3,"names":["_index","require","validate","node","key","val","fields","NODE_FIELDS","type","field","validateField","validateChild","optional","NODE_PARENT_VALIDATIONS"],"sources":["../../src/validators/validate.ts"],"sourcesContent":["import {\n NODE_FIELDS,\n NODE_PARENT_VALIDATIONS,\n type FieldOptions,\n} from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function validate(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateField(\n node: t.Node | undefined | null,\n key: string,\n val: any,\n field: FieldOptions | undefined | null,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(\n node: t.Node | undefined | null,\n key: string,\n val?: t.Node | undefined | null,\n) {\n if (val == null) return;\n const validate = NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOe,SAASC,QAAQA,CAC9BC,IAA+B,EAC/BC,GAAW,EACXC,GAAQ,EACF;EACN,IAAI,CAACF,IAAI,EAAE;EAEX,MAAMG,MAAM,GAAGC,kBAAW,CAACJ,IAAI,CAACK,IAAI,CAAC;EACrC,IAAI,CAACF,MAAM,EAAE;EAEb,MAAMG,KAAK,GAAGH,MAAM,CAACF,GAAG,CAAC;EACzBM,aAAa,CAACP,IAAI,EAAEC,GAAG,EAAEC,GAAG,EAAEI,KAAK,CAAC;EACpCE,aAAa,CAACR,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAC/B;AAEO,SAASK,aAAaA,CAC3BP,IAA+B,EAC/BC,GAAW,EACXC,GAAQ,EACRI,KAAsC,EAChC;EACN,IAAI,EAACA,KAAK,YAALA,KAAK,CAAEP,QAAQ,GAAE;EACtB,IAAIO,KAAK,CAACG,QAAQ,IAAIP,GAAG,IAAI,IAAI,EAAE;EAEnCI,KAAK,CAACP,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAChC;AAEO,SAASM,aAAaA,CAC3BR,IAA+B,EAC/BC,GAAW,EACXC,GAA+B,EAC/B;EACA,IAAIA,GAAG,IAAI,IAAI,EAAE;EACjB,MAAMH,QAAQ,GAAGW,8BAAuB,CAACR,GAAG,CAACG,IAAI,CAAC;EAClD,IAAI,CAACN,QAAQ,EAAE;EACfA,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAC1B","ignoreList":[]}
|
||||
{"version":3,"names":["_index","require","validate","node","key","val","fields","NODE_FIELDS","type","field","validateField","validateChild","validateInternal","maybeNode","optional","_NODE_PARENT_VALIDATI","NODE_PARENT_VALIDATIONS","call","_NODE_PARENT_VALIDATI2"],"sources":["../../src/validators/validate.ts"],"sourcesContent":["import {\n NODE_FIELDS,\n NODE_PARENT_VALIDATIONS,\n type FieldOptions,\n} from \"../definitions/index.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function validate(\n node: t.Node | undefined | null,\n key: string,\n val: unknown,\n): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateInternal(\n field: FieldOptions,\n node: t.Node | undefined | null,\n key: string,\n val: unknown,\n maybeNode?: 1,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n\n if (maybeNode) {\n const type = (val as t.Node).type;\n if (type == null) return;\n NODE_PARENT_VALIDATIONS[type]?.(node, key, val);\n }\n}\n\nexport function validateField(\n node: t.Node | undefined | null,\n key: string,\n val: unknown,\n field: FieldOptions | undefined | null,\n): void {\n if (!field?.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(\n node: t.Node | undefined | null,\n key: string,\n val?: unknown,\n) {\n const type = (val as t.Node)?.type;\n if (type == null) return;\n NODE_PARENT_VALIDATIONS[type]?.(node, key, val);\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOe,SAASC,QAAQA,CAC9BC,IAA+B,EAC/BC,GAAW,EACXC,GAAY,EACN;EACN,IAAI,CAACF,IAAI,EAAE;EAEX,MAAMG,MAAM,GAAGC,kBAAW,CAACJ,IAAI,CAACK,IAAI,CAAC;EACrC,IAAI,CAACF,MAAM,EAAE;EAEb,MAAMG,KAAK,GAAGH,MAAM,CAACF,GAAG,CAAC;EACzBM,aAAa,CAACP,IAAI,EAAEC,GAAG,EAAEC,GAAG,EAAEI,KAAK,CAAC;EACpCE,aAAa,CAACR,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAC/B;AAEO,SAASO,gBAAgBA,CAC9BH,KAAmB,EACnBN,IAA+B,EAC/BC,GAAW,EACXC,GAAY,EACZQ,SAAa,EACP;EACN,IAAI,EAACJ,KAAK,YAALA,KAAK,CAAEP,QAAQ,GAAE;EACtB,IAAIO,KAAK,CAACK,QAAQ,IAAIT,GAAG,IAAI,IAAI,EAAE;EAEnCI,KAAK,CAACP,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;EAE9B,IAAIQ,SAAS,EAAE;IAAA,IAAAE,qBAAA;IACb,MAAMP,IAAI,GAAIH,GAAG,CAAYG,IAAI;IACjC,IAAIA,IAAI,IAAI,IAAI,EAAE;IAClB,CAAAO,qBAAA,GAAAC,8BAAuB,CAACR,IAAI,CAAC,aAA7BO,qBAAA,CAAAE,IAAA,CAAAD,8BAAuB,EAASb,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;EACjD;AACF;AAEO,SAASK,aAAaA,CAC3BP,IAA+B,EAC/BC,GAAW,EACXC,GAAY,EACZI,KAAsC,EAChC;EACN,IAAI,EAACA,KAAK,YAALA,KAAK,CAAEP,QAAQ,GAAE;EACtB,IAAIO,KAAK,CAACK,QAAQ,IAAIT,GAAG,IAAI,IAAI,EAAE;EAEnCI,KAAK,CAACP,QAAQ,CAACC,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AAChC;AAEO,SAASM,aAAaA,CAC3BR,IAA+B,EAC/BC,GAAW,EACXC,GAAa,EACb;EAAA,IAAAa,sBAAA;EACA,MAAMV,IAAI,GAAIH,GAAG,oBAAHA,GAAG,CAAaG,IAAI;EAClC,IAAIA,IAAI,IAAI,IAAI,EAAE;EAClB,CAAAU,sBAAA,GAAAF,8BAAuB,CAACR,IAAI,CAAC,aAA7BU,sBAAA,CAAAD,IAAA,CAAAD,8BAAuB,EAASb,IAAI,EAAEC,GAAG,EAAEC,GAAG,CAAC;AACjD","ignoreList":[]}
|
@ -1,20 +0,0 @@
|
||||
/* This file is automatically generated by scripts/generators/tsconfig.js */
|
||||
{
|
||||
"extends": [
|
||||
"../../tsconfig.base.json",
|
||||
"../../tsconfig.paths.json"
|
||||
],
|
||||
"include": [
|
||||
"../../packages/babel-types/src/**/*.ts",
|
||||
"../../lib/globals.d.ts",
|
||||
"../../scripts/repo-utils/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../packages/babel-helper-string-parser"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/babel-helper-validator-identifier"
|
||||
}
|
||||
]
|
||||
}
|
File diff suppressed because one or more lines are too long
BIN
front_page/node_modules/@rollup/rollup-win32-x64-msvc/rollup.win32-x64-msvc.node
generated
vendored
BIN
front_page/node_modules/@rollup/rollup-win32-x64-msvc/rollup.win32-x64-msvc.node
generated
vendored
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
var x=String;
|
||||
var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x}};
|
||||
var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}};
|
||||
module.exports=create();
|
||||
module.exports.createColors = create;
|
||||
|
@ -1,30 +0,0 @@
|
||||
export type Formatter = (input: string | number | null | undefined) => string
|
||||
|
||||
export interface Colors {
|
||||
isColorSupported: boolean
|
||||
reset: Formatter
|
||||
bold: Formatter
|
||||
dim: Formatter
|
||||
italic: Formatter
|
||||
underline: Formatter
|
||||
inverse: Formatter
|
||||
hidden: Formatter
|
||||
strikethrough: Formatter
|
||||
black: Formatter
|
||||
red: Formatter
|
||||
green: Formatter
|
||||
yellow: Formatter
|
||||
blue: Formatter
|
||||
magenta: Formatter
|
||||
cyan: Formatter
|
||||
white: Formatter
|
||||
gray: Formatter
|
||||
bgBlack: Formatter
|
||||
bgRed: Formatter
|
||||
bgGreen: Formatter
|
||||
bgYellow: Formatter
|
||||
bgBlue: Formatter
|
||||
bgMagenta: Formatter
|
||||
bgCyan: Formatter
|
||||
bgWhite: Formatter
|
||||
}
|
@ -1,115 +1,104 @@
|
||||
declare module 'source-map-js' {
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
}
|
||||
|
||||
export interface RawSourceMap extends StartOfSourceMap {
|
||||
version: string;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface LineRange extends Position {
|
||||
lastColumn: number;
|
||||
}
|
||||
|
||||
export interface FindPosition extends Position {
|
||||
// SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
|
||||
bias?: number;
|
||||
}
|
||||
|
||||
export interface SourceFindPosition extends FindPosition {
|
||||
source: string;
|
||||
}
|
||||
export interface StartOfSourceMap {
|
||||
file?: string;
|
||||
sourceRoot?: string;
|
||||
}
|
||||
|
||||
export interface MappedPosition extends Position {
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
export interface RawSourceMap extends StartOfSourceMap {
|
||||
version: string;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourcesContent?: string[];
|
||||
mappings: string;
|
||||
}
|
||||
|
||||
export interface MappingItem {
|
||||
source: string;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
name: string;
|
||||
}
|
||||
export interface Position {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
|
||||
export class SourceMapConsumer {
|
||||
static GENERATED_ORDER: number;
|
||||
static ORIGINAL_ORDER: number;
|
||||
export interface LineRange extends Position {
|
||||
lastColumn: number;
|
||||
}
|
||||
|
||||
static GREATEST_LOWER_BOUND: number;
|
||||
static LEAST_UPPER_BOUND: number;
|
||||
export interface FindPosition extends Position {
|
||||
// SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
|
||||
bias?: number;
|
||||
}
|
||||
|
||||
constructor(rawSourceMap: RawSourceMap);
|
||||
computeColumnSpans(): void;
|
||||
originalPositionFor(generatedPosition: FindPosition): MappedPosition;
|
||||
generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
|
||||
hasContentsOfAllSources(): boolean;
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string;
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
}
|
||||
export interface SourceFindPosition extends FindPosition {
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original: Position;
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
export interface MappedPosition extends Position {
|
||||
source: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer): SourceMapGenerator;
|
||||
addMapping(mapping: Mapping): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
toString(): string;
|
||||
}
|
||||
export interface MappingItem {
|
||||
source: string | null;
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalLine: number | null;
|
||||
originalColumn: number | null;
|
||||
name: string | null;
|
||||
}
|
||||
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
export class SourceMapConsumer {
|
||||
static GENERATED_ORDER: number;
|
||||
static ORIGINAL_ORDER: number;
|
||||
|
||||
static GREATEST_LOWER_BOUND: number;
|
||||
static LEAST_UPPER_BOUND: number;
|
||||
|
||||
constructor(rawSourceMap: RawSourceMap);
|
||||
readonly file: string | undefined | null;
|
||||
readonly sourceRoot: string | undefined | null;
|
||||
readonly sourcesContent: readonly string[] | null | undefined;
|
||||
readonly sources: readonly string[]
|
||||
|
||||
computeColumnSpans(): void;
|
||||
originalPositionFor(generatedPosition: FindPosition): MappedPosition;
|
||||
generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
|
||||
allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
|
||||
hasContentsOfAllSources(): boolean;
|
||||
sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null;
|
||||
eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
|
||||
}
|
||||
|
||||
export class SourceNode {
|
||||
constructor();
|
||||
constructor(line: number, column: number, source: string);
|
||||
constructor(line: number, column: number, source: string, chunk?: string, name?: string);
|
||||
static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
|
||||
add(chunk: string): void;
|
||||
prepend(chunk: string): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
|
||||
walkSourceContents(fn: (file: string, content: string) => void): void;
|
||||
join(sep: string): SourceNode;
|
||||
replaceRight(pattern: string, replacement: string): SourceNode;
|
||||
toString(): string;
|
||||
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
|
||||
}
|
||||
export interface Mapping {
|
||||
generated: Position;
|
||||
original?: Position | null;
|
||||
source?: string | null;
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-map-generator' {
|
||||
import { SourceMapGenerator } from 'source-map-js'
|
||||
export { SourceMapGenerator }
|
||||
export class SourceMapGenerator {
|
||||
constructor(startOfSourceMap?: StartOfSourceMap);
|
||||
static fromSourceMap(sourceMapConsumer: SourceMapConsumer, startOfSourceMap?: StartOfSourceMap): SourceMapGenerator;
|
||||
addMapping(mapping: Mapping): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string | null | undefined): void;
|
||||
applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
|
||||
toString(): string;
|
||||
toJSON(): RawSourceMap;
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-map-consumer' {
|
||||
import { SourceMapConsumer } from 'source-map-js'
|
||||
export { SourceMapConsumer }
|
||||
export interface CodeWithSourceMap {
|
||||
code: string;
|
||||
map: SourceMapGenerator;
|
||||
}
|
||||
|
||||
declare module 'source-map-js/lib/source-node' {
|
||||
import { SourceNode } from 'source-map-js'
|
||||
export { SourceNode }
|
||||
export class SourceNode {
|
||||
constructor();
|
||||
constructor(line: number, column: number, source: string);
|
||||
constructor(line: number, column: number, source: string, chunk?: string, name?: string);
|
||||
static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
|
||||
add(chunk: string): void;
|
||||
prepend(chunk: string): void;
|
||||
setSourceContent(sourceFile: string, sourceContent: string): void;
|
||||
walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
|
||||
walkSourceContents(fn: (file: string, content: string) => void): void;
|
||||
join(sep: string): SourceNode;
|
||||
replaceRight(pattern: string, replacement: string): SourceNode;
|
||||
toString(): string;
|
||||
toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
let fastProto = null;
|
||||
|
||||
// Creates an object with permanently fast properties in V8. See Toon Verwaest's
|
||||
// post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62
|
||||
// for more details. Use %HasFastProperties(object) and the Node.js flag
|
||||
// --allow-natives-syntax to check whether an object has fast properties.
|
||||
function FastObject(o) {
|
||||
// A prototype object will have "fast properties" enabled once it is checked
|
||||
// against the inline property cache of a function, e.g. fastProto.property:
|
||||
// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63
|
||||
if (fastProto !== null && typeof fastProto.property) {
|
||||
const result = fastProto;
|
||||
fastProto = FastObject.prototype = null;
|
||||
return result;
|
||||
}
|
||||
fastProto = FastObject.prototype = o == null ? Object.create(null) : o;
|
||||
return new FastObject;
|
||||
}
|
||||
|
||||
// Initialize the inline property cache of FastObject
|
||||
FastObject();
|
||||
|
||||
module.exports = function toFastproperties(o) {
|
||||
return FastObject(o);
|
||||
};
|
@ -1,10 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2014 Petka Antonov
|
||||
2015 Sindre Sorhus
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "to-fast-properties",
|
||||
"version": "2.0.0",
|
||||
"description": "Force V8 to use fast properties for an object",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/to-fast-properties",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node --allow-natives-syntax test.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"object",
|
||||
"obj",
|
||||
"properties",
|
||||
"props",
|
||||
"v8",
|
||||
"optimize",
|
||||
"fast",
|
||||
"convert",
|
||||
"mode"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "0.0.4"
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
# to-fast-properties [![Build Status](https://travis-ci.org/sindresorhus/to-fast-properties.svg?branch=master)](https://travis-ci.org/sindresorhus/to-fast-properties)
|
||||
|
||||
> Force V8 to use fast properties for an object
|
||||
|
||||
[Read more.](http://stackoverflow.com/questions/24987896/)
|
||||
|
||||
Use `%HasFastProperties(object)` and `--allow-natives-syntax` to check whether an object already has fast properties.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save to-fast-properties
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const toFastProperties = require('to-fast-properties');
|
||||
|
||||
const obj = {
|
||||
foo: true,
|
||||
bar: true
|
||||
};
|
||||
|
||||
delete obj.foo;
|
||||
// `obj` now has slow properties
|
||||
|
||||
toFastProperties(obj);
|
||||
// `obj` now has fast properties
|
||||
```
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © Petka Antonov, John-David Dalton, Sindre Sorhus
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue