jest-matcher-utils
Advanced tools
Comparing version 30.0.0-alpha.2 to 30.0.0-alpha.3
@@ -30,3 +30,3 @@ /*! | ||
const supportTypes = ['map', 'array', 'object']; | ||
const supportTypes = new Set(['map', 'array', 'object']); | ||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ | ||
@@ -39,3 +39,3 @@ class Replaceable { | ||
this.type = (0, _jestGetType.getType)(object); | ||
if (!supportTypes.includes(this.type)) { | ||
if (!supportTypes.has(this.type)) { | ||
throw new Error(`Type ${this.type} is not support in Replaceable!`); | ||
@@ -47,3 +47,3 @@ } | ||
const obj2Type = (0, _jestGetType.getType)(obj2); | ||
return obj1Type === obj2Type && supportTypes.includes(obj1Type); | ||
return obj1Type === obj2Type && supportTypes.has(obj1Type); | ||
} | ||
@@ -277,3 +277,3 @@ forEach(cb) { | ||
exports.stringify = stringify; | ||
const highlightTrailingWhitespace = text => text.replace(/\s+$/gm, _chalk.default.inverse('$&')); | ||
const highlightTrailingWhitespace = text => text.replaceAll(/\s+$/gm, _chalk.default.inverse('$&')); | ||
@@ -283,3 +283,3 @@ // Instead of inverse highlight which now implies a change, | ||
exports.highlightTrailingWhitespace = highlightTrailingWhitespace; | ||
const replaceTrailingSpaces = text => text.replace(/\s+$/gm, spaces => SPACE_SYMBOL.repeat(spaces.length)); | ||
const replaceTrailingSpaces = text => text.replaceAll(/\s+$/gm, spaces => SPACE_SYMBOL.repeat(spaces.length)); | ||
const printReceived = object => RECEIVED_COLOR(replaceTrailingSpaces(stringify(object))); | ||
@@ -296,3 +296,3 @@ exports.printReceived = printReceived; | ||
const ensureNoExpected = (expected, matcherName, options) => { | ||
if (typeof expected !== 'undefined') { | ||
if (expected !== undefined) { | ||
// Prepend maybe not only for backward compatibility. | ||
@@ -299,0 +299,0 @@ const matcherString = (options ? '' : '[.not]') + matcherName; |
{ | ||
"name": "jest-matcher-utils", | ||
"description": "A set of utility functions for expect and related packages", | ||
"version": "30.0.0-alpha.2", | ||
"version": "30.0.0-alpha.3", | ||
"repository": { | ||
@@ -27,8 +27,8 @@ "type": "git", | ||
"chalk": "^4.0.0", | ||
"jest-diff": "30.0.0-alpha.2", | ||
"jest-get-type": "30.0.0-alpha.2", | ||
"pretty-format": "30.0.0-alpha.2" | ||
"jest-diff": "30.0.0-alpha.3", | ||
"jest-get-type": "30.0.0-alpha.3", | ||
"pretty-format": "30.0.0-alpha.3" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "30.0.0-alpha.2", | ||
"@jest/test-utils": "30.0.0-alpha.3", | ||
"@types/node": "*" | ||
@@ -39,3 +39,3 @@ }, | ||
}, | ||
"gitHead": "c04d13d7abd22e47b0997f6027886aed225c9ce4" | ||
"gitHead": "e267aff33d105399f2134bad7c8f82285104f3da" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30748
+ Added@jest/schemas@30.0.0-alpha.3(transitive)
+ Added@sinclair/typebox@0.32.35(transitive)
+ Addeddiff-sequences@30.0.0-alpha.3(transitive)
+ Addedjest-diff@30.0.0-alpha.3(transitive)
+ Addedjest-get-type@30.0.0-alpha.3(transitive)
+ Addedpretty-format@30.0.0-alpha.3(transitive)
- Removed@jest/schemas@30.0.0-alpha.2(transitive)
- Removed@sinclair/typebox@0.31.28(transitive)
- Removeddiff-sequences@30.0.0-alpha.2(transitive)
- Removedjest-diff@30.0.0-alpha.2(transitive)
- Removedjest-get-type@30.0.0-alpha.2(transitive)
- Removedpretty-format@30.0.0-alpha.2(transitive)
Updatedjest-diff@30.0.0-alpha.3
Updatedjest-get-type@30.0.0-alpha.3
Updatedpretty-format@30.0.0-alpha.3