wip: refs

This commit is contained in:
Evan You
2019-06-03 13:44:45 +08:00
parent 0ad31f29c4
commit 2848f65a7f
6 changed files with 69 additions and 14 deletions

View File

@@ -14,6 +14,9 @@ export const isString = (val: any): val is string => typeof val === 'string'
export const isObject = (val: any): val is Record<any, any> =>
val !== null && typeof val === 'object'
export const isReservedProp = (key: string): boolean =>
key === 'key' || key === 'ref'
const camelizeRE = /-(\w)/g
export const camelize = (str: string): string => {
return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''))