You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
daton/lib/src/unit/RecursiveCanonical.ts

13 lines
358 B

import {Canonical} from './Canonical.ts'
export class RecursiveCanonical extends Canonical<any> {
public get(key: string): any | undefined {
const parts = key.split('.')
let current_value = this._items
for ( const part of parts ) {
current_value = current_value?.[part]
}
return current_value
}
}