Conversation
| "dependencies": { | ||
| "packageurl-js": ">=0.0.6 <0.0.8 || ^1" | ||
| "packageurl-js": ">=0.0.6 <0.0.8 || ^1", | ||
| "spdx-expression-parse": "^3.0.1" |
There was a problem hiding this comment.
❌ new dep must be communicated in HISTORY
| @@ -23,11 +23,19 @@ import { fixupSpdxId } from '../spdx' | |||
|
|
|||
| export class LicenseFactory { | |||
| makeFromString (value: string): License { | |||
There was a problem hiding this comment.
⚡ behavioral change. breaking change.
src/models/license.ts
Outdated
| import type { Attachment } from './attachment' | ||
|
|
||
| export class LicenseExpression { | ||
| static isEligibleExpression (expression: string | any): boolean { |
| export interface OptionalNamedLicenseProperties { | ||
| text?: NamedLicense['text'] | ||
| url?: NamedLicense['url'] | ||
| class DisjunctiveLicenseBase { |
There was a problem hiding this comment.
nonbreaking optimization
| suite('Factories.LicenseFactory', () => { | ||
| test('makeFromString() -> LicenseExpression', () => { | ||
| const sut = new LicenseFactory() | ||
| const expression = '(MIT OR Apache-2.0)' |
There was a problem hiding this comment.
fix according to https://spdx.github.io/spdx-spec/v2.3/SPDX-license-list/
jkowalleck
left a comment
There was a problem hiding this comment.
contains breaking changes
src/models/license.ts
Outdated
| return false | ||
| } | ||
| try { | ||
| spdxExpressionParse(expression) |
There was a problem hiding this comment.
behavioral change.
BREAKING CHNAGE ⚡
| } | ||
|
|
||
| makeDisjunctiveWithName (value: string | any): NamedLicense { | ||
| makeNamedLicense (value: string | any): NamedLicense { |
| const spdxId = fixupSpdxId(String(value)) | ||
| if (undefined === spdxId) { | ||
| throw new RangeError('Unsupported SPDX id') | ||
| makeSpdxLicense (value: string | any): SpdxLicense { |
| * You may assert valid objects with {@link Factories.LicenseFactory.makeExpression | Factories.LicenseFactory.makeExpression()}. | ||
| */ | ||
| export class LicenseExpression { | ||
| static isEligibleExpression (expression: string | any): boolean { |
|
|
||
| /** | ||
| * @throws {@link RangeError} if `expression` is not {@link LicenseExpression.isEligibleExpression | eligible} | ||
| * @throws {@link RangeError} if `expression` is empty string |
|
|
||
| /** | ||
| * @throws {@link RangeError} if value is not {@link LicenseExpression.isEligibleExpression | eligible} | ||
| * @throws {@link RangeError} if `value` is empty string |
|
|
||
| /** | ||
| * @throws {@link RangeError} if `id` is not {@link isSupportedSpdxId | supported} | ||
| * @throws {@link RangeError} if `id` is empy string |
6281c2c to
1f35a28
Compare
Coverage summary from CodacyMerging #547 (8f2e1f0) into
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
a43f5f1 to
dc1f01f
Compare
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
dc1f01f to
2f9bb5e
Compare
2f9bb5e to
8f2e1f0
Compare
|
|
||
| /** | ||
| * @throws {@link RangeError} if value is not {@link isSupportedSpdxId | supported} | ||
| * @throws {@link RangeError} if `value` is empy string |
this is a blob of improvements for license handling.
needs to be split and introduced separately,
some might be breaking changes or regressions.
see annotations