This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class KeyPath { | |
static lastValue(keypath, object) { | |
return keypath.split('.').reduce((prev, curr) => { | |
return prev && prev[curr]; | |
}, data); | |
} | |
static lastKey(keypath, object) { | |
return keypath.split('.').pop(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import {Event} from './event.es6'; | |
import * as func from './func.es6'; | |
import * as classes from './classes.es6'; | |
const paramReg = /:(\w+)/g; | |
const slashReg = /\//g; | |
const paramRepl = '(.*?)'; | |
const slashRepl = '\\/'; |