(base: string, prefix: string)
| 157 | } |
| 158 | |
| 159 | export function getKeysStartingWith(base: string, prefix: string): string[] { |
| 160 | const keys = new Set<string>(); |
| 161 | for (const elem of hierarchy) { |
| 162 | const propertyMap = findProps(base, elem); |
| 163 | if (propertyMap) { |
| 164 | for (const key of Object.keys(propertyMap)) { |
| 165 | if (key.startsWith(prefix)) { |
| 166 | keys.add(key); |
| 167 | } |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | return [...keys]; |
| 172 | } |
| 173 | |
| 174 | export function propsFor(base: string): PropertyGetter { |
| 175 | return (property: string, defaultValue: any) => get(base, property, defaultValue); |
no test coverage detected