arylo-init
Advanced tools
Comparing version 2.1.9 to 2.1.10
@@ -8,3 +8,4 @@ "use strict"; | ||
}; | ||
exports.hisVersions = fs.readdirSync(__dirname) | ||
exports.hisVersions = fs | ||
.readdirSync(__dirname) | ||
.filter((name) => /\d+\.\d+\.\d+\.[jt]s$/.test(name)) | ||
@@ -17,7 +18,18 @@ .map((name) => name.replace(/\.[jt]s$/, "")); | ||
const curVersion = parseVersion(ver); | ||
return exports.hisVersions.reduce((arr, v) => { | ||
return exports.hisVersions | ||
.reduce((arr, v) => { | ||
arr.push(parseVersion(v)); | ||
return arr; | ||
}, []).filter((v) => { | ||
}, []) | ||
.sort((a, b) => { | ||
for (const level of ["major", "minor", "patch"]) { | ||
if (a[level] === b[level]) { | ||
continue; | ||
} | ||
return a[level] - b[level]; | ||
} | ||
return 0; | ||
}) | ||
.filter((v) => { | ||
for (const level of ["major", "minor", "patch"]) { | ||
if (v[level] > curVersion[level]) { | ||
@@ -31,3 +43,4 @@ return true; | ||
return false; | ||
}).map((v) => `${v.major}.${v.minor}.${v.patch}`); | ||
}) | ||
.map((v) => `${v.major}.${v.minor}.${v.patch}`); | ||
}; | ||
@@ -34,0 +47,0 @@ const parseVersion = (ver) => { |
@@ -21,3 +21,4 @@ import * as fs from "fs"; | ||
export const hisVersions = fs.readdirSync(__dirname) | ||
export const hisVersions = fs | ||
.readdirSync(__dirname) | ||
.filter((name) => /\d+\.\d+\.\d+\.[jt]s$/.test(name)) | ||
@@ -28,19 +29,34 @@ .map((name) => name.replace(/\.[jt]s$/, "")); | ||
if (ver === constants.version) { | ||
return [ ]; | ||
return []; | ||
} | ||
const curVersion = parseVersion(ver); | ||
return hisVersions.reduce((arr, v) => { | ||
arr.push(parseVersion(v)); | ||
return arr; | ||
}, [ ] as IVersion[]).filter((v) => { | ||
for (const level of ["major", "minor", "patch"]) { | ||
if (v[level] > curVersion[level]) { | ||
return true; | ||
return hisVersions | ||
.reduce( | ||
(arr, v) => { | ||
arr.push(parseVersion(v)); | ||
return arr; | ||
}, | ||
[] as IVersion[] | ||
) | ||
.sort((a, b) => { | ||
for (const level of ["major", "minor", "patch"]) { | ||
if (a[level] === b[level]) { | ||
continue; | ||
} | ||
return a[level] - b[level]; | ||
} | ||
if (v[level] < curVersion[level]) { | ||
return false; | ||
return 0; | ||
}) | ||
.filter((v) => { | ||
for (const level of ["major", "minor", "patch"]) { | ||
if (v[level] > curVersion[level]) { | ||
return true; | ||
} | ||
if (v[level] < curVersion[level]) { | ||
return false; | ||
} | ||
} | ||
} | ||
return false; | ||
}).map((v) => `${v.major}.${v.minor}.${v.patch}`); | ||
return false; | ||
}) | ||
.map((v) => `${v.major}.${v.minor}.${v.patch}`); | ||
}; | ||
@@ -47,0 +63,0 @@ |
{ | ||
"name": "arylo-init", | ||
"version": "2.1.9", | ||
"version": "2.1.10", | ||
"description": "Initial Node.js Project for Arylo Edition", | ||
@@ -51,4 +51,7 @@ "main": "./dist/index.js", | ||
"devDependencies": { | ||
"@commitlint/cli": "^7.2.1", | ||
"@commitlint/config-conventional": "^7.1.2", | ||
"@commitlint/lint": "^7.2.1", | ||
"@types/chalk": "^2.2.0", | ||
"@types/glob": "^5.0.35", | ||
"@types/glob": "^7.1.1", | ||
"@types/make-dir": "^1.0.3", | ||
@@ -68,3 +71,3 @@ "@types/node": "^10.1.2", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"glob": "^7.1.2", | ||
"glob": "^7.1.3", | ||
"husky": "^1.1.2", | ||
@@ -71,0 +74,0 @@ "lint-staged": "^7.3.0", |
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
65947
67
1575
29