@ledgerhq/live-network
Advanced tools
Comparing version 1.1.13 to 1.2.0-nightly.0
# @ledgerhq/live-network | ||
## 1.2.0-nightly.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 | ||
## 1.1.13 | ||
@@ -4,0 +10,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-nightly.0", | ||
"description": "Ledger Live network and cache utilities", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
81371
1155
2