Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/fonts/iran-yekan/beflpn/node-abi.zip
Назад
PK �n[x��e .github/workflows/update-abi.ymlnu �Iw�� name: Auto-update ABI JSON file on: schedule: - cron: '0 * * * *' jobs: autoupdate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: '12.x' - name: Get npm cache directory id: npm-cache run: | echo "::set-output name=dir::$(npm config get cache)" - uses: actions/cache@v1 with: path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} restore-keys: | ${{ runner.os }}-node- - run: npm install --no-package-lock - name: Update ABI registry run: npm run update-abi-registry - name: Commit Changes to ABI registry env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "machine github.com login $GITHUB_ACTOR password $GITHUB_TOKEN" > ~/.netrc chmod 600 ~/.netrc git add abi_registry.json if test -n "$(git status -s)"; then git config user.name "GitHub Actions" git config user.email "github-actions@users.noreply.github.com" git diff --cached git commit -m "feat: update ABI registry" git push origin HEAD:$GITHUB_REF else echo No update needed fi PK �n[�t9B B node_modules/semver/bin/semvernu ��̗� #!/usr/bin/env node // Standalone semver comparison program. // Exits successfully and prints matching version(s) if // any supplied version is valid and passes all tests. var argv = process.argv.slice(2) var versions = [] var range = [] var inc = null var version = require('../package.json').version var loose = false var includePrerelease = false var coerce = false var identifier var semver = require('../semver') var reverse = false var options = {} main() function main () { if (!argv.length) return help() while (argv.length) { var a = argv.shift() var indexOfEqualSign = a.indexOf('=') if (indexOfEqualSign !== -1) { a = a.slice(0, indexOfEqualSign) argv.unshift(a.slice(indexOfEqualSign + 1)) } switch (a) { case '-rv': case '-rev': case '--rev': case '--reverse': reverse = true break case '-l': case '--loose': loose = true break case '-p': case '--include-prerelease': includePrerelease = true break case '-v': case '--version': versions.push(argv.shift()) break case '-i': case '--inc': case '--increment': switch (argv[0]) { case 'major': case 'minor': case 'patch': case 'prerelease': case 'premajor': case 'preminor': case 'prepatch': inc = argv.shift() break default: inc = 'patch' break } break case '--preid': identifier = argv.shift() break case '-r': case '--range': range.push(argv.shift()) break case '-c': case '--coerce': coerce = true break case '-h': case '--help': case '-?': return help() default: versions.push(a) break } } var options = { loose: loose, includePrerelease: includePrerelease } versions = versions.map(function (v) { return coerce ? (semver.coerce(v) || { version: v }).version : v }).filter(function (v) { return semver.valid(v) }) if (!versions.length) return fail() if (inc && (versions.length !== 1 || range.length)) { return failInc() } for (var i = 0, l = range.length; i < l; i++) { versions = versions.filter(function (v) { return semver.satisfies(v, range[i], options) }) if (!versions.length) return fail() } return success(versions) } function failInc () { console.error('--inc can only be used on a single version with no range') fail() } function fail () { process.exit(1) } function success () { var compare = reverse ? 'rcompare' : 'compare' versions.sort(function (a, b) { return semver[compare](a, b, options) }).map(function (v) { return semver.clean(v, options) }).map(function (v) { return inc ? semver.inc(v, inc, options, identifier) : v }).forEach(function (v, i, _) { console.log(v) }) } function help () { console.log(['SemVer ' + version, '', 'A JavaScript implementation of the https://semver.org/ specification', 'Copyright Isaac Z. Schlueter', '', 'Usage: semver [options] <version> [<version> [...]]', 'Prints valid versions sorted by SemVer precedence', '', 'Options:', '-r --range <range>', ' Print versions that match the specified range.', '', '-i --increment [<level>]', ' Increment a version by the specified level. Level can', ' be one of: major, minor, patch, premajor, preminor,', " prepatch, or prerelease. Default level is 'patch'.", ' Only one version may be specified.', '', '--preid <identifier>', ' Identifier to be used to prefix premajor, preminor,', ' prepatch or prerelease version increments.', '', '-l --loose', ' Interpret versions and ranges loosely', '', '-p --include-prerelease', ' Always include prerelease versions in range matching', '', '-c --coerce', ' Coerce a string into SemVer if possible', ' (does not imply --loose)', '', 'Program exits successfully if any valid version satisfies', 'all supplied ranges, and prints all satisfying versions.', '', 'If no satisfying versions are found, then exits failure.', '', 'Versions are printed in ascending order, so supplying', 'multiple versions to the utility will just sort them.' ].join('\n')) } PK �n[�j� � node_modules/semver/CHANGELOG.mdnu �Iw�� # changes log ## 5.7 * Add `minVersion` method ## 5.6 * Move boolean `loose` param to an options object, with backwards-compatibility protection. * Add ability to opt out of special prerelease version handling with the `includePrerelease` option flag. ## 5.5 * Add version coercion capabilities ## 5.4 * Add intersection checking ## 5.3 * Add `minSatisfying` method ## 5.2 * Add `prerelease(v)` that returns prerelease components ## 5.1 * Add Backus-Naur for ranges * Remove excessively cute inspection methods ## 5.0 * Remove AMD/Browserified build artifacts * Fix ltr and gtr when using the `*` range * Fix for range `*` with a prerelease identifier PK �n[�aGW� � node_modules/semver/LICENSEnu �Iw�� The ISC License Copyright (c) Isaac Z. Schlueter and Contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. PK �n[�A� k= k= node_modules/semver/README.mdnu �Iw�� semver(1) -- The semantic versioner for npm =========================================== ## Install ```bash npm install --save semver ```` ## Usage As a node module: ```js const semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null semver.clean(' =v1.2.3 ') // '1.2.3' semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true semver.gt('1.2.3', '9.8.7') // false semver.lt('1.2.3', '9.8.7') // true semver.minVersion('>=1.0.0') // '1.0.0' semver.valid(semver.coerce('v2')) // '2.0.0' semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' ``` As a command-line utility: ``` $ semver -h A JavaScript implementation of the https://semver.org/ specification Copyright Isaac Z. Schlueter Usage: semver [options] <version> [<version> [...]] Prints valid versions sorted by SemVer precedence Options: -r --range <range> Print versions that match the specified range. -i --increment [<level>] Increment a version by the specified level. Level can be one of: major, minor, patch, premajor, preminor, prepatch, or prerelease. Default level is 'patch'. Only one version may be specified. --preid <identifier> Identifier to be used to prefix premajor, preminor, prepatch or prerelease version increments. -l --loose Interpret versions and ranges loosely -p --include-prerelease Always include prerelease versions in range matching -c --coerce Coerce a string into SemVer if possible (does not imply --loose) Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. ``` ## Versions A "version" is described by the `v2.0.0` specification found at <https://semver.org/>. A leading `"="` or `"v"` character is stripped off and ignored. ## Ranges A `version range` is a set of `comparators` which specify versions that satisfy the range. A `comparator` is composed of an `operator` and a `version`. The set of primitive `operators` is: * `<` Less than * `<=` Less than or equal to * `>` Greater than * `>=` Greater than or equal to * `=` Equal. If no operator is specified, then equality is assumed, so this operator is optional, but MAY be included. For example, the comparator `>=1.2.7` would match the versions `1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` or `1.1.0`. Comparators can be joined by whitespace to form a `comparator set`, which is satisfied by the **intersection** of all of the comparators it includes. A range is composed of one or more comparator sets, joined by `||`. A version matches a range if and only if every comparator in at least one of the `||`-separated comparator sets is satisfied by the version. For example, the range `>=1.2.7 <1.3.0` would match the versions `1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, or `1.1.0`. The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, `1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. ### Prerelease Tags If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then it will only be allowed to satisfy comparator sets if at least one comparator with the same `[major, minor, patch]` tuple also has a prerelease tag. For example, the range `>1.2.3-alpha.3` would be allowed to match the version `1.2.3-alpha.7`, but it would *not* be satisfied by `3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater than" `1.2.3-alpha.3` according to the SemVer sort rules. The version range only accepts prerelease tags on the `1.2.3` version. The version `3.4.5` *would* satisfy the range, because it does not have a prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. The purpose for this behavior is twofold. First, prerelease versions frequently are updated very quickly, and contain many breaking changes that are (by the author's design) not yet fit for public consumption. Therefore, by default, they are excluded from range matching semantics. Second, a user who has opted into using a prerelease version has clearly indicated the intent to use *that specific* set of alpha/beta/rc versions. By including a prerelease tag in the range, the user is indicating that they are aware of the risk. However, it is still not appropriate to assume that they have opted into taking a similar risk on the *next* set of prerelease versions. Note that this behavior can be suppressed (treating all prerelease versions as if they were normal versions, for the purpose of range matching) by setting the `includePrerelease` flag on the options object to any [functions](https://github.com/npm/node-semver#functions) that do range matching. #### Prerelease Identifiers The method `.inc` takes an additional `identifier` string argument that will append the value of the string as a prerelease identifier: ```javascript semver.inc('1.2.3', 'prerelease', 'beta') // '1.2.4-beta.0' ``` command-line example: ```bash $ semver 1.2.3 -i prerelease --preid beta 1.2.4-beta.0 ``` Which then can be used to increment further: ```bash $ semver 1.2.4-beta.0 -i prerelease 1.2.4-beta.1 ``` ### Advanced Range Syntax Advanced range syntax desugars to primitive comparators in deterministic ways. Advanced ranges may be combined in the same way as primitive comparators using white space or `||`. #### Hyphen Ranges `X.Y.Z - A.B.C` Specifies an inclusive set. * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` If a partial version is provided as the first version in the inclusive range, then the missing pieces are replaced with zeroes. * `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` If a partial version is provided as the second version in the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but nothing that would be greater than the provided tuple parts. * `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` * `1.2.3 - 2` := `>=1.2.3 <3.0.0` #### X-Ranges `1.2.x` `1.X` `1.2.*` `*` Any of `X`, `x`, or `*` may be used to "stand in" for one of the numeric values in the `[major, minor, patch]` tuple. * `*` := `>=0.0.0` (Any version satisfies) * `1.x` := `>=1.0.0 <2.0.0` (Matching major version) * `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) A partial version range is treated as an X-Range, so the special character is in fact optional. * `""` (empty string) := `*` := `>=0.0.0` * `1` := `1.x.x` := `>=1.0.0 <2.0.0` * `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` #### Tilde Ranges `~1.2.3` `~1.2` `~1` Allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not. * `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` * `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) * `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) * `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` * `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) * `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) * `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in the `1.2.3` version will be allowed, if they are greater than or equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. #### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` Allows changes that do not modify the left-most non-zero digit in the `[major, minor, patch]` tuple. In other words, this allows patch and minor updates for versions `1.0.0` and above, patch updates for versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. Many authors treat a `0.x` version as if the `x` were the major "breaking-change" indicator. Caret ranges are ideal when an author may make breaking changes between `0.2.4` and `0.3.0` releases, which is a common practice. However, it presumes that there will *not* be breaking changes between `0.2.4` and `0.2.5`. It allows for changes that are presumed to be additive (but non-breaking), according to commonly observed practices. * `^1.2.3` := `>=1.2.3 <2.0.0` * `^0.2.3` := `>=0.2.3 <0.3.0` * `^0.0.3` := `>=0.0.3 <0.0.4` * `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in the `1.2.3` version will be allowed, if they are greater than or equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but `1.2.4-beta.2` would not, because it is a prerelease of a different `[major, minor, patch]` tuple. * `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the `0.0.3` version *only* will be allowed, if they are greater than or equal to `beta`. So, `0.0.3-pr.2` would be allowed. When parsing caret ranges, a missing `patch` value desugars to the number `0`, but will allow flexibility within that value, even if the major and minor versions are both `0`. * `^1.2.x` := `>=1.2.0 <2.0.0` * `^0.0.x` := `>=0.0.0 <0.1.0` * `^0.0` := `>=0.0.0 <0.1.0` A missing `minor` and `patch` values will desugar to zero, but also allow flexibility within those values, even if the major version is zero. * `^1.x` := `>=1.0.0 <2.0.0` * `^0.x` := `>=0.0.0 <1.0.0` ### Range Grammar Putting all this together, here is a Backus-Naur grammar for ranges, for the benefit of parser authors: ```bnf range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ ``` ## Functions All methods and classes take a final `options` object argument. All options in this object are `false` by default. The options supported are: - `loose` Be more forgiving about not-quite-valid semver strings. (Any resulting output will always be 100% strict compliant, of course.) For backwards compatibility reasons, if the `options` argument is a boolean value instead of an object, it is interpreted to be the `loose` param. - `includePrerelease` Set to suppress the [default behavior](https://github.com/npm/node-semver#prerelease-tags) of excluding prerelease tagged versions from ranges unless they are explicitly opted into. Strict-mode Comparators and Ranges will be strict about the SemVer strings that they parse. * `valid(v)`: Return the parsed version, or null if it's not valid. * `inc(v, release)`: Return the version incremented by the release type (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), or null if it's not valid * `premajor` in one call will bump the version up to the next major version and down to a prerelease of that major version. `preminor`, and `prepatch` work the same way. * If called from a non-prerelease version, the `prerelease` will work the same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. * `prerelease(v)`: Returns an array of prerelease components, or null if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. * `intersects(r1, r2, loose)`: Return true if the two supplied ranges or comparators intersect. * `parse(v)`: Attempt to parse a string as a semantic version, returning either a `SemVer` object or `null`. ### Comparison * `gt(v1, v2)`: `v1 > v2` * `gte(v1, v2)`: `v1 >= v2` * `lt(v1, v2)`: `v1 < v2` * `lte(v1, v2)`: `v1 <= v2` * `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. * `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. * `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call the corresponding function above. `"==="` and `"!=="` do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. * `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. * `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions in descending order when passed to `Array.sort()`. * `diff(v1, v2)`: Returns difference between two versions by the release type (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), or null if the versions are the same. ### Comparators * `intersects(comparator)`: Return true if the comparators intersect ### Ranges * `validRange(range)`: Return the valid range or null if it's not valid * `satisfies(version, range)`: Return true if the version satisfies the range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. * `minSatisfying(versions, range)`: Return the lowest version in the list that satisfies the range, or `null` if none of them do. * `minVersion(range)`: Return the lowest version that can possibly match the given range. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the versions possible in the range. * `outside(version, range, hilo)`: Return true if the version is outside the bounds of the range in either the high or low direction. The `hilo` argument must be either the string `'>'` or `'<'`. (This is the function called by `gtr` and `ltr`.) * `intersects(range)`: Return true if any of the ranges comparators intersect Note that, since ranges may be non-contiguous, a version might not be greater than a range, less than a range, *or* satisfy a range! For example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` until `2.0.0`, so the version `1.2.10` would not be greater than the range (because `2.0.1` satisfies, which is higher), nor less than the range (since `1.2.8` satisfies, which is lower), and it also does not satisfy the range. If you want to know if a version satisfies or does not satisfy a range, use the `satisfies(version, range)` function. ### Coercion * `coerce(version)`: Coerces a string to semver if possible This aims to provide a very forgiving translation of a non-semver string to semver. It looks for the first digit in a string, and consumes all remaining characters which satisfy at least a partial semver (e.g., `1`, `1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes `3.4.0`). Only text which lacks digits will fail coercion (`version one` is not valid). The maximum length for any semver component considered for coercion is 16 characters; longer components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value components are invalid (`9999999999999999.4.7.4` is likely invalid). PK �n[��#�� � node_modules/semver/package.jsonnu �Iw�� { "_args": [ [ "semver@5.7.1", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "semver@5.7.1", "_id": "semver@5.7.1", "_inBundle": false, "_integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "_location": "/node-abi/semver", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "semver@5.7.1", "name": "semver", "escapedName": "semver", "rawSpec": "5.7.1", "saveSpec": null, "fetchSpec": "5.7.1" }, "_requiredBy": [ "/node-abi" ], "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "_spec": "5.7.1", "_where": "/home/freeclou/app.optimyar.com/backend", "bin": { "semver": "bin/semver" }, "bugs": { "url": "https://github.com/npm/node-semver/issues" }, "description": "The semantic version parser used by npm.", "devDependencies": { "tap": "^13.0.0-rc.18" }, "files": [ "bin", "range.bnf", "semver.js" ], "homepage": "https://github.com/npm/node-semver#readme", "license": "ISC", "main": "semver.js", "name": "semver", "repository": { "type": "git", "url": "git+https://github.com/npm/node-semver.git" }, "scripts": { "postpublish": "git push origin --all; git push origin --tags", "postversion": "npm publish", "preversion": "npm test", "test": "tap" }, "tap": { "check-coverage": true }, "version": "5.7.1" } PK �n[�o�k k node_modules/semver/range.bnfnu �Iw�� range-set ::= range ( logical-or range ) * logical-or ::= ( ' ' ) * '||' ( ' ' ) * range ::= hyphen | simple ( ' ' simple ) * | '' hyphen ::= partial ' - ' partial simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr nr ::= '0' | [1-9] ( [0-9] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? pre ::= parts build ::= parts parts ::= part ( '.' part ) * part ::= nr | [-0-9A-Za-z]+ PK �n[I��$�� �� node_modules/semver/semver.jsnu �Iw�� exports = module.exports = SemVer var debug /* istanbul ignore next */ if (typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { debug = function () { var args = Array.prototype.slice.call(arguments, 0) args.unshift('SEMVER') console.log.apply(console, args) } } else { debug = function () {} } // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0' var MAX_LENGTH = 256 var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ 9007199254740991 // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16 // The actual regexps go on exports.re var re = exports.re = [] var src = exports.src = [] var R = 0 // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++ src[NUMERICIDENTIFIER] = '0|[1-9]\\d*' var NUMERICIDENTIFIERLOOSE = R++ src[NUMERICIDENTIFIERLOOSE] = '[0-9]+' // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++ src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*' // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++ src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')' var MAINVERSIONLOOSE = R++ src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')' // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++ src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')' var PRERELEASEIDENTIFIERLOOSE = R++ src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')' // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++ src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))' var PRERELEASELOOSE = R++ src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))' // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++ src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+' // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++ src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))' // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++ var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?' src[FULL] = '^' + FULLPLAIN + '$' // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?' var LOOSE = R++ src[LOOSE] = '^' + LOOSEPLAIN + '$' var GTLT = R++ src[GTLT] = '((?:<|>)?=?)' // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++ src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*' var XRANGEIDENTIFIER = R++ src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*' var XRANGEPLAIN = R++ src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?' var XRANGEPLAINLOOSE = R++ src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?' var XRANGE = R++ src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$' var XRANGELOOSE = R++ src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$' // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++ src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])' // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++ src[LONETILDE] = '(?:~>?)' var TILDETRIM = R++ src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+' re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g') var tildeTrimReplace = '$1~' var TILDE = R++ src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$' var TILDELOOSE = R++ src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$' // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++ src[LONECARET] = '(?:\\^)' var CARETTRIM = R++ src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+' re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g') var caretTrimReplace = '$1^' var CARET = R++ src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$' var CARETLOOSE = R++ src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$' // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++ src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$' var COMPARATOR = R++ src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$' // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++ src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')' // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g') var comparatorTrimReplace = '$1$2$3' // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++ src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$' var HYPHENRANGELOOSE = R++ src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$' // Star ranges basically just allow anything at all. var STAR = R++ src[STAR] = '(<|>)?=?\\s*\\*' // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]) if (!re[i]) { re[i] = new RegExp(src[i]) } } exports.parse = parse function parse (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } if (version.length > MAX_LENGTH) { return null } var r = options.loose ? re[LOOSE] : re[FULL] if (!r.test(version)) { return null } try { return new SemVer(version, options) } catch (er) { return null } } exports.valid = valid function valid (version, options) { var v = parse(version, options) return v ? v.version : null } exports.clean = clean function clean (version, options) { var s = parse(version.trim().replace(/^[=v]+/, ''), options) return s ? s.version : null } exports.SemVer = SemVer function SemVer (version, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (version instanceof SemVer) { if (version.loose === options.loose) { return version } else { version = version.version } } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version) } if (version.length > MAX_LENGTH) { throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') } if (!(this instanceof SemVer)) { return new SemVer(version, options) } debug('SemVer', version, options) this.options = options this.loose = !!options.loose var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]) if (!m) { throw new TypeError('Invalid Version: ' + version) } this.raw = version // these are actually numbers this.major = +m[1] this.minor = +m[2] this.patch = +m[3] if (this.major > MAX_SAFE_INTEGER || this.major < 0) { throw new TypeError('Invalid major version') } if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { throw new TypeError('Invalid minor version') } if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { throw new TypeError('Invalid patch version') } // numberify any prerelease numeric ids if (!m[4]) { this.prerelease = [] } else { this.prerelease = m[4].split('.').map(function (id) { if (/^[0-9]+$/.test(id)) { var num = +id if (num >= 0 && num < MAX_SAFE_INTEGER) { return num } } return id }) } this.build = m[5] ? m[5].split('.') : [] this.format() } SemVer.prototype.format = function () { this.version = this.major + '.' + this.minor + '.' + this.patch if (this.prerelease.length) { this.version += '-' + this.prerelease.join('.') } return this.version } SemVer.prototype.toString = function () { return this.version } SemVer.prototype.compare = function (other) { debug('SemVer.compare', this.version, this.options, other) if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return this.compareMain(other) || this.comparePre(other) } SemVer.prototype.compareMain = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch) } SemVer.prototype.comparePre = function (other) { if (!(other instanceof SemVer)) { other = new SemVer(other, this.options) } // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) { return -1 } else if (!this.prerelease.length && other.prerelease.length) { return 1 } else if (!this.prerelease.length && !other.prerelease.length) { return 0 } var i = 0 do { var a = this.prerelease[i] var b = other.prerelease[i] debug('prerelease compare', i, a, b) if (a === undefined && b === undefined) { return 0 } else if (b === undefined) { return 1 } else if (a === undefined) { return -1 } else if (a === b) { continue } else { return compareIdentifiers(a, b) } } while (++i) } // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function (release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0 this.patch = 0 this.minor = 0 this.major++ this.inc('pre', identifier) break case 'preminor': this.prerelease.length = 0 this.patch = 0 this.minor++ this.inc('pre', identifier) break case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0 this.inc('patch', identifier) this.inc('pre', identifier) break // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) { this.inc('patch', identifier) } this.inc('pre', identifier) break case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { this.major++ } this.minor = 0 this.patch = 0 this.prerelease = [] break case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) { this.minor++ } this.patch = 0 this.prerelease = [] break case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) { this.patch++ } this.prerelease = [] break // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) { this.prerelease = [0] } else { var i = this.prerelease.length while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++ i = -2 } } if (i === -1) { // didn't increment anything this.prerelease.push(0) } } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) { this.prerelease = [identifier, 0] } } else { this.prerelease = [identifier, 0] } } break default: throw new Error('invalid increment argument: ' + release) } this.format() this.raw = this.version return this } exports.inc = inc function inc (version, release, loose, identifier) { if (typeof (loose) === 'string') { identifier = loose loose = undefined } try { return new SemVer(version, loose).inc(release, identifier).version } catch (er) { return null } } exports.diff = diff function diff (version1, version2) { if (eq(version1, version2)) { return null } else { var v1 = parse(version1) var v2 = parse(version2) var prefix = '' if (v1.prerelease.length || v2.prerelease.length) { prefix = 'pre' var defaultResult = 'prerelease' } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return prefix + key } } } return defaultResult // may be undefined } } exports.compareIdentifiers = compareIdentifiers var numeric = /^[0-9]+$/ function compareIdentifiers (a, b) { var anum = numeric.test(a) var bnum = numeric.test(b) if (anum && bnum) { a = +a b = +b } return a === b ? 0 : (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : 1 } exports.rcompareIdentifiers = rcompareIdentifiers function rcompareIdentifiers (a, b) { return compareIdentifiers(b, a) } exports.major = major function major (a, loose) { return new SemVer(a, loose).major } exports.minor = minor function minor (a, loose) { return new SemVer(a, loose).minor } exports.patch = patch function patch (a, loose) { return new SemVer(a, loose).patch } exports.compare = compare function compare (a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)) } exports.compareLoose = compareLoose function compareLoose (a, b) { return compare(a, b, true) } exports.rcompare = rcompare function rcompare (a, b, loose) { return compare(b, a, loose) } exports.sort = sort function sort (list, loose) { return list.sort(function (a, b) { return exports.compare(a, b, loose) }) } exports.rsort = rsort function rsort (list, loose) { return list.sort(function (a, b) { return exports.rcompare(a, b, loose) }) } exports.gt = gt function gt (a, b, loose) { return compare(a, b, loose) > 0 } exports.lt = lt function lt (a, b, loose) { return compare(a, b, loose) < 0 } exports.eq = eq function eq (a, b, loose) { return compare(a, b, loose) === 0 } exports.neq = neq function neq (a, b, loose) { return compare(a, b, loose) !== 0 } exports.gte = gte function gte (a, b, loose) { return compare(a, b, loose) >= 0 } exports.lte = lte function lte (a, b, loose) { return compare(a, b, loose) <= 0 } exports.cmp = cmp function cmp (a, op, b, loose) { switch (op) { case '===': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a === b case '!==': if (typeof a === 'object') a = a.version if (typeof b === 'object') b = b.version return a !== b case '': case '=': case '==': return eq(a, b, loose) case '!=': return neq(a, b, loose) case '>': return gt(a, b, loose) case '>=': return gte(a, b, loose) case '<': return lt(a, b, loose) case '<=': return lte(a, b, loose) default: throw new TypeError('Invalid operator: ' + op) } } exports.Comparator = Comparator function Comparator (comp, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (comp instanceof Comparator) { if (comp.loose === !!options.loose) { return comp } else { comp = comp.value } } if (!(this instanceof Comparator)) { return new Comparator(comp, options) } debug('comparator', comp, options) this.options = options this.loose = !!options.loose this.parse(comp) if (this.semver === ANY) { this.value = '' } else { this.value = this.operator + this.semver.version } debug('comp', this) } var ANY = {} Comparator.prototype.parse = function (comp) { var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR] var m = comp.match(r) if (!m) { throw new TypeError('Invalid comparator: ' + comp) } this.operator = m[1] if (this.operator === '=') { this.operator = '' } // if it literally is just '>' or '' then allow anything. if (!m[2]) { this.semver = ANY } else { this.semver = new SemVer(m[2], this.options.loose) } } Comparator.prototype.toString = function () { return this.value } Comparator.prototype.test = function (version) { debug('Comparator.test', version, this.options.loose) if (this.semver === ANY) { return true } if (typeof version === 'string') { version = new SemVer(version, this.options) } return cmp(version, this.operator, this.semver, this.options) } Comparator.prototype.intersects = function (comp, options) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required') } if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } var rangeTmp if (this.operator === '') { rangeTmp = new Range(comp.value, options) return satisfies(this.value, rangeTmp, options) } else if (comp.operator === '') { rangeTmp = new Range(this.value, options) return satisfies(comp.semver, rangeTmp, options) } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>') var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<') var sameSemVer = this.semver.version === comp.semver.version var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=') var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, options) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')) var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, options) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')) return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan } exports.Range = Range function Range (range, options) { if (!options || typeof options !== 'object') { options = { loose: !!options, includePrerelease: false } } if (range instanceof Range) { if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { return range } else { return new Range(range.raw, options) } } if (range instanceof Comparator) { return new Range(range.value, options) } if (!(this instanceof Range)) { return new Range(range, options) } this.options = options this.loose = !!options.loose this.includePrerelease = !!options.includePrerelease // First, split based on boolean or || this.raw = range this.set = range.split(/\s*\|\|\s*/).map(function (range) { return this.parseRange(range.trim()) }, this).filter(function (c) { // throw out any that are not relevant for whatever reason return c.length }) if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range) } this.format() } Range.prototype.format = function () { this.range = this.set.map(function (comps) { return comps.join(' ').trim() }).join('||').trim() return this.range } Range.prototype.toString = function () { return this.range } Range.prototype.parseRange = function (range) { var loose = this.options.loose range = range.trim() // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE] range = range.replace(hr, hyphenReplace) debug('hyphen replace', range) // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace) debug('comparator trim', range, re[COMPARATORTRIM]) // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace) // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace) // normalize spaces range = range.split(/\s+/).join(' ') // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR] var set = range.split(' ').map(function (comp) { return parseComparator(comp, this.options) }, this).join(' ').split(/\s+/) if (this.options.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function (comp) { return !!comp.match(compRe) }) } set = set.map(function (comp) { return new Comparator(comp, this.options) }, this) return set } Range.prototype.intersects = function (range, options) { if (!(range instanceof Range)) { throw new TypeError('a Range is required') } return this.set.some(function (thisComparators) { return thisComparators.every(function (thisComparator) { return range.set.some(function (rangeComparators) { return rangeComparators.every(function (rangeComparator) { return thisComparator.intersects(rangeComparator, options) }) }) }) }) } // Mostly just for testing and legacy API reasons exports.toComparators = toComparators function toComparators (range, options) { return new Range(range, options).set.map(function (comp) { return comp.map(function (c) { return c.value }).join(' ').trim().split(' ') }) } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator (comp, options) { debug('comp', comp, options) comp = replaceCarets(comp, options) debug('caret', comp) comp = replaceTildes(comp, options) debug('tildes', comp) comp = replaceXRanges(comp, options) debug('xrange', comp) comp = replaceStars(comp, options) debug('stars', comp) return comp } function isX (id) { return !id || id.toLowerCase() === 'x' || id === '*' } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceTilde(comp, options) }).join(' ') } function replaceTilde (comp, options) { var r = options.loose ? re[TILDELOOSE] : re[TILDE] return comp.replace(r, function (_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else if (pr) { debug('replaceTilde pr', pr) ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } else { // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } debug('tilde return', ret) return ret }) } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets (comp, options) { return comp.trim().split(/\s+/).map(function (comp) { return replaceCaret(comp, options) }).join(' ') } function replaceCaret (comp, options) { debug('caret', comp, options) var r = options.loose ? re[CARETLOOSE] : re[CARET] return comp.replace(r, function (_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr) var ret if (isX(M)) { ret = '' } else if (isX(m)) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (isX(p)) { if (M === '0') { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } else { ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0' } } else if (pr) { debug('replaceCaret pr', pr) if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + '-' + pr + ' <' + (+M + 1) + '.0.0' } } else { debug('no pr') if (M === '0') { if (m === '0') { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1) } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0' } } else { ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0' } } debug('caret return', ret) return ret }) } function replaceXRanges (comp, options) { debug('replaceXRanges', comp, options) return comp.split(/\s+/).map(function (comp) { return replaceXRange(comp, options) }).join(' ') } function replaceXRange (comp, options) { comp = comp.trim() var r = options.loose ? re[XRANGELOOSE] : re[XRANGE] return comp.replace(r, function (ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr) var xM = isX(M) var xm = xM || isX(m) var xp = xm || isX(p) var anyX = xp if (gtlt === '=' && anyX) { gtlt = '' } if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0' } else { // nothing is forbidden ret = '*' } } else if (gtlt && anyX) { // we know patch is an x, because we have any x at all. // replace X with 0 if (xm) { m = 0 } p = 0 if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>=' if (xm) { M = +M + 1 m = 0 p = 0 } else { m = +m + 1 p = 0 } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<' if (xm) { M = +M + 1 } else { m = +m + 1 } } ret = gtlt + M + '.' + m + '.' + p } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0' } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0' } debug('xRange return', ret) return ret }) } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars (comp, options) { debug('replaceStars', comp, options) // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], '') } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) { from = '' } else if (isX(fm)) { from = '>=' + fM + '.0.0' } else if (isX(fp)) { from = '>=' + fM + '.' + fm + '.0' } else { from = '>=' + from } if (isX(tM)) { to = '' } else if (isX(tm)) { to = '<' + (+tM + 1) + '.0.0' } else if (isX(tp)) { to = '<' + tM + '.' + (+tm + 1) + '.0' } else if (tpr) { to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr } else { to = '<=' + to } return (from + ' ' + to).trim() } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function (version) { if (!version) { return false } if (typeof version === 'string') { version = new SemVer(version, this.options) } for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version, this.options)) { return true } } return false } function testSet (set, version, options) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) { return false } } if (version.prerelease.length && !options.includePrerelease) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (i = 0; i < set.length; i++) { debug(set[i].semver) if (set[i].semver === ANY) { continue } if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { return true } } } // Version has a -pre, but it's not one of the ones we like. return false } return true } exports.satisfies = satisfies function satisfies (version, range, options) { try { range = new Range(range, options) } catch (er) { return false } return range.test(version) } exports.maxSatisfying = maxSatisfying function maxSatisfying (versions, range, options) { var max = null var maxSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v maxSV = new SemVer(max, options) } } }) return max } exports.minSatisfying = minSatisfying function minSatisfying (versions, range, options) { var min = null var minSV = null try { var rangeObj = new Range(range, options) } catch (er) { return null } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, options) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v minSV = new SemVer(min, options) } } }) return min } exports.minVersion = minVersion function minVersion (range, loose) { range = new Range(range, loose) var minver = new SemVer('0.0.0') if (range.test(minver)) { return minver } minver = new SemVer('0.0.0-0') if (range.test(minver)) { return minver } minver = null for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] comparators.forEach(function (comparator) { // Clone to avoid manipulating the comparator's semver object. var compver = new SemVer(comparator.semver.version) switch (comparator.operator) { case '>': if (compver.prerelease.length === 0) { compver.patch++ } else { compver.prerelease.push(0) } compver.raw = compver.format() /* fallthrough */ case '': case '>=': if (!minver || gt(minver, compver)) { minver = compver } break case '<': case '<=': /* Ignore maximum versions */ break /* istanbul ignore next */ default: throw new Error('Unexpected operation: ' + comparator.operator) } }) } if (minver && range.test(minver)) { return minver } return null } exports.validRange = validRange function validRange (range, options) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, options).range || '*' } catch (er) { return null } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr function ltr (version, range, options) { return outside(version, range, '<', options) } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr function gtr (version, range, options) { return outside(version, range, '>', options) } exports.outside = outside function outside (version, range, hilo, options) { version = new SemVer(version, options) range = new Range(range, options) var gtfn, ltefn, ltfn, comp, ecomp switch (hilo) { case '>': gtfn = gt ltefn = lte ltfn = lt comp = '>' ecomp = '>=' break case '<': gtfn = lt ltefn = gte ltfn = gt comp = '<' ecomp = '<=' break default: throw new TypeError('Must provide a hilo val of "<" or ">"') } // If it satisifes the range it is not outside if (satisfies(version, range, options)) { return false } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i] var high = null var low = null comparators.forEach(function (comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator low = low || comparator if (gtfn(comparator.semver, high.semver, options)) { high = comparator } else if (ltfn(comparator.semver, low.semver, options)) { low = comparator } }) // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false } } return true } exports.prerelease = prerelease function prerelease (version, options) { var parsed = parse(version, options) return (parsed && parsed.prerelease.length) ? parsed.prerelease : null } exports.intersects = intersects function intersects (r1, r2, options) { r1 = new Range(r1, options) r2 = new Range(r2, options) return r1.intersects(r2) } exports.coerce = coerce function coerce (version) { if (version instanceof SemVer) { return version } if (typeof version !== 'string') { return null } var match = version.match(re[COERCE]) if (match == null) { return null } return parse(match[1] + '.' + (match[2] || '0') + '.' + (match[3] || '0')) } PK �n[���� � scripts/update-abi-registry.jsnu �Iw�� const got = require('got') const path = require('path') const semver = require('semver') const { writeFile } = require('fs').promises async function getJSONFromCDN (urlPath) { const response = await got(`https://cdn.jsdelivr.net/gh/${urlPath}`) return JSON.parse(response.body) } async function fetchElectronReleases () { const response = await got(`https://electronjs.org/headers/index.json`) return JSON.parse(response.body) } async function fetchNodeVersions () { const schedule = await getJSONFromCDN('nodejs/Release/schedule.json') const versions = {} for (const [majorVersion, metadata] of Object.entries(schedule)) { if (majorVersion.startsWith('v0')) { continue } const version = `${majorVersion.slice(1)}.0.0` const lts = metadata.hasOwnProperty('lts') ? [metadata.lts, metadata.maintenance] : false versions[version] = { runtime: 'node', target: version, lts: lts, future: new Date(Date.parse(metadata.start)) > new Date() } } return versions } async function fetchAbiVersions () { return (await getJSONFromCDN('nodejs/node/doc/abi_version_registry.json')) .NODE_MODULE_VERSION .filter(({ modules }) => modules > 66) } function electronReleasesToTargets (releases) { const versions = releases.map(({ version }) => version) const versionsByModules = releases .filter(release => Number(release.modules) >= 70) .map(({ version, modules }) => ({ version, modules, })) .filter(({ version }) => !version.includes('nightly')) .sort((a, b) => Number(a.modules) - Number(b.modules)) .reduce( (acc, { modules, version }) => ({ ...acc, [`${version.split('.')[0]}-${modules}`]: { version, modules, } }), {} ) return Object.entries(versionsByModules) .map( ([major, {version, modules}]) => ({ abi: modules, future: !versions.find( v => { const major = version.split(".")[0] return semver.satisfies( v, /^[0-9]/.test(major) ? `>= ${major}` : major ) } ), lts: false, runtime: 'electron', target: version }) ) } function nodeVersionsToTargets (abiVersions, nodeVersions) { return Object.values( abiVersions .filter(({ runtime }) => runtime === 'node') .reduce( (acc, abiVersion) => { const { version: nodeVersion } = semver.coerce(abiVersion.versions) return { [nodeVersion]: { ...nodeVersions[nodeVersion], abi: abiVersion.modules.toString(), }, ...acc, }; }, {} ) ) } async function main () { const nodeVersions = await fetchNodeVersions() const abiVersions = await fetchAbiVersions() const electronReleases = await fetchElectronReleases() const electronTargets = electronReleasesToTargets(electronReleases) const nodeTargets = nodeVersionsToTargets(abiVersions, nodeVersions) const supportedTargets = [ ...nodeTargets, ...electronTargets, ] await writeFile(path.resolve(__dirname, '..', 'abi_registry.json'), JSON.stringify(supportedTargets, null, 2)) } main() PK �n[Tݹ�f f test/index.jsnu �Iw�� var test = require('tape') var semver = require('semver') var getAbi = require('../index').getAbi var getTarget = require('../index').getTarget var getNextTarget = require('../index')._getNextTarget var allTargets = require('../index').allTargets test('getNextTarget gets the next unsupported target', function (t) { var mockTargets = [ {runtime: 'node', target: '7.0.0', abi: '51', lts: false}, {runtime: 'node', target: '8.0.0', abi: '57', lts: false}, {runtime: 'electron', target: '0.36.0', abi: '47', lts: false}, {runtime: 'electron', target: '1.1.0', abi: '48', lts: false} ] t.equal(getNextTarget('node', mockTargets), '9.0.0') t.equal(getNextTarget('electron', mockTargets), '1.2.0') t.end() }) test('getTarget calculates correct Node target', function (t) { t.equal(getTarget(undefined), process.versions.node) t.equal(getTarget(null), process.versions.node) t.equal(getTarget('11'), '0.10.4') t.equal(getTarget('14'), '0.11.11') t.equal(getTarget('46'), '4.0.0') t.equal(getTarget('47'), '5.0.0') t.equal(getTarget('48'), '6.0.0') t.equal(getTarget('51'), '7.0.0') t.equal(getTarget('67'), '11.0.0') t.equal(getTarget('72'), '12.0.0') t.equal(getTarget('83'), '14.0.0') t.equal(getTarget('88'), '15.0.0') t.end() }) test('getTarget calculates correct Electron target', function (t) { t.throws(getTarget.bind(null, '14', 'electron')) t.equal(getTarget('47', 'electron'), '0.36.0') t.equal(getTarget('48', 'electron'), '1.1.0') t.equal(getTarget('49', 'electron'), '1.3.0') t.equal(getTarget('50', 'electron'), '1.4.0') t.equal(getTarget('76', 'electron'), '8.0.0') t.equal(getTarget('82', 'electron'), '10.0.0') t.end() }) test('getTarget calculates correct Node-Webkit target', function (t) { t.throws(getTarget.bind(null, '14', 'ode-webkit')) t.equal(getTarget('47', 'node-webkit'), '0.13.0') t.equal(getTarget('48', 'node-webkit'), '0.15.0') t.equal(getTarget('51', 'node-webkit'), '0.18.3') t.equal(getTarget('57', 'node-webkit'), '0.23.0') t.equal(getTarget('59', 'node-webkit'), '0.26.5') t.end() }) test('getAbi calculates correct Node ABI', function (t) { t.equal(getAbi(undefined), process.versions.modules) t.equal(getAbi(null), process.versions.modules) t.throws(function () { getAbi('a.b.c') }) t.throws(function () { getAbi(getNextTarget('node')) }) t.equal(getAbi('15.0.0'), '88') t.equal(getAbi('14.0.0'), '83') t.equal(getAbi('13.0.0'), '79') t.equal(getAbi('12.0.0'), '72') t.equal(getAbi('11.0.0'), '67') t.equal(getAbi('7.2.0'), '51') t.equal(getAbi('7.0.0'), '51') t.equal(getAbi('6.9.9'), '48') t.equal(getAbi('6.0.0'), '48') t.equal(getAbi('5.9.9'), '47') t.equal(getAbi('5.0.0'), '47') t.equal(getAbi('4.9.9'), '46') t.equal(getAbi('4.0.0'), '46') t.equal(getAbi('0.12.17'), '14') t.equal(getAbi('0.12.0'), '14') t.equal(getAbi('0.11.16'), '14') t.equal(getAbi('0.11.11'), '14') t.equal(getAbi('0.11.10'), '13') t.equal(getAbi('0.11.8'), '13') t.equal(getAbi('0.11.7'), '0x000C') t.equal(getAbi('0.11.0'), '0x000C') t.equal(getAbi('0.10.48'), '11') t.equal(getAbi('0.10.30'), '11') t.equal(getAbi('0.10.4'), '11') t.equal(getAbi('0.10.3'), '0x000B') t.equal(getAbi('0.10.1'), '0x000B') t.equal(getAbi('0.10.0'), '0x000B') t.equal(getAbi('0.9.12'), '0x000B') t.equal(getAbi('0.9.9'), '0x000B') t.equal(getAbi('0.9.8'), '0x000A') t.equal(getAbi('0.9.1'), '0x000A') t.equal(getAbi('0.9.0'), '1') t.equal(getAbi('0.8.0'), '1') t.equal(getAbi('0.2.0'), '1') t.end() }) test('getAbi calculates correct Electron ABI', function (t) { t.throws(function () { getAbi(undefined, 'electron') }) t.throws(function () { getAbi(getNextTarget('electron'), 'electron') }) t.equal(getAbi('10.0.0-beta.1', 'electron'), '82') t.equal(getAbi('10.0.0', 'electron'), '82') t.equal(getAbi('9.0.0', 'electron'), '80') t.equal(getAbi('8.0.0', 'electron'), '76') t.equal(getAbi('7.0.0', 'electron'), '75') t.equal(getAbi('6.0.0', 'electron'), '73') t.equal(getAbi('5.0.0', 'electron'), '70') t.equal(getAbi('4.1.4', 'electron'), '69') t.equal(getAbi('4.0.4', 'electron'), '69') t.equal(getAbi('4.0.3', 'electron'), '64') t.equal(getAbi('3.1.8', 'electron'), '64') t.equal(getAbi('2.0.18', 'electron'), '57') t.equal(getAbi('1.4.0', 'electron'), '50') t.equal(getAbi('1.3.0', 'electron'), '49') t.equal(getAbi('1.2.0', 'electron'), '48') t.equal(getAbi('1.1.0', 'electron'), '48') t.equal(getAbi('1.0.0', 'electron'), '47') t.equal(getAbi('0.37.0', 'electron'), '47') t.equal(getAbi('0.36.0', 'electron'), '47') t.equal(getAbi('0.35.0', 'electron'), '46') t.equal(getAbi('0.34.0', 'electron'), '46') t.equal(getAbi('0.33.0', 'electron'), '46') t.equal(getAbi('0.32.0', 'electron'), '45') t.equal(getAbi('0.31.0', 'electron'), '45') t.equal(getAbi('0.30.0', 'electron'), '44') t.end() }) test('getAbi calculates correct Node-Webkit ABI', function (t) { t.throws(function () { getAbi(undefined, 'node-webkit') }) t.throws(function () { getAbi(getNextTarget('node-webkit'), 'node-webkit') }) t.equal(getAbi('0.13.0', 'node-webkit'), '47') t.equal(getAbi('0.14.0', 'node-webkit'), '47') t.equal(getAbi('0.15.0', 'node-webkit'), '48') t.equal(getAbi('0.16.0', 'node-webkit'), '48') t.equal(getAbi('0.17.0', 'node-webkit'), '48') t.equal(getAbi('0.18.2', 'node-webkit'), '48') t.equal(getAbi('0.18.3', 'node-webkit'), '51') t.equal(getAbi('0.19.0', 'node-webkit'), '51') t.equal(getAbi('0.20.0', 'node-webkit'), '51') t.equal(getAbi('0.21.0', 'node-webkit'), '51') t.equal(getAbi('0.22.0', 'node-webkit'), '51') t.equal(getAbi('0.23.0', 'node-webkit'), '57') t.equal(getAbi('0.24.0', 'node-webkit'), '57') t.equal(getAbi('0.25.0', 'node-webkit'), '57') t.equal(getAbi('0.26.4', 'node-webkit'), '57') t.equal(getAbi('0.26.5', 'node-webkit'), '59') t.end() }) test('getAbi supports leading v', function (t) { t.equal(getAbi('v7.2.0'), '51') t.end() }) test('getAbi returns abi if passed as target', function (t) { t.equal(getAbi('57'), '57') t.end() }) test('allTargets are sorted', function (t) { var electron = allTargets.filter(function (t) { return t.runtime === 'electron' }) var node = allTargets.filter(function (t) { return t.runtime === 'node' }) var nodeWebkit = allTargets.filter(function (t) { return t.runtime === 'node-webkit' }) function sort (t1, t2) { return semver.compare(t1.target, t2.target) } t.deepEqual(electron, electron.slice().sort(sort), 'electron targets are sorted') t.deepEqual(node, node.slice().sort(sort), 'node targets are sorted') t.deepEqual(nodeWebkit, nodeWebkit.slice().sort(sort), 'node-webkit targets are sorted') t.end() }) PK �n[G�[� � .travis.ymlnu �Iw�� language: node_js cache: directories: - ~/.npm notifications: email: false node_js: - '14' - '12' - '10' - '9' - '8' after_success: - npm run travis-deploy-once "npm run semantic-release" branches: except: - /^v\d+\.\d+\.\d+$/ PK �n[�@�z z CODE_OF_CONDUCT.mdnu �Iw�� # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lukas.geiger94@gmail.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct/ [homepage]: https://www.contributor-covenant.org PK �n[�� �n n CONTRIBUTING.mdnu �Iw�� # Contributing to `node-abi` :+1::tada: First off, thanks for taking the time to contribute to `node-abi`! :tada::+1: ## Commit Message Guidelines This module uses [`semantic-release`](https://github.com/semantic-release/semantic-release) to automatically release new versions via Travis. Therefor we have very precise rules over how our git commit messages can be formatted. Each commit message consists of a **header**, a **body** and a **footer**. The header has a special format that includes a **type**, a **scope** and a **subject** ([full explanation](https://github.com/stevemao/conventional-changelog-angular/blob/master/convention.md)): ``` <type>(<scope>): <subject> <BLANK LINE> <body> <BLANK LINE> <footer> ``` ### Type Must be one of the following: - **feat**: A new feature. **Will trigger a new release** - **fix**: A bug fix or a addition to one of the target arrays. **Will trigger a new release** - **docs**: Documentation only changes - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) - **refactor**: A code change that neither fixes a bug nor adds a feature - **perf**: A code change that improves performance - **test**: Adding missing or correcting existing tests - **chore**: Changes to the build process or auxiliary tools and libraries such as documentation generation ### Patch Release ``` fix(electron): Support Electron 1.8.0 ``` ### ~~Minor~~ Feature Release ``` feat: add .getTarget(abi, runtime) ``` ### ~~Major~~ Breaking Release ``` feat: Add amazing new feature BREAKING CHANGE: This removes support for Node 0.10 and 0.12. ``` PK �n[�*~�- - LICENSEnu �Iw�� MIT License Copyright (c) 2016 Lukas Geiger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK �n[� \� � README.mdnu �Iw�� # Node.js ABI [](https://travis-ci.org/lgeiger/node-abi) [](https://greenkeeper.io/) Get the Node ABI for a given target and runtime, and vice versa. ## Installation ``` npm install node-abi ``` ## Usage ```javascript const nodeAbi = require('node-abi') nodeAbi.getAbi('7.2.0', 'node') // '51' nodeAbi.getAbi('1.4.10', 'electron') // '50' nodeAbi.getTarget('51', 'node') // '7.2.0' nodeAbi.getTarget('50', 'electron') // '1.4.15' nodeAbi.allTargets // [ // { runtime: 'node', target: '0.10.48', abi: '11', lts: false }, // { runtime: 'node', target: '0.12.17', abi: '14', lts: false }, // { runtime: 'node', target: '4.6.1', abi: '46', lts: true }, // { runtime: 'node', target: '5.12.0', abi: '47', lts: false }, // { runtime: 'node', target: '6.9.4', abi: '48', lts: true }, // { runtime: 'node', target: '7.4.0', abi: '51', lts: false }, // { runtime: 'electron', target: '1.0.2', abi: '47', lts: false }, // { runtime: 'electron', target: '1.2.8', abi: '48', lts: false }, // { runtime: 'electron', target: '1.3.13', abi: '49', lts: false }, // { runtime: 'electron', target: '1.4.15', abi: '50', lts: false } // ] nodeAbi.deprecatedTargets nodeAbi.supportedTargets nodeAbi.additionalTargets nodeAbi.futureTargets // ... ``` ## References - https://github.com/lgeiger/electron-abi - https://nodejs.org/en/download/releases/ - https://github.com/nodejs/Release PK �n[V��D D abi_registry.jsonnu �Iw�� [ { "runtime": "node", "target": "11.0.0", "lts": false, "future": false, "abi": "67" }, { "runtime": "node", "target": "12.0.0", "lts": [ "2019-10-21", "2020-11-30" ], "future": false, "abi": "72" }, { "runtime": "node", "target": "13.0.0", "lts": false, "future": false, "abi": "79" }, { "runtime": "node", "target": "14.0.0", "lts": [ "2020-10-27", "2021-10-19" ], "future": false, "abi": "83" }, { "runtime": "node", "target": "15.0.0", "lts": false, "future": false, "abi": "88" }, { "runtime": "node", "target": "16.0.0", "lts": [ "2021-10-26", "2022-10-18" ], "future": false, "abi": "93" }, { "abi": "70", "future": false, "lts": false, "runtime": "electron", "target": "5.0.0-beta.9" }, { "abi": "73", "future": false, "lts": false, "runtime": "electron", "target": "6.0.0-beta.1" }, { "abi": "75", "future": false, "lts": false, "runtime": "electron", "target": "7.0.0-beta.1" }, { "abi": "76", "future": false, "lts": false, "runtime": "electron", "target": "8.0.0-beta.1" }, { "abi": "76", "future": false, "lts": false, "runtime": "electron", "target": "9.0.0-beta.1" }, { "abi": "80", "future": false, "lts": false, "runtime": "electron", "target": "9.0.0-beta.2" }, { "abi": "82", "future": false, "lts": false, "runtime": "electron", "target": "10.0.0-beta.1" }, { "abi": "82", "future": false, "lts": false, "runtime": "electron", "target": "11.0.0-beta.1" }, { "abi": "85", "future": false, "lts": false, "runtime": "electron", "target": "11.0.0-beta.11" }, { "abi": "87", "future": false, "lts": false, "runtime": "electron", "target": "12.0.0-beta.1" }, { "abi": "89", "future": false, "lts": false, "runtime": "electron", "target": "14.0.0-beta.1" }, { "abi": "89", "future": false, "lts": false, "runtime": "electron", "target": "13.0.0-beta.2" }, { "abi": "89", "future": true, "lts": false, "runtime": "electron", "target": "15.0.0-alpha.1" } ]PK �n[���� � index.jsnu �Iw�� var semver = require('semver') function getNextTarget (runtime, targets) { if (targets == null) targets = allTargets var latest = targets.filter(function (t) { return t.runtime === runtime }).slice(-1)[0] var increment = runtime === 'electron' ? 'minor' : 'major' var next = semver.inc(latest.target, increment) // Electron releases appear in the registry in their beta form, sometimes there is // no active beta line. During this time we need to double bump if (runtime === 'electron' && semver.parse(latest.target).prerelease.length) { next = semver.inc(next, 'major') } return next } function getAbi (target, runtime) { if (target === String(Number(target))) return target if (target) target = target.replace(/^v/, '') if (!runtime) runtime = 'node' if (runtime === 'node') { if (!target) return process.versions.modules if (target === process.versions.node) return process.versions.modules } var abi for (var i = 0; i < allTargets.length; i++) { var t = allTargets[i] if (t.runtime !== runtime) continue if (semver.lte(t.target, target)) abi = t.abi else break } if (abi && semver.lt(target, getNextTarget(runtime))) return abi throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '. Updating "node-abi" might help solve this issue if it is a new release of ' + runtime) } function getTarget (abi, runtime) { if (abi && abi !== String(Number(abi))) return abi if (!runtime) runtime = 'node' if (runtime === 'node' && !abi) return process.versions.node var match = allTargets .filter(function (t) { return t.abi === abi && t.runtime === runtime }) .map(function (t) { return t.target }) if (match.length) { var betaSeparatorIndex = match[0].indexOf("-") return betaSeparatorIndex > -1 ? match[0].substring(0, betaSeparatorIndex) : match[0] } throw new Error('Could not detect target for abi ' + abi + ' and runtime ' + runtime) } function sortByTargetFn (a, b) { var abiComp = Number(a.abi) - Number(b.abi) if (abiComp !== 0) return abiComp if (a.target < b.target) return -1 if (a.target > b.target) return 1 return 0 } function loadGeneratedTargets () { var registry = require('./abi_registry.json') var targets = { supported: [], additional: [], future: [] } registry.forEach(function (item) { var target = { runtime: item.runtime, target: item.target, abi: item.abi } if (item.lts) { var startDate = new Date(Date.parse(item.lts[0])) var endDate = new Date(Date.parse(item.lts[1])) var currentDate = new Date() target.lts = startDate < currentDate && currentDate < endDate } else { target.lts = false } if (target.runtime === 'node-webkit') { targets.additional.push(target) } else if (item.future) { targets.future.push(target) } else { targets.supported.push(target) } }) targets.supported.sort(sortByTargetFn) targets.additional.sort(sortByTargetFn) targets.future.sort(sortByTargetFn) return targets } var generatedTargets = loadGeneratedTargets() var supportedTargets = [ {runtime: 'node', target: '5.0.0', abi: '47', lts: false}, {runtime: 'node', target: '6.0.0', abi: '48', lts: false}, {runtime: 'node', target: '7.0.0', abi: '51', lts: false}, {runtime: 'node', target: '8.0.0', abi: '57', lts: false}, {runtime: 'node', target: '9.0.0', abi: '59', lts: false}, {runtime: 'node', target: '10.0.0', abi: '64', lts: new Date(2018, 10, 1) < new Date() && new Date() < new Date(2020, 4, 31)}, {runtime: 'electron', target: '0.36.0', abi: '47', lts: false}, {runtime: 'electron', target: '1.1.0', abi: '48', lts: false}, {runtime: 'electron', target: '1.3.0', abi: '49', lts: false}, {runtime: 'electron', target: '1.4.0', abi: '50', lts: false}, {runtime: 'electron', target: '1.5.0', abi: '51', lts: false}, {runtime: 'electron', target: '1.6.0', abi: '53', lts: false}, {runtime: 'electron', target: '1.7.0', abi: '54', lts: false}, {runtime: 'electron', target: '1.8.0', abi: '57', lts: false}, {runtime: 'electron', target: '2.0.0', abi: '57', lts: false}, {runtime: 'electron', target: '3.0.0', abi: '64', lts: false}, {runtime: 'electron', target: '4.0.0', abi: '64', lts: false}, {runtime: 'electron', target: '4.0.4', abi: '69', lts: false} ] supportedTargets.push.apply(supportedTargets, generatedTargets.supported) var additionalTargets = [ {runtime: 'node-webkit', target: '0.13.0', abi: '47', lts: false}, {runtime: 'node-webkit', target: '0.15.0', abi: '48', lts: false}, {runtime: 'node-webkit', target: '0.18.3', abi: '51', lts: false}, {runtime: 'node-webkit', target: '0.23.0', abi: '57', lts: false}, {runtime: 'node-webkit', target: '0.26.5', abi: '59', lts: false} ] additionalTargets.push.apply(additionalTargets, generatedTargets.additional) var deprecatedTargets = [ {runtime: 'node', target: '0.2.0', abi: '1', lts: false}, {runtime: 'node', target: '0.9.1', abi: '0x000A', lts: false}, {runtime: 'node', target: '0.9.9', abi: '0x000B', lts: false}, {runtime: 'node', target: '0.10.4', abi: '11', lts: false}, {runtime: 'node', target: '0.11.0', abi: '0x000C', lts: false}, {runtime: 'node', target: '0.11.8', abi: '13', lts: false}, {runtime: 'node', target: '0.11.11', abi: '14', lts: false}, {runtime: 'node', target: '1.0.0', abi: '42', lts: false}, {runtime: 'node', target: '1.1.0', abi: '43', lts: false}, {runtime: 'node', target: '2.0.0', abi: '44', lts: false}, {runtime: 'node', target: '3.0.0', abi: '45', lts: false}, {runtime: 'node', target: '4.0.0', abi: '46', lts: false}, {runtime: 'electron', target: '0.30.0', abi: '44', lts: false}, {runtime: 'electron', target: '0.31.0', abi: '45', lts: false}, {runtime: 'electron', target: '0.33.0', abi: '46', lts: false} ] var futureTargets = generatedTargets.future var allTargets = deprecatedTargets .concat(supportedTargets) .concat(additionalTargets) .concat(futureTargets) exports.getAbi = getAbi exports.getTarget = getTarget exports.deprecatedTargets = deprecatedTargets exports.supportedTargets = supportedTargets exports.additionalTargets = additionalTargets exports.futureTargets = futureTargets exports.allTargets = allTargets exports._getNextTarget = getNextTarget PK �n[m�� � package.jsonnu �Iw�� { "_args": [ [ "node-abi@2.30.1", "/home/freeclou/app.optimyar.com/backend" ] ], "_from": "node-abi@2.30.1", "_id": "node-abi@2.30.1", "_inBundle": false, "_integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==", "_location": "/node-abi", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "node-abi@2.30.1", "name": "node-abi", "escapedName": "node-abi", "rawSpec": "2.30.1", "saveSpec": null, "fetchSpec": "2.30.1" }, "_requiredBy": [ "/prebuild-install" ], "_resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz", "_spec": "2.30.1", "_where": "/home/freeclou/app.optimyar.com/backend", "author": { "name": "Lukas Geiger" }, "bugs": { "url": "https://github.com/lgeiger/node-abi/issues" }, "dependencies": { "semver": "^5.4.1" }, "description": "Get the Node ABI for a given target and runtime, and vice versa.", "devDependencies": { "got": "^10.6.0", "semantic-release": "^15.8.0", "tape": "^4.6.3", "travis-deploy-once": "^5.0.1" }, "homepage": "https://github.com/lgeiger/node-abi#readme", "keywords": [ "node", "electron", "node_module_version", "abi", "v8" ], "license": "MIT", "main": "index.js", "name": "node-abi", "repository": { "type": "git", "url": "git+https://github.com/lgeiger/node-abi.git" }, "scripts": { "semantic-release": "semantic-release", "test": "tape test/index.js", "travis-deploy-once": "travis-deploy-once", "update-abi-registry": "node --unhandled-rejections=strict scripts/update-abi-registry.js" }, "version": "2.30.1" } PK �n[x��e .github/workflows/update-abi.ymlnu �Iw�� PK �n[�t9B B m node_modules/semver/bin/semvernu ��̗� PK �n[�j� � � node_modules/semver/CHANGELOG.mdnu �Iw�� PK �n[�aGW� � � node_modules/semver/LICENSEnu �Iw�� PK �n[�A� k= k= 5 node_modules/semver/README.mdnu �Iw�� PK �n[��#�� � �Z node_modules/semver/package.jsonnu �Iw�� PK �n[�o�k k a node_modules/semver/range.bnfnu �Iw�� PK �n[I��$�� �� �c node_modules/semver/semver.jsnu �Iw�� PK �n[���� � �� scripts/update-abi-registry.jsnu �Iw�� PK �n[Tݹ�f f � test/index.jsnu �Iw�� PK �n[G�[� � �# .travis.ymlnu �Iw�� PK �n[�@�z z �$ CODE_OF_CONDUCT.mdnu �Iw�� PK �n[�� �n n �1 CONTRIBUTING.mdnu �Iw�� PK �n[�*~�- - =8 LICENSEnu �Iw�� PK �n[� \� � �< README.mdnu �Iw�� PK �n[V��D D �B abi_registry.jsonnu �Iw�� PK �n[���� � WL index.jsnu �Iw�� PK �n[m�� � �e package.jsonnu �Iw�� PK � �l
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка