REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 4.62 KB
Close
/home/byroehnu/easepaybiz.easetack.com/node_modules/@emotion/babel-plugin/src/utils/label.js
Text
Base64
import nodePath from 'path' /* type LabelFormatOptions = { name: string, path: string } */ const invalidClassNameCharacters = /[!"#$%&'()*+,./:;<=>?@[\]^`|}~{]/g const sanitizeLabelPart = (labelPart /*: string */) => labelPart.trim().replace(invalidClassNameCharacters, '-') function getLabel( identifierName /* ?: string */, labelFormat /* ?: string | (LabelFormatOptions => string) */, filename /*: string */ ) { if (!identifierName) return null const sanitizedName = sanitizeLabelPart(identifierName) if (!labelFormat) { return sanitizedName } if (typeof labelFormat === 'function') { return labelFormat({ name: sanitizedName, path: filename }) } const parsedPath = nodePath.parse(filename) let localDirname = nodePath.basename(parsedPath.dir) let localFilename = parsedPath.name if (localFilename === 'index') { localFilename = localDirname } return labelFormat .replace(/\[local\]/gi, sanitizedName) .replace(/\[filename\]/gi, sanitizeLabelPart(localFilename)) .replace(/\[dirname\]/gi, sanitizeLabelPart(localDirname)) } export function getLabelFromPath(path, state, t) { return getLabel( getIdentifierName(path, t), state.opts.labelFormat, state.file.opts.filename ) } const getObjPropertyLikeName = (path, t) => { if ( (!t.isObjectProperty(path) && !t.isObjectMethod(path)) || path.node.computed ) { return null } if (t.isIdentifier(path.node.key)) { return path.node.key.name } if (t.isStringLiteral(path.node.key)) { return path.node.key.value.replace(/\s+/g, '-') } return null } function getDeclaratorName(path, t) { const parent = path.findParent( p => p.isVariableDeclarator() || p.isAssignmentExpression() || p.isFunctionDeclaration() || p.isFunctionExpression() || p.isArrowFunctionExpression() || p.isObjectProperty() || p.isObjectMethod() ) if (!parent) { return '' } // we probably have a css call assigned to a variable // so we'll just return the variable name if (parent.isVariableDeclarator()) { if (t.isIdentifier(parent.node.id)) { return parent.node.id.name } return '' } if (parent.isAssignmentExpression()) { let { left } = parent.node if (t.isIdentifier(left)) { return left.name } if (t.isMemberExpression(left)) { let memberExpression = left let name = '' while (true) { if (!t.isIdentifier(memberExpression.property)) { return '' } name = `${memberExpression.property.name}${name ? `-${name}` : ''}` if (t.isIdentifier(memberExpression.object)) { return `${memberExpression.object.name}-${name}` } if (!t.isMemberExpression(memberExpression.object)) { return '' } memberExpression = memberExpression.object } } return '' } // we probably have an inline css prop usage if (parent.isFunctionDeclaration()) { return parent.node.id.name || '' } if (parent.isFunctionExpression()) { if (parent.node.id) { return parent.node.id.name || '' } return getDeclaratorName(parent, t) } if (parent.isArrowFunctionExpression()) { return getDeclaratorName(parent, t) } // we could also have an object property const objPropertyLikeName = getObjPropertyLikeName(parent, t) if (objPropertyLikeName) { return objPropertyLikeName } let variableDeclarator = parent.findParent(p => p.isVariableDeclarator()) if (!variableDeclarator || !variableDeclarator.get('id').isIdentifier()) { return '' } return variableDeclarator.node.id.name } function getIdentifierName(path, t) { let objPropertyLikeName = getObjPropertyLikeName(path.parentPath, t) if (objPropertyLikeName) { return objPropertyLikeName } let classOrClassPropertyParent = path.findParent( p => t.isClassProperty(p) || t.isClass(p) ) if (classOrClassPropertyParent) { if ( t.isClassProperty(classOrClassPropertyParent) && classOrClassPropertyParent.node.computed === false && t.isIdentifier(classOrClassPropertyParent.node.key) ) { return classOrClassPropertyParent.node.key.name } if ( t.isClass(classOrClassPropertyParent) && classOrClassPropertyParent.node.id ) { return t.isIdentifier(classOrClassPropertyParent.node.id) ? classOrClassPropertyParent.node.id.name : '' } } let declaratorName = getDeclaratorName(path, t) // if the name starts with _ it was probably generated by babel so we should ignore it if (declaratorName.charAt(0) === '_') { return '' } return declaratorName }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 14
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
.htaccess
127 B
lr--r--r--
2026-03-14 01:49:07
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
add-import.js
750 B
lrw-r--r--
2026-03-05 00:19:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
create-node-env-conditional.js
373 B
lrw-r--r--
2026-03-05 00:19:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-styled-options.js
2.79 KB
lrw-r--r--
2026-03-05 00:19:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
get-target-class-name.js
1.49 KB
lrw-r--r--
2026-03-05 00:20:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
537 B
lrw-r--r--
2026-03-05 00:20:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
label.js
4.62 KB
lrw-r--r--
2026-03-05 00:20:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
minify.js
3.91 KB
lrw-r--r--
2026-03-05 00:20:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
object-to-string.js
1.26 KB
lrw-r--r--
2026-03-05 00:20:05
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
source-maps.js
1.07 KB
lrw-r--r--
2026-03-05 00:20:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
strings.js
1.90 KB
lrw-r--r--
2026-03-05 00:20:08
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
transform-expression-with-styles.js
4.21 KB
lrw-r--r--
2026-03-05 00:20:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
transformer-macro.js
1.65 KB
lrw-r--r--
2026-03-05 00:20:09
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
transpiled-output-utils.js
2.28 KB
lrw-r--r--
2026-03-05 00:20:09
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).