Skip to content

Commit 240abe0

Browse files
committed
refactor: convert a few more statements
1 parent 7b497bf commit 240abe0

File tree

7 files changed

+185
-256
lines changed

7 files changed

+185
-256
lines changed

packages/types/src/builtins/collections.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class RealMapType extends RealType implements MapType {
7777

7878
_write(tap, val) {
7979
if (!val || typeof val != 'object' || Array.isArray(val)) {
80-
throwInvalidError(val, this);
80+
throw invalidValueError(val, this);
8181
}
8282

8383
const values = this.valuesType;
@@ -120,7 +120,7 @@ class RealMapType extends RealType implements MapType {
120120
}
121121
return copy;
122122
}
123-
throwInvalidError(val, this);
123+
throw invalidValueError(val, this);
124124
}
125125

126126
valuesType(): Type {
@@ -212,7 +212,7 @@ class RealArrayType extends RealType implements ArrayType {
212212

213213
_write(tap, val) {
214214
if (!Array.isArray(val)) {
215-
throwInvalidError(val, this);
215+
throw invalidValueError(val, this);
216216
}
217217
const items = this.itemsType;
218218
const n = val.length;
@@ -252,7 +252,7 @@ class RealArrayType extends RealType implements ArrayType {
252252

253253
_copy(val, opts) {
254254
if (!Array.isArray(val)) {
255-
throwInvalidError(val, this);
255+
throw invalidValueError(val, this);
256256
}
257257
const items = new Array(val.length);
258258
for (let i = 0, l = val.length; i < l; i++) {

0 commit comments

Comments
 (0)