Comparing version 27.3.1 to 27.4.0
@@ -12,5 +12,5 @@ /** | ||
type MatcherState = JestMatcherState; | ||
interface Matchers<R, T> extends MatcherInterface<R, T> { | ||
interface Matchers<R, T = unknown> extends MatcherInterface<R, T> { | ||
} | ||
} | ||
export = expectExport; |
@@ -963,3 +963,3 @@ 'use strict'; | ||
typeof expectedPath === 'string' | ||
? expectedPath.split('.').length | ||
? (0, _utils.pathAsArray)(expectedPath).length | ||
: expectedPath.length; | ||
@@ -966,0 +966,0 @@ |
@@ -22,2 +22,3 @@ /** | ||
export declare const partition: <T>(items: T[], predicate: (arg: T) => boolean) => [T[], T[]]; | ||
export declare const pathAsArray: (propertyPath: string) => Array<any>; | ||
export declare const isError: (value: unknown) => value is Error; | ||
@@ -24,0 +25,0 @@ export declare function emptyObject(obj: unknown): boolean; |
@@ -9,2 +9,3 @@ 'use strict'; | ||
exports.isError = | ||
exports.pathAsArray = | ||
exports.partition = | ||
@@ -59,3 +60,3 @@ exports.sparseArrayEquality = | ||
if (!Array.isArray(propertyPath)) { | ||
propertyPath = propertyPath.split('.'); | ||
propertyPath = pathAsArray(propertyPath); | ||
} | ||
@@ -407,6 +408,24 @@ | ||
return result; | ||
}; // Copied from https://github.com/graingert/angular.js/blob/a43574052e9775cbc1d7dd8a086752c979b0f020/src/Angular.js#L685-L693 | ||
}; | ||
exports.partition = partition; | ||
const pathAsArray = propertyPath => { | ||
// will match everything that's not a dot or a bracket, and "" for consecutive dots. | ||
const pattern = RegExp('[^.[\\]]+|(?=(?:\\.)(?:\\.|$))', 'g'); | ||
const properties = []; // Because the regex won't match a dot in the beginning of the path, if present. | ||
if (propertyPath[0] === '.') { | ||
properties.push(''); | ||
} | ||
propertyPath.replace(pattern, match => { | ||
properties.push(match); | ||
return match; | ||
}); | ||
return properties; | ||
}; // Copied from https://github.com/graingert/angular.js/blob/a43574052e9775cbc1d7dd8a086752c979b0f020/src/Angular.js#L685-L693 | ||
exports.pathAsArray = pathAsArray; | ||
const isError = value => { | ||
@@ -413,0 +432,0 @@ switch (Object.prototype.toString.call(value)) { |
{ | ||
"name": "expect", | ||
"version": "27.3.1", | ||
"version": "27.4.0", | ||
"repository": { | ||
@@ -13,3 +13,6 @@ "type": "git", | ||
"exports": { | ||
".": "./build/index.js", | ||
".": { | ||
"types": "./build/index.d.ts", | ||
"default": "./build/index.js" | ||
}, | ||
"./package.json": "./package.json", | ||
@@ -20,11 +23,11 @@ "./build/utils": "./build/utils.js", | ||
"dependencies": { | ||
"@jest/types": "^27.2.5", | ||
"@jest/types": "^27.4.0", | ||
"ansi-styles": "^5.0.0", | ||
"jest-get-type": "^27.3.1", | ||
"jest-matcher-utils": "^27.3.1", | ||
"jest-message-util": "^27.3.1", | ||
"jest-regex-util": "^27.0.6" | ||
"jest-get-type": "^27.4.0", | ||
"jest-matcher-utils": "^27.4.0", | ||
"jest-message-util": "^27.4.0", | ||
"jest-regex-util": "^27.4.0" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "^27.3.1", | ||
"@jest/test-utils": "^27.4.0", | ||
"chalk": "^4.0.0", | ||
@@ -40,3 +43,3 @@ "fast-check": "^2.0.0", | ||
}, | ||
"gitHead": "4f3328f3227aa0668486f819b3353af5b6cc797b" | ||
"gitHead": "0dc6dde296550370ade2574d6665748fed37f9c9" | ||
} |
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
170047
5036
Updated@jest/types@^27.4.0
Updatedjest-get-type@^27.4.0
Updatedjest-matcher-utils@^27.4.0
Updatedjest-message-util@^27.4.0
Updatedjest-regex-util@^27.4.0