More quoting nonsense
This commit is contained in:
parent
d79166a5bc
commit
515ad7fc9c
5 changed files with 593 additions and 9 deletions
|
|
@ -107,6 +107,15 @@ export const _rt = {
|
|||
.filter(name => _rt.fuzzyMatch(query)(name)._tag === 'True')
|
||||
.sort((a, b) => a.length - b.length);
|
||||
},
|
||||
getAt: (pathStr: string) => {
|
||||
const parts = pathStr.split('.');
|
||||
let obj: any = store[parts[0]];
|
||||
for (let i = 1; i < parts.length; i++) {
|
||||
if (obj === undefined || obj === null) return { _tag: 'None' };
|
||||
obj = obj[parts[i]];
|
||||
}
|
||||
return obj === undefined ? { _tag: 'None' } : { _tag: 'Some', _0: obj };
|
||||
},
|
||||
getSource: (name: string) => {
|
||||
const ast = definitions.get(name);
|
||||
if (!ast) return "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue