Skip to content

Commit 761b887

Browse files
committed
Use moree explicit definittion
1 parent bfb9fb4 commit 761b887

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { DEBUG } from '@glimmer/env';
22

3-
export const eq = (...args: unknown[]) => {
4-
if (DEBUG && args.length !== 2) {
5-
throw new Error(`\`eq\` expects exactly two arguments, but received ${args.length}.`);
3+
/**
4+
* Performs a strict equality comparison.
5+
*
6+
* left === right
7+
*/
8+
export function eq(left: unknown, right: unknown) {
9+
if (DEBUG && arguments.length !== 2) {
10+
throw new Error(`\`eq\` expects exactly two arguments, but received ${arguments.length}.`);
611
}
712

8-
return args[0] === args[1];
9-
};
13+
return left === right;
14+
}
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { DEBUG } from '@glimmer/env';
22

3-
export const neq = (...args: unknown[]) => {
4-
if (DEBUG && args.length !== 2) {
5-
throw new Error(`\`neq\` expects exactly two arguments, but received ${args.length}.`);
3+
/**
4+
* Performs a strict inequality comparison.
5+
*
6+
* left !== right
7+
*/
8+
export function neq(left: unknown, right: unknown) {
9+
if (DEBUG && arguments.length !== 2) {
10+
throw new Error(`\`neq\` expects exactly two arguments, but received ${arguments.length}.`);
611
}
712

8-
return args[0] !== args[1];
9-
};
13+
return left !== right;
14+
}

0 commit comments

Comments
 (0)