@trezor/utils
Advanced tools
Comparing version 9.0.2 to 9.0.3
@@ -1,4 +0,4 @@ | ||
export declare const arrayToDictionary: <T>(array: T[], getKey: (item: T) => string) => { | ||
export declare const arrayToDictionary: <T>(array: T[], getKey: (item: T) => string | number) => { | ||
[key: string]: T; | ||
}; | ||
//# sourceMappingURL=arrayToDictionary.d.ts.map |
export declare const createDeferred: <T, P = string | number | undefined>(id?: P | undefined) => { | ||
id: P | undefined; | ||
resolve: (t: T) => void; | ||
reject: (e?: Error | undefined) => void; | ||
reject: (e?: Error) => void; | ||
promise: Promise<T>; | ||
@@ -6,0 +6,0 @@ }; |
@@ -5,2 +5,3 @@ export * from './createDeferred'; | ||
export * from './arrayToDictionary'; | ||
export * as bufferUtils from './bufferUtils'; | ||
export * from './bytesToHumanReadable'; | ||
@@ -25,2 +26,5 @@ export * from './mergeObject'; | ||
export * from './createTimeoutPromise'; | ||
export * from './scheduleAction'; | ||
export * from './redactUserPath'; | ||
export * as xssFilters from './xssFilters'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -25,3 +29,3 @@ if (k2 === undefined) k2 = k; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.versionUtils = void 0; | ||
exports.xssFilters = exports.versionUtils = exports.bufferUtils = void 0; | ||
__exportStar(require("./createDeferred"), exports); | ||
@@ -31,2 +35,3 @@ __exportStar(require("./arrayDistinct"), exports); | ||
__exportStar(require("./arrayToDictionary"), exports); | ||
exports.bufferUtils = __importStar(require("./bufferUtils")); | ||
__exportStar(require("./bytesToHumanReadable"), exports); | ||
@@ -51,2 +56,5 @@ __exportStar(require("./mergeObject"), exports); | ||
__exportStar(require("./createTimeoutPromise"), exports); | ||
__exportStar(require("./scheduleAction"), exports); | ||
__exportStar(require("./redactUserPath"), exports); | ||
exports.xssFilters = __importStar(require("./xssFilters")); | ||
//# sourceMappingURL=index.js.map |
@@ -7,3 +7,4 @@ declare type VersionArray = [number, number, number]; | ||
export declare const isNewerOrEqual: (versionX: VersionInput, versionY: VersionInput) => boolean; | ||
export declare const normalizeVersion: (version: string) => string; | ||
export {}; | ||
//# sourceMappingURL=versionUtils.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isNewerOrEqual = exports.isEqual = exports.isNewer = exports.isVersionArray = void 0; | ||
exports.normalizeVersion = exports.isNewerOrEqual = exports.isEqual = exports.isNewer = exports.isVersionArray = void 0; | ||
const parse = (versionArr) => ({ | ||
@@ -16,3 +16,3 @@ major: versionArr[0], | ||
}; | ||
const toString = (arr) => `${arr[0]}.${arr[1]}.${arr[2]}`; | ||
const versionToString = (arr) => `${arr[0]}.${arr[1]}.${arr[2]}`; | ||
const isVersionArray = (arr) => arr.length === 3; | ||
@@ -36,4 +36,4 @@ exports.isVersionArray = isVersionArray; | ||
const isEqual = (versionX, versionY) => { | ||
const strX = typeof versionX === 'string' ? versionX : toString(versionX); | ||
const strY = typeof versionY === 'string' ? versionY : toString(versionY); | ||
const strX = typeof versionX === 'string' ? versionX : versionToString(versionX); | ||
const strY = typeof versionY === 'string' ? versionY : versionToString(versionY); | ||
return strX === strY; | ||
@@ -44,2 +44,4 @@ }; | ||
exports.isNewerOrEqual = isNewerOrEqual; | ||
const normalizeVersion = (version) => version.replace(/\b0+(\d)/g, '$1'); | ||
exports.normalizeVersion = normalizeVersion; | ||
//# sourceMappingURL=versionUtils.js.map |
{ | ||
"name": "@trezor/utils", | ||
"version": "9.0.2", | ||
"version": "9.0.3", | ||
"author": "Trezor <info@trezor.io>", | ||
@@ -22,7 +22,12 @@ "homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/utils", | ||
"scripts": { | ||
"lint": "eslint '**/*.{ts,tsx,js}'", | ||
"test:unit": "jest --verbose -c jest.config.js", | ||
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'", | ||
"test:unit": "jest --verbose -c ../../jest.config.base.js", | ||
"type-check": "tsc --build tsconfig.json", | ||
"build:lib": "rimraf ./lib && tsc --build tsconfig.lib.json" | ||
"build:lib": "rimraf ./lib && yarn tsc --build tsconfig.lib.json" | ||
}, | ||
"devDependencies": { | ||
"jest": "^26.6.3", | ||
"rimraf": "^3.0.2", | ||
"typescript": "4.7.4" | ||
} | ||
} |
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
28372
59
504
3