Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
53
Frontend-Learner/node_modules/parse-imports-exports/index.js
generated
vendored
Normal file
53
Frontend-Learner/node_modules/parse-imports-exports/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import { onGlobalError } from './onErrors.js';
|
||||
import { comments, getStatements } from './statements.js';
|
||||
import { CONTEXT_KEY, createParseFunction, getCacheKey, removeErrorsCausedByOverloading, } from './utils.js';
|
||||
/**
|
||||
* Parses `import`/`export` in ECMAScript/TypeScript syntax.
|
||||
*/
|
||||
export const parseImportsExports = (source, options) => {
|
||||
const cacheKey = getCacheKey(options);
|
||||
const importsExports = {
|
||||
namedImports: undefined,
|
||||
namespaceImports: undefined,
|
||||
dynamicImports: undefined,
|
||||
requires: undefined,
|
||||
typeNamedImports: undefined,
|
||||
typeNamespaceImports: undefined,
|
||||
typeDynamicImports: undefined,
|
||||
namedReexports: undefined,
|
||||
namespaceReexports: undefined,
|
||||
starReexports: undefined,
|
||||
typeNamedReexports: undefined,
|
||||
typeNamespaceReexports: undefined,
|
||||
typeStarReexports: undefined,
|
||||
defaultExport: undefined,
|
||||
namedExports: undefined,
|
||||
declarationExports: undefined,
|
||||
typeNamedExports: undefined,
|
||||
typeExports: undefined,
|
||||
interfaceExports: undefined,
|
||||
namespaceExports: undefined,
|
||||
commonJsNamespaceExport: undefined,
|
||||
commonJsExports: undefined,
|
||||
errors: undefined,
|
||||
[CONTEXT_KEY]: { lineColumnCache: undefined, linesIndexes: undefined, options, source },
|
||||
};
|
||||
var parse = parseCache[cacheKey];
|
||||
if (parse === undefined) {
|
||||
const statements = getStatements(options);
|
||||
parse = createParseFunction({ ...baseParseOptions, statements });
|
||||
parseCache[cacheKey] = parse;
|
||||
}
|
||||
parse(importsExports, source);
|
||||
removeErrorsCausedByOverloading(importsExports);
|
||||
importsExports[CONTEXT_KEY] = undefined;
|
||||
return importsExports;
|
||||
};
|
||||
/**
|
||||
* Base options of parse function.
|
||||
*/
|
||||
const baseParseOptions = { comments, onError: onGlobalError };
|
||||
/**
|
||||
* Cache of parse functions with different options.
|
||||
*/
|
||||
const parseCache = { __proto__: null };
|
||||
Loading…
Add table
Add a link
Reference in a new issue