REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.57 KB
Close
/home/byroehnu/.trash/node_modules11/babel-plugin-styled-components/lib/utils/getName.js
Text
Base64
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * Get the name of variable that contains node * * @param {Path} path to the node * * @return {String} The target */ var _default = t => path => { let namedNode; path.find(path => { // X = styled if (path.isAssignmentExpression()) { namedNode = path.node.left; // const X = { Y: styled } } else if (path.isObjectProperty()) { namedNode = path.node.key; // class Y { (static) X = styled } } else if (path.isClassProperty()) { namedNode = path.node.key; // const X = styled } else if (path.isVariableDeclarator()) { namedNode = path.node.id; } else if (path.isStatement()) { // we've hit a statement, we should stop crawling up return true; } // we've got an displayName (if we need it) no need to continue // However if this is an assignment expression like X = styled then we // want to keep going up incase there is Y = X = styled; in this case we // want to pick the outer name because react-refresh will add HMR variables // like this: X = _a = styled. We could also consider only doing this if the // name starts with an underscore. if (namedNode && !path.isAssignmentExpression()) return true; }); // foo.bar -> bar if (t.isMemberExpression(namedNode)) { namedNode = namedNode.property; } // identifiers are the only thing we can reliably get a name from return t.isIdentifier(namedNode) ? namedNode.name : undefined; }; exports.default = _default;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
detectors.js
6.61 KB
lrw-r--r--
2026-02-28 00:26:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
getName.js
1.57 KB
lrw-r--r--
2026-02-28 00:27:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
getSequenceExpressionValue.js
261 B
lrw-r--r--
2026-02-28 00:27:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
hash.js
1.55 KB
lrw-r--r--
2026-02-28 00:27:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
options.js
1.91 KB
lrw-r--r--
2026-02-28 00:28:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
prefixDigit.js
194 B
lrw-r--r--
2026-02-28 00:28:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).