@augment-vir/assert 31.57.0 → 31.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -401,7 +401,7 @@ const assertions = {
401
401
  * - {@link assert.isNumber} : the opposite assertion.
402
402
  */
403
403
  isNotNumber(actual, failureMessage) {
404
- if (typeof actual === 'number') {
404
+ if (typeof actual === 'number' && !isNaN(actual)) {
405
405
  throw new AssertionError(`'${stringify(actual)}' is a number.`, failureMessage);
406
406
  }
407
407
  },
@@ -652,7 +652,7 @@ export const runtimeTypeGuards = {
652
652
  * - {@link check.isNotNumber} : the opposite check.
653
653
  */
654
654
  isNumber(actual) {
655
- return typeof actual === 'number';
655
+ return typeof actual === 'number' && !isNaN(actual);
656
656
  },
657
657
  /**
658
658
  * Checks that a value is an object. This excludes arrays.
@@ -885,7 +885,7 @@ export const runtimeTypeGuards = {
885
885
  * - {@link check.isNumber} : the opposite check.
886
886
  */
887
887
  isNotNumber(actual) {
888
- return typeof actual !== 'number';
888
+ return typeof actual !== 'number' || isNaN(actual);
889
889
  },
890
890
  /**
891
891
  * Checks that a value is _not_ an object. This includes arrays.
@@ -1443,7 +1443,7 @@ export const runtimeTypeGuards = {
1443
1443
  * - {@link assertWrap.isNumber} : the opposite assertion.
1444
1444
  */
1445
1445
  isNotNumber(actual, failureMessage) {
1446
- if (typeof actual === 'number') {
1446
+ if (typeof actual === 'number' && !isNaN(actual)) {
1447
1447
  throw new AssertionError(`'${stringify(actual)}' is a number.`, failureMessage);
1448
1448
  }
1449
1449
  return actual;
@@ -1744,7 +1744,7 @@ export const runtimeTypeGuards = {
1744
1744
  * - {@link checkWrap.isNotNumber} : the opposite check.
1745
1745
  */
1746
1746
  isNumber(actual) {
1747
- if (typeof actual === 'number') {
1747
+ if (typeof actual === 'number' && !isNaN(actual)) {
1748
1748
  return actual;
1749
1749
  }
1750
1750
  else {
@@ -2027,7 +2027,7 @@ export const runtimeTypeGuards = {
2027
2027
  * - {@link checkWrap.isNumber} : the opposite check.
2028
2028
  */
2029
2029
  isNotNumber(actual) {
2030
- if (typeof actual === 'number') {
2030
+ if (typeof actual === 'number' && !isNaN(actual)) {
2031
2031
  return undefined;
2032
2032
  }
2033
2033
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augment-vir/assert",
3
- "version": "31.57.0",
3
+ "version": "31.57.1",
4
4
  "description": "A collection of assertions for test and production code alike.",
5
5
  "keywords": [
6
6
  "augment",
@@ -42,7 +42,7 @@
42
42
  "test:update": "npm test"
43
43
  },
44
44
  "dependencies": {
45
- "@augment-vir/core": "^31.57.0",
45
+ "@augment-vir/core": "^31.57.1",
46
46
  "@date-vir/duration": "^8.1.0",
47
47
  "deep-eql": "^5.0.2",
48
48
  "expect-type": "^1.3.0",