Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/format/src/types/materials/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export namespace Materials {
"version" in value.compiler &&
typeof value.compiler.version === "string" &&
"sources" in value &&
value.sources instanceof Array &&
Array.isArray(value.sources) &&
value.sources.every(isSource);

export interface Source {
Expand Down
6 changes: 3 additions & 3 deletions packages/format/src/types/pointer/pointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export namespace Pointer {
typeof value === "object" &&
Object.keys(value).length === 1 &&
"group" in value &&
value.group instanceof Array &&
Array.isArray(value.group) &&
value.group.length >= 1 &&
value.group.every(isPointer);

Expand Down Expand Up @@ -290,7 +290,7 @@ export namespace Pointer {

export type Operands = Expression[];
export const isOperands = (value: unknown): value is Expression[] =>
value instanceof Array && value.every(isExpression);
Array.isArray(value) && value.every(isExpression);

export namespace Arithmetic {
export type Operation =
Expand Down Expand Up @@ -472,7 +472,7 @@ export namespace Pointer {
typeof value === "object" &&
Object.keys(value).length === 2 &&
"expect" in value &&
value.expect instanceof Array &&
Array.isArray(value.expect) &&
value.expect.every(isIdentifier) &&
"for" in value &&
isPointer(value.for);
Expand Down
2 changes: 1 addition & 1 deletion packages/format/src/types/program/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export namespace Context {
typeof value === "object" &&
!!value &&
"variables" in value &&
value.variables instanceof Array &&
Array.isArray(value.variables) &&
value.variables.length > 0 &&
value.variables.every(Variables.isVariable);

Expand Down
3 changes: 1 addition & 2 deletions packages/format/src/types/program/instruction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ export namespace Instruction {
"mnemonic" in value &&
typeof value.mnemonic === "string" &&
(!("arguments" in value) ||
(value.arguments instanceof Array &&
value.arguments.every(Data.isValue)));
(Array.isArray(value.arguments) && value.arguments.every(Data.isValue)));
}
2 changes: 1 addition & 1 deletion packages/format/src/types/program/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const isProgram = (value: unknown): value is Program =>
"environment" in value &&
Program.isEnvironment(value.environment) &&
"instructions" in value &&
value.instructions instanceof Array &&
Array.isArray(value.instructions) &&
value.instructions.every(Program.isInstruction) &&
(!("compilation" in value) ||
Materials.isReference<Materials.Compilation>(value.compilation)) &&
Expand Down
2 changes: 1 addition & 1 deletion packages/format/src/types/type/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const isComplex = (value: unknown): value is Complex =>
"contains" in value &&
!!value.contains &&
(isWrapper(value.contains) ||
(value.contains instanceof Array && value.contains.every(isWrapper)) ||
(Array.isArray(value.contains) && value.contains.every(isWrapper)) ||
(typeof value.contains === "object" &&
Object.values(value.contains).every(isWrapper)));

Expand Down
9 changes: 4 additions & 5 deletions packages/format/src/types/type/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export namespace Type {
"class" in value &&
(!("contains" in value) ||
Type.isWrapper(value.contains) ||
(value.contains instanceof Array &&
value.contains.every(Type.isWrapper)) ||
(Array.isArray(value.contains) && value.contains.every(Type.isWrapper)) ||
(typeof value.contains === "object" &&
Object.values(value.contains).every(Type.isWrapper)));

Expand Down Expand Up @@ -262,7 +261,7 @@ export namespace Type {
mayHaveClass(value, "elementary") &&
hasKind(value, "enum") &&
"values" in value &&
value.values instanceof Array &&
Array.isArray(value.values) &&
(!("definition" in value) || isDefinition(value.definition));
}

Expand Down Expand Up @@ -330,7 +329,7 @@ export namespace Type {
mayHaveClass(value, "complex") &&
hasKind(value, "tuple") &&
"contains" in value &&
value.contains instanceof Array &&
Array.isArray(value.contains) &&
value.contains.every(
(element) =>
isWrapper(element) &&
Expand Down Expand Up @@ -386,7 +385,7 @@ export namespace Type {
mayHaveClass(value, "complex") &&
hasKind(value, "struct") &&
"contains" in value &&
value.contains instanceof Array &&
Array.isArray(value.contains) &&
value.contains.every(
(field) =>
isWrapper(field) &&
Expand Down
Loading