diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-09-28 14:11:02 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-09-28 14:11:02 -0300 |
commit | 411c053dc4b314b2bc0d58d3899fd796ad0054c2 (patch) | |
tree | 5e84c2bfc0609861ae4fb8d4dbf4f758030bbe2c /src/util/sugar.js | |
parent | 518647f8b80ffda6d502b1a75656da7f2ae4b9d3 (diff) |
data, util: use typeAppearance in more places
Diffstat (limited to 'src/util/sugar.js')
-rw-r--r-- | src/util/sugar.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js index ef6ab18c..29fcf848 100644 --- a/src/util/sugar.js +++ b/src/util/sugar.js @@ -82,7 +82,7 @@ export function stitchArrays(keyToArray) { for (const [key, value] of Object.entries(keyToArray)) { if (value === null) continue; if (Array.isArray(value)) continue; - errors.push(new TypeError(`(${key}) Expected array or null, got ${value}`)); + errors.push(new TypeError(`(${key}) Expected array or null, got ${typeAppearance(value)}`)); } if (!empty(errors)) { @@ -170,11 +170,11 @@ export function setIntersection(set1, set2) { export function filterProperties(object, properties) { if (typeof object !== 'object' || object === null) { - throw new TypeError(`Expected object to be an object, got ${object}`); + throw new TypeError(`Expected object to be an object, got ${typeAppearance(object)}`); } if (!Array.isArray(properties)) { - throw new TypeError(`Expected properties to be an array, got ${properties}`); + throw new TypeError(`Expected properties to be an array, got ${typeAppearance(properties)}`); } const filteredObject = {}; |