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.
13 lines
385 B
13 lines
385 B
import {Canonical} from "./Canonical";
|
|
|
|
export class CanonicalRecursive extends Canonical<any> {
|
|
public get(key: string, fallback?: any): any | undefined {
|
|
const parts = key.split('.')
|
|
let currentValue = this.loadedItems
|
|
for ( const part of parts ) {
|
|
currentValue = currentValue?.[part]
|
|
}
|
|
return currentValue ?? fallback
|
|
}
|
|
}
|