MCPcopy Index your code
hub / github.com/formatjs/formatjs / isValidIdentifier

Function isValidIdentifier

packages/ts-transformer/transform.ts:51–58  ·  view source on GitHub ↗
(k: string)

Source from the content-addressed store, hash-verified

49}
50
51function isValidIdentifier(k: string): boolean {
52 try {
53 new Function(`return {${k}:1}`)
54 return true
55 } catch {
56 return false
57 }
58}
59
60function objToTSNode(factory: typescript.NodeFactory, obj: object) {
61 if (typeof obj === 'object' && !obj) {

Callers 1

objToTSNodeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected