Spaces:
Sleeping
Sleeping
pythonic-rag-FastAPIReact / frontend /node_modules /@emotion /babel-plugin /src /utils /add-import.js
Download frontend/node_modules/@emotion/babel-plugin/src/utils/add-import.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 750 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/%40emotion/babel-plugin/src/utils/add-import.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/@emotion/babel-plugin/src/utils/add-import.js
-
curl -L -o add-import.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/94e32638a275d46bc1ba62feac204fcaaf313da4/frontend/node_modules/%40emotion/babel-plugin/src/utils/add-import.js
750 Bytes
| import { addDefault, addNamed } from '@babel/helper-module-imports' | |
| export function addImport( | |
| state, | |
| importSource /*: string */, | |
| importedSpecifier /*: string */, | |
| nameHint /* ?: string */ | |
| ) { | |
| let cacheKey = ['import', importSource, importedSpecifier].join(':') | |
| if (state[cacheKey] === undefined) { | |
| let importIdentifier | |
| if (importedSpecifier === 'default') { | |
| importIdentifier = addDefault(state.file.path, importSource, { nameHint }) | |
| } else { | |
| importIdentifier = addNamed( | |
| state.file.path, | |
| importedSpecifier, | |
| importSource, | |
| { | |
| nameHint | |
| } | |
| ) | |
| } | |
| state[cacheKey] = importIdentifier.name | |
| } | |
| return { | |
| type: 'Identifier', | |
| name: state[cacheKey] | |
| } | |
| } | |