mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-12 11:16:09 +09:00
Clean up the oopsie. Rebuild the blank exercises.
This commit is contained in:
+1
@@ -1,3 +1,4 @@
|
||||
C. Scott Ananian <cscott@cscott.net> (http://cscott.net)
|
||||
Kyle E. Mitchell <kyle@kemitchell.com> (https://kemitchell.com)
|
||||
Shinnosuke Watanabe <snnskwtnb@gmail.com>
|
||||
Antoine Motet <antoine.motet@gmail.com>
|
||||
|
||||
+17
-9
@@ -1,4 +1,4 @@
|
||||
This package parses SPDX license expression strings describing license terms, like [package.json license strings](https://docs.npmjs.com/files/package.json#license), into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools.
|
||||
This package parses [SPDX license expression](https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60) strings describing license terms, like [package.json license strings](https://docs.npmjs.com/files/package.json#license), into consistently structured ECMAScript objects. The npm command-line interface depends on this package, as do many automatic license-audit tools.
|
||||
|
||||
In a nutshell:
|
||||
|
||||
@@ -19,8 +19,9 @@ assert.throws(function () {
|
||||
})
|
||||
|
||||
assert.deepEqual(
|
||||
// Dual licensed under LGPL 2.1 or a combination of the Three-Clause
|
||||
// BSD License and the MIT License.
|
||||
// Dual licensed under either:
|
||||
// - LGPL 2.1
|
||||
// - a combination of Three-Clause BSD and MIT
|
||||
parse('(LGPL-2.1 OR BSD-3-Clause AND MIT)'),
|
||||
{
|
||||
left: {license: 'LGPL-2.1'},
|
||||
@@ -38,12 +39,16 @@ The syntax comes from the [Software Package Data eXchange (SPDX)](https://spdx.o
|
||||
|
||||
The bulk of the SPDX standard describes syntax and semantics of XML metadata files. This package implements two lightweight, plain-text components of that larger standard:
|
||||
|
||||
1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-exceptions) and [spdx-exceptions](https://www.npmjs.com/package/spdx-license-ids) packages implement the license list. They are development dependencies of this package.
|
||||
1. The [license list](https://spdx.org/licenses), a mapping from specific string identifiers, like `Apache-2.0`, to standard form license texts and bolt-on license exceptions. The [spdx-license-ids](https://www.npmjs.com/package/spdx-license-ids) and [spdx-exceptions](https://www.npmjs.com/package/spdx-exceptions) packages implement the license list. `spdx-expression-parse` depends on and `require()`s them.
|
||||
|
||||
Any license identifier from the license list is a valid license expression:
|
||||
|
||||
```javascript
|
||||
require('spdx-license-ids').forEach(function (id) {
|
||||
var identifiers = []
|
||||
.concat(require('spdx-license-ids'))
|
||||
.concat(require('spdx-license-ids/deprecated'))
|
||||
|
||||
identifiers.forEach(function (id) {
|
||||
assert.deepEqual(parse(id), {license: id})
|
||||
})
|
||||
```
|
||||
@@ -51,7 +56,7 @@ The bulk of the SPDX standard describes syntax and semantics of XML metadata fil
|
||||
So is any license identifier `WITH` a standardized license exception:
|
||||
|
||||
```javascript
|
||||
require('spdx-license-ids').forEach(function (id) {
|
||||
identifiers.forEach(function (id) {
|
||||
require('spdx-exceptions').forEach(function (e) {
|
||||
assert.deepEqual(
|
||||
parse(id + ' WITH ' + e),
|
||||
@@ -61,12 +66,15 @@ The bulk of the SPDX standard describes syntax and semantics of XML metadata fil
|
||||
})
|
||||
```
|
||||
|
||||
2. The license expression language, for describing simple and complex license terms, like `MIT` for MIT-licensed and `(GPL-2.0 OR Apache-2.0)` for dual-licensing under GPL 2.0 and Apache 2.0. This package implements the license expression language.
|
||||
2. The license expression language, for describing simple and complex license terms, like `MIT` for MIT-licensed and `(GPL-2.0 OR Apache-2.0)` for dual-licensing under GPL 2.0 and Apache 2.0. `spdx-expression-parse` itself implements license expression language, exporting a parser.
|
||||
|
||||
```javascript
|
||||
assert.deepEqual(
|
||||
// Licensed under a combination of the MIT License and a combination
|
||||
// of LGPL 2.1 (or a later version) and the Three-Clause BSD License.
|
||||
// Licensed under a combination of:
|
||||
// - the MIT License AND
|
||||
// - a combination of:
|
||||
// - LGPL 2.1 (or a later version) AND
|
||||
// - Three-Clause BSD
|
||||
parse('(MIT AND (LGPL-2.1+ AND BSD-3-Clause))'),
|
||||
{
|
||||
left: {license: 'MIT'},
|
||||
|
||||
+6
-3
@@ -1,5 +1,8 @@
|
||||
var parser = require('./parser').parser
|
||||
'use strict'
|
||||
|
||||
module.exports = function (argument) {
|
||||
return parser.parse(argument)
|
||||
var scan = require('./scan')
|
||||
var parse = require('./parse')
|
||||
|
||||
module.exports = function (source) {
|
||||
return parse(scan(source))
|
||||
}
|
||||
|
||||
+32
-25
@@ -1,34 +1,35 @@
|
||||
{
|
||||
"_from": "spdx-expression-parse@~1.0.0",
|
||||
"_id": "spdx-expression-parse@1.0.4",
|
||||
"_from": "spdx-expression-parse@^3.0.0",
|
||||
"_id": "spdx-expression-parse@3.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=",
|
||||
"_integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
|
||||
"_location": "/spdx-expression-parse",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "spdx-expression-parse@~1.0.0",
|
||||
"raw": "spdx-expression-parse@^3.0.0",
|
||||
"name": "spdx-expression-parse",
|
||||
"escapedName": "spdx-expression-parse",
|
||||
"rawSpec": "~1.0.0",
|
||||
"rawSpec": "^3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "~1.0.0"
|
||||
"fetchSpec": "^3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/spdx-correct",
|
||||
"/validate-npm-package-license"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz",
|
||||
"_shasum": "9bdf2f20e1f40ed447fbe273266191fced51626c",
|
||||
"_spec": "spdx-expression-parse@~1.0.0",
|
||||
"_where": "/Users/cloyd/coderrr/odin/javascript-exercises/node_modules/validate-npm-package-license",
|
||||
"_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
|
||||
"_shasum": "cf70f50482eefdc98e3ce0a6833e4a53ceeba679",
|
||||
"_spec": "spdx-expression-parse@^3.0.0",
|
||||
"_where": "/home/michael/projects/javascript-exercises/node_modules/validate-npm-package-license",
|
||||
"author": {
|
||||
"name": "Kyle E. Mitchell",
|
||||
"email": "kyle@kemitchell.com",
|
||||
"url": "http://kemitchell.com"
|
||||
"url": "https://kemitchell.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/kemitchell/spdx-expression-parse.js/issues"
|
||||
"url": "https://github.com/jslicense/spdx-expression-parse.js/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
@@ -45,24 +46,30 @@
|
||||
{
|
||||
"name": "Shinnosuke Watanabe",
|
||||
"email": "snnskwtnb@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Antoine Motet",
|
||||
"email": "antoine.motet@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"spdx-exceptions": "^2.1.0",
|
||||
"spdx-license-ids": "^3.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "parse SPDX license expressions",
|
||||
"devDependencies": {
|
||||
"defence-cli": "^1.0.1",
|
||||
"jison": "^0.4.15",
|
||||
"defence-cli": "^3.0.1",
|
||||
"replace-require-self": "^1.0.0",
|
||||
"spdx-exceptions": "^1.0.4",
|
||||
"spdx-license-ids": "^1.0.0",
|
||||
"standard": "^8.0.0"
|
||||
"standard": "^14.1.0"
|
||||
},
|
||||
"files": [
|
||||
"AUTHORS",
|
||||
"index.js",
|
||||
"parser.js"
|
||||
"parse.js",
|
||||
"scan.js"
|
||||
],
|
||||
"homepage": "https://github.com/kemitchell/spdx-expression-parse.js#readme",
|
||||
"homepage": "https://github.com/jslicense/spdx-expression-parse.js#readme",
|
||||
"keywords": [
|
||||
"SPDX",
|
||||
"law",
|
||||
@@ -73,17 +80,17 @@
|
||||
"package.json",
|
||||
"standards"
|
||||
],
|
||||
"license": "(MIT AND CC-BY-3.0)",
|
||||
"license": "MIT",
|
||||
"name": "spdx-expression-parse",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/kemitchell/spdx-expression-parse.js.git"
|
||||
"url": "git+https://github.com/jslicense/spdx-expression-parse.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"prepublish": "node generate-parser.js > parser.js",
|
||||
"pretest": "npm run prepublish",
|
||||
"test": "defence -i javascript README.md | replace-require-self | node"
|
||||
"test": "npm run test:suite && npm run test:readme",
|
||||
"test:readme": "defence -i javascript README.md | replace-require-self | node",
|
||||
"test:suite": "node test.js"
|
||||
},
|
||||
"version": "1.0.4"
|
||||
"version": "3.0.1"
|
||||
}
|
||||
|
||||
-1357
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user