Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

js-green-licenses

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-green-licenses - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

7

build/src/checker.js

@@ -45,2 +45,3 @@ "use strict";

const DEFAULT_GREEN_LICENSES = [
'0BSD',
'AFL-2.1',

@@ -107,7 +108,7 @@ 'AFL-3.0',

}
// tslint:disable-next-line:no-any `EventEmitter` uses ...args: any[]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
on(event, listener) {
return super.on(event, listener);
}
// tslint:disable-next-line:no-any `EventEmitter` uses ...args: any[]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
emit(event, ...args) {

@@ -264,3 +265,3 @@ return super.emit(event, ...args);

async checkPackageJsonContent(content, localDirectory) {
// tslint:disable-next-line:no-any `JSON.parse()` returns any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let json = null;

@@ -267,0 +268,0 @@ try {

@@ -19,3 +19,4 @@ #!/usr/bin/env node

const checker_1 = require("./checker");
const version = require('../../package.json').version;
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { version } = require('../../package.json');
const argParser = new argparse_1.ArgumentParser({

@@ -22,0 +23,0 @@ version,

@@ -35,19 +35,28 @@ "use strict";

getAxiosConfig(authToken) {
return authToken
? { headers: { Authorization: `token ${authToken}` } }
: {};
return authToken ? { headers: { Authorization: `token ${authToken}` } } : {};
}
async apiGet(path, params) {
const url = url_1.parse('https://api.github.com', true);
const url = new url_1.URL('https://api.github.com');
url.pathname = path_1.posix.join(this.pathPrefix, path);
if (params) {
url.query = params;
Object.keys(params).forEach(key => {
url.searchParams.set(key, params[key]);
});
}
const resp = await gaxios_1.request(Object.assign({ method: 'GET', url: url_1.format(url) }, this.getAxiosConfig()));
const resp = await gaxios_1.request({
method: 'GET',
url: url.href,
...this.getAxiosConfig(),
});
return resp.data;
}
async apiPost(path, body) {
const url = url_1.parse('https://api.github.com');
const url = new url_1.URL('https://api.github.com');
url.pathname = path_1.posix.join(this.pathPrefix, path);
const resp = await gaxios_1.request(Object.assign({ method: 'POST', url: url_1.format(url), data: body }, this.getAxiosConfig()));
const resp = await gaxios_1.request({
method: 'POST',
url: url.href,
data: body,
...this.getAxiosConfig(),
});
return resp.data;

@@ -58,3 +67,3 @@ }

answer = ensureSingleResponseData(answer);
if (answer.mergeable == null) {
if (answer.mergeable === null) {
if (attemptCount > GitHubRepository.MAX_PR_COMMIT_RETRIES) {

@@ -154,5 +163,5 @@ throw new Error(`Tried ${attemptCount} times but the mergeable field is not set. Giving up`);

}
exports.GitHubRepository = GitHubRepository;
// How many times to retry PR commit retrieval until giving up.
GitHubRepository.MAX_PR_COMMIT_RETRIES = 10;
exports.GitHubRepository = GitHubRepository;
//# sourceMappingURL=github.js.map

@@ -27,5 +27,5 @@ "use strict";

}
// tslint:disable-next-line:no-any `obj` is from JSON and can be any.
function isDependencies(obj) {
for (const key in obj) {
// eslint-disable-next-line no-prototype-builtins
if (obj.hasOwnProperty(key) && typeof obj[key] !== 'string') {

@@ -32,0 +32,0 @@ return false;

@@ -7,2 +7,21 @@ # Changelog

## [2.0.0](https://www.github.com/google/js-green-licenses/compare/v1.1.0...v2.0.0) (2020-05-07)
### ⚠ BREAKING CHANGES
* drop support for node.js 8 (#124)
### Bug Fixes
* **deps:** update dependency gaxios to v3 ([#121](https://www.github.com/google/js-green-licenses/issues/121)) ([1fdd3e4](https://www.github.com/google/js-green-licenses/commit/1fdd3e4e7ad642da55ad94b72d71049f4789310c))
* **deps:** update dependency npm-package-arg to v7 ([#110](https://www.github.com/google/js-green-licenses/issues/110)) ([25d0235](https://www.github.com/google/js-green-licenses/commit/25d0235d0ff996b644fe84482241bda5a4b14b2a))
* **deps:** update dependency npm-package-arg to v8 ([#111](https://www.github.com/google/js-green-licenses/issues/111)) ([4763858](https://www.github.com/google/js-green-licenses/commit/4763858fe10d35e2f1e944d0f4e91a309503c812))
* add 0BSD as a valid license ([#132](https://www.github.com/google/js-green-licenses/issues/132)) ([e4db3eb](https://www.github.com/google/js-green-licenses/commit/e4db3ebe01bf49a922f0d3a0d71d9ee4af83cdf0))
### Build System
* drop support for node.js 8 ([#124](https://www.github.com/google/js-green-licenses/issues/124)) ([06283e1](https://www.github.com/google/js-green-licenses/commit/06283e10c44306f88cdb382ac9d593f4a48c0b7d))
## [1.1.0](https://www.github.com/google/js-green-licenses/compare/v1.0.0...v1.1.0) (2019-06-05)

@@ -9,0 +28,0 @@

{
"name": "js-green-licenses",
"version": "1.1.0",
"version": "2.0.0",
"description": "JavaScript package.json license checker",

@@ -10,5 +10,2 @@ "main": "build/src/checker.js",

"files": [
"CONTRIBUTING.md",
"LICENSE",
"README.md",
"build/src"

@@ -18,5 +15,4 @@ ],

"scripts": {
"test": "nyc ava",
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json",
"check": "gts check",
"test": "c8 mocha build/test",
"lint": "gts check",
"clean": "gts clean",

@@ -28,7 +24,6 @@ "compile": "tsc -p .",

"pretest": "npm run compile",
"posttest": "npm run check && npm run check-self",
"check-self": "node build/src/cli.js --local ."
"license-check": "node build/src/cli.js --local ."
},
"engines": {
"node": ">= 8.x"
"node": ">= 10.x"
},

@@ -43,8 +38,3 @@ "keywords": [

"repository": "github:google/js-green-licenses",
"ava": {
"files": [
"build/test/*-test.js"
]
},
"nyc": {
"c8": {
"exclude": [

@@ -56,4 +46,4 @@ "build/test"

"argparse": "^1.0.10",
"gaxios": "^2.0.1",
"npm-package-arg": "^6.1.0",
"gaxios": "^3.0.0",
"npm-package-arg": "^8.0.0",
"package-json": "^6.0.0",

@@ -66,6 +56,6 @@ "spdx-correct": "^3.0.0",

"@types/argparse": "^1.0.33",
"@types/mocha": "^7.0.0",
"@types/nock": "^10.0.0",
"@types/node": "^10.0.1",
"@types/npm-package-arg": "^6.0.0",
"@types/package-json": "^5.0.0",
"@types/proxyquire": "^1.3.28",

@@ -75,15 +65,12 @@ "@types/spdx-correct": "^2.0.0",

"@types/strip-json-comments": "0.0.30",
"@types/tmp": "0.1.0",
"ava": "^2.0.0",
"codecov": "^3.0.1",
"gts": "^1.0.0",
"c8": "^7.0.0",
"gts": "^2.0.0",
"inline-fixtures": "^1.1.0",
"make-dir": "^3.0.0",
"mocha": "^7.0.0",
"mock-fs": "^4.4.2",
"nock": "^10.0.0",
"nyc": "^14.0.0",
"nock": "^12.0.0",
"proxyquire": "^2.0.1",
"tmp": "0.1.0",
"typescript": "~3.5.0"
"typescript": "~3.8.0"
}
}
# JavaScript package.json License Checker
[![NPM Version][npm-image]][npm-url]
[![CircleCI][circle-image]][circle-url]
[![CI][actions-image]][actions-url]
[![Dependency Status][david-image]][david-url]

@@ -311,4 +311,4 @@ [![Known Vulnerabilities][snyk-image]][snyk-url]

[circle-image]: https://circleci.com/gh/google/js-green-licenses.svg?style=shield
[circle-url]: https://circleci.com/gh/google/js-green-licenses
[actions-image]: https://github.com/google/js-green-licenses/workflows/ci/badge.svg
[actions-url]: https://github.com/google/js-green-licenses/actions
[codecov-image]: https://codecov.io/gh/google/js-green-licenses/branch/master/graph/badge.svg

@@ -315,0 +315,0 @@ [codecov-url]: https://codecov.io/gh/google/js-green-licenses

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc