MCPcopy Create free account
hub / github.com/adobe/react-spectrum / process

Function process

packages/dev/parcel-transformer-mdx-docs/MDXTransformer.js:642–659  ·  view source on GitHub ↗
(specifiers, importKind)

Source from the content-addressed store, hash-verified

640 Program: {
641 exit(path) {
642 let process = (specifiers, importKind) => {
643 for (let lib in specifiers) {
644 let names = specifiers[lib];
645 if (names.length > 0) {
646 let monopackage =
647 lib === '@react-spectrum' ? '@adobe/react-spectrum' : lib.slice(1);
648 let literal = t.stringLiteral(monopackage);
649
650 let decl = t.importDeclaration(
651 names.map(s => t.importSpecifier(t.identifier(s), t.identifier(s))),
652 literal
653 );
654
655 decl.importKind = importKind;
656 path.unshiftContainer('body', [decl]);
657 }
658 }
659 };
660
661 process(specifiers, 'value');
662 process(typeSpecifiers, 'type');

Callers 1

exitFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected