spdx-satisfies
    DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/spdx-satisfies package

    5.0.1 • Public • Published
    var assert = require('assert')
    var satisfies = require('spdx-satisfies')
    
    assert(satisfies('MIT', 'MIT'))
    
    assert(satisfies('MIT', '(ISC OR MIT)'))
    assert(satisfies('Zlib', '(ISC OR (MIT OR Zlib))'))
    assert(!satisfies('GPL-3.0', '(ISC OR MIT)'))
    
    assert(satisfies('GPL-2.0', 'GPL-2.0+'))
    assert(satisfies('GPL-3.0', 'GPL-2.0+'))
    assert(satisfies('GPL-1.0+', 'GPL-2.0+'))
    assert(!satisfies('GPL-1.0', 'GPL-2.0+'))
    assert(satisfies('GPL-2.0-only', 'GPL-2.0-only'))
    assert(satisfies('GPL-3.0-only', 'GPL-2.0+'))
    assert(satisfies('LGPL-3.0-only', 'LGPL-3.0-or-later'))
    assert(satisfies('GPL-2.0', 'GPL-2.0+'))
    assert(satisfies('GPL-2.0-only', 'GPL-2.0+'))
    assert(satisfies('GPL-2.0', 'GPL-2.0-or-later'))
    
    assert(!satisfies(
      'GPL-2.0',
      'GPL-2.0+ WITH Bison-exception-2.2'
    ))
    
    assert(satisfies(
      'GPL-3.0 WITH Bison-exception-2.2',
      'GPL-2.0+ WITH Bison-exception-2.2'
    ))
    
    assert(satisfies('(MIT OR GPL-2.0)', '(ISC OR MIT)'))
    assert(satisfies('(MIT AND GPL-2.0)', '(MIT AND GPL-2.0)'))
    assert(satisfies('MIT AND GPL-2.0 AND ISC', 'MIT AND GPL-2.0 AND ISC'))
    assert(satisfies('MIT AND GPL-2.0 AND ISC', 'ISC AND GPL-2.0 AND MIT'))
    assert(satisfies('(MIT OR GPL-2.0) AND ISC', 'MIT AND ISC'))
    assert(satisfies('MIT AND ISC', '(MIT OR GPL-2.0) AND ISC'))
    assert(satisfies('MIT AND ISC', '(MIT AND GPL-2.0) OR ISC'))
    assert(satisfies('(MIT OR Apache-2.0) AND (ISC OR GPL-2.0)', 'Apache-2.0 AND ISC'))
    assert(satisfies('(MIT OR Apache-2.0) AND (ISC OR GPL-2.0)', 'Apache-2.0 OR ISC'))
    assert(satisfies('(MIT AND GPL-2.0)', '(MIT OR GPL-2.0)'))
    assert(satisfies('(MIT AND GPL-2.0)', '(GPL-2.0 AND MIT)'))
    assert(satisfies('MIT', '(GPL-2.0 OR MIT) AND (MIT OR ISC)'))
    assert(satisfies('MIT AND ICU', '(MIT AND GPL-2.0) OR (ISC AND (Apache-2.0 OR ICU))'))
    assert(!satisfies('(MIT AND GPL-2.0)', '(ISC OR GPL-2.0)'))
    assert(!satisfies('MIT AND (GPL-2.0 OR ISC)', 'MIT'))
    assert(!satisfies('(MIT OR Apache-2.0) AND (ISC OR GPL-2.0)', 'MIT'))

    Install

    npm i spdx-satisfies

    DownloadsWeekly Downloads

    316,752

    Version

    5.0.1

    License

    MIT

    Unpacked Size

    8.38 kB

    Total Files

    4

    Last publish

    Collaborators

    • kemitchell