@ledgerhq/live-network
Advanced tools
Comparing version 1.1.13 to 1.2.0-next.0
# @ledgerhq/live-network | ||
## 1.2.0-next.0 | ||
### Minor Changes | ||
- [#6172](https://github.com/LedgerHQ/ledger-live/pull/6172) [`7fb3eb2`](https://github.com/LedgerHQ/ledger-live/commit/7fb3eb266acdca143c94d2fce74329809ebfbb79) Thanks [@sprohaszka-ledger](https://github.com/sprohaszka-ledger)! - Remove API injection in coin-module | ||
### Patch Changes | ||
- Updated dependencies [[`4744c31`](https://github.com/LedgerHQ/ledger-live/commit/4744c3136021f1f47ad1617f2c84f47ac0647370), [`0dd1546`](https://github.com/LedgerHQ/ledger-live/commit/0dd15467070cbf7fcbb9d9055a4535f6a25b2ad0), [`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8)]: | ||
- @ledgerhq/live-env@2.0.0-next.0 | ||
- @ledgerhq/errors@6.16.3-next.0 | ||
## 1.1.13 | ||
@@ -4,0 +16,0 @@ |
import LRU from "lru-cache"; | ||
export type CacheOptions = LRU.Options<string, unknown>; | ||
export declare function seconds(num: number, max?: number): CacheOptions; | ||
export declare function minutes(num: number, max?: number): CacheOptions; | ||
export declare function hours(num: number, max?: number): CacheOptions; | ||
export type CacheRes<A extends Array<any>, T> = { | ||
@@ -3,0 +7,0 @@ (...args: A): Promise<T>; |
import LRU from "lru-cache"; | ||
export function seconds(num, max = 100) { | ||
return { | ||
max, | ||
ttl: num * 1000, | ||
}; | ||
} | ||
export function minutes(num, max = 100) { | ||
return seconds(num * 60, max); | ||
} | ||
export function hours(num, max = 100) { | ||
return minutes(num * 60, max); | ||
} | ||
/** | ||
@@ -3,0 +15,0 @@ * Creates an LRU cache function that wraps the given async function `f`. |
import LRU from "lru-cache"; | ||
export type CacheOptions = LRU.Options<string, unknown>; | ||
export declare function seconds(num: number, max?: number): CacheOptions; | ||
export declare function minutes(num: number, max?: number): CacheOptions; | ||
export declare function hours(num: number, max?: number): CacheOptions; | ||
export type CacheRes<A extends Array<any>, T> = { | ||
@@ -3,0 +7,0 @@ (...args: A): Promise<T>; |
@@ -6,4 +6,19 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.makeLRUCache = void 0; | ||
exports.makeLRUCache = exports.hours = exports.minutes = exports.seconds = void 0; | ||
const lru_cache_1 = __importDefault(require("lru-cache")); | ||
function seconds(num, max = 100) { | ||
return { | ||
max, | ||
ttl: num * 1000, | ||
}; | ||
} | ||
exports.seconds = seconds; | ||
function minutes(num, max = 100) { | ||
return seconds(num * 60, max); | ||
} | ||
exports.minutes = minutes; | ||
function hours(num, max = 100) { | ||
return minutes(num * 60, max); | ||
} | ||
exports.hours = hours; | ||
/** | ||
@@ -10,0 +25,0 @@ * Creates an LRU cache function that wraps the given async function `f`. |
{ | ||
"name": "@ledgerhq/live-network", | ||
"version": "1.1.13", | ||
"version": "1.2.0-next.0", | ||
"description": "Ledger Live network and cache utilities", | ||
@@ -55,4 +55,4 @@ "keywords": [ | ||
"lru-cache": "^7.14.1", | ||
"@ledgerhq/errors": "^6.16.2", | ||
"@ledgerhq/live-env": "^1.0.1", | ||
"@ledgerhq/errors": "^6.16.3-next.0", | ||
"@ledgerhq/live-env": "^2.0.0-next.0", | ||
"@ledgerhq/live-promise": "^0.0.3", | ||
@@ -59,0 +59,0 @@ "@ledgerhq/logs": "^6.12.0" |
import LRU from "lru-cache"; | ||
export type CacheOptions = LRU.Options<string, unknown>; //{ max: number; ttl: number }; | ||
export function seconds(num: number, max = 100): CacheOptions { | ||
return { | ||
max, | ||
ttl: num * 1000, | ||
}; | ||
} | ||
export function minutes(num: number, max = 100): CacheOptions { | ||
return seconds(num * 60, max); | ||
} | ||
export function hours(num: number, max = 100): CacheOptions { | ||
return minutes(num * 60, max); | ||
} | ||
export type CacheRes<A extends Array<any>, T> = { | ||
@@ -4,0 +18,0 @@ (...args: A): Promise<T>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
81801
1155
2
+ Added@ledgerhq/live-env@2.5.0(transitive)
- Removed@ledgerhq/live-env@1.0.1(transitive)