| | |
| | | ); |
| | | |
| | | /** |
| | | * Gets default target. |
| | | * @param {string} context the context directory |
| | | * @returns {string} default target |
| | | */ |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Defines the platform target properties type used by this module. |
| | | * @typedef {object} PlatformTargetProperties |
| | | * @property {boolean | null=} web web platform, importing of http(s) and std: is available |
| | | * @property {boolean | null=} browser browser platform, running in a normal web browser |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the electron context target properties type used by this module. |
| | | * @typedef {object} ElectronContextTargetProperties |
| | | * @property {boolean | null} electronMain in main context |
| | | * @property {boolean | null} electronPreload in preload context |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the api target properties type used by this module. |
| | | * @typedef {object} ApiTargetProperties |
| | | * @property {boolean | null} require has require function available |
| | | * @property {boolean | null} nodeBuiltins has node.js built-in modules available |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the ecma target properties type used by this module. |
| | | * @typedef {object} EcmaTargetProperties |
| | | * @property {boolean | null} globalThis has globalThis variable available |
| | | * @property {boolean | null} bigIntLiteral big int literal syntax is available |
| | | * @property {boolean | null} const const and let variable declarations are available |
| | | * @property {boolean | null} methodShorthand object method shorthand is available |
| | | * @property {boolean | null} arrowFunction arrow functions are available |
| | | * @property {boolean | null} forOf for of iteration is available |
| | | * @property {boolean | null} destructuring destructuring is available |
| | |
| | | */ |
| | | |
| | | /** |
| | | * Defines the shared type used by this module. |
| | | * @template T |
| | | * @typedef {{ [P in keyof T]?: never }} Never<T> |
| | | */ |
| | | |
| | | /** |
| | | * Defines the shared type used by this module. |
| | | * @template A |
| | | * @template B |
| | | * @typedef {(A & Never<B>) | (Never<A> & B) | (A & B)} Mix<A, B> |
| | |
| | | /** @typedef {Mix<Mix<PlatformTargetProperties, ElectronContextTargetProperties>, Mix<ApiTargetProperties, EcmaTargetProperties>>} TargetProperties */ |
| | | |
| | | /** |
| | | * Returns check if version is greater or equal. |
| | | * @param {string} major major version |
| | | * @param {string | undefined} minor minor version |
| | | * @returns {(vMajor: number, vMinor?: number) => boolean | undefined} check if version is greater or equal |
| | |
| | | const: v(6), |
| | | templateLiteral: v(4), |
| | | optionalChaining: v(14), |
| | | methodShorthand: v(4), |
| | | arrowFunction: v(6), |
| | | asyncFunction: v(7, 6), |
| | | forOf: v(5), |
| | |
| | | const: v(1, 1), |
| | | templateLiteral: v(1, 1), |
| | | optionalChaining: v(8), |
| | | methodShorthand: v(1, 1), |
| | | arrowFunction: v(1, 1), |
| | | asyncFunction: v(1, 7), |
| | | forOf: v(0, 36), |
| | |
| | | const: v(0, 15), |
| | | templateLiteral: v(0, 13), |
| | | optionalChaining: v(0, 44), |
| | | methodShorthand: v(0, 15), |
| | | arrowFunction: v(0, 15), |
| | | asyncFunction: v(0, 21), |
| | | forOf: v(0, 13), |
| | |
| | | const: v >= 2015, |
| | | templateLiteral: v >= 2015, |
| | | optionalChaining: v >= 2020, |
| | | methodShorthand: v >= 2015, |
| | | arrowFunction: v >= 2015, |
| | | forOf: v >= 2015, |
| | | destructuring: v >= 2015, |
| | |
| | | ]; |
| | | |
| | | /** |
| | | * Gets target properties. |
| | | * @param {string} target the target |
| | | * @param {string} context the context directory |
| | | * @returns {TargetProperties} target properties |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Merges target properties. |
| | | * @param {TargetProperties[]} targetProperties array of target properties |
| | | * @returns {TargetProperties} merged target properties |
| | | */ |
| | |
| | | }; |
| | | |
| | | /** |
| | | * Gets targets properties. |
| | | * @param {string[]} targets the targets |
| | | * @param {string} context the context directory |
| | | * @returns {TargetProperties} target properties |