tree-changes
Advanced tools
Comparing version
import { Data, TreeChanges } from './types'; | ||
export default function treeChanges(data: Data, nextData: Data): TreeChanges; | ||
export declare const useTreeChanges: (value: any) => TreeChanges; |
import * as equal from 'fast-deep-equal'; | ||
import { compareNumbers, getIterables, isArray, isDefined, isPlainObj, nested } from './helpers'; | ||
import createTreeChangesHook from './hook'; | ||
export default function treeChanges(data, nextData) { | ||
@@ -108,2 +109,3 @@ if (!data || !nextData) { | ||
} | ||
export var useTreeChanges = createTreeChangesHook(treeChanges); | ||
//# sourceMappingURL=index.js.map |
@@ -15,2 +15,3 @@ export declare type AcceptedTypes = string | boolean | number | GenericObject; | ||
} | ||
export declare type TreeChangesFn = (previousData: Data, data: Data) => TreeChanges; | ||
export interface TreeChanges { | ||
@@ -17,0 +18,0 @@ added: (key?: Key, compare?: any) => boolean; |
import { Data, TreeChanges } from './types'; | ||
export default function treeChanges(data: Data, nextData: Data): TreeChanges; | ||
export declare const useTreeChanges: (value: any) => TreeChanges; |
@@ -5,2 +5,3 @@ "use strict"; | ||
var helpers_1 = require("./helpers"); | ||
var hook_1 = require("./hook"); | ||
function treeChanges(data, nextData) { | ||
@@ -112,2 +113,3 @@ if (!data || !nextData) { | ||
exports.default = treeChanges; | ||
exports.useTreeChanges = hook_1.default(treeChanges); | ||
//# sourceMappingURL=index.js.map |
@@ -15,2 +15,3 @@ export declare type AcceptedTypes = string | boolean | number | GenericObject; | ||
} | ||
export declare type TreeChangesFn = (previousData: Data, data: Data) => TreeChanges; | ||
export interface TreeChanges { | ||
@@ -17,0 +18,0 @@ added: (key?: Key, compare?: any) => boolean; |
{ | ||
"name": "tree-changes", | ||
"version": "0.6.0-0", | ||
"version": "0.6.0-1", | ||
"description": "Get changes between two versions of data with similar shape", | ||
@@ -27,2 +27,5 @@ "author": "Gil Barbara <gilbarbara@gmail.com>", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"react": "^16.8.0" | ||
}, | ||
"dependencies": { | ||
@@ -34,21 +37,27 @@ "deep-diff": "^1.0.2", | ||
"@gilbarbara/tsconfig": "^0.1.0", | ||
"@size-limit/preset-small-lib": "^2.2.4", | ||
"@size-limit/preset-small-lib": "^4.3.1", | ||
"@testing-library/jest-dom": "^5.1.1", | ||
"@testing-library/react": "^9.5.0", | ||
"@types/deep-diff": "^1.0.0", | ||
"@types/jest": "^24.0.25", | ||
"@types/node": "^13.1.4", | ||
"@typescript-eslint/eslint-plugin": "^2.14.0", | ||
"@typescript-eslint/parser": "^2.14.0", | ||
"@types/jest": "^25.1.4", | ||
"@types/node": "^13.9.0", | ||
"@types/react": "^16.9.23", | ||
"@typescript-eslint/eslint-plugin": "^2.22.0", | ||
"@typescript-eslint/parser": "^2.22.0", | ||
"eslint": "^6.8.0", | ||
"eslint-config-airbnb-base": "^14.0.0", | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-config-prettier": "^6.10.0", | ||
"eslint-plugin-import": "^2.20.1", | ||
"eslint-plugin-jsx-a11y": "^6.2.3", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"husky": "^3.1.0", | ||
"jest": "^24.9.0", | ||
"husky": "^4.2.3", | ||
"jest": "^25.1.0", | ||
"prettier": "^1.19.1", | ||
"react": "^16.13.0", | ||
"react-dom": "^16.13.0", | ||
"repo-tools": "^0.2.0", | ||
"rimraf": "^3.0.0", | ||
"ts-jest": "^24.2.0", | ||
"typescript": "^3.7.4" | ||
"rimraf": "^3.0.2", | ||
"size-limit": "^4.3.1", | ||
"ts-jest": "^25.2.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -66,4 +75,4 @@ "scripts": { | ||
"format": "prettier \"**/*.{js,jsx,json,yml,yaml,css,less,scss,ts,tsx,md,graphql,mdx}\" --write", | ||
"validate": "npm run lint && npm run test:coverage && npm run size", | ||
"size": "npm run build && size-limit", | ||
"validate": "npm run lint && npm run test:coverage && npm run build && npm run size", | ||
"size": "size-limit", | ||
"prepublishOnly": "npm run validate" | ||
@@ -70,0 +79,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
46940
10.91%27
28.57%533
12.68%0
-100%3
50%26
30%