diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-05-01 13:59:51 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-05-06 12:29:05 -0300 |
commit | 9f14f1dfc7aa6c00c0cfa07577208ad1bdcc62f7 (patch) | |
tree | d6de6f584c522ba61c0eef9c4fb74360b2e95763 /src/common-util/sugar.js | |
parent | 608f493d62ab788126fea7d53e2311a9d00e41fb (diff) |
sugar: exhaust
Not actually used in any commit yet. Sorry!
Diffstat (limited to 'src/common-util/sugar.js')
-rw-r--r-- | src/common-util/sugar.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common-util/sugar.js b/src/common-util/sugar.js index 66e160aa..9e344816 100644 --- a/src/common-util/sugar.js +++ b/src/common-util/sugar.js @@ -221,6 +221,9 @@ export const compareArrays = (arr1, arr2, {checkOrder = true} = {}) => ? arr1.every((x, i) => arr2[i] === x) : arr1.every((x) => arr2.includes(x))); +export const exhaust = (generatorFunction) => + Array.from(generatorFunction()); + export function compareObjects(obj1, obj2, { checkOrder = false, checkSymbols = true, |