Full-featured .scad text editor w/ autocomplete

This commit is contained in:
ochafik 2023-03-24 04:04:05 +00:00
commit 186049b215
14 changed files with 930 additions and 13 deletions

12
src/utils.ts Normal file
View file

@ -0,0 +1,12 @@
// Portions of this file are Copyright 2021 Google LLC, and licensed under GPL2+. See COPYING.
export function mapObject(o: any, f: (key: string, value: any) => any, ifPred: (key: string) => boolean) {
const ret = [];
for (const key of Object.keys(o)) {
if (ifPred && !ifPred(key)) {
continue;
}
ret.push(f(key, o[key]));
}
return ret;
}