isLiteralNode,
isCallOf,
unwrapTSNode,
- toRuntimeTypeString
+ toRuntimeTypeString,
+ getEscapedKey
} from './utils'
import { genModelProps } from './defineModel'
import { getObjectOrArrayExpressionKeys } from './analyzeScriptBindings'
return 'Function'
}
}
-
-/**
- * key may contain symbols
- * e.g. onUpdate:modelValue -> "onUpdate:modelValue"
- */
-export const escapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g
-function getEscapedKey(key: string) {
- return escapeSymbolsRE.test(key)
- ? JSON.stringify(key)
- : key
-}
}
export const joinPaths = (path.posix || path).join
+
+/**
+ * key may contain symbols
+ * e.g. onUpdate:modelValue -> "onUpdate:modelValue"
+ */
+export const escapeSymbolsRE = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g
+
+export function getEscapedKey(key: string) {
+ return escapeSymbolsRE.test(key) ? JSON.stringify(key) : key
+}
BindingMetadata
} from '@vue/compiler-dom'
import { SFCDescriptor } from '../parse'
-import { escapeSymbolsRE } from '../script/defineProps'
+import { escapeSymbolsRE } from '../script/utils'
import { PluginCreator } from 'postcss'
import hash from 'hash-sum'
return hash(id + raw)
} else {
// escape ASCII Punctuation & Symbols
- return `${id}-${raw.replace(
- escapeSymbolsRE,
- s => `\\${s}`
- )}`
+ return `${id}-${raw.replace(escapeSymbolsRE, s => `\\${s}`)}`
}
}