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

use-deep-compare

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-deep-compare - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

9

dist-node/index.js

@@ -10,7 +10,4 @@ 'use strict';

function isPrimitive(val) {
return val == null || /^[sbn]/.test(typeof val);
}
function checkDeps(deps, name) {
const reactHookName = `React.${name.replace(/DeepCompare/, '')}`;
const reactHookName = `React.${name.replace(/DeepCompare/, "")}`;

@@ -20,6 +17,2 @@ if (!deps || deps.length === 0) {

}
if (deps.every(isPrimitive)) {
throw new Error(`${name} should not be used with dependencies that are all primitive values. Use ${reactHookName} instead.`);
}
}

@@ -26,0 +19,0 @@ function useDeepCompareMemoize(value) {

13

dist-src/useDeepCompareMemoize.js

@@ -1,8 +0,5 @@

import deepEqual from 'dequal';
import React from 'react';
export function isPrimitive(val) {
return val == null || /^[sbn]/.test(typeof val);
}
import React from "react";
import deepEqual from "dequal";
export function checkDeps(deps, name) {
const reactHookName = `React.${name.replace(/DeepCompare/, '')}`;
const reactHookName = `React.${name.replace(/DeepCompare/, "")}`;

@@ -12,6 +9,2 @@ if (!deps || deps.length === 0) {

}
if (deps.every(isPrimitive)) {
throw new Error(`${name} should not be used with dependencies that are all primitive values. Use ${reactHookName} instead.`);
}
}

@@ -18,0 +11,0 @@ export function useDeepCompareMemoize(value) {

@@ -1,4 +0,3 @@

import React from 'react';
export declare function isPrimitive(val: any): boolean;
import React from "react";
export declare function checkDeps(deps: React.DependencyList, name: string): void;
export declare function useDeepCompareMemoize(value: React.DependencyList): React.DependencyList;
import React from 'react';
import deepEqual from 'dequal';
function isPrimitive(val) {
return val == null || /^[sbn]/.test(typeof val);
}
function checkDeps(deps, name) {
const reactHookName = `React.${name.replace(/DeepCompare/, '')}`;
const reactHookName = `React.${name.replace(/DeepCompare/, "")}`;

@@ -13,6 +10,2 @@ if (!deps || deps.length === 0) {

}
if (deps.every(isPrimitive)) {
throw new Error(`${name} should not be used with dependencies that are all primitive values. Use ${reactHookName} instead.`);
}
}

@@ -19,0 +12,0 @@ function useDeepCompareMemoize(value) {

{
"name": "use-deep-compare",
"description": "React hooks, except using deep comparison on the inputs, not reference equality",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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