made a start on mutating the AST

This commit is contained in:
Chris Kruining 2025-03-10 16:48:37 +01:00
parent 603719de38
commit 97036272dd
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
12 changed files with 318 additions and 165 deletions

View file

@ -129,7 +129,8 @@ export function* deepDiff<T1 extends object, T2 extends object>(a: T1, b: T2, pa
}
};
const isIterable = (subject: object): subject is Iterable<any> => ['boolean', 'undefined', 'null', 'number'].includes(typeof subject) === false;
const nonIterableTypes = ['boolean', 'undefined', 'null', 'number'];
const isIterable = (subject: object): subject is Iterable<any> => nonIterableTypes.includes(typeof subject) === false;
const entriesOf = (subject: object): Iterable<readonly [string | number, any]> => {
if (subject instanceof Array) {
return subject.entries();