Make path character separator configurable
goliatone opened this issue · comments
goliatone commented
Currently we use .
as a path segment separator, we should make this optional.
Enable global override or a per-function override.
Use:
KeyPath.DEFAULTS = {
separator: '.'
};
Keypath.get = function(target, path, defaultValue, options={}) {
if (!target || !path) return false;
let separator = options.separator || KeyPath.DEFAULTS.separator;
path = path.split(separator);
...
};