MCPcopy
hub / github.com/webpack/webpack / propertyName

Function propertyName

lib/util/property.js:69–74  ·  view source on GitHub ↗
(prop)

Source from the content-addressed store, hash-verified

67 * @returns {string} valid JS property name
68 */
69const propertyName = (prop) => {
70 if (SAFE_IDENTIFIER.test(prop) && !RESERVED_IDENTIFIER.has(prop)) {
71 return prop;
72 }
73 return JSON.stringify(prop);
74};
75
76/**
77 * Returns chain of property accesses.

Callers 5

codeGenerationMethod · 0.85
getContentMethod · 0.85

Calls 2

testMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected