@tevm/voltaire / primitives/License
primitives/License
Type Aliases
LicenseType
LicenseType =Defined in: src/primitives/License/LicenseType.ts:14 Branded License type - represents SPDX license identifier Used in smart contract metadata for license identification Common values: “MIT”, “Apache-2.0”, “GPL-3.0”, “BSD-3-Clause”, “UNLICENSED”string&object
Type Declaration
[brand]
readonly[brand]:"License"
Example
Variables
COMMON_LICENSES
Defined in: src/primitives/License/constants.js:5 Common SPDX license identifiersconstCOMMON_LICENSES:string[]
See
https://spdx.org/licenses/License
Defined in: src/primitives/License/index.ts:33constLicense:object
Type Declaration
COMMON_LICENSES
COMMON_LICENSES: string[]
Common SPDX license identifiers
See
https://spdx.org/licenses/from()
from: (Create License from SPDX identifier stringvalue) =>LicenseType
Parameters
value
string
SPDX license identifier (e.g., “MIT”, “Apache-2.0”)
Returns
LicenseType
License
Example
isOSI()
isOSI: (license) =>boolean
Parameters
license
string
Returns
boolean
OSI_APPROVED_LICENSES
OSI_APPROVED_LICENSES: string[]
OSI-approved open source licenses
See
https://opensource.org/licensestoString()
toString: (license) =>string
Parameters
license
string
Returns
string
OSI_APPROVED_LICENSES
Defined in: src/primitives/License/constants.js:22 OSI-approved open source licensesconstOSI_APPROVED_LICENSES:string[]
See
https://opensource.org/licensesFunctions
_isOSI()
_isOSI(Defined in: src/primitives/License/isOSI.js:18 Check if license is OSI-approvedlicense):boolean
Parameters
license
LicenseType
License to check
Returns
boolean
True if OSI-approved
Example
_toString()
_toString(Defined in: src/primitives/License/toString.js:14 Convert License to stringlicense):string
Parameters
license
LicenseType
License to convert
Returns
string
String representation
Example
from()
from(Defined in: src/primitives/License/from.js:13 Create License from SPDX identifier stringvalue):LicenseType
Parameters
value
string
SPDX license identifier (e.g., “MIT”, “Apache-2.0”)
Returns
LicenseType
License
Example
isOSI()
isOSI(Defined in: src/primitives/License/index.ts:20license):boolean
Parameters
license
string
Returns
boolean
toString()
toString(Defined in: src/primitives/License/index.ts:25license):string
Parameters
license
string
Returns
string
