Skip to content

Commit 7ab7b52

Browse files
committed
use @ts-ignore to preserve ArraySchema.every() type. closes #189
1 parent d5c83e0 commit 7ab7b52

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@colyseus/schema",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"description": "Binary state serializer with delta encoding for games",
55
"bin": {
66
"schema-codegen": "./bin/schema-codegen",

src/types/custom/ArraySchema.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -496,18 +496,17 @@ export class ArraySchema<V = any> implements Array<V>, Collection<number, V> {
496496
return this.items.lastIndexOf(searchElement, fromIndex);
497497
}
498498

499-
// /**
500-
// * Determines whether all the members of an array satisfy the specified test.
501-
// * @param callbackfn A function that accepts up to three arguments. The every method calls
502-
// * the callbackfn function for each element in the array until the callbackfn returns a value
503-
// * which is coercible to the Boolean value false, or until the end of the array.
504-
// * @param thisArg An object to which the this keyword can refer in the callbackfn function.
505-
// * If thisArg is omitted, undefined is used as the this value.
506-
// */
507-
every<S extends V>(predicate: (value: V, index: number, array: V[]) => value is S, thisArg?: any): this is S[];
508-
every(callbackfn: (value: V, index: number, array: V[]) => unknown, thisArg?: any): boolean;
509-
every(predicate: any, thisArg?: any): any {
510-
return this.items.every(predicate, thisArg);
499+
/**
500+
* Determines whether all the members of an array satisfy the specified test.
501+
* @param callbackfn A function that accepts up to three arguments. The every method calls
502+
* the callbackfn function for each element in the array until the callbackfn returns a value
503+
* which is coercible to the Boolean value false, or until the end of the array.
504+
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
505+
* If thisArg is omitted, undefined is used as the this value.
506+
*/
507+
// @ts-ignore
508+
every(callbackfn: (value: V, index: number, array: V[]) => unknown, thisArg?: any): boolean {
509+
return this.items.every(callbackfn, thisArg);
511510
}
512511

513512
/**

0 commit comments

Comments
 (0)