Socket
Socket
Sign inDemoInstall

@vitest/utils

Package Overview
Dependencies
Maintainers
3
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitest/utils - npm Package Compare versions

Comparing version 0.31.1 to 0.31.2

2

dist/diff.js

@@ -106,2 +106,4 @@ import { b as getColors } from './chunk-colors.js';

});
if (counts["+"] === 0 && counts["-"] === 0)
return "";
let legend = "";

@@ -108,0 +110,0 @@ if (showLegend) {

7

dist/helpers.d.ts
import { Nullable, Arrayable } from './types.js';
interface CloneOptions {
forceWritable?: boolean;
}
declare function notNullish<T>(v: T | null | undefined): v is NonNullable<T>;

@@ -12,4 +15,4 @@ declare function assertTypes(value: unknown, name: string, types: string[]): void;

declare function getOwnProperties(obj: any): (string | symbol)[];
declare function deepClone<T>(val: T): T;
declare function clone<T>(val: T, seen: WeakMap<any, any>): T;
declare function deepClone<T>(val: T, options?: CloneOptions): T;
declare function clone<T>(val: T, seen: WeakMap<any, any>, options?: CloneOptions): T;
declare function noop(): void;

@@ -16,0 +19,0 @@ declare function objectAttr(source: any, path: string, defaultValue?: undefined): any;

@@ -52,7 +52,8 @@ function notNullish(v) {

}
function deepClone(val) {
const defaultCloneOptions = { forceWritable: false };
function deepClone(val, options = defaultCloneOptions) {
const seen = /* @__PURE__ */ new WeakMap();
return clone(val, seen);
return clone(val, seen, options);
}
function clone(val, seen) {
function clone(val, seen, options = defaultCloneOptions) {
let k, out;

@@ -87,2 +88,3 @@ if (seen.has(val))

...descriptor,
writable: options.forceWritable ? true : descriptor.writable,
value: cloned

@@ -89,0 +91,0 @@ });

{
"name": "@vitest/utils",
"type": "module",
"version": "0.31.1",
"version": "0.31.2",
"description": "Shared Vitest utility functions",

@@ -6,0 +6,0 @@ "license": "MIT",

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