Closed TotalTechGeek closed 7 months ago
splitPath('a.b.c') // ['a', 'b', 'c'] splitPath('a\\.b.c') // ['a.b', 'c'] splitPath('a\\\\.b.c') // ['a\\', 'b', 'c'] splitPath('a\\\\\\.b.c') // ['a\\.b', 'c'] splitPath('hello') // ['hello'] splitPath('hello\\') // ['hello\\'] splitPath('hello\\\\') // ['hello\\']
const f = engine.build({ var: "hello\\.world" }) f({ "hello.world": 5 }) // 5
Based on @tatarysh's recommendation, I've added support for escaping in the path to allow you to reference dots.
Add Support for Dot-Prop like Syntax
Based on @tatarysh's recommendation, I've added support for escaping in the path to allow you to reference dots.