@tinacms/app 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/appFiles/node_modules/.package-lock.json +29 -28
- package/appFiles/node_modules/@babel/generator/lib/buffer.js +34 -10
- package/appFiles/node_modules/@babel/generator/lib/buffer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/classes.js +3 -4
- package/appFiles/node_modules/@babel/generator/lib/generators/classes.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js +7 -0
- package/appFiles/node_modules/@babel/generator/lib/generators/expressions.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js +51 -8
- package/appFiles/node_modules/@babel/generator/lib/generators/methods.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/modules.js +7 -10
- package/appFiles/node_modules/@babel/generator/lib/generators/modules.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/types.js +2 -0
- package/appFiles/node_modules/@babel/generator/lib/generators/types.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js +2 -2
- package/appFiles/node_modules/@babel/generator/lib/generators/typescript.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/index.js +1 -1
- package/appFiles/node_modules/@babel/generator/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/node/parentheses.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/printer.js +7 -0
- package/appFiles/node_modules/@babel/generator/lib/printer.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/lib/source-map.js +40 -9
- package/appFiles/node_modules/@babel/generator/lib/source-map.js.map +1 -1
- package/appFiles/node_modules/@babel/generator/package.json +5 -5
- package/appFiles/node_modules/@babel/helper-function-name/lib/index.js +0 -31
- package/appFiles/node_modules/@babel/helper-function-name/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/helper-function-name/package.json +3 -3
- package/appFiles/node_modules/@babel/parser/lib/index.js +1901 -1885
- package/appFiles/node_modules/@babel/parser/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/parser/package.json +2 -2
- package/appFiles/node_modules/@babel/parser/typings/babel-parser.d.ts +12 -0
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2203R.js +173 -170
- package/appFiles/node_modules/@babel/runtime/helpers/applyDecs2301.js +221 -0
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2203R.js +173 -170
- package/appFiles/node_modules/@babel/runtime/helpers/esm/applyDecs2301.js +220 -0
- package/appFiles/node_modules/@babel/runtime/package.json +10 -1
- package/appFiles/node_modules/@babel/traverse/lib/path/modification.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/lib/visitors.js +11 -5
- package/appFiles/node_modules/@babel/traverse/lib/visitors.js.map +1 -1
- package/appFiles/node_modules/@babel/traverse/package.json +5 -5
- package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js +12 -7
- package/appFiles/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js +5 -5
- package/appFiles/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js +2 -6
- package/appFiles/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js +5 -4
- package/appFiles/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js +1 -9
- package/appFiles/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/core.js +21 -57
- package/appFiles/node_modules/@babel/types/lib/definitions/core.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +12 -0
- package/appFiles/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
- package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/flow.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/flow.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/index.js +10 -0
- package/appFiles/node_modules/@babel/types/lib/definitions/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js +6 -4
- package/appFiles/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/definitions/utils.js +0 -2
- package/appFiles/node_modules/@babel/types/lib/definitions/utils.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/index-legacy.d.ts +10 -3
- package/appFiles/node_modules/@babel/types/lib/index.d.ts +23 -6
- package/appFiles/node_modules/@babel/types/lib/index.js +9 -2
- package/appFiles/node_modules/@babel/types/lib/index.js.flow +8 -3
- package/appFiles/node_modules/@babel/types/lib/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +1 -9
- package/appFiles/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js +1 -3
- package/appFiles/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +0 -8
- package/appFiles/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +2 -6
- package/appFiles/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js +30 -0
- package/appFiles/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
- package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +0 -3
- package/appFiles/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js +11 -6
- package/appFiles/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js +2 -4
- package/appFiles/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isLet.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isLet.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js +0 -21
- package/appFiles/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isScope.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isScope.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isType.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isType.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +0 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -1
- package/appFiles/node_modules/@babel/types/lib/validators/isVar.js +1 -2
- package/appFiles/node_modules/@babel/types/lib/validators/isVar.js.map +1 -1
- package/appFiles/node_modules/@babel/types/package.json +3 -3
- package/appFiles/node_modules/css-to-react-native/index.d.ts +17 -0
- package/appFiles/node_modules/css-to-react-native/index.js +15 -0
- package/appFiles/node_modules/css-to-react-native/package.json +2 -1
- package/appFiles/node_modules/css-to-react-native/src/__tests__/aspectRatio.js +23 -0
- package/appFiles/node_modules/css-to-react-native/src/transforms/aspectRatio.js +12 -0
- package/appFiles/node_modules/css-to-react-native/src/transforms/index.js +2 -0
- package/appFiles/src/App.tsx +3 -5
- package/appFiles/src/fields/rich-text/monaco/mdx.js +2 -2
- package/appFiles/src/lib/machines/query-machine.ts +0 -13
- package/appFiles/src/preview.tsx +22 -0
- package/dist/index.js +3 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SourceMap","constructor","opts","code","_map","_rawMappings","_sourceFileName","_lastGenLine","_lastSourceLine","_lastSourceColumn","map","GenMapping","sourceRoot","sourceFileName","replace","undefined","setSourceContent","
|
|
1
|
+
{"version":3,"names":["SourceMap","constructor","opts","code","_map","_rawMappings","_sourceFileName","_lastGenLine","_lastSourceLine","_lastSourceColumn","_inputMap","map","GenMapping","sourceRoot","sourceFileName","replace","undefined","inputSourceMap","TraceMap","resolvedSources","length","i","setSourceContent","sourcesContent","Object","keys","get","toEncodedMap","getDecoded","toDecodedMap","getRawMappings","allMappings","mark","generated","line","column","identifierName","identifierNamePos","filename","originalMapping","originalPositionFor","name","originalIdentifierMapping","source","maybeAddMapping","original"],"sources":["../src/source-map.ts"],"sourcesContent":["import {\n GenMapping,\n maybeAddMapping,\n setSourceContent,\n allMappings,\n toEncodedMap,\n toDecodedMap,\n} from \"@jridgewell/gen-mapping\";\n\nimport type {\n EncodedSourceMap,\n DecodedSourceMap,\n Mapping,\n} from \"@jridgewell/gen-mapping\";\n\nimport {\n type SourceMapInput,\n originalPositionFor,\n TraceMap,\n} from \"@jridgewell/trace-mapping\";\n\n/**\n * Build a sourcemap.\n */\n\nexport default class SourceMap {\n private _map: GenMapping;\n private _rawMappings: Mapping[] | undefined;\n private _sourceFileName: string | undefined;\n\n // Any real line is > 0, so init to 0 is fine.\n private _lastGenLine = 0;\n private _lastSourceLine = 0;\n\n // Source columns can be 0, but we ony check in unison with sourceLine, which\n // inits to an impossible value. So init to 0 is fine.\n private _lastSourceColumn = 0;\n\n public _inputMap: TraceMap;\n\n constructor(\n opts: {\n sourceFileName?: string;\n sourceRoot?: string;\n inputSourceMap?: SourceMapInput;\n },\n code: string | { [sourceFileName: string]: string },\n ) {\n const map = (this._map = new GenMapping({ sourceRoot: opts.sourceRoot }));\n this._sourceFileName = opts.sourceFileName?.replace(/\\\\/g, \"/\");\n this._rawMappings = undefined;\n\n if (opts.inputSourceMap) {\n this._inputMap = new TraceMap(opts.inputSourceMap);\n const resolvedSources = this._inputMap.resolvedSources;\n if (resolvedSources.length) {\n for (let i = 0; i < resolvedSources.length; i++) {\n setSourceContent(\n map,\n resolvedSources[i],\n this._inputMap.sourcesContent?.[i],\n );\n }\n }\n }\n\n if (typeof code === \"string\" && !opts.inputSourceMap) {\n setSourceContent(map, this._sourceFileName, code);\n } else if (typeof code === \"object\") {\n for (const sourceFileName of Object.keys(code)) {\n setSourceContent(\n map,\n sourceFileName.replace(/\\\\/g, \"/\"),\n code[sourceFileName],\n );\n }\n }\n }\n\n /**\n * Get the sourcemap.\n */\n get(): EncodedSourceMap {\n return toEncodedMap(this._map);\n }\n\n getDecoded(): DecodedSourceMap {\n return toDecodedMap(this._map);\n }\n\n getRawMappings(): Mapping[] {\n return (this._rawMappings ||= allMappings(this._map));\n }\n\n /**\n * Mark the current generated position with a source position. May also be passed null line/column\n * values to insert a mapping to nothing.\n */\n\n mark(\n generated: { line: number; column: number },\n line: number,\n column: number,\n identifierName?: string | null,\n identifierNamePos?: { line: number; column: number },\n filename?: string | null,\n ) {\n this._rawMappings = undefined;\n\n let originalMapping: {\n source: string | null;\n name?: string | null;\n line: number | null;\n column: number | null;\n };\n\n if (line != null) {\n if (this._inputMap) {\n // This is the lookup for this mark\n originalMapping = originalPositionFor(this._inputMap, {\n line,\n column,\n });\n\n // If the we found a name, nothing else needs to be done\n // Maybe we're marking a `(` and the input map already had a name attached there,\n // or we're marking a `(` and the sourcemap spanned a `foo(`,\n // or we're marking an identifier, etc.\n if (!originalMapping.name && identifierNamePos) {\n // We're trying to mark a `(` (as that's the only thing that provides\n // an identifierNamePos currently), and we the AST had an identifier attached.\n // Lookup it's original name.\n const originalIdentifierMapping = originalPositionFor(\n this._inputMap,\n identifierNamePos,\n );\n if (originalIdentifierMapping.name) {\n identifierName = originalIdentifierMapping.name;\n }\n }\n } else {\n originalMapping = {\n source: filename?.replace(/\\\\/g, \"/\") || this._sourceFileName,\n line: line,\n column: column,\n };\n }\n }\n\n maybeAddMapping(this._map, {\n name: identifierName,\n generated,\n source: originalMapping?.source,\n original: originalMapping,\n });\n }\n}\n"],"mappings":";;;;;;AAAA;AAeA;AAUe,MAAMA,SAAS,CAAC;EAe7BC,WAAW,CACTC,IAIC,EACDC,IAAmD,EACnD;IAAA;IAAA,KArBMC,IAAI;IAAA,KACJC,YAAY;IAAA,KACZC,eAAe;IAAA,KAGfC,YAAY,GAAG,CAAC;IAAA,KAChBC,eAAe,GAAG,CAAC;IAAA,KAInBC,iBAAiB,GAAG,CAAC;IAAA,KAEtBC,SAAS;IAUd,MAAMC,GAAG,GAAI,IAAI,CAACP,IAAI,GAAG,IAAIQ,sBAAU,CAAC;MAAEC,UAAU,EAAEX,IAAI,CAACW;IAAW,CAAC,CAAE;IACzE,IAAI,CAACP,eAAe,2BAAGJ,IAAI,CAACY,cAAc,qBAAnB,qBAAqBC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;IAC/D,IAAI,CAACV,YAAY,GAAGW,SAAS;IAE7B,IAAId,IAAI,CAACe,cAAc,EAAE;MACvB,IAAI,CAACP,SAAS,GAAG,IAAIQ,sBAAQ,CAAChB,IAAI,CAACe,cAAc,CAAC;MAClD,MAAME,eAAe,GAAG,IAAI,CAACT,SAAS,CAACS,eAAe;MACtD,IAAIA,eAAe,CAACC,MAAM,EAAE;QAC1B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,eAAe,CAACC,MAAM,EAAEC,CAAC,EAAE,EAAE;UAAA;UAC/C,IAAAC,4BAAgB,EACdX,GAAG,EACHQ,eAAe,CAACE,CAAC,CAAC,2BAClB,IAAI,CAACX,SAAS,CAACa,cAAc,qBAA7B,sBAAgCF,CAAC,CAAC,CACnC;QACH;MACF;IACF;IAEA,IAAI,OAAOlB,IAAI,KAAK,QAAQ,IAAI,CAACD,IAAI,CAACe,cAAc,EAAE;MACpD,IAAAK,4BAAgB,EAACX,GAAG,EAAE,IAAI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eAAe,GAAG;UAChBI,MAAM,EAAE,CAAAL,QAAQ,oBAARA,QAAQ,CAAEvB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,KAAI,IAAI,CAACT,eAAe;UAC7D4B,IAAI,EAAEA,IAAI;UACVC,MAAM,EAAEA;QACV,CAAC;MACH;IACF;IAEA,IAAAS,2BAAe,EAAC,IAAI,CAACxC,IAAI,EAAE;MACzBqC,IAAI,EAAEL,cAAc;MACpBH,SAAS;MACTU,MAAM,sBAAEJ,eAAe,qBAAf,iBAAiBI,MAAM;MAC/BE,QAAQ,EAAEN;IACZ,CAAC,CAAC;EACJ;AACF;AAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@babel/generator",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.21.1",
|
|
4
4
|
"description": "Turns an AST into code.",
|
|
5
5
|
"author": "The Babel Team (https://babel.dev/team)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"lib"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@babel/types": "^7.
|
|
22
|
+
"@babel/types": "^7.21.0",
|
|
23
23
|
"@jridgewell/gen-mapping": "^0.3.2",
|
|
24
|
+
"@jridgewell/trace-mapping": "^0.3.17",
|
|
24
25
|
"jsesc": "^2.5.1"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"@babel/helper-fixtures": "^7.
|
|
28
|
-
"@babel/parser": "^7.
|
|
29
|
-
"@jridgewell/trace-mapping": "^0.3.8",
|
|
28
|
+
"@babel/helper-fixtures": "^7.21.0",
|
|
29
|
+
"@babel/parser": "^7.21.1",
|
|
30
30
|
"@types/jsesc": "^2.5.0",
|
|
31
31
|
"charcodes": "^0.2.0"
|
|
32
32
|
},
|
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
var _template = require("@babel/template");
|
|
9
|
-
|
|
10
8
|
var _t = require("@babel/types");
|
|
11
|
-
|
|
12
9
|
const {
|
|
13
10
|
NOT_LOCAL_BINDING,
|
|
14
11
|
cloneNode,
|
|
@@ -27,12 +24,10 @@ const {
|
|
|
27
24
|
isVariableDeclarator,
|
|
28
25
|
toBindingIdentifierName
|
|
29
26
|
} = _t;
|
|
30
|
-
|
|
31
27
|
function getFunctionArity(node) {
|
|
32
28
|
const count = node.params.findIndex(param => isAssignmentPattern(param) || isRestElement(param));
|
|
33
29
|
return count === -1 ? node.params.length : count;
|
|
34
30
|
}
|
|
35
|
-
|
|
36
31
|
const buildPropertyMethodAssignmentWrapper = _template.default.statement(`
|
|
37
32
|
(function (FUNCTION_KEY) {
|
|
38
33
|
function FUNCTION_ID() {
|
|
@@ -46,7 +41,6 @@ const buildPropertyMethodAssignmentWrapper = _template.default.statement(`
|
|
|
46
41
|
return FUNCTION_ID;
|
|
47
42
|
})(FUNCTION)
|
|
48
43
|
`);
|
|
49
|
-
|
|
50
44
|
const buildGeneratorPropertyMethodAssignmentWrapper = _template.default.statement(`
|
|
51
45
|
(function (FUNCTION_KEY) {
|
|
52
46
|
function* FUNCTION_ID() {
|
|
@@ -60,7 +54,6 @@ const buildGeneratorPropertyMethodAssignmentWrapper = _template.default.statemen
|
|
|
60
54
|
return FUNCTION_ID;
|
|
61
55
|
})(FUNCTION)
|
|
62
56
|
`);
|
|
63
|
-
|
|
64
57
|
const visitor = {
|
|
65
58
|
"ReferencedIdentifier|BindingIdentifier"(path, state) {
|
|
66
59
|
if (path.node.name !== state.name) return;
|
|
@@ -69,29 +62,22 @@ const visitor = {
|
|
|
69
62
|
state.selfReference = true;
|
|
70
63
|
path.stop();
|
|
71
64
|
}
|
|
72
|
-
|
|
73
65
|
};
|
|
74
|
-
|
|
75
66
|
function getNameFromLiteralId(id) {
|
|
76
67
|
if (isNullLiteral(id)) {
|
|
77
68
|
return "null";
|
|
78
69
|
}
|
|
79
|
-
|
|
80
70
|
if (isRegExpLiteral(id)) {
|
|
81
71
|
return `_${id.pattern}_${id.flags}`;
|
|
82
72
|
}
|
|
83
|
-
|
|
84
73
|
if (isTemplateLiteral(id)) {
|
|
85
74
|
return id.quasis.map(quasi => quasi.value.raw).join("");
|
|
86
75
|
}
|
|
87
|
-
|
|
88
76
|
if (id.value !== undefined) {
|
|
89
77
|
return id.value + "";
|
|
90
78
|
}
|
|
91
|
-
|
|
92
79
|
return "";
|
|
93
80
|
}
|
|
94
|
-
|
|
95
81
|
function wrap(state, method, id, scope) {
|
|
96
82
|
if (state.selfReference) {
|
|
97
83
|
if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
|
|
@@ -99,30 +85,24 @@ function wrap(state, method, id, scope) {
|
|
|
99
85
|
} else {
|
|
100
86
|
if (!isFunction(method)) return;
|
|
101
87
|
let build = buildPropertyMethodAssignmentWrapper;
|
|
102
|
-
|
|
103
88
|
if (method.generator) {
|
|
104
89
|
build = buildGeneratorPropertyMethodAssignmentWrapper;
|
|
105
90
|
}
|
|
106
|
-
|
|
107
91
|
const template = build({
|
|
108
92
|
FUNCTION: method,
|
|
109
93
|
FUNCTION_ID: id,
|
|
110
94
|
FUNCTION_KEY: scope.generateUidIdentifier(id.name)
|
|
111
95
|
}).expression;
|
|
112
96
|
const params = template.callee.body.body[0].params;
|
|
113
|
-
|
|
114
97
|
for (let i = 0, len = getFunctionArity(method); i < len; i++) {
|
|
115
98
|
params.push(scope.generateUidIdentifier("x"));
|
|
116
99
|
}
|
|
117
|
-
|
|
118
100
|
return template;
|
|
119
101
|
}
|
|
120
102
|
}
|
|
121
|
-
|
|
122
103
|
method.id = id;
|
|
123
104
|
scope.getProgramParent().references[id.name] = true;
|
|
124
105
|
}
|
|
125
|
-
|
|
126
106
|
function visit(node, name, scope) {
|
|
127
107
|
const state = {
|
|
128
108
|
selfAssignment: false,
|
|
@@ -131,7 +111,6 @@ function visit(node, name, scope) {
|
|
|
131
111
|
name: name
|
|
132
112
|
};
|
|
133
113
|
const binding = scope.getOwnBinding(name);
|
|
134
|
-
|
|
135
114
|
if (binding) {
|
|
136
115
|
if (binding.kind === "param") {
|
|
137
116
|
state.selfReference = true;
|
|
@@ -139,10 +118,8 @@ function visit(node, name, scope) {
|
|
|
139
118
|
} else if (state.outerDeclar || scope.hasGlobal(name)) {
|
|
140
119
|
scope.traverse(node, visitor, state);
|
|
141
120
|
}
|
|
142
|
-
|
|
143
121
|
return state;
|
|
144
122
|
}
|
|
145
|
-
|
|
146
123
|
function _default({
|
|
147
124
|
node,
|
|
148
125
|
parent,
|
|
@@ -150,17 +127,14 @@ function _default({
|
|
|
150
127
|
id
|
|
151
128
|
}, localBinding = false, supportUnicodeId = false) {
|
|
152
129
|
if (node.id) return;
|
|
153
|
-
|
|
154
130
|
if ((isObjectProperty(parent) || isObjectMethod(parent, {
|
|
155
131
|
kind: "method"
|
|
156
132
|
})) && (!parent.computed || isLiteral(parent.key))) {
|
|
157
133
|
id = parent.key;
|
|
158
134
|
} else if (isVariableDeclarator(parent)) {
|
|
159
135
|
id = parent.id;
|
|
160
|
-
|
|
161
136
|
if (isIdentifier(id) && !localBinding) {
|
|
162
137
|
const binding = scope.parent.getBinding(id.name);
|
|
163
|
-
|
|
164
138
|
if (binding && binding.constant && scope.getBinding(id.name) === binding) {
|
|
165
139
|
node.id = cloneNode(id);
|
|
166
140
|
node.id[NOT_LOCAL_BINDING] = true;
|
|
@@ -174,23 +148,18 @@ function _default({
|
|
|
174
148
|
} else if (!id) {
|
|
175
149
|
return;
|
|
176
150
|
}
|
|
177
|
-
|
|
178
151
|
let name;
|
|
179
|
-
|
|
180
152
|
if (id && isLiteral(id)) {
|
|
181
153
|
name = getNameFromLiteralId(id);
|
|
182
154
|
} else if (id && isIdentifier(id)) {
|
|
183
155
|
name = id.name;
|
|
184
156
|
}
|
|
185
|
-
|
|
186
157
|
if (name === undefined) {
|
|
187
158
|
return;
|
|
188
159
|
}
|
|
189
|
-
|
|
190
160
|
if (!supportUnicodeId && isFunction(node) && /[\uD800-\uDFFF]/.test(name)) {
|
|
191
161
|
return;
|
|
192
162
|
}
|
|
193
|
-
|
|
194
163
|
name = toBindingIdentifierName(name);
|
|
195
164
|
const newId = identifier(name);
|
|
196
165
|
newId[NOT_LOCAL_BINDING] = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NOT_LOCAL_BINDING","cloneNode","identifier","isAssignmentExpression","isAssignmentPattern","isFunction","isIdentifier","isLiteral","isNullLiteral","isObjectMethod","isObjectProperty","isRegExpLiteral","isRestElement","isTemplateLiteral","isVariableDeclarator","toBindingIdentifierName","getFunctionArity","node","count","params","findIndex","param","length","buildPropertyMethodAssignmentWrapper","template","statement","buildGeneratorPropertyMethodAssignmentWrapper","visitor","path","state","name","localDeclar","scope","getBindingIdentifier","outerDeclar","selfReference","stop","getNameFromLiteralId","id","pattern","flags","quasis","map","quasi","value","raw","join","undefined","wrap","method","hasBinding","hasGlobal","rename","build","generator","FUNCTION","FUNCTION_ID","FUNCTION_KEY","generateUidIdentifier","expression","callee","body","i","len","push","getProgramParent","references","visit","selfAssignment","binding","getOwnBinding","kind","traverse","parent","localBinding","supportUnicodeId","computed","key","getBinding","constant","operator","left","test","newId"],"sources":["../src/index.ts"],"sourcesContent":["import template from \"@babel/template\";\nimport {\n NOT_LOCAL_BINDING,\n cloneNode,\n identifier,\n isAssignmentExpression,\n isAssignmentPattern,\n isFunction,\n isIdentifier,\n isLiteral,\n isNullLiteral,\n isObjectMethod,\n isObjectProperty,\n isRegExpLiteral,\n isRestElement,\n isTemplateLiteral,\n isVariableDeclarator,\n toBindingIdentifierName,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { NodePath, Scope, Visitor } from \"@babel/traverse\";\n\nfunction getFunctionArity(node: t.Function): number {\n const count = node.params.findIndex(\n param => isAssignmentPattern(param) || isRestElement(param),\n );\n return count === -1 ? node.params.length : count;\n}\n\nconst buildPropertyMethodAssignmentWrapper = template.statement(`\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n`);\n\nconst buildGeneratorPropertyMethodAssignmentWrapper = template.statement(`\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n`);\n\ntype State = {\n name: string;\n outerDeclar: t.Identifier;\n selfAssignment: boolean;\n selfReference: boolean;\n};\n\nconst visitor: Visitor<State> = {\n \"ReferencedIdentifier|BindingIdentifier\"(\n path: NodePath<t.Identifier>,\n state,\n ) {\n // check if this node matches our function id\n if (path.node.name !== state.name) return;\n\n // check that we don't have a local variable declared as that removes the need\n // for the wrapper\n const localDeclar = path.scope.getBindingIdentifier(state.name);\n if (localDeclar !== state.outerDeclar) return;\n\n state.selfReference = true;\n path.stop();\n },\n};\n\nfunction getNameFromLiteralId(id: t.Literal) {\n if (isNullLiteral(id)) {\n return \"null\";\n }\n\n if (isRegExpLiteral(id)) {\n return `_${id.pattern}_${id.flags}`;\n }\n\n if (isTemplateLiteral(id)) {\n return id.quasis.map(quasi => quasi.value.raw).join(\"\");\n }\n\n if (id.value !== undefined) {\n return id.value + \"\";\n }\n\n return \"\";\n}\n\nfunction wrap(\n state: State,\n method: t.FunctionExpression | t.Class,\n id: t.Identifier,\n scope: Scope,\n) {\n if (state.selfReference) {\n if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {\n // we can just munge the local binding\n scope.rename(id.name);\n } else {\n // we don't currently support wrapping class expressions\n if (!isFunction(method)) return;\n\n // need to add a wrapper since we can't change the references\n let build = buildPropertyMethodAssignmentWrapper;\n if (method.generator) {\n build = buildGeneratorPropertyMethodAssignmentWrapper;\n }\n\n const template = (\n build({\n FUNCTION: method,\n FUNCTION_ID: id,\n FUNCTION_KEY: scope.generateUidIdentifier(id.name),\n }) as t.ExpressionStatement\n ).expression as t.CallExpression;\n\n // shim in dummy params to retain function arity, if you try to read the\n // source then you'll get the original since it's proxied so it's all good\n const params = (\n (template.callee as t.FunctionExpression).body\n .body[0] as any as t.FunctionExpression\n ).params;\n\n for (let i = 0, len = getFunctionArity(method); i < len; i++) {\n params.push(scope.generateUidIdentifier(\"x\"));\n }\n\n return template;\n }\n }\n\n method.id = id;\n scope.getProgramParent().references[id.name] = true;\n}\n\nfunction visit(\n node: t.FunctionExpression | t.Class,\n name: string,\n scope: Scope,\n) {\n const state: State = {\n selfAssignment: false,\n selfReference: false,\n outerDeclar: scope.getBindingIdentifier(name),\n name: name,\n };\n\n // check to see if we have a local binding of the id we're setting inside of\n // the function, this is important as there are caveats associated\n\n const binding = scope.getOwnBinding(name);\n\n if (binding) {\n if (binding.kind === \"param\") {\n // safari will blow up in strict mode with code like:\n //\n // let t = function t(t) {};\n //\n // with the error:\n //\n // Cannot declare a parameter named 't' as it shadows the name of a\n // strict mode function.\n //\n // this isn't to the spec and they've invented this behaviour which is\n // **extremely** annoying so we avoid setting the name if it has a param\n // with the same id\n state.selfReference = true;\n } else {\n // otherwise it's defined somewhere in scope like:\n //\n // let t = function () {\n // let t = 2;\n // };\n //\n // so we can safely just set the id and move along as it shadows the\n // bound function id\n }\n } else if (state.outerDeclar || scope.hasGlobal(name)) {\n scope.traverse(node, visitor, state);\n }\n\n return state;\n}\n\n/**\n * Add id to function/class expression inferred from the AST\n *\n * @export\n * @template N The unamed expression type\n * @param {Object} nodePathLike The NodePath-like input\n * @param {N} nodePathLike.node an AST node\n * @param {NodePath<N>[\"parent\"]} [nodePathLike.parent] The parent of the AST node\n * @param {Scope} nodePathLike.scope The scope associated to the AST node\n * @param {t.LVal | t.StringLiteral | t.NumericLiteral | t.BigIntLiteral} [nodePathLike.id] the fallback naming source when the helper\n * can not infer the function name from the AST\n * @param {boolean} [localBinding=false] whether a name could shadow a self-reference (e.g. converting arrow function)\n * @param {boolean} [supportUnicodeId=false] whether the compilation target supports unicodeId (non-BMP characters) or not\n * @returns {(N | t.CallExpression | void)}\n * - modified node when name can be inferred,\n * - an IIFE when `node` contains a binding shadowing the inferred function name (e.g. `let f = function (f) {}`),\n * - `void` when `node` has `id` property or the helper can not inferred the name or the inferred name contains non-BMP characters that is not supported by current target\n */\nexport default function <N extends t.FunctionExpression | t.Class>(\n {\n node,\n parent,\n scope,\n id,\n }: {\n node: N;\n parent?: NodePath<N>[\"parent\"];\n scope: Scope;\n id?: t.LVal | t.StringLiteral | t.NumericLiteral | t.BigIntLiteral;\n },\n localBinding = false,\n supportUnicodeId = false,\n): N | t.CallExpression | void {\n // has an `id` so we don't need to infer one\n if (node.id) return;\n\n if (\n (isObjectProperty(parent) || isObjectMethod(parent, { kind: \"method\" })) &&\n (!parent.computed || isLiteral(parent.key))\n ) {\n // { foo() {} };\n id = parent.key as\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral;\n } else if (isVariableDeclarator(parent)) {\n // let foo = function () {};\n id = parent.id;\n\n // but not \"let foo = () => {};\" being converted to function expression\n if (isIdentifier(id) && !localBinding) {\n const binding = scope.parent.getBinding(id.name);\n if (\n binding &&\n binding.constant &&\n scope.getBinding(id.name) === binding\n ) {\n // always going to reference this method\n node.id = cloneNode(id);\n // @ts-expect-error Fixme: avoid mutating AST nodes\n node.id[NOT_LOCAL_BINDING] = true;\n return;\n }\n }\n } else if (isAssignmentExpression(parent, { operator: \"=\" })) {\n // foo = function () {};\n id = parent.left;\n } else if (!id) {\n return;\n }\n\n let name;\n if (id && isLiteral(id)) {\n name = getNameFromLiteralId(id);\n } else if (id && isIdentifier(id)) {\n name = id.name;\n }\n\n if (name === undefined) {\n return;\n }\n\n if (!supportUnicodeId && isFunction(node) && /[\\uD800-\\uDFFF]/.test(name)) {\n return;\n }\n\n name = toBindingIdentifierName(name);\n const newId = identifier(name);\n\n // The id shouldn't be considered a local binding to the function because\n // we are simply trying to set the function name and not actually create\n // a local binding.\n // @ts-expect-error Fixme: avoid mutating AST nodes\n newId[NOT_LOCAL_BINDING] = true;\n\n const state = visit(node, name, scope);\n return wrap(state, node, newId, scope) || node;\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;;EACEA,iB;EACAC,S;EACAC,U;EACAC,sB;EACAC,mB;EACAC,U;EACAC,Y;EACAC,S;EACAC,a;EACAC,c;EACAC,gB;EACAC,e;EACAC,a;EACAC,iB;EACAC,oB;EACAC;;;AAKF,SAASC,gBAAT,CAA0BC,IAA1B,EAAoD;EAClD,MAAMC,KAAK,GAAGD,IAAI,CAACE,MAAL,CAAYC,SAAZ,CACZC,KAAK,IAAIjB,mBAAmB,CAACiB,KAAD,CAAnB,IAA8BT,aAAa,CAACS,KAAD,CADxC,CAAd;EAGA,OAAOH,KAAK,KAAK,CAAC,CAAX,GAAeD,IAAI,CAACE,MAAL,CAAYG,MAA3B,GAAoCJ,KAA3C;AACD;;AAED,MAAMK,oCAAoC,GAAGC,iBAAA,CAASC,SAAT,CAAoB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAZ6C,CAA7C;;AAcA,MAAMC,6CAA6C,GAAGF,iBAAA,CAASC,SAAT,CAAoB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAZsD,CAAtD;;AAqBA,MAAME,OAAuB,GAAG;EAC9B,yCACEC,IADF,EAEEC,KAFF,EAGE;IAEA,IAAID,IAAI,CAACX,IAAL,CAAUa,IAAV,KAAmBD,KAAK,CAACC,IAA7B,EAAmC;IAInC,MAAMC,WAAW,GAAGH,IAAI,CAACI,KAAL,CAAWC,oBAAX,CAAgCJ,KAAK,CAACC,IAAtC,CAApB;IACA,IAAIC,WAAW,KAAKF,KAAK,CAACK,WAA1B,EAAuC;IAEvCL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,EAAyB;IACvBR,IAAI,GAAGO,oBAAoB,CAACC,EAAD,CAA3B;EACD,CAFD,MAEO,IAAIA,EAAE,IAAIhC,YAAY,CAACgC,EAAD,CAAtB,EAA4B;IACjCR,IAAI,GAAGQ,EAAE,CAACR,IAAV;EACD;;EAED,IAAIA,IAAI,KAAKiB,SAAb,EAAwB;IACtB;EACD;;EAED,IAAI,CAAC4B,gBAAD,IAAqBtE,UAAU,CAACY,IAAD,CAA/B,IAAyC,kBAAkBiE,IAAlB,CAAuBpD,IAAvB,CAA7C,EAA2E;IACzE;EACD;;EAEDA,IAAI,GAAGf,uBAAuB,CAACe,IAAD,CAA9B;EACA,MAAMqD,KAAK,GAAGjF,UAAU,CAAC4B,IAAD,CAAxB;EAMAqD,KAAK,CAACnF,iBAAD,CAAL,GAA2B,IAA3B;EAEA,MAAM6B,KAAK,GAAGsC,KAAK,CAAClD,IAAD,EAAOa,IAAP,EAAaE,KAAb,CAAnB;EACA,OAAOgB,IAAI,CAACnB,KAAD,EAAQZ,IAAR,EAAckE,KAAd,EAAqBnD,KAArB,CAAJ,IAAmCf,IAA1C;AACD"}
|
|
1
|
+
{"version":3,"names":["NOT_LOCAL_BINDING","cloneNode","identifier","isAssignmentExpression","isAssignmentPattern","isFunction","isIdentifier","isLiteral","isNullLiteral","isObjectMethod","isObjectProperty","isRegExpLiteral","isRestElement","isTemplateLiteral","isVariableDeclarator","toBindingIdentifierName","getFunctionArity","node","count","params","findIndex","param","length","buildPropertyMethodAssignmentWrapper","template","statement","buildGeneratorPropertyMethodAssignmentWrapper","visitor","path","state","name","localDeclar","scope","getBindingIdentifier","outerDeclar","selfReference","stop","getNameFromLiteralId","id","pattern","flags","quasis","map","quasi","value","raw","join","undefined","wrap","method","hasBinding","hasGlobal","rename","build","generator","FUNCTION","FUNCTION_ID","FUNCTION_KEY","generateUidIdentifier","expression","callee","body","i","len","push","getProgramParent","references","visit","selfAssignment","binding","getOwnBinding","kind","traverse","parent","localBinding","supportUnicodeId","computed","key","getBinding","constant","operator","left","test","newId"],"sources":["../src/index.ts"],"sourcesContent":["import template from \"@babel/template\";\nimport {\n NOT_LOCAL_BINDING,\n cloneNode,\n identifier,\n isAssignmentExpression,\n isAssignmentPattern,\n isFunction,\n isIdentifier,\n isLiteral,\n isNullLiteral,\n isObjectMethod,\n isObjectProperty,\n isRegExpLiteral,\n isRestElement,\n isTemplateLiteral,\n isVariableDeclarator,\n toBindingIdentifierName,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport type { NodePath, Scope, Visitor } from \"@babel/traverse\";\n\nfunction getFunctionArity(node: t.Function): number {\n const count = node.params.findIndex(\n param => isAssignmentPattern(param) || isRestElement(param),\n );\n return count === -1 ? node.params.length : count;\n}\n\nconst buildPropertyMethodAssignmentWrapper = template.statement(`\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n`);\n\nconst buildGeneratorPropertyMethodAssignmentWrapper = template.statement(`\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n`);\n\ntype State = {\n name: string;\n outerDeclar: t.Identifier;\n selfAssignment: boolean;\n selfReference: boolean;\n};\n\nconst visitor: Visitor<State> = {\n \"ReferencedIdentifier|BindingIdentifier\"(\n path: NodePath<t.Identifier>,\n state,\n ) {\n // check if this node matches our function id\n if (path.node.name !== state.name) return;\n\n // check that we don't have a local variable declared as that removes the need\n // for the wrapper\n const localDeclar = path.scope.getBindingIdentifier(state.name);\n if (localDeclar !== state.outerDeclar) return;\n\n state.selfReference = true;\n path.stop();\n },\n};\n\nfunction getNameFromLiteralId(id: t.Literal) {\n if (isNullLiteral(id)) {\n return \"null\";\n }\n\n if (isRegExpLiteral(id)) {\n return `_${id.pattern}_${id.flags}`;\n }\n\n if (isTemplateLiteral(id)) {\n return id.quasis.map(quasi => quasi.value.raw).join(\"\");\n }\n\n if (id.value !== undefined) {\n return id.value + \"\";\n }\n\n return \"\";\n}\n\nfunction wrap(\n state: State,\n method: t.FunctionExpression | t.Class,\n id: t.Identifier,\n scope: Scope,\n) {\n if (state.selfReference) {\n if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {\n // we can just munge the local binding\n scope.rename(id.name);\n } else {\n // we don't currently support wrapping class expressions\n if (!isFunction(method)) return;\n\n // need to add a wrapper since we can't change the references\n let build = buildPropertyMethodAssignmentWrapper;\n if (method.generator) {\n build = buildGeneratorPropertyMethodAssignmentWrapper;\n }\n\n const template = (\n build({\n FUNCTION: method,\n FUNCTION_ID: id,\n FUNCTION_KEY: scope.generateUidIdentifier(id.name),\n }) as t.ExpressionStatement\n ).expression as t.CallExpression;\n\n // shim in dummy params to retain function arity, if you try to read the\n // source then you'll get the original since it's proxied so it's all good\n const params = (\n (template.callee as t.FunctionExpression).body\n .body[0] as any as t.FunctionExpression\n ).params;\n\n for (let i = 0, len = getFunctionArity(method); i < len; i++) {\n params.push(scope.generateUidIdentifier(\"x\"));\n }\n\n return template;\n }\n }\n\n method.id = id;\n scope.getProgramParent().references[id.name] = true;\n}\n\nfunction visit(\n node: t.FunctionExpression | t.Class,\n name: string,\n scope: Scope,\n) {\n const state: State = {\n selfAssignment: false,\n selfReference: false,\n outerDeclar: scope.getBindingIdentifier(name),\n name: name,\n };\n\n // check to see if we have a local binding of the id we're setting inside of\n // the function, this is important as there are caveats associated\n\n const binding = scope.getOwnBinding(name);\n\n if (binding) {\n if (binding.kind === \"param\") {\n // safari will blow up in strict mode with code like:\n //\n // let t = function t(t) {};\n //\n // with the error:\n //\n // Cannot declare a parameter named 't' as it shadows the name of a\n // strict mode function.\n //\n // this isn't to the spec and they've invented this behaviour which is\n // **extremely** annoying so we avoid setting the name if it has a param\n // with the same id\n state.selfReference = true;\n } else {\n // otherwise it's defined somewhere in scope like:\n //\n // let t = function () {\n // let t = 2;\n // };\n //\n // so we can safely just set the id and move along as it shadows the\n // bound function id\n }\n } else if (state.outerDeclar || scope.hasGlobal(name)) {\n scope.traverse(node, visitor, state);\n }\n\n return state;\n}\n\n/**\n * Add id to function/class expression inferred from the AST\n *\n * @export\n * @template N The unnamed expression type\n * @param {Object} nodePathLike The NodePath-like input\n * @param {N} nodePathLike.node an AST node\n * @param {NodePath<N>[\"parent\"]} [nodePathLike.parent] The parent of the AST node\n * @param {Scope} nodePathLike.scope The scope associated to the AST node\n * @param {t.LVal | t.StringLiteral | t.NumericLiteral | t.BigIntLiteral} [nodePathLike.id] the fallback naming source when the helper\n * can not infer the function name from the AST\n * @param {boolean} [localBinding=false] whether a name could shadow a self-reference (e.g. converting arrow function)\n * @param {boolean} [supportUnicodeId=false] whether the compilation target supports unicodeId (non-BMP characters) or not\n * @returns {(N | t.CallExpression | void)}\n * - modified node when name can be inferred,\n * - an IIFE when `node` contains a binding shadowing the inferred function name (e.g. `let f = function (f) {}`),\n * - `void` when `node` has `id` property or the helper can not inferred the name or the inferred name contains non-BMP characters that is not supported by current target\n */\nexport default function <N extends t.FunctionExpression | t.Class>(\n {\n node,\n parent,\n scope,\n id,\n }: {\n node: N;\n parent?: NodePath<N>[\"parent\"];\n scope: Scope;\n id?: t.LVal | t.StringLiteral | t.NumericLiteral | t.BigIntLiteral;\n },\n localBinding = false,\n supportUnicodeId = false,\n): N | t.CallExpression | void {\n // has an `id` so we don't need to infer one\n if (node.id) return;\n\n if (\n (isObjectProperty(parent) || isObjectMethod(parent, { kind: \"method\" })) &&\n (!parent.computed || isLiteral(parent.key))\n ) {\n // { foo() {} };\n id = parent.key as\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral;\n } else if (isVariableDeclarator(parent)) {\n // let foo = function () {};\n id = parent.id;\n\n // but not \"let foo = () => {};\" being converted to function expression\n if (isIdentifier(id) && !localBinding) {\n const binding = scope.parent.getBinding(id.name);\n if (\n binding &&\n binding.constant &&\n scope.getBinding(id.name) === binding\n ) {\n // always going to reference this method\n node.id = cloneNode(id);\n // @ts-expect-error Fixme: avoid mutating AST nodes\n node.id[NOT_LOCAL_BINDING] = true;\n return;\n }\n }\n } else if (isAssignmentExpression(parent, { operator: \"=\" })) {\n // foo = function () {};\n id = parent.left;\n } else if (!id) {\n return;\n }\n\n let name;\n if (id && isLiteral(id)) {\n name = getNameFromLiteralId(id);\n } else if (id && isIdentifier(id)) {\n name = id.name;\n }\n\n if (name === undefined) {\n return;\n }\n\n if (!supportUnicodeId && isFunction(node) && /[\\uD800-\\uDFFF]/.test(name)) {\n return;\n }\n\n name = toBindingIdentifierName(name);\n const newId = identifier(name);\n\n // The id shouldn't be considered a local binding to the function because\n // we are simply trying to set the function name and not actually create\n // a local binding.\n // @ts-expect-error Fixme: avoid mutating AST nodes\n newId[NOT_LOCAL_BINDING] = true;\n\n const state = visit(node, name, scope);\n return wrap(state, node, newId, scope) || node;\n}\n"],"mappings":";;;;;;AAAA;AACA;AAiBsB;EAhBpBA,iBAAiB;EACjBC,SAAS;EACTC,UAAU;EACVC,sBAAsB;EACtBC,mBAAmB;EACnBC,UAAU;EACVC,YAAY;EACZC,SAAS;EACTC,aAAa;EACbC,cAAc;EACdC,gBAAgB;EAChBC,eAAe;EACfC,aAAa;EACbC,iBAAiB;EACjBC,oBAAoB;EACpBC;AAAuB;AAKzB,SAASC,gBAAgB,CAACC,IAAgB,EAAU;EAClD,MAAMC,KAAK,GAAGD,IAAI,CAACE,MAAM,CAACC,SAAS,CACjCC,KAAK,IAAIjB,mBAAmB,CAACiB,KAAK,CAAC,IAAIT,aAAa,CAACS,KAAK,CAAC,CAC5D;EACD,OAAOH,KAAK,KAAK,CAAC,CAAC,GAAGD,IAAI,CAACE,MAAM,CAACG,MAAM,GAAGJ,KAAK;AAClD;AAEA,MAAMK,oCAAoC,GAAGC,iBAAQ,C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-
"version": "7.
|
|
3
|
+
"version": "7.21.0",
|
|
4
4
|
"description": "Helper function to change the property 'name' of every function",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"main": "./lib/index.js",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@babel/template": "^7.
|
|
18
|
-
"@babel/types": "^7.
|
|
17
|
+
"@babel/template": "^7.20.7",
|
|
18
|
+
"@babel/types": "^7.21.0"
|
|
19
19
|
},
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=6.9.0"
|