@waiting/shared-core
Advanced tools
Comparing version 23.20.2 to 23.21.0
@@ -54,5 +54,5 @@ /** | ||
else { | ||
throw new Error('input is invalid'); | ||
throw new TypeError('input is invalid'); | ||
} | ||
} | ||
//# sourceMappingURL=date.js.map |
@@ -25,5 +25,5 @@ export function expandFFIParamArray(input) { | ||
else { | ||
throw new Error('invalid input'); | ||
throw new TypeError('invalid input'); | ||
} | ||
} | ||
//# sourceMappingURL=ffi.js.map |
import type { NpmPkgView } from '@waiting/shared-types'; | ||
export type { NpmPkgView }; | ||
export declare function getNpmPkgViewFromRegistry(pkgName: string, version?: string, registry?: string): Promise<NpmPkgView | undefined>; | ||
/** | ||
* Compare two versions, input format: '1.2.3' without prefix 'v' | ||
* @returns 0: equal, -1: v1 < v2, 1: v1 > v2 | ||
*/ | ||
export declare function compareVersions(version1: string, version2: string): number; | ||
//# sourceMappingURL=npm-pkg.d.ts.map |
@@ -29,2 +29,19 @@ import assert from 'node:assert'; | ||
} | ||
/** | ||
* Compare two versions, input format: '1.2.3' without prefix 'v' | ||
* @returns 0: equal, -1: v1 < v2, 1: v1 > v2 | ||
*/ | ||
export function compareVersions(version1, version2) { | ||
const v1Parts = version1.split('.').map(Number); | ||
const v2Parts = version2.split('.').map(Number); | ||
for (let i = 0; i < Math.max(v1Parts.length, v2Parts.length); i += 1) { | ||
if ((v1Parts[i] ?? 0) < (v2Parts[i] ?? 0)) { | ||
return -1; | ||
} | ||
if ((v1Parts[i] ?? 0) > (v2Parts[i] ?? 0)) { | ||
return 1; | ||
} | ||
} | ||
return 0; | ||
} | ||
//# sourceMappingURL=npm-pkg.js.map |
{ | ||
"name": "@waiting/shared-core", | ||
"author": "waiting", | ||
"version": "23.20.2", | ||
"version": "23.21.0", | ||
"description": "node core function re export with Promise or Observable", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"@types/minimist": "^1.2.5", | ||
"@waiting/shared-types": "^23.20.2", | ||
"@waiting/shared-types": "^23.21.0", | ||
"minimist": "^1.2.8", | ||
@@ -84,3 +84,3 @@ "semver": "^7.6.2", | ||
}, | ||
"gitHead": "bbef800075f7758e28d427c845ba4f6986d61fa0" | ||
"gitHead": "34e3a649e3ce27f8ceaa681e0a0a0da1c33fd606" | ||
} |
@@ -71,5 +71,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
else { | ||
throw new Error('input is invalid') | ||
throw new TypeError('input is invalid') | ||
} | ||
} | ||
@@ -33,5 +33,5 @@ | ||
else { | ||
throw new Error('invalid input') | ||
throw new TypeError('invalid input') | ||
} | ||
} | ||
@@ -45,1 +45,16 @@ import assert from 'node:assert' | ||
/** | ||
* Compare two versions, input format: '1.2.3' without prefix 'v' | ||
* @returns 0: equal, -1: v1 < v2, 1: v1 > v2 | ||
*/ | ||
export function compareVersions(version1: string, version2: string): number { | ||
const v1Parts = version1.split('.').map(Number) | ||
const v2Parts = version2.split('.').map(Number) | ||
for (let i = 0; i < Math.max(v1Parts.length, v2Parts.length); i += 1) { | ||
if ((v1Parts[i] ?? 0) < (v2Parts[i] ?? 0)) { return -1 } | ||
if ((v1Parts[i] ?? 0) > (v2Parts[i] ?? 0)) { return 1 } | ||
} | ||
return 0 | ||
} | ||
@@ -37,3 +37,3 @@ { | ||
"stripInternal": true, | ||
"target": "ES2022", | ||
"target": "ES2023", | ||
"tsBuildInfoFile": ".tsbuildinfo", | ||
@@ -40,0 +40,0 @@ "types" : ["mocha", "node"], |
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
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
168962
3380
+ Added@types/node@22.9.1(transitive)
- Removed@types/node@22.9.3(transitive)