8 lines
235 B
TypeScript
Raw Permalink Normal View History

2024-11-05 10:14:41 +08:00
import { stringToPath } from './_stringToPath'
import type { PropertyName, PropertyPath } from './_common'
export function castPath(value: PropertyPath) {
return Array.isArray(value) ? value : stringToPath(value as PropertyName)
}