limit-once
Advanced tools
Comparing version 0.14.0 to 0.15.0
{ | ||
"name": "limit-once", | ||
"version": "0.14.0", | ||
"description": "Remember the first result of a function call", | ||
"version": "0.15.0", | ||
"author": "Alex Reardon <alexreardon@gmail.com>", | ||
"license": "MIT", | ||
"private": false, | ||
"repository": { | ||
@@ -9,12 +12,12 @@ "type": "git", | ||
}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.15.3", | ||
"@types/bun": "latest", | ||
"expect-type": "^0.19.0", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.7", | ||
"tiny-invariant": "^1.3.3", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"keywords": [ | ||
"once", | ||
"cache", | ||
"limit", | ||
"performance", | ||
"memoize", | ||
"memoization" | ||
], | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "./dist/index.cjs", | ||
@@ -29,5 +32,4 @@ "exports": { | ||
}, | ||
"description": "Remember the first result of a function call", | ||
"engines": { | ||
"bun": ">=1.1.10" | ||
"node": ">=18" | ||
}, | ||
@@ -38,11 +40,2 @@ "files": [ | ||
], | ||
"keywords": [ | ||
"memoize", | ||
"memoization", | ||
"once", | ||
"cache", | ||
"performance" | ||
], | ||
"license": "MIT", | ||
"private": false, | ||
"scripts": { | ||
@@ -57,4 +50,12 @@ "prepublishOnly": "bun build:dist", | ||
}, | ||
"sideEffects": false, | ||
"type": "module" | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.15.3", | ||
"@types/bun": "latest", | ||
"expect-type": "^0.19.0", | ||
"prettier": "^3.2.5", | ||
"rimraf": "^5.0.7", | ||
"tiny-invariant": "^1.3.3", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.5" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # limit-once | ||
Cache the first successful result of a function call. | ||
Cache the first successful result of a `function` call. | ||
@@ -35,3 +35,3 @@ > [!NOTE] | ||
Create a new `function` that wraps an existing `function`, where the wrapped function is only called once. | ||
Create a new `function` that only allows an existing `function` to be called once. | ||
@@ -94,3 +94,3 @@ ```ts | ||
You can clear the cache of a onced function by using the `.clear()` function property. | ||
You can clear the cache of a onced `function` by using the `.clear()` `function` property. | ||
@@ -124,3 +124,3 @@ ```ts | ||
Our async variant allows you to have a `once` functionality for functions that `Promise`. | ||
Allows you to have a `once` functionality for a `function` that returns a `Promise`. | ||
@@ -149,3 +149,3 @@ ```ts | ||
If the wrapped function has it's `Promise` `"rejected"`, then the `"rejected"` `Promise` will not be cached, and the underlying function can be called again. | ||
If the wrapped `function` has it's `Promise` `"rejected"`, then the `"rejected"` `Promise` will not be cached, and the underlying `function` can be called again. | ||
@@ -179,5 +179,5 @@ ```ts | ||
If multiple calls are made to a `onceAsync(fn)` function while the original `Promise` is still `"pending"`, then the original `Promise` is re-used. | ||
If multiple calls are made to a `onceAsync(fn)` `function` while the original `Promise` is still `"pending"`, then the original `Promise` is re-used. | ||
✨ This prevents multiple calls to the underlying function ✨ | ||
✨ This prevents multiple calls to the underlying `function` ✨ | ||
@@ -207,3 +207,3 @@ ```ts | ||
You can clear the cache of a `onceAsync` function by using the `.clear()` function property. | ||
You can clear the cache of a `onceAsync` `function` by using the `.clear()` `function` property. | ||
@@ -210,0 +210,0 @@ ```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
22607