Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expect

Package Overview
Dependencies
Maintainers
5
Versions
237
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect - npm Package Compare versions

Comparing version 27.3.1 to 27.4.0

2

build/index.d.ts

@@ -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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc