js-green-licenses
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -60,20 +60,30 @@ "use strict"; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
} | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var events_1 = require("events"); | ||
var fs = require("fs"); | ||
var npmPackageArg = require("npm-package-arg"); | ||
var path = require("path"); | ||
var pify = require("pify"); | ||
var fs = __importStar(require("fs")); | ||
var npm_package_arg_1 = __importDefault(require("npm-package-arg")); | ||
var package_json_1 = __importDefault(require("package-json")); | ||
var path = __importStar(require("path")); | ||
var pify_1 = __importDefault(require("pify")); | ||
var spdx_correct_1 = __importDefault(require("spdx-correct")); | ||
var spdx_satisfies_1 = __importDefault(require("spdx-satisfies")); | ||
var util_1 = require("util"); | ||
var config = require("./config"); | ||
var config = __importStar(require("./config")); | ||
var github_1 = require("./github"); | ||
var package_json_file_1 = require("./package-json-file"); | ||
var packageJson = require("package-json"); | ||
var spdxCorrect = require("spdx-correct"); | ||
var spdxSatisfies = require("spdx-satisfies"); | ||
var github_2 = require("./github"); | ||
exports.GitHubRepository = github_2.GitHubRepository; | ||
var fsAccess = pify(fs.access); | ||
var fsReadDir = pify(fs.readdir); | ||
var fsReadFile = pify(fs.readFile); | ||
var fsAccess = pify_1.default(fs.access); | ||
var fsReadDir = pify_1.default(fs.readdir); | ||
var fsReadFile = pify_1.default(fs.readFile); | ||
// Valid license IDs defined in https://spdx.org/licenses/ must be used whenever | ||
@@ -159,3 +169,3 @@ // possible. When adding new licenses, please consult the relevant documents. | ||
LicenseChecker.prototype.correctLicenseName = function (license) { | ||
var corrected = spdxCorrect(license); | ||
var corrected = spdx_correct_1.default(license); | ||
if (this.opts.verbose && corrected && corrected !== license) { | ||
@@ -179,3 +189,3 @@ console.warn("Correcting " + license + " to " + corrected); | ||
try { | ||
return spdxSatisfies(correctedName, this.greenLicenseExpr); | ||
return spdx_satisfies_1.default(correctedName, this.greenLicenseExpr); | ||
} | ||
@@ -206,3 +216,3 @@ catch (err) { | ||
_a.trys.push([1, 4, , 5]); | ||
return [4 /*yield*/, packageJson(packageName, { version: versionSpec, fullMetadata: true })]; | ||
return [4 /*yield*/, package_json_1.default(packageName, { version: versionSpec, fullMetadata: true })]; | ||
case 2: | ||
@@ -450,3 +460,3 @@ json = _a.sent(); | ||
_a.apply(this, [_b.sent()]); | ||
pkgArgs = npmPackageArg(pkg); | ||
pkgArgs = npm_package_arg_1.default(pkg); | ||
pkgType = pkgArgs.type; | ||
@@ -453,0 +463,0 @@ if (!['tag', 'version', 'range'].some(function (type) { return type === pkgType; })) { |
@@ -50,8 +50,18 @@ "use strict"; | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
} | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var fs = require("fs"); | ||
var path = require("path"); | ||
var pify = require("pify"); | ||
var stripJsonComments = require("strip-json-comments"); | ||
var fsReadFile = pify(fs.readFile); | ||
var fs = __importStar(require("fs")); | ||
var path = __importStar(require("path")); | ||
var pify_1 = __importDefault(require("pify")); | ||
var strip_json_comments_1 = __importDefault(require("strip-json-comments")); | ||
var fsReadFile = pify_1.default(fs.readFile); | ||
var CONFIG_FILE_NAME = 'js-green-licenses.json'; | ||
@@ -74,3 +84,3 @@ function isConfig(obj) { | ||
function parseJson(input) { | ||
return JSON.parse(stripJsonComments(input)); | ||
return JSON.parse(strip_json_comments_1.default(input)); | ||
} | ||
@@ -77,0 +87,0 @@ function getLocalConfig(directory) { |
@@ -50,6 +50,9 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// Abstractions over GitHub REST API v3 and related features. For GitHub API, | ||
// see https://developer.github.com/v3/. | ||
var axios_1 = require("axios"); | ||
var axios_1 = __importDefault(require("axios")); | ||
var path_1 = require("path"); | ||
@@ -56,0 +59,0 @@ var url_1 = require("url"); |
{ | ||
"name": "js-green-licenses", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "JavaScript package.json license checker", | ||
@@ -49,8 +49,8 @@ "main": "build/src/checker.js", | ||
"argparse": "^1.0.9", | ||
"axios": "^0.17.1", | ||
"axios": "^0.18.0", | ||
"npm-package-arg": "^6.0.0", | ||
"package-json": "^4.0.1", | ||
"pify": "^3.0.0", | ||
"spdx-correct": "^2.0.4", | ||
"spdx-satisfies": "^0.1.3", | ||
"spdx-correct": "^3.0.0", | ||
"spdx-satisfies": "^4.0.0", | ||
"strip-json-comments": "^2.0.1" | ||
@@ -70,3 +70,3 @@ }, | ||
"@types/strip-json-comments": "0.0.30", | ||
"ava": "^0.24.0", | ||
"ava": "^0.25.0", | ||
"codecov": "^3.0.0", | ||
@@ -77,5 +77,5 @@ "gts": "^0.5.3", | ||
"nyc": "^11.4.1", | ||
"proxyquire": "^1.8.0", | ||
"typescript": "~2.6.2" | ||
"proxyquire": "^2.0.0", | ||
"typescript": "~2.7.1" | ||
} | ||
} |
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
106296
1238
+ Addedarray-find-index@1.0.2(transitive)
+ Addedaxios@0.18.1(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
+ Addedis-buffer@2.0.5(transitive)
+ Addedspdx-compare@1.0.0(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.21(transitive)
+ Addedspdx-ranges@2.1.1(transitive)
+ Addedspdx-satisfies@4.0.1(transitive)
- Removedaxios@0.17.1(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedspdx-compare@0.1.2(transitive)
- Removedspdx-correct@2.0.4(transitive)
- Removedspdx-expression-parse@1.0.42.0.2(transitive)
- Removedspdx-license-ids@2.0.1(transitive)
- Removedspdx-ranges@1.0.1(transitive)
- Removedspdx-satisfies@0.1.3(transitive)
Updatedaxios@^0.18.0
Updatedspdx-correct@^3.0.0
Updatedspdx-satisfies@^4.0.0