use-deep-compare
Advanced tools
Comparing version 0.1.0 to 1.0.0
@@ -92,1 +92,2 @@ 'use strict'; | ||
exports.useDeepCompareMemo = useDeepCompareMemo; | ||
//# sourceMappingURL=index.js.map |
import React from 'react'; | ||
export declare function isPrimitive(val: any): boolean; | ||
export declare function checkDeps(deps: React.DependencyList, name: string): void; | ||
export declare function useDeepCompareMemoize(value: React.DependencyList): readonly any[]; | ||
export declare function useDeepCompareMemoize(value: React.DependencyList): React.DependencyList; |
@@ -8,10 +8,10 @@ import React from 'react'; | ||
function checkDeps(deps, name) { | ||
const reactHookName = "React.".concat(name.replace(/DeepCompare/, '')); | ||
const reactHookName = `React.${name.replace(/DeepCompare/, '')}`; | ||
if (!deps || deps.length === 0) { | ||
throw new Error("".concat(name, " should not be used with no dependencies. Use ").concat(reactHookName, " instead.")); | ||
throw new Error(`${name} should not be used with no dependencies. Use ${reactHookName} instead.`); | ||
} | ||
if (deps.every(isPrimitive)) { | ||
throw new Error("".concat(name, " should not be used with dependencies that are all primitive values. Use ").concat(reactHookName, " instead.")); | ||
throw new Error(`${name} should not be used with dependencies that are all primitive values. Use ${reactHookName} instead.`); | ||
} | ||
@@ -85,1 +85,2 @@ } | ||
export { useDeepCompareCallback, useDeepCompareEffect, useDeepCompareMemo }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "use-deep-compare", | ||
"version": "0.1.0", | ||
"description": "React hooks, except using deep comparison on the inputs, not reference equality", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"esnext": "dist-src/index.js", | ||
"main": "dist-node/index.js", | ||
"module": "dist-web/index.js", | ||
"types": "dist-types/index.d.ts", | ||
"pika": true, | ||
"sideEffects": false, | ||
"files": [ | ||
"dist-*/", | ||
"assets/", | ||
"bin/" | ||
], | ||
"pika": true, | ||
"sideEffects": false, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sandiiarov/use-deep-compare.git" | ||
}, | ||
"dependencies": { | ||
@@ -23,14 +23,18 @@ "dequal": "1.0.0" | ||
"devDependencies": { | ||
"@babel/preset-react": "7.0.0", | ||
"@babel/preset-typescript": "7.3.3", | ||
"@pika/pack": "0.3.6", | ||
"@pika/plugin-build-node": "0.3.14", | ||
"@pika/plugin-build-types": "0.3.14", | ||
"@pika/plugin-build-web": "0.3.14", | ||
"@pika/plugin-standard-pkg": "0.3.14", | ||
"@types/react": "16.8.10", | ||
"react": "16.8.6", | ||
"react-dom": "16.8.6", | ||
"typescript": "3.4.1" | ||
} | ||
"@babel/preset-react": "7.10.1", | ||
"@babel/preset-typescript": "7.10.1", | ||
"@pika/pack": "0.5.0", | ||
"@pika/plugin-build-node": "0.9.2", | ||
"@pika/plugin-build-types": "0.9.2", | ||
"@pika/plugin-build-web": "0.9.2", | ||
"@pika/plugin-standard-pkg": "0.9.2", | ||
"@types/react": "16.9.35", | ||
"react": "16.13.1", | ||
"react-dom": "16.13.1", | ||
"typescript": "3.9.3" | ||
}, | ||
"esnext": "dist-src/index.js", | ||
"main": "dist-node/index.js", | ||
"module": "dist-web/index.js", | ||
"types": "dist-types/index.d.ts" | ||
} |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
23492
17
261
1
0
79
9