@chakra-ui/utils
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Change Log | ||
All notable changes to this project will be documented in this file. | ||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
## 1.0.1 | ||
# 1.0.0 (2020-11-13) | ||
### Patch Changes | ||
**Note:** Version bump only for package @chakra-ui/utils | ||
- [`5c482483`](https://github.com/chakra-ui/chakra-ui/commit/5c482483ce24fc798540c9792a15e06772eae213) | ||
[#2562](https://github.com/chakra-ui/chakra-ui/pull/2562) Thanks | ||
[@LaurenceGGush](https://github.com/LaurenceGGush)! - Fix memory leak in | ||
`utils/objects.ts` | ||
All notable changes to this project will be documented in this file. See | ||
[Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
# 1.0.0 (2020-11-13) | ||
**Note:** Version bump only for package @chakra-ui/utils | ||
# Change Log | ||
@@ -15,0 +20,0 @@ |
@@ -10,3 +10,3 @@ "use strict"; | ||
exports.objectFilter = objectFilter; | ||
exports.fromEntries = exports.objectKeys = exports.filterUndefined = exports.memoizedGet = exports.objectAssign = exports.mergeWith = void 0; | ||
exports.fromEntries = exports.objectKeys = exports.filterUndefined = exports.memoizedGet = exports.memoize = exports.objectAssign = exports.mergeWith = void 0; | ||
@@ -86,10 +86,9 @@ var _lodash = _interopRequireDefault(require("lodash.mergewith")); | ||
var map = cache.get(obj); | ||
var key = typeof path === "string" ? path.split(".") : [path]; | ||
if (map.has(key)) { | ||
return map.get(key); | ||
if (map.has(path)) { | ||
return map.get(path); | ||
} | ||
var value = fn(obj, path, fallback, index); | ||
map.set(key, value); | ||
map.set(path, value); | ||
return value; | ||
@@ -101,2 +100,3 @@ }; | ||
exports.memoize = memoize; | ||
var memoizedGet = memoize(get); | ||
@@ -103,0 +103,0 @@ /** |
@@ -53,4 +53,3 @@ export { default as mergeWith } from "lodash.mergewith"; | ||
} | ||
var memoize = fn => { | ||
export var memoize = fn => { | ||
var cache = new WeakMap(); | ||
@@ -64,10 +63,9 @@ | ||
var map = cache.get(obj); | ||
var key = typeof path === "string" ? path.split(".") : [path]; | ||
if (map.has(key)) { | ||
return map.get(key); | ||
if (map.has(path)) { | ||
return map.get(path); | ||
} | ||
var value = fn(obj, path, fallback, index); | ||
map.set(key, value); | ||
map.set(path, value); | ||
return value; | ||
@@ -78,3 +76,2 @@ }; | ||
}; | ||
export var memoizedGet = memoize(get); | ||
@@ -81,0 +78,0 @@ /** |
@@ -16,2 +16,3 @@ import type { Dict } from "./types"; | ||
declare type Handler = (obj: Readonly<object>, path: string | number, fallback?: any, index?: number) => any; | ||
export declare const memoize: (fn: Handler) => Handler; | ||
export declare const memoizedGet: Handler; | ||
@@ -18,0 +19,0 @@ /** |
{ | ||
"name": "@chakra-ui/utils", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Common utilties and types for Chakra UI", | ||
@@ -55,3 +55,5 @@ "author": "Segun Adebayo <sage@adebayosegun.com>", | ||
}, | ||
"gitHead": "c98ca366cec7151fe7ea4e0b6f893088797c5398" | ||
"devDependencies": { | ||
"react": "^17.0.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
199700
1
63