-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cac98b
commit d31149d
Showing
33 changed files
with
1,367 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export declare function _versionUnsafe(part: string, defaultValue?: string): string; | ||
export declare function _version(part1: string): string; | ||
export declare function _versionSafe(part: string): string; | ||
export declare function _part(part1: string, part2: string): [string, string]; | ||
export declare function partsToVersion(parts: string[]): string; | ||
export declare function versionToParts(version: string): string[]; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
export type { Operator, Options } from 'semver'; | ||
/// <reference types="node" /> | ||
import { Operator, Options } from 'semver'; | ||
export type { Operator, Options } from 'semver'; | ||
export declare type IOptionsOrLoose = boolean | Options; | ||
export declare type ICompareReturnType = 1 | 0 | -1; | ||
export declare function compare(part1: string, part2: string, optionsOrLoose?: boolean | Options): 0 | 1 | -1; | ||
export declare function compare(part1: string, part2: string, optionsOrLoose?: boolean | Options): import("readline").Direction; | ||
export declare function eq(part1: string, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function neq(part1: string, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function gt(part1: string, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function gte(part1: string, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function lt(part1: string, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function lte(part1: string, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function cmp(part1: string, operator: Operator, part2: string, optionsOrLoose?: boolean | Options): boolean; | ||
export declare function tryCompare(v1: string, v2: string, optionsOrLoose?: IOptionsOrLoose): import("readline").Direction; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/// <reference types="node" /> | ||
export declare type IParseVersionsFindIndex = 0 | 1 | 2; | ||
export declare function parseVersions(versionOld: string, versionNew: string): { | ||
versionOld: string; | ||
versionNew: string; | ||
partsOld: string[]; | ||
partsNew: string[]; | ||
index: IParseVersionsFindIndex; | ||
}; | ||
export declare function parseVersionsAndCompare(versionOld: string, versionNew: string): { | ||
comp: import("readline").Direction; | ||
versionOld: string; | ||
versionNew: string; | ||
partsOld: string[]; | ||
partsNew: string[]; | ||
index: IParseVersionsFindIndex; | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { versionToParts } from './_core'; | ||
import { tryCompare } from './compare'; | ||
|
||
export type IParseVersionsFindIndex = 0 | 1 | 2; | ||
|
||
export function parseVersions(versionOld: string, versionNew: string) | ||
{ | ||
const partsNew = versionToParts(versionNew); | ||
const partsOld = versionToParts(versionOld); | ||
|
||
let index: IParseVersionsFindIndex = partsNew.findIndex((part, i) => part !== partsOld[i]) as any; | ||
|
||
index = index >= 0 ? index : partsNew.length as any; | ||
|
||
return { | ||
versionOld, | ||
versionNew, | ||
|
||
partsOld, | ||
partsNew, | ||
|
||
index, | ||
} | ||
} | ||
|
||
export function parseVersionsAndCompare(versionOld: string, versionNew: string) | ||
{ | ||
const data = parseVersions(versionOld, versionNew) | ||
|
||
let comp = tryCompare(data.partsNew[data.index], data.partsOld[data.index]); | ||
|
||
return { | ||
...data, | ||
comp, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
.idea | ||
node_modules | ||
~ci.list.txt | ||
~ci.log.txt | ||
~ci.errors.txt | ||
*.stackdump | ||
*.bak | ||
*.old | ||
package-lock.json | ||
test/**/*.js | ||
test/**/*.d.ts | ||
test/*.js | ||
test/*.d.ts | ||
test/temp* | ||
test/**/*.map | ||
tests/**/*.js | ||
tests/**/*.d.ts | ||
tests/*.js | ||
tests/*.d.ts | ||
tests/temp* | ||
tests/**/*.map | ||
bin/*.d.ts | ||
bin/**/*.d.ts | ||
/packages/*/bin/*.d.ts | ||
/packages/*/test/**/*.js | ||
/packages/*/test/**/*.d.ts | ||
/packages/*/test/*.js | ||
/packages/*/test/*.d.ts | ||
/packages/*/test/temp* | ||
/packages/*/tests/**/*.js | ||
/packages/*/tests/**/*.d.ts | ||
/packages/*/tests/*.js | ||
/packages/*/tests/*.d.ts | ||
/packages/*/tests/temp* | ||
**/node_modules | ||
*.tgz | ||
/tsconfig.json.tpl | ||
/.eslintrc.json.tpl | ||
!tsconfig.json | ||
!.eslintrc.json | ||
yarn-error.log | ||
*.log | ||
.git | ||
yarn.lock | ||
.env.local | ||
.env.*.local | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
*.vue.js | ||
*.vue.d.ts | ||
*.vue.js.map | ||
vue.config.d.ts | ||
vue.config.js.map | ||
.nyc_output | ||
coverage | ||
/*.tpl | ||
!.forestry | ||
!.vuepress | ||
!.github | ||
!.gitee | ||
!.gitlab | ||
.git | ||
|
||
*.tsbuildinfo | ||
tsconfig.esm.json.tpl | ||
|
||
.browserslistrc | ||
.nvmrc | ||
|
||
/.eslintignore | ||
/package.d.ts | ||
.nycrc | ||
.mocharc.yml | ||
#jest.config.js | ||
node_modules/.cache | ||
.yarn-integrity | ||
jest.config.d.ts | ||
jest.config.js.map | ||
/report.*.json | ||
*.js.map | ||
/now.json | ||
.nyc_output | ||
.coverage-cache | ||
.reify-cache | ||
*.spec.d.ts | ||
*.spec.js | ||
.nowignore | ||
*/**/.github | ||
!/.github | ||
!npm-shrinkwrap.json |
Oops, something went wrong.