@dbmx/confy 0.0.72 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/_virtual/index10.js +2 -2
- package/esm/_virtual/index11.js +2 -2
- package/esm/_virtual/index12.js +2 -2
- package/esm/_virtual/index13.js +2 -2
- package/esm/_virtual/index14.js +2 -2
- package/esm/_virtual/index8.js +2 -2
- package/esm/_virtual/index9.js +2 -2
- package/esm/components/SelectMemberMenu/index.js +1 -1
- package/esm/ducks/utils.js +1 -1
- package/esm/forms/utils.js +2 -2
- package/esm/hooks/roles.js +1 -1
- package/esm/lib/api/apiKeys.js +51 -0
- package/esm/lib/api/apiKeys.js.map +1 -0
- package/esm/lib/api/auth.js +1 -2
- package/esm/lib/api/auth.js.map +1 -1
- package/esm/lib/api/config.js +1 -2
- package/esm/lib/api/config.js.map +1 -1
- package/esm/lib/api/dataBuckets.js +18 -0
- package/esm/lib/api/dataBuckets.js.map +1 -0
- package/esm/lib/api/index.js +1 -2
- package/esm/lib/api/index.js.map +1 -1
- package/esm/lib/api/jobs.js +56 -0
- package/esm/lib/api/jobs.js.map +1 -0
- package/esm/lib/api/members.js +33 -0
- package/esm/lib/api/members.js.map +1 -0
- package/esm/lib/api/people.js +50 -0
- package/esm/lib/api/people.js.map +1 -0
- package/esm/lib/api/roles.js +17 -0
- package/esm/lib/api/roles.js.map +1 -0
- package/esm/lib/api/routes.js +43 -0
- package/esm/lib/api/routes.js.map +1 -0
- package/esm/lib/api/servicesMap.js +17 -0
- package/esm/lib/api/servicesMap.js.map +1 -0
- package/esm/lib/api/spaces.js +32 -0
- package/esm/lib/api/spaces.js.map +1 -0
- package/esm/lib/api/storage.js +94 -0
- package/esm/lib/api/storage.js.map +1 -0
- package/esm/node_modules/@dbmx/auth/dist/index.js +638 -0
- package/esm/node_modules/@dbmx/auth/dist/index.js.map +1 -0
- package/esm/node_modules/@dbmx/auth/dist/oidc-client.js +107 -0
- package/esm/node_modules/@dbmx/auth/dist/oidc-client.js.map +1 -0
- package/esm/node_modules/@dbmx/semver/dist/index.esm.js +958 -0
- package/esm/node_modules/@dbmx/semver/dist/index.esm.js.map +1 -0
- package/esm/node_modules/@dbmx/semver/node_modules/lru-cache/index.js +340 -0
- package/esm/node_modules/@dbmx/semver/node_modules/lru-cache/index.js.map +1 -0
- package/esm/node_modules/@dbmx/semver/node_modules/yallist/iterator.js +18 -0
- package/esm/node_modules/@dbmx/semver/node_modules/yallist/iterator.js.map +1 -0
- package/esm/node_modules/@dbmx/semver/node_modules/yallist/yallist.js +430 -0
- package/esm/node_modules/@dbmx/semver/node_modules/yallist/yallist.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/index.js +251 -0
- package/esm/node_modules/@dbmx/users/esm/index.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/ap.js +44 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/ap.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/bind.js +36 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/bind.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/curry.js +53 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/curry.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/curryN.js +60 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/curryN.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/difference.js +50 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/difference.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/either.js +46 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/either.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/equals.js +37 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/equals.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/flip.js +37 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/flip.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/identity.js +29 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/identity.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/includes.js +32 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/includes.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_Set.js +201 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_Set.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_arity.js +65 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_arity.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_arrayFromIterator.js +13 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_arrayFromIterator.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_concat.js +37 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_concat.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curry1.js +23 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curry1.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curry2.js +35 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curry2.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curry3.js +53 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curry3.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curryN.js +46 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_curryN.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_dispatchable.js +50 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_dispatchable.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_equals.js +170 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_equals.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_filter.js +18 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_filter.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_functionName.js +8 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_functionName.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_has.js +6 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_has.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_identity.js +6 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_identity.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_includes.js +8 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_includes.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_includesWith.js +17 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_includesWith.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_indexOf.js +71 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_indexOf.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isArguments.js +16 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isArguments.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isArray.js +18 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isArray.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isArrayLike.js +58 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isArrayLike.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isFunction.js +7 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isFunction.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isInteger.js +14 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isInteger.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isPlaceholder.js +6 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isPlaceholder.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isString.js +6 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isString.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isTransformer.js +6 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_isTransformer.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_map.js +15 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_map.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_objectIs.js +17 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_objectIs.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_reduce.js +74 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_reduce.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_xfBase.js +11 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_xfBase.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_xmap.js +29 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_xmap.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_xwrap.js +28 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/internal/_xwrap.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/intersection.js +42 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/intersection.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/is.js +34 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/is.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/keys.js +92 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/keys.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/lift.js +34 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/lift.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/liftN.js +35 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/liftN.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/map.js +68 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/map.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/nth.js +39 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/nth.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/or.js +31 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/or.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/path.js +32 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/path.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/paths.js +47 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/paths.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/prop.js +33 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/prop.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/propEq.js +37 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/propEq.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/type.js +36 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/type.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/uniq.js +27 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/uniq.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/uniqBy.js +46 -0
- package/esm/node_modules/@dbmx/users/esm/node_modules/ramda/es/uniqBy.js.map +1 -0
- package/esm/node_modules/@dbmx/users/esm/roles.js +127 -0
- package/esm/node_modules/@dbmx/users/esm/roles.js.map +1 -0
- package/esm/node_modules/@testing-library/dom/node_modules/ansi-styles/index.js +1 -1
- package/esm/node_modules/@testing-library/dom/node_modules/react-is/index.js +1 -1
- package/esm/node_modules/aria-query/lib/index.js +1 -1
- package/esm/node_modules/call-bind/index.js +1 -1
- package/esm/node_modules/call-bind-apply-helpers/actualApply.js +2 -2
- package/esm/node_modules/call-bind-apply-helpers/actualApply.js.map +1 -1
- package/esm/node_modules/call-bind-apply-helpers/applyBind.js +2 -2
- package/esm/node_modules/call-bind-apply-helpers/applyBind.js.map +1 -1
- package/esm/node_modules/call-bind-apply-helpers/index.js +4 -4
- package/esm/node_modules/call-bind-apply-helpers/index.js.map +1 -1
- package/esm/node_modules/define-data-property/index.js +2 -2
- package/esm/node_modules/define-data-property/index.js.map +1 -1
- package/esm/node_modules/es-errors/type.js +3 -12
- package/esm/node_modules/es-errors/type.js.map +1 -1
- package/esm/node_modules/function-bind/implementation.js +93 -84
- package/esm/node_modules/function-bind/implementation.js.map +1 -1
- package/esm/node_modules/function-bind/index.js +13 -4
- package/esm/node_modules/function-bind/index.js.map +1 -1
- package/esm/node_modules/get-intrinsic/index.js +4 -4
- package/esm/node_modules/get-intrinsic/index.js.map +1 -1
- package/esm/node_modules/has-symbols/index.js +2 -2
- package/esm/node_modules/has-symbols/index.js.map +1 -1
- package/esm/node_modules/has-symbols/shams.js +34 -43
- package/esm/node_modules/has-symbols/shams.js.map +1 -1
- package/esm/node_modules/has-tostringtag/shams.js +7 -16
- package/esm/node_modules/has-tostringtag/shams.js.map +1 -1
- package/esm/node_modules/hasown/index.js +2 -2
- package/esm/node_modules/hasown/index.js.map +1 -1
- package/esm/node_modules/is-arguments/index.js +2 -2
- package/esm/node_modules/is-arguments/index.js.map +1 -1
- package/esm/node_modules/is-bigint/index.js +1 -1
- package/esm/node_modules/is-boolean-object/index.js +2 -2
- package/esm/node_modules/is-boolean-object/index.js.map +1 -1
- package/esm/node_modules/is-date-object/index.js +2 -2
- package/esm/node_modules/is-date-object/index.js.map +1 -1
- package/esm/node_modules/is-number-object/index.js +2 -2
- package/esm/node_modules/is-number-object/index.js.map +1 -1
- package/esm/node_modules/is-regex/index.js +2 -2
- package/esm/node_modules/is-regex/index.js.map +1 -1
- package/esm/node_modules/is-string/index.js +2 -2
- package/esm/node_modules/is-string/index.js.map +1 -1
- package/esm/node_modules/is-symbol/index.js +1 -1
- package/esm/node_modules/is-weakset/index.js +1 -1
- package/esm/node_modules/jsrsasign/lib/jsrsasign.js +248 -0
- package/esm/node_modules/jsrsasign/lib/jsrsasign.js.map +1 -0
- package/esm/node_modules/jwt-decode/build/esm/index.js +60 -0
- package/esm/node_modules/jwt-decode/build/esm/index.js.map +1 -0
- package/esm/node_modules/object-inspect/util.inspect.js +2 -2
- package/esm/node_modules/object-inspect/util.inspect.js.map +1 -1
- package/esm/node_modules/object.assign/implementation.js +2 -2
- package/esm/node_modules/object.assign/implementation.js.map +1 -1
- package/esm/node_modules/oidc-client-ts/dist/esm/oidc-client-ts.js +3591 -0
- package/esm/node_modules/oidc-client-ts/dist/esm/oidc-client-ts.js.map +1 -0
- package/esm/node_modules/ramda/es/internal/_objectAssign.js +32 -0
- package/esm/node_modules/ramda/es/internal/_objectAssign.js.map +1 -0
- package/esm/node_modules/ramda/es/merge.js +36 -0
- package/esm/node_modules/ramda/es/merge.js.map +1 -0
- package/esm/node_modules/regexp.prototype.flags/implementation.js +2 -2
- package/esm/node_modules/regexp.prototype.flags/implementation.js.map +1 -1
- package/esm/node_modules/safe-regex-test/index.js +2 -2
- package/esm/node_modules/safe-regex-test/index.js.map +1 -1
- package/esm/node_modules/set-function-length/index.js +2 -2
- package/esm/node_modules/set-function-length/index.js.map +1 -1
- package/esm/node_modules/set-function-name/index.js +2 -2
- package/esm/node_modules/set-function-name/index.js.map +1 -1
- package/esm/node_modules/side-channel/index.js +2 -2
- package/esm/node_modules/side-channel/index.js.map +1 -1
- package/esm/node_modules/side-channel-list/index.js +2 -2
- package/esm/node_modules/side-channel-list/index.js.map +1 -1
- package/esm/node_modules/side-channel-map/index.js +2 -2
- package/esm/node_modules/side-channel-map/index.js.map +1 -1
- package/esm/node_modules/side-channel-weakmap/index.js +2 -2
- package/esm/node_modules/side-channel-weakmap/index.js.map +1 -1
- package/esm/node_modules/which-typed-array/index.js +2 -2
- package/esm/node_modules/which-typed-array/index.js.map +1 -1
- package/esm/store/index.js +6 -5
- package/esm/store/index.js.map +1 -1
- package/esm/utils/authorizations.js +1 -1
- package/esm/utils/confy.js +1 -1
- package/package.json +6 -5
- package/esm/_virtual/browser.js +0 -4
- package/esm/_virtual/browser.js.map +0 -1
- package/esm/_virtual/index15.js +0 -4
- package/esm/_virtual/index15.js.map +0 -1
- package/esm/_virtual/index16.js +0 -4
- package/esm/_virtual/index16.js.map +0 -1
- package/esm/_virtual/index17.js +0 -4
- package/esm/_virtual/index17.js.map +0 -1
- package/esm/_virtual/index18.js +0 -4
- package/esm/_virtual/index18.js.map +0 -1
- package/esm/_virtual/node.js +0 -4
- package/esm/_virtual/node.js.map +0 -1
- package/esm/_virtual/serialOrdered.js +0 -4
- package/esm/_virtual/serialOrdered.js.map +0 -1
- package/esm/node_modules/asynckit/index.js +0 -13
- package/esm/node_modules/asynckit/index.js.map +0 -1
- package/esm/node_modules/asynckit/lib/abort.js +0 -32
- package/esm/node_modules/asynckit/lib/abort.js.map +0 -1
- package/esm/node_modules/asynckit/lib/async.js +0 -39
- package/esm/node_modules/asynckit/lib/async.js.map +0 -1
- package/esm/node_modules/asynckit/lib/defer.js +0 -29
- package/esm/node_modules/asynckit/lib/defer.js.map +0 -1
- package/esm/node_modules/asynckit/lib/iterate.js +0 -81
- package/esm/node_modules/asynckit/lib/iterate.js.map +0 -1
- package/esm/node_modules/asynckit/lib/state.js +0 -40
- package/esm/node_modules/asynckit/lib/state.js.map +0 -1
- package/esm/node_modules/asynckit/lib/terminator.js +0 -35
- package/esm/node_modules/asynckit/lib/terminator.js.map +0 -1
- package/esm/node_modules/asynckit/parallel.js +0 -50
- package/esm/node_modules/asynckit/parallel.js.map +0 -1
- package/esm/node_modules/asynckit/serial.js +0 -22
- package/esm/node_modules/asynckit/serial.js.map +0 -1
- package/esm/node_modules/asynckit/serialOrdered.js +0 -85
- package/esm/node_modules/asynckit/serialOrdered.js.map +0 -1
- package/esm/node_modules/axios/index.js +0 -26
- package/esm/node_modules/axios/index.js.map +0 -1
- package/esm/node_modules/axios/lib/adapters/adapters.js +0 -133
- package/esm/node_modules/axios/lib/adapters/adapters.js.map +0 -1
- package/esm/node_modules/axios/lib/adapters/fetch.js +0 -331
- package/esm/node_modules/axios/lib/adapters/fetch.js.map +0 -1
- package/esm/node_modules/axios/lib/adapters/http.js +0 -945
- package/esm/node_modules/axios/lib/adapters/http.js.map +0 -1
- package/esm/node_modules/axios/lib/adapters/xhr.js +0 -225
- package/esm/node_modules/axios/lib/adapters/xhr.js.map +0 -1
- package/esm/node_modules/axios/lib/axios.js +0 -87
- package/esm/node_modules/axios/lib/axios.js.map +0 -1
- package/esm/node_modules/axios/lib/cancel/CancelToken.js +0 -134
- package/esm/node_modules/axios/lib/cancel/CancelToken.js.map +0 -1
- package/esm/node_modules/axios/lib/cancel/CanceledError.js +0 -21
- package/esm/node_modules/axios/lib/cancel/CanceledError.js.map +0 -1
- package/esm/node_modules/axios/lib/cancel/isCancel.js +0 -6
- package/esm/node_modules/axios/lib/cancel/isCancel.js.map +0 -1
- package/esm/node_modules/axios/lib/core/Axios.js +0 -260
- package/esm/node_modules/axios/lib/core/Axios.js.map +0 -1
- package/esm/node_modules/axios/lib/core/AxiosError.js +0 -89
- package/esm/node_modules/axios/lib/core/AxiosError.js.map +0 -1
- package/esm/node_modules/axios/lib/core/AxiosHeaders.js +0 -343
- package/esm/node_modules/axios/lib/core/AxiosHeaders.js.map +0 -1
- package/esm/node_modules/axios/lib/core/InterceptorManager.js +0 -71
- package/esm/node_modules/axios/lib/core/InterceptorManager.js.map +0 -1
- package/esm/node_modules/axios/lib/core/buildFullPath.js +0 -23
- package/esm/node_modules/axios/lib/core/buildFullPath.js.map +0 -1
- package/esm/node_modules/axios/lib/core/dispatchRequest.js +0 -78
- package/esm/node_modules/axios/lib/core/dispatchRequest.js.map +0 -1
- package/esm/node_modules/axios/lib/core/mergeConfig.js +0 -108
- package/esm/node_modules/axios/lib/core/mergeConfig.js.map +0 -1
- package/esm/node_modules/axios/lib/core/settle.js +0 -32
- package/esm/node_modules/axios/lib/core/settle.js.map +0 -1
- package/esm/node_modules/axios/lib/core/transformData.js +0 -29
- package/esm/node_modules/axios/lib/core/transformData.js.map +0 -1
- package/esm/node_modules/axios/lib/defaults/index.js +0 -171
- package/esm/node_modules/axios/lib/defaults/index.js.map +0 -1
- package/esm/node_modules/axios/lib/defaults/transitional.js +0 -9
- package/esm/node_modules/axios/lib/defaults/transitional.js.map +0 -1
- package/esm/node_modules/axios/lib/env/data.js +0 -4
- package/esm/node_modules/axios/lib/env/data.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -155
- package/esm/node_modules/axios/lib/helpers/AxiosTransformStream.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -61
- package/esm/node_modules/axios/lib/helpers/AxiosURLSearchParams.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -78
- package/esm/node_modules/axios/lib/helpers/HttpStatusCode.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -28
- package/esm/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/bind.js +0 -15
- package/esm/node_modules/axios/lib/helpers/bind.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/buildURL.js +0 -67
- package/esm/node_modules/axios/lib/helpers/buildURL.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/callbackify.js +0 -19
- package/esm/node_modules/axios/lib/helpers/callbackify.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/combineURLs.js +0 -16
- package/esm/node_modules/axios/lib/helpers/combineURLs.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/composeSignals.js +0 -57
- package/esm/node_modules/axios/lib/helpers/composeSignals.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/cookies.js +0 -51
- package/esm/node_modules/axios/lib/helpers/cookies.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +0 -76
- package/esm/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/formDataToJSON.js +0 -94
- package/esm/node_modules/axios/lib/helpers/formDataToJSON.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/formDataToStream.js +0 -119
- package/esm/node_modules/axios/lib/helpers/formDataToStream.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/fromDataURI.js +0 -54
- package/esm/node_modules/axios/lib/helpers/fromDataURI.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -20
- package/esm/node_modules/axios/lib/helpers/isAbsoluteURL.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/isAxiosError.js +0 -15
- package/esm/node_modules/axios/lib/helpers/isAxiosError.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -19
- package/esm/node_modules/axios/lib/helpers/isURLSameOrigin.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/parseHeaders.js +0 -70
- package/esm/node_modules/axios/lib/helpers/parseHeaders.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/parseProtocol.js +0 -7
- package/esm/node_modules/axios/lib/helpers/parseProtocol.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/progressEventReducer.js +0 -54
- package/esm/node_modules/axios/lib/helpers/progressEventReducer.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/readBlob.js +0 -16
- package/esm/node_modules/axios/lib/helpers/readBlob.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/resolveConfig.js +0 -73
- package/esm/node_modules/axios/lib/helpers/resolveConfig.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/speedometer.js +0 -54
- package/esm/node_modules/axios/lib/helpers/speedometer.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/spread.js +0 -29
- package/esm/node_modules/axios/lib/helpers/spread.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/throttle.js +0 -45
- package/esm/node_modules/axios/lib/helpers/throttle.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/toFormData.js +0 -239
- package/esm/node_modules/axios/lib/helpers/toFormData.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -20
- package/esm/node_modules/axios/lib/helpers/toURLEncodedForm.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/trackStream.js +0 -92
- package/esm/node_modules/axios/lib/helpers/trackStream.js.map +0 -1
- package/esm/node_modules/axios/lib/helpers/validator.js +0 -111
- package/esm/node_modules/axios/lib/helpers/validator.js.map +0 -1
- package/esm/node_modules/axios/lib/platform/common/utils.js +0 -47
- package/esm/node_modules/axios/lib/platform/common/utils.js.map +0 -1
- package/esm/node_modules/axios/lib/platform/index.js +0 -10
- package/esm/node_modules/axios/lib/platform/index.js.map +0 -1
- package/esm/node_modules/axios/lib/platform/node/classes/FormData.js +0 -6
- package/esm/node_modules/axios/lib/platform/node/classes/FormData.js.map +0 -1
- package/esm/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -6
- package/esm/node_modules/axios/lib/platform/node/classes/URLSearchParams.js.map +0 -1
- package/esm/node_modules/axios/lib/platform/node/index.js +0 -40
- package/esm/node_modules/axios/lib/platform/node/index.js.map +0 -1
- package/esm/node_modules/axios/lib/utils.js +0 -920
- package/esm/node_modules/axios/lib/utils.js.map +0 -1
- package/esm/node_modules/call-bind-apply-helpers/node_modules/function-bind/implementation.js +0 -66
- package/esm/node_modules/call-bind-apply-helpers/node_modules/function-bind/implementation.js.map +0 -1
- package/esm/node_modules/call-bind-apply-helpers/node_modules/function-bind/index.js +0 -7
- package/esm/node_modules/call-bind-apply-helpers/node_modules/function-bind/index.js.map +0 -1
- package/esm/node_modules/combined-stream/lib/combined_stream.js +0 -215
- package/esm/node_modules/combined-stream/lib/combined_stream.js.map +0 -1
- package/esm/node_modules/debug/src/browser.js +0 -287
- package/esm/node_modules/debug/src/browser.js.map +0 -1
- package/esm/node_modules/debug/src/common.js +0 -304
- package/esm/node_modules/debug/src/common.js.map +0 -1
- package/esm/node_modules/debug/src/index.js +0 -24
- package/esm/node_modules/debug/src/index.js.map +0 -1
- package/esm/node_modules/debug/src/node.js +0 -281
- package/esm/node_modules/debug/src/node.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/has-symbols/index.js +0 -22
- package/esm/node_modules/deep-equal/node_modules/has-symbols/index.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/has-symbols/shams.js +0 -58
- package/esm/node_modules/deep-equal/node_modules/has-symbols/shams.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/has-tostringtag/shams.js +0 -9
- package/esm/node_modules/deep-equal/node_modules/has-tostringtag/shams.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/is-regex/index.js +0 -53
- package/esm/node_modules/deep-equal/node_modules/is-regex/index.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/is-regex/node_modules/call-bind/callBound.js +0 -16
- package/esm/node_modules/deep-equal/node_modules/is-regex/node_modules/call-bind/callBound.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/is-regex/node_modules/call-bind/index.js +0 -53
- package/esm/node_modules/deep-equal/node_modules/is-regex/node_modules/call-bind/index.js.map +0 -1
- package/esm/node_modules/deep-equal/node_modules/is-regex/node_modules/get-intrinsic/index.js +0 -307
- package/esm/node_modules/deep-equal/node_modules/is-regex/node_modules/get-intrinsic/index.js.map +0 -1
- package/esm/node_modules/delayed-stream/lib/delayed_stream.js +0 -113
- package/esm/node_modules/delayed-stream/lib/delayed_stream.js.map +0 -1
- package/esm/node_modules/es-set-tostringtag/index.js +0 -41
- package/esm/node_modules/es-set-tostringtag/index.js.map +0 -1
- package/esm/node_modules/follow-redirects/debug.js +0 -20
- package/esm/node_modules/follow-redirects/debug.js.map +0 -1
- package/esm/node_modules/follow-redirects/index.js +0 -701
- package/esm/node_modules/follow-redirects/index.js.map +0 -1
- package/esm/node_modules/form-data/lib/form_data.js +0 -514
- package/esm/node_modules/form-data/lib/form_data.js.map +0 -1
- package/esm/node_modules/form-data/lib/populate.js +0 -11
- package/esm/node_modules/form-data/lib/populate.js.map +0 -1
- package/esm/node_modules/get-intrinsic/node_modules/function-bind/implementation.js +0 -75
- package/esm/node_modules/get-intrinsic/node_modules/function-bind/implementation.js.map +0 -1
- package/esm/node_modules/get-intrinsic/node_modules/function-bind/index.js +0 -16
- package/esm/node_modules/get-intrinsic/node_modules/function-bind/index.js.map +0 -1
- package/esm/node_modules/has/src/index.js +0 -7
- package/esm/node_modules/has/src/index.js.map +0 -1
- package/esm/node_modules/has-flag/index.js +0 -18
- package/esm/node_modules/has-flag/index.js.map +0 -1
- package/esm/node_modules/hasown/node_modules/function-bind/implementation.js +0 -75
- package/esm/node_modules/hasown/node_modules/function-bind/implementation.js.map +0 -1
- package/esm/node_modules/hasown/node_modules/function-bind/index.js +0 -16
- package/esm/node_modules/hasown/node_modules/function-bind/index.js.map +0 -1
- package/esm/node_modules/is-boolean-object/node_modules/call-bind/callBound.js +0 -16
- package/esm/node_modules/is-boolean-object/node_modules/call-bind/callBound.js.map +0 -1
- package/esm/node_modules/is-boolean-object/node_modules/call-bind/index.js +0 -53
- package/esm/node_modules/is-boolean-object/node_modules/call-bind/index.js.map +0 -1
- package/esm/node_modules/is-boolean-object/node_modules/get-intrinsic/index.js +0 -307
- package/esm/node_modules/is-boolean-object/node_modules/get-intrinsic/index.js.map +0 -1
- package/esm/node_modules/is-boolean-object/node_modules/has-symbols/index.js +0 -22
- package/esm/node_modules/is-boolean-object/node_modules/has-symbols/index.js.map +0 -1
- package/esm/node_modules/is-boolean-object/node_modules/has-symbols/shams.js +0 -67
- package/esm/node_modules/is-boolean-object/node_modules/has-symbols/shams.js.map +0 -1
- package/esm/node_modules/is-boolean-object/node_modules/has-tostringtag/shams.js +0 -18
- package/esm/node_modules/is-boolean-object/node_modules/has-tostringtag/shams.js.map +0 -1
- package/esm/node_modules/is-number-object/node_modules/has-symbols/shams.js +0 -58
- package/esm/node_modules/is-number-object/node_modules/has-symbols/shams.js.map +0 -1
- package/esm/node_modules/is-number-object/node_modules/has-tostringtag/shams.js +0 -9
- package/esm/node_modules/is-number-object/node_modules/has-tostringtag/shams.js.map +0 -1
- package/esm/node_modules/is-string/node_modules/has-symbols/shams.js +0 -58
- package/esm/node_modules/is-string/node_modules/has-symbols/shams.js.map +0 -1
- package/esm/node_modules/is-string/node_modules/has-tostringtag/shams.js +0 -9
- package/esm/node_modules/is-string/node_modules/has-tostringtag/shams.js.map +0 -1
- package/esm/node_modules/is-symbol/node_modules/has-symbols/index.js +0 -22
- package/esm/node_modules/is-symbol/node_modules/has-symbols/index.js.map +0 -1
- package/esm/node_modules/is-symbol/node_modules/has-symbols/shams.js +0 -58
- package/esm/node_modules/is-symbol/node_modules/has-symbols/shams.js.map +0 -1
- package/esm/node_modules/mime-db/db.json.js +0 -10705
- package/esm/node_modules/mime-db/db.json.js.map +0 -1
- package/esm/node_modules/mime-db/index.js +0 -17
- package/esm/node_modules/mime-db/index.js.map +0 -1
- package/esm/node_modules/mime-types/index.js +0 -194
- package/esm/node_modules/mime-types/index.js.map +0 -1
- package/esm/node_modules/ms/index.js +0 -173
- package/esm/node_modules/ms/index.js.map +0 -1
- package/esm/node_modules/proxy-from-env/index.js +0 -112
- package/esm/node_modules/proxy-from-env/index.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/call-bind/callBound.js +0 -16
- package/esm/node_modules/side-channel/node_modules/call-bind/callBound.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/call-bind/index.js +0 -53
- package/esm/node_modules/side-channel/node_modules/call-bind/index.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/get-intrinsic/index.js +0 -307
- package/esm/node_modules/side-channel/node_modules/get-intrinsic/index.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/has-symbols/index.js +0 -22
- package/esm/node_modules/side-channel/node_modules/has-symbols/index.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/has-symbols/shams.js +0 -58
- package/esm/node_modules/side-channel/node_modules/has-symbols/shams.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/object-inspect/index.js +0 -469
- package/esm/node_modules/side-channel/node_modules/object-inspect/index.js.map +0 -1
- package/esm/node_modules/side-channel/node_modules/object-inspect/util.inspect.js +0 -6
- package/esm/node_modules/side-channel/node_modules/object-inspect/util.inspect.js.map +0 -1
- package/esm/node_modules/supports-color/index.js +0 -149
- package/esm/node_modules/supports-color/index.js.map +0 -1
|
@@ -0,0 +1,958 @@
|
|
|
1
|
+
import LRU from '../node_modules/lru-cache/index.js';
|
|
2
|
+
|
|
3
|
+
const MAX_LENGTH = 256;
|
|
4
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
5
|
+
|
|
6
|
+
const numeric = /^[0-9]+$/;
|
|
7
|
+
|
|
8
|
+
const compareIdentifiers = (a, b) => {
|
|
9
|
+
const anum = numeric.test(a);
|
|
10
|
+
const bnum = numeric.test(b);
|
|
11
|
+
|
|
12
|
+
if (anum && bnum) {
|
|
13
|
+
a = +a;
|
|
14
|
+
b = +b;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return a === b ? 0
|
|
18
|
+
: (anum && !bnum) ? -1
|
|
19
|
+
: (bnum && !anum) ? 1
|
|
20
|
+
: a < b ? -1
|
|
21
|
+
: 1
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class SemVerError extends Error {
|
|
25
|
+
constructor(message) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = this.constructor.name;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const re = [];
|
|
32
|
+
const src = [];
|
|
33
|
+
const t = {};
|
|
34
|
+
let R = 0;
|
|
35
|
+
|
|
36
|
+
const createToken = (name, value, isGlobal) => {
|
|
37
|
+
const index = R++;
|
|
38
|
+
t[name] = index;
|
|
39
|
+
src[index] = value;
|
|
40
|
+
re[index] = new RegExp(value, undefined);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// The following Regular Expressions can be used for tokenizing,
|
|
44
|
+
// validating, and parsing SemVer version strings.
|
|
45
|
+
|
|
46
|
+
// ## Numeric Identifier
|
|
47
|
+
// A single `0`, or a non-zero digit followed by zero or more digits.
|
|
48
|
+
|
|
49
|
+
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
|
|
50
|
+
|
|
51
|
+
// ## Non-numeric Identifier
|
|
52
|
+
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
|
53
|
+
// more letters, digits, or hyphens.
|
|
54
|
+
|
|
55
|
+
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
|
|
56
|
+
|
|
57
|
+
// ## Main Version
|
|
58
|
+
// Three dot-separated numeric identifiers.
|
|
59
|
+
|
|
60
|
+
createToken(
|
|
61
|
+
'MAINVERSION',
|
|
62
|
+
`(${src[t.NUMERICIDENTIFIER]})\\.` + `(${src[t.NUMERICIDENTIFIER]})(?:\\.` + `(${src[t.NUMERICIDENTIFIER]}))?`,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
// ## Pre-release Version Identifier
|
|
66
|
+
// A numeric identifier, or a non-numeric identifier.
|
|
67
|
+
|
|
68
|
+
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
69
|
+
|
|
70
|
+
// ## Pre-release Version
|
|
71
|
+
// Hyphen, followed by one or more dot-separated pre-release version
|
|
72
|
+
// identifiers.
|
|
73
|
+
|
|
74
|
+
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
75
|
+
|
|
76
|
+
// ## Build Metadata Identifier
|
|
77
|
+
// Any combination of digits, letters, or hyphens.
|
|
78
|
+
|
|
79
|
+
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
|
|
80
|
+
|
|
81
|
+
// ## Build Metadata
|
|
82
|
+
// Plus sign, followed by one or more period-separated build metadata
|
|
83
|
+
// identifiers.
|
|
84
|
+
|
|
85
|
+
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
86
|
+
|
|
87
|
+
// ## Full Version String
|
|
88
|
+
// A main version, followed optionally by a pre-release version and
|
|
89
|
+
// build metadata.
|
|
90
|
+
|
|
91
|
+
// Note that the only major, minor, patch, and pre-release sections of
|
|
92
|
+
// the version string are capturing groups. The build metadata is not a
|
|
93
|
+
// capturing group, because it should not ever be used in version
|
|
94
|
+
// comparison.
|
|
95
|
+
|
|
96
|
+
createToken('FULLPLAIN', `${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
97
|
+
|
|
98
|
+
createToken('FULL', `^${src[t.FULLPLAIN]}$`);
|
|
99
|
+
|
|
100
|
+
createToken('GTLT', '((?:<|>)?=?)');
|
|
101
|
+
|
|
102
|
+
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
|
103
|
+
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Represents a Semantic Version (SemVer) object
|
|
107
|
+
*
|
|
108
|
+
* @function SemVer
|
|
109
|
+
* @tag semver
|
|
110
|
+
* @param {string} - Version to parse
|
|
111
|
+
* @throws {SemVerError} - Throws an error if the provided version is invalid
|
|
112
|
+
* @example
|
|
113
|
+
*
|
|
114
|
+
* expect(SemVer('1.0').parts()).toEqual(2)
|
|
115
|
+
* expect(SemVer('1.0.1').parts()).toEqual(3)
|
|
116
|
+
* expect(SemVer('1.0.1-draft').parts()).toEqual(4)
|
|
117
|
+
* expect(SemVer('1.0').isNonVersioned()).toBeTruthy()
|
|
118
|
+
* expect(SemVer('1.0.1').isNonVersioned()).toBeFalsy()
|
|
119
|
+
*
|
|
120
|
+
* expect(SemVer('1.0').is2Parts()).toBeTruthy()
|
|
121
|
+
* expect(SemVer('1.0').patch).toEqual(null)
|
|
122
|
+
* expect(SemVer('1.0.0').patch).toEqual(0)
|
|
123
|
+
* expect(SemVer('1.0.0').is2Parts()).toBeFalsy()
|
|
124
|
+
* expect(SemVer('1.0.0-draft.1').extension).toEqual('draft.1')
|
|
125
|
+
* expect(() => SemVer('1.0-draft.1')).toThrow(/Invalid version/)
|
|
126
|
+
*
|
|
127
|
+
* expect(SemVer('1.0').isStable()).toBeFalsy()
|
|
128
|
+
* expect(SemVer('0.1.2').isStable()).toBeFalsy()
|
|
129
|
+
* expect(SemVer('3.1.2-draft').isStable()).toBeFalsy()
|
|
130
|
+
* expect(SemVer('3.1.2').isStable()).toBeTruthy()
|
|
131
|
+
*
|
|
132
|
+
* expect(SemVer('1.0').compare('1.0')).toEqual(0)
|
|
133
|
+
* expect(SemVer('1.1').compare('1.0')).toEqual(1)
|
|
134
|
+
* expect(SemVer('1.0').compare('1.0.0')).toEqual(-1)
|
|
135
|
+
* expect(SemVer('1.0.0-draft').compare('1.0')).toEqual(1)
|
|
136
|
+
* expect(SemVer('1.2.1').compare('1.2.1')).toEqual(0)
|
|
137
|
+
* expect(SemVer('1.2.2').compare('1.2.1')).toEqual(1)
|
|
138
|
+
* expect(SemVer('1.2.2').compare('1.2.2-draft')).toEqual(1)
|
|
139
|
+
* expect(SemVer('1.2.2-draft').compare('1.2.2-draft.1')).toEqual(-1)
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
class SemVer {
|
|
144
|
+
constructor(version) {
|
|
145
|
+
if (version instanceof SemVer) {
|
|
146
|
+
version = version.version;
|
|
147
|
+
} else if (typeof version !== 'string') {
|
|
148
|
+
throw new SemVerError(`Invalid Version: ${JSON.stringify(version, null, 4)}`)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (version.length > MAX_LENGTH) {
|
|
152
|
+
throw new SemVerError(`version is longer than ${MAX_LENGTH} characters`)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const m = version.trim().match(re[t.FULL]);
|
|
156
|
+
|
|
157
|
+
if (!m) {
|
|
158
|
+
throw new SemVerError(`Invalid Version: ${version}`)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// these are actually numbers
|
|
162
|
+
this.major = +m[1];
|
|
163
|
+
this.minor = +m[2];
|
|
164
|
+
this.patch = m[3] ? +m[3] : null;
|
|
165
|
+
|
|
166
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
167
|
+
throw new SemVerError('Invalid major version')
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
171
|
+
throw new SemVerError('Invalid minor version')
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
175
|
+
throw new SemVerError('Invalid patch version')
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
this.extension = m[4] || null;
|
|
179
|
+
|
|
180
|
+
if (this.patch === null && this.extension) {
|
|
181
|
+
throw new SemVerError('Invalid version')
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
this.format();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
is2Parts() {
|
|
188
|
+
return this.patch === null
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
parts() {
|
|
192
|
+
return this.extension === null ? (this.patch === null ? 2 : 3) : 4
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
isNonVersioned() {
|
|
196
|
+
return this.parts() === 2
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
isStable() {
|
|
200
|
+
return !this.extension && this.major > 0 && !this.is2Parts()
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
format() {
|
|
204
|
+
this.version = this.is2Parts() ? `${this.major}.${this.minor}` : `${this.major}.${this.minor}.${this.patch}`;
|
|
205
|
+
if (this.extension) this.version += `-${this.extension}`;
|
|
206
|
+
return this.version
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
toString() {
|
|
210
|
+
return this.version
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
compare(other) {
|
|
214
|
+
if (!(other instanceof SemVer)) {
|
|
215
|
+
if (typeof other === 'string' && other === this.version) {
|
|
216
|
+
return 0
|
|
217
|
+
}
|
|
218
|
+
other = new SemVer(other);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (other.version === this.version) {
|
|
222
|
+
return 0
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return this.compareMain(other) || this.comparePre(other)
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
compareMain(other) {
|
|
229
|
+
if (!(other instanceof SemVer)) {
|
|
230
|
+
other = new SemVer(other);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
compareIdentifiers(this.major, other.major) ||
|
|
235
|
+
compareIdentifiers(this.minor, other.minor) ||
|
|
236
|
+
this.comparePatch(other)
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
comparePatch(other) {
|
|
241
|
+
if (this.patch === other.patch) return 0
|
|
242
|
+
// if (this.is2Parts() && other.patch === 0) return 0
|
|
243
|
+
if (this.is2Parts()) return -1
|
|
244
|
+
if (other.is2Parts()) return 1
|
|
245
|
+
return compareIdentifiers(this.patch, other.patch)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
comparePre(other) {
|
|
249
|
+
if (!(other instanceof SemVer)) {
|
|
250
|
+
other = new SemVer(other);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// NOT having a extension is > having one
|
|
254
|
+
if (this.extension && !other.extension) {
|
|
255
|
+
return -1
|
|
256
|
+
} else if (!this.extension && other.extension) {
|
|
257
|
+
return 1
|
|
258
|
+
} else if (!this.extension && !other.extension) {
|
|
259
|
+
return 0
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
let i = 0;
|
|
263
|
+
do {
|
|
264
|
+
const a = this.extension[i];
|
|
265
|
+
const b = other.extension[i];
|
|
266
|
+
if (a === undefined && b === undefined) {
|
|
267
|
+
return 0
|
|
268
|
+
} else if (b === undefined) {
|
|
269
|
+
return 1
|
|
270
|
+
} else if (a === undefined) {
|
|
271
|
+
return -1
|
|
272
|
+
} else if (a === b) {
|
|
273
|
+
continue
|
|
274
|
+
} else {
|
|
275
|
+
return compareIdentifiers(a, b)
|
|
276
|
+
}
|
|
277
|
+
} while (++i)
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
var SemVer$1 = version => new SemVer(version);
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Compares two version strings or SemVer instances
|
|
285
|
+
*
|
|
286
|
+
* @function compare
|
|
287
|
+
* @tag core
|
|
288
|
+
* @param {string|SemVer} - First version string or SemVer instance (a)
|
|
289
|
+
* @param {string|SemVer} - Second version string or SemVer instance (b)
|
|
290
|
+
* @return {number} - Returns 0 if versions are equal, 1 if `a` is greater than `b`, and -1 if `a` is less than `b`
|
|
291
|
+
* @example
|
|
292
|
+
*
|
|
293
|
+
* compare('1.0.0', '1.2.0'); // -1
|
|
294
|
+
* compare('1.2.0', '1.2.0'); // 0
|
|
295
|
+
* compare('2.0.0', '1.2.0'); // 1
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
const compare = (a, b) => SemVer$1(a).compare(SemVer$1(b));
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Checks if two version strings or SemVer instances are equal
|
|
302
|
+
*
|
|
303
|
+
* @function eq
|
|
304
|
+
* @tag core
|
|
305
|
+
* @param {string|SemVer} - First version string or SemVer instance
|
|
306
|
+
* @param {string|SemVer} - Second version string or SemVer instance
|
|
307
|
+
* @return {boolean} - Returns true if the versions are equal, otherwise false
|
|
308
|
+
* @example
|
|
309
|
+
*
|
|
310
|
+
* eq('1.0.0', '1.0.0'); // true
|
|
311
|
+
* eq('1.0.0', '1.2.0'); // false
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
const eq = (a, b) => compare(a, b) === 0;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Checks if two version strings or SemVer instances are not equal
|
|
318
|
+
*
|
|
319
|
+
* @function neq
|
|
320
|
+
* @tag core
|
|
321
|
+
* @param {string|SemVer} - First version string or SemVer instance
|
|
322
|
+
* @param {string|SemVer} - Second version string or SemVer instance
|
|
323
|
+
* @return {boolean} - Returns true if the versions are not equal, otherwise false
|
|
324
|
+
* @example
|
|
325
|
+
*
|
|
326
|
+
* neq('1.0.0', '1.0.0'); // false
|
|
327
|
+
* neq('1.0.0', '1.2.0'); // true
|
|
328
|
+
*/
|
|
329
|
+
|
|
330
|
+
const neq = (a, b) => compare(a, b) !== 0;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Checks if the first version string or SemVer instance is greater than the second
|
|
334
|
+
*
|
|
335
|
+
* @function gt
|
|
336
|
+
* @tag core
|
|
337
|
+
* @param {string|SemVer} - First version string or SemVer instance (a)
|
|
338
|
+
* @param {string|SemVer} - Second version string or SemVer instance (b)
|
|
339
|
+
* @return {boolean} - Returns true if `a` is greater than `b`, otherwise false
|
|
340
|
+
* @example
|
|
341
|
+
*
|
|
342
|
+
* gt('1.2.0', '1.0.0'); // true
|
|
343
|
+
* gt('1.0.0', '1.2.0'); // false
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
const gt = (a, b) => compare(a, b) > 0;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Checks if the first version string or SemVer instance is greater than or equal to the second
|
|
350
|
+
*
|
|
351
|
+
* @function gte
|
|
352
|
+
* @tag core
|
|
353
|
+
* @param {string|SemVer} - First version string or SemVer instance (a)
|
|
354
|
+
* @param {string|SemVer} - Second version string or SemVer instance (b)
|
|
355
|
+
* @return {boolean} - Returns true if `a` is greater than or equal `b`, otherwise false
|
|
356
|
+
* @example
|
|
357
|
+
*
|
|
358
|
+
* gte('1.2.0', '1.0.0'); // true
|
|
359
|
+
* gte('1.0.0', '1.2.0'); // false
|
|
360
|
+
* gte('1.2.0', '1.2.0'); // true
|
|
361
|
+
*/
|
|
362
|
+
|
|
363
|
+
const gte = (a, b) => compare(a, b) >= 0;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Checks if the first version string or SemVer instance is less than the second
|
|
367
|
+
*
|
|
368
|
+
* @function lt
|
|
369
|
+
* @tag core
|
|
370
|
+
* @param {string|SemVer} - First version string or SemVer instance (a)
|
|
371
|
+
* @param {string|SemVer} - Second version string or SemVer instance (b)
|
|
372
|
+
* @return {boolean} - Returns true if `a` is less than `b`, otherwise false
|
|
373
|
+
* @example
|
|
374
|
+
*
|
|
375
|
+
* lt('1.0.0', '1.2.0'); // true
|
|
376
|
+
* lt('1.2.0', '1.0.0'); // false
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
const lt = (a, b) => compare(a, b) < 0;
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Checks if the first version string or SemVer instance is less than or equal to the second
|
|
383
|
+
*
|
|
384
|
+
* @function lte
|
|
385
|
+
* @tag core
|
|
386
|
+
* @param {string|SemVer} - First version string or SemVer instance (a)
|
|
387
|
+
* @param {string|SemVer} - Second version string or SemVer instance (b)
|
|
388
|
+
* @return {boolean} - Returns true if `a` is less than or equal than `b`, otherwise false
|
|
389
|
+
* @example
|
|
390
|
+
*
|
|
391
|
+
* lte('1.0.0', '1.2.0'); // true
|
|
392
|
+
* lte('1.2.0', '1.0.0'); // false
|
|
393
|
+
* lte('1.2.0', '1.2.0'); // true
|
|
394
|
+
*/
|
|
395
|
+
|
|
396
|
+
const lte = (a, b) => compare(a, b) <= 0;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Performs comparison operations between version strings or SemVer instances
|
|
400
|
+
*
|
|
401
|
+
* @function cmp
|
|
402
|
+
* @tag core
|
|
403
|
+
* @param {string|SemVer} - First version string or SemVer instance
|
|
404
|
+
* @param {string} - Comparison operator ('===', '!==', '=', '==', '!=', '>', '>=', '<', '<=')
|
|
405
|
+
* @param {string|SemVer} - Second version string or SemVer instance
|
|
406
|
+
* @return {boolean} - Returns true if the comparison operation is true, otherwise false.
|
|
407
|
+
* @throws {SemVerError} - Throws an error if the comparison operator is invalid.
|
|
408
|
+
* @example
|
|
409
|
+
*
|
|
410
|
+
* cmp('1.0.0', '===', '1.0.0'); // true
|
|
411
|
+
* cmp('1.0.0', '!=', '1.0.1'); // true
|
|
412
|
+
* cmp('1.2.0', '>', '1.0.0'); // true
|
|
413
|
+
*/
|
|
414
|
+
|
|
415
|
+
var cmp = (a, op, b) => {
|
|
416
|
+
switch (op) {
|
|
417
|
+
case '===':
|
|
418
|
+
if (typeof a === 'object') a = a.version;
|
|
419
|
+
if (typeof b === 'object') b = b.version;
|
|
420
|
+
return a === b
|
|
421
|
+
|
|
422
|
+
case '!==':
|
|
423
|
+
if (typeof a === 'object') a = a.version;
|
|
424
|
+
if (typeof b === 'object') b = b.version;
|
|
425
|
+
return a !== b
|
|
426
|
+
|
|
427
|
+
case '':
|
|
428
|
+
case '=':
|
|
429
|
+
case '==':
|
|
430
|
+
return eq(a, b)
|
|
431
|
+
|
|
432
|
+
case '!=':
|
|
433
|
+
return neq(a, b)
|
|
434
|
+
|
|
435
|
+
case '>':
|
|
436
|
+
return gt(a, b)
|
|
437
|
+
|
|
438
|
+
case '>=':
|
|
439
|
+
return gte(a, b)
|
|
440
|
+
|
|
441
|
+
case '<':
|
|
442
|
+
return lt(a, b)
|
|
443
|
+
|
|
444
|
+
case '<=':
|
|
445
|
+
return lte(a, b)
|
|
446
|
+
|
|
447
|
+
default:
|
|
448
|
+
throw new SemVerError(`Invalid operator: ${op}`)
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
const ANY = Symbol('SemVer ANY');
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Represents a comparator object used for version comparison
|
|
456
|
+
*
|
|
457
|
+
* @function Comparator
|
|
458
|
+
* @param {string|Comparator} - Comparator string or another Comparator object
|
|
459
|
+
* @throw {SemVerError} - Throws an error if the provided comparator is invalid
|
|
460
|
+
* @example
|
|
461
|
+
*
|
|
462
|
+
* Comparator('> 1.2.3')
|
|
463
|
+
* Comparator('<= 1.2')
|
|
464
|
+
* Comparator('= 1.21.3-draft')
|
|
465
|
+
* Comparator('1.21.3-draft')
|
|
466
|
+
*
|
|
467
|
+
*/
|
|
468
|
+
|
|
469
|
+
class Comparator {
|
|
470
|
+
static get ANY() {
|
|
471
|
+
return ANY
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
constructor(comp) {
|
|
475
|
+
if (comp instanceof Comparator) {
|
|
476
|
+
comp = comp.value;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
this.parse(comp);
|
|
480
|
+
|
|
481
|
+
if (this.semver === ANY) {
|
|
482
|
+
this.value = '';
|
|
483
|
+
} else {
|
|
484
|
+
this.value = this.operator + this.semver.version;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
parse(comp) {
|
|
489
|
+
const r = re[t.COMPARATOR];
|
|
490
|
+
const m = comp.match(r);
|
|
491
|
+
|
|
492
|
+
if (!m) {
|
|
493
|
+
throw new SemVerError(`Invalid comparator: ${comp}`)
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
this.operator = m[1] !== undefined ? m[1] : '';
|
|
497
|
+
if (this.operator === '=') {
|
|
498
|
+
this.operator = '';
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
this.semver = SemVer$1(m[2]);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
toString() {
|
|
505
|
+
return this.value
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
test(version) {
|
|
509
|
+
// if (this.semver === ANY || version === ANY) {
|
|
510
|
+
// return true
|
|
511
|
+
// }
|
|
512
|
+
|
|
513
|
+
if (typeof version === 'string') {
|
|
514
|
+
try {
|
|
515
|
+
version = SemVer$1(version);
|
|
516
|
+
} catch (err) {
|
|
517
|
+
return false
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return cmp(version, this.operator, this.semver)
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
intersects(comp) {
|
|
525
|
+
if (!(comp instanceof Comparator)) {
|
|
526
|
+
throw new SemVerError('a Comparator is required')
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
if (this.operator === '') {
|
|
530
|
+
if (this.value === '') {
|
|
531
|
+
return true
|
|
532
|
+
}
|
|
533
|
+
return Range$1(comp.value).test(this.value)
|
|
534
|
+
} else if (comp.operator === '') {
|
|
535
|
+
if (comp.value === '') {
|
|
536
|
+
return true
|
|
537
|
+
}
|
|
538
|
+
return Range$1(this.value).test(comp.semver)
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
const sameDirectionIncreasing =
|
|
542
|
+
(this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>');
|
|
543
|
+
const sameDirectionDecreasing =
|
|
544
|
+
(this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<');
|
|
545
|
+
const sameSemVer = this.semver.version === comp.semver.version;
|
|
546
|
+
const differentDirectionsInclusive =
|
|
547
|
+
(this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<=');
|
|
548
|
+
const oppositeDirectionsLessThan =
|
|
549
|
+
cmp(this.semver, '<', comp.semver) &&
|
|
550
|
+
(this.operator === '>=' || this.operator === '>') &&
|
|
551
|
+
(comp.operator === '<=' || comp.operator === '<');
|
|
552
|
+
const oppositeDirectionsGreaterThan =
|
|
553
|
+
cmp(this.semver, '>', comp.semver) &&
|
|
554
|
+
(this.operator === '<=' || this.operator === '<') &&
|
|
555
|
+
(comp.operator === '>=' || comp.operator === '>');
|
|
556
|
+
|
|
557
|
+
return (
|
|
558
|
+
sameDirectionIncreasing ||
|
|
559
|
+
sameDirectionDecreasing ||
|
|
560
|
+
(sameSemVer && differentDirectionsInclusive) ||
|
|
561
|
+
oppositeDirectionsLessThan ||
|
|
562
|
+
oppositeDirectionsGreaterThan
|
|
563
|
+
)
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
var Comparator$1 = comp => new Comparator(comp);
|
|
568
|
+
|
|
569
|
+
const cache = new LRU({ max: 1000 });
|
|
570
|
+
|
|
571
|
+
const NUM = '0|[1-9]\\d*';
|
|
572
|
+
|
|
573
|
+
const RANGE_TYPE = {
|
|
574
|
+
ONE: 'one',
|
|
575
|
+
MANY: 'many',
|
|
576
|
+
LATEST: 'latest',
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
const matchSemVer = (string, map) => regexp => {
|
|
580
|
+
const res = string.match(regexp);
|
|
581
|
+
if (!res) return () => false
|
|
582
|
+
const result = () => true;
|
|
583
|
+
for (const [key, pos, def = 0] of map) {
|
|
584
|
+
result[key] = res[pos] || def;
|
|
585
|
+
}
|
|
586
|
+
return result
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
// take a set of comparators and determine whether there
|
|
590
|
+
// exists a version which can satisfy it
|
|
591
|
+
const isSatisfiable = comparators => {
|
|
592
|
+
let result = true;
|
|
593
|
+
const remainingComparators = comparators.slice();
|
|
594
|
+
let testComparator = remainingComparators.pop();
|
|
595
|
+
|
|
596
|
+
while (result && remainingComparators.length) {
|
|
597
|
+
result = remainingComparators.every(otherComparator => {
|
|
598
|
+
return testComparator.intersects(otherComparator)
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
testComparator = remainingComparators.pop();
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
return result
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Represents a range of versions for semantic versioning
|
|
609
|
+
*
|
|
610
|
+
* @function Range
|
|
611
|
+
* @tag range
|
|
612
|
+
* @param {string} - Version range
|
|
613
|
+
* @throws {SemVerError} - Throws an error if the provided range is invalid
|
|
614
|
+
* @example
|
|
615
|
+
*
|
|
616
|
+
* expect(() => Range('wrong range')).toThrow()
|
|
617
|
+
* expect(Range('1.0').test('1.0')).toBeTruthy()
|
|
618
|
+
* expect(Range('1.0').test('1.0.0')).toBeFalsy()
|
|
619
|
+
*
|
|
620
|
+
* expect(Range('~').toString()).toEqual('>=0.0.0-0')
|
|
621
|
+
* expect(Range('~').test('1.2.3-draft')).toBeTruthy()
|
|
622
|
+
* expect(Range('1.~').test('1.2.3-draft')).toBeFalsy()
|
|
623
|
+
*
|
|
624
|
+
* expect(Range('+').toString()).toEqual('>=1.0.0')
|
|
625
|
+
* expect(Range('+').test('1.2.3-draft')).toBeFalsy()
|
|
626
|
+
* expect(Range('1.0.+').test('1.0.3')).toBeTruthy()
|
|
627
|
+
*
|
|
628
|
+
* expect(Range('*').test('1.0')).toBeTruthy()
|
|
629
|
+
* expect(Range('*').test('1.0.0-draft')).toBeTruthy()
|
|
630
|
+
* expect(Range('1.*').test('1.1.3')).toBeFalsy()
|
|
631
|
+
*
|
|
632
|
+
* expect(Range('1~.2.0').test('4.3.2')).toBeTruthy()
|
|
633
|
+
* expect(Range('1~.2.0').test('4.3.2-draft')).toBeTruthy()
|
|
634
|
+
* expect(Range('1.2~.0').toString()).toEqual('>=1.2.0-0 <2.0.0-0')
|
|
635
|
+
*
|
|
636
|
+
*/
|
|
637
|
+
class Range {
|
|
638
|
+
constructor(range) {
|
|
639
|
+
if (range instanceof Range) return new Range(range.raw)
|
|
640
|
+
|
|
641
|
+
if (range instanceof Comparator) {
|
|
642
|
+
this.raw = range.value;
|
|
643
|
+
this.set = [[range]];
|
|
644
|
+
this.format();
|
|
645
|
+
return this
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
this.raw = range;
|
|
649
|
+
const [type, set, subType] = this.makeRangeSet(range);
|
|
650
|
+
this.set = set;
|
|
651
|
+
this.type = type;
|
|
652
|
+
this.subType = subType;
|
|
653
|
+
|
|
654
|
+
if (!this.set.length) {
|
|
655
|
+
throw new SemVerError(`Invalid SemVer Range: ${range}`)
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
this.format();
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
get comparators() {
|
|
662
|
+
const res = [];
|
|
663
|
+
for (const a of this.set) {
|
|
664
|
+
for (const b of a) {
|
|
665
|
+
res.push(b);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
return res
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
isMonoVersion() {
|
|
672
|
+
return this.type === RANGE_TYPE.ONE
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
isResolved() {
|
|
676
|
+
return this.isMonoVersion()
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
format() {
|
|
680
|
+
this.range = this.set
|
|
681
|
+
.map(comps => {
|
|
682
|
+
return comps.join(' ').trim()
|
|
683
|
+
})
|
|
684
|
+
.join('||')
|
|
685
|
+
.trim();
|
|
686
|
+
return this.range
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
toString() {
|
|
690
|
+
return this.range
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
makeRangeSet(range) {
|
|
694
|
+
range = range.trim();
|
|
695
|
+
const memoKey = `parseRange:${range}`;
|
|
696
|
+
const cached = cache.get(memoKey);
|
|
697
|
+
if (cached) return cached
|
|
698
|
+
|
|
699
|
+
range = range.replace(/\s+/, '');
|
|
700
|
+
|
|
701
|
+
const [type, comparators, subType] = makeComparators(range);
|
|
702
|
+
if (!comparators) return [null, []]
|
|
703
|
+
|
|
704
|
+
const set = comparators.map(comp => comp.split(/\s+/).map(comp => Comparator$1(comp)));
|
|
705
|
+
|
|
706
|
+
cache.set(memoKey, [type, set, subType]);
|
|
707
|
+
return [type, set, subType]
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
intersects(range) {
|
|
711
|
+
if (!(range instanceof Range)) {
|
|
712
|
+
throw new SemVerError('a Range is required')
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
return this.set.some(thisComparators => {
|
|
716
|
+
return (
|
|
717
|
+
isSatisfiable(thisComparators) &&
|
|
718
|
+
range.set.some(rangeComparators => {
|
|
719
|
+
return (
|
|
720
|
+
isSatisfiable(rangeComparators) &&
|
|
721
|
+
thisComparators.every(thisComparator => {
|
|
722
|
+
return rangeComparators.every(rangeComparator => {
|
|
723
|
+
return thisComparator.intersects(rangeComparator)
|
|
724
|
+
})
|
|
725
|
+
})
|
|
726
|
+
)
|
|
727
|
+
})
|
|
728
|
+
)
|
|
729
|
+
})
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
733
|
+
test(version) {
|
|
734
|
+
if (!version) {
|
|
735
|
+
return false
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
if (typeof version === 'string') {
|
|
739
|
+
try {
|
|
740
|
+
version = SemVer$1(version);
|
|
741
|
+
} catch (er) {
|
|
742
|
+
return false
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
747
|
+
if (testSet(this.set[i], version)) return true
|
|
748
|
+
}
|
|
749
|
+
return false
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
const RANGE_SUB_TYPE = {
|
|
754
|
+
RESOLVED: 'resolved',
|
|
755
|
+
STABLE: 'stable',
|
|
756
|
+
LATEST_STABLE: 'latest_stable',
|
|
757
|
+
LATEST_UNSTABLE: 'latest_unstable',
|
|
758
|
+
UNSTABLE: 'unstable',
|
|
759
|
+
ALL: 'all',
|
|
760
|
+
ABOVE: 'above',
|
|
761
|
+
};
|
|
762
|
+
|
|
763
|
+
const makeComparators = comp => {
|
|
764
|
+
let newComp;
|
|
765
|
+
|
|
766
|
+
newComp = checkSpecific(comp);
|
|
767
|
+
if (newComp) return [RANGE_TYPE.ONE, [newComp], RANGE_SUB_TYPE.RESOLVED]
|
|
768
|
+
|
|
769
|
+
newComp = checkOnlyStable(comp);
|
|
770
|
+
if (newComp) return [RANGE_TYPE.LATEST, [newComp], RANGE_SUB_TYPE.STABLE]
|
|
771
|
+
|
|
772
|
+
newComp = checkLatestStable(comp);
|
|
773
|
+
if (newComp) return [RANGE_TYPE.LATEST, [newComp], RANGE_SUB_TYPE.LATEST_STABLE]
|
|
774
|
+
|
|
775
|
+
newComp = checkLatestUnStable(comp);
|
|
776
|
+
if (newComp) return [RANGE_TYPE.LATEST, [newComp], RANGE_SUB_TYPE.LATEST_UNSTABLE]
|
|
777
|
+
|
|
778
|
+
newComp = checkPossibleUnstable(comp);
|
|
779
|
+
if (newComp) return [RANGE_TYPE.LATEST, [newComp], RANGE_SUB_TYPE.UNSTABLE]
|
|
780
|
+
|
|
781
|
+
newComp = checkAllVersions(comp);
|
|
782
|
+
if (newComp) return [RANGE_TYPE.MANY, newComp, RANGE_SUB_TYPE.ALL]
|
|
783
|
+
|
|
784
|
+
newComp = checkAllAboveVersions(comp);
|
|
785
|
+
if (newComp) return [RANGE_TYPE.MANY, newComp, RANGE_SUB_TYPE.ABOVE]
|
|
786
|
+
|
|
787
|
+
return []
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
const checkSpecific = comp => {
|
|
791
|
+
const res = comp.match(re[t.FULL]);
|
|
792
|
+
if (res) return comp
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
const checkAllVersions = comp => {
|
|
796
|
+
if (comp === '*') return ['>=0.0.0-0', '>=0.0']
|
|
797
|
+
const match = matchSemVer(comp, [
|
|
798
|
+
['M', 1],
|
|
799
|
+
['m', 2],
|
|
800
|
+
['p', 3],
|
|
801
|
+
]);
|
|
802
|
+
let r;
|
|
803
|
+
|
|
804
|
+
r = match(`^(${NUM})[.]([*])$`);
|
|
805
|
+
if (r()) return [`>=${r.M}.0 <${+r.M + 1}.0`]
|
|
806
|
+
|
|
807
|
+
r = match(`^(${NUM})[.]([*])[.](${NUM})$`);
|
|
808
|
+
if (r()) return [`>=${r.M}.0.0-0 <${+r.M + 1}.0.0-0`]
|
|
809
|
+
|
|
810
|
+
r = match(`^(${NUM})[.](${NUM})[.]([*])$`);
|
|
811
|
+
if (r()) return [`>=${r.M}.${r.m}.0-0 <${r.M}.${+r.m + 1}.0-0`]
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
const checkAllAboveVersions = comp => {
|
|
815
|
+
const match = matchSemVer(comp, [
|
|
816
|
+
['M', 1],
|
|
817
|
+
['m', 2],
|
|
818
|
+
['p', 3],
|
|
819
|
+
]);
|
|
820
|
+
let r;
|
|
821
|
+
|
|
822
|
+
r = match(`^(${NUM})[.](${NUM})[*]$`);
|
|
823
|
+
if (r()) return [`>=${r.M}.${r.m} <${+r.M + 1}.0`]
|
|
824
|
+
|
|
825
|
+
r = match(`^(${NUM})[.](${NUM})[*][.](${NUM})$`);
|
|
826
|
+
if (r()) return [`>=${r.M}.${r.m}.0-0 <${+r.M + 1}.0.0-0`]
|
|
827
|
+
|
|
828
|
+
r = match(`^(${NUM})[.](${NUM})[.](${NUM})[*]$`);
|
|
829
|
+
if (r()) return [`>=${r.M}.${r.m}.${r.p}-0 <${r.M}.${+r.m + 1}.0-0`]
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
const checkPossibleUnstable = comp => {
|
|
833
|
+
if (comp === '~') return `>=0.0.0-0`
|
|
834
|
+
const match = matchSemVer(comp, [
|
|
835
|
+
['M', 1],
|
|
836
|
+
['m', 2],
|
|
837
|
+
['p', 3],
|
|
838
|
+
]);
|
|
839
|
+
let r;
|
|
840
|
+
|
|
841
|
+
r = match(`^(${NUM})[.]([~])$`);
|
|
842
|
+
if (r()) return `>=${r.M}.0 <${+r.M + 1}.0`
|
|
843
|
+
|
|
844
|
+
r = match(`^(${NUM})[.]([~])[.](${NUM})$`);
|
|
845
|
+
if (r()) return `>=${r.M}.0.0-0 <${+r.M + 1}.0.0-0`
|
|
846
|
+
|
|
847
|
+
r = match(`^(${NUM})[.](${NUM})[.]([~])$`);
|
|
848
|
+
if (r()) return `>=${r.M}.${r.m}.0-0 <${r.M}.${+r.m + 1}.0-0`
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
const checkOnlyStable = comp => {
|
|
852
|
+
if (comp === '+') return `>=1.0.0`
|
|
853
|
+
const match = matchSemVer(comp, [
|
|
854
|
+
['M', 1],
|
|
855
|
+
['m', 2],
|
|
856
|
+
['p', 3],
|
|
857
|
+
]);
|
|
858
|
+
|
|
859
|
+
let r;
|
|
860
|
+
|
|
861
|
+
r = match(`^(${NUM})[.]([+])(?:[.](${NUM}))?$`);
|
|
862
|
+
if (r()) return `>=${r.M}.0.0 <${+r.M + 1}.0.0`
|
|
863
|
+
|
|
864
|
+
r = match(`^(${NUM})[.](${NUM})[.]([+])$`);
|
|
865
|
+
if (r()) return `>=${r.M}.${r.m}.0 <${r.M}.${+r.m + 1}.0`
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
const checkLatestStable = comp => {
|
|
869
|
+
const match = matchSemVer(comp, [
|
|
870
|
+
['M', 1],
|
|
871
|
+
['m', 2],
|
|
872
|
+
['p', 3],
|
|
873
|
+
]);
|
|
874
|
+
|
|
875
|
+
let r;
|
|
876
|
+
r = match(`^(${NUM})[+][.](${NUM})[.](${NUM})$`);
|
|
877
|
+
if (r()) return `>=${r.M}.${r.m}.${r.p}`
|
|
878
|
+
|
|
879
|
+
r = match(`^(${NUM})[.](${NUM})[+][.](${NUM})$`);
|
|
880
|
+
if (r()) return `>=${r.M}.${r.m}.${r.p} <${+r.M + 1}.0.0`
|
|
881
|
+
|
|
882
|
+
r = match(`^(${NUM})[.](${NUM})[.](${NUM})[+]$`);
|
|
883
|
+
if (r()) return `>=${r.M}.${r.m}.${r.p} <${r.M}.${+r.m + 1}.0`
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
const checkLatestUnStable = comp => {
|
|
887
|
+
const match = matchSemVer(comp, [
|
|
888
|
+
['M', 1],
|
|
889
|
+
['m', 2],
|
|
890
|
+
['p', 3],
|
|
891
|
+
]);
|
|
892
|
+
|
|
893
|
+
let r;
|
|
894
|
+
r = match(`^(${NUM})[~][.](${NUM})[.](${NUM})$`);
|
|
895
|
+
if (r()) return `>=${r.M}.${r.m}.${r.p}-0`
|
|
896
|
+
|
|
897
|
+
r = match(`^(${NUM})[.](${NUM})[~][.](${NUM})$`);
|
|
898
|
+
if (r()) return `>=${r.M}.${r.m}.${r.p}-0 <${+r.M + 1}.0.0-0`
|
|
899
|
+
|
|
900
|
+
r = match(`^(${NUM})[.](${NUM})[.](${NUM})[~]$`);
|
|
901
|
+
if (r()) return `>=${r.M}.${r.m}.${r.p}-0 <${r.M}.${+r.m + 1}.0-0`
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
const testSet = (set, version) => {
|
|
905
|
+
for (let i = 0; i < set.length; i++) {
|
|
906
|
+
if (set[i].semver.is2Parts() && !version.is2Parts()) return false
|
|
907
|
+
if (version.is2Parts() && !set[i].semver.is2Parts()) return false
|
|
908
|
+
if (set[i].semver.isStable() && !version.isStable()) return false
|
|
909
|
+
if (!set[i].test(version)) return false
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
return true
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
var Range$1 = range => new Range(range);
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Represents a matcher object used for version matching
|
|
919
|
+
*
|
|
920
|
+
* @function Matcher
|
|
921
|
+
* @tag matcher
|
|
922
|
+
* @param {string} - Version string or range to create a matcher for
|
|
923
|
+
* @throws {SemVerError} - Throws an error if the provided version or range is invalid
|
|
924
|
+
* @example
|
|
925
|
+
*
|
|
926
|
+
* expect(() => Matcher('wrong range')).toThrow()
|
|
927
|
+
* expect(Matcher('1.0').isMonoType()).toBeTruthy()
|
|
928
|
+
* expect(Matcher('1.0.1').isMonoType()).toBeTruthy()
|
|
929
|
+
* expect(Matcher('1.0.1').isResolved()).toBeTruthy()
|
|
930
|
+
* expect(Matcher('1~.2.0').isLatestType()).toBeTruthy()
|
|
931
|
+
* expect(() => Matcher('1.*')).toThrow()
|
|
932
|
+
*
|
|
933
|
+
*/
|
|
934
|
+
class Matcher {
|
|
935
|
+
constructor(value) {
|
|
936
|
+
this.raw = value;
|
|
937
|
+
this.range = Range$1(value);
|
|
938
|
+
if (this.range.type !== RANGE_TYPE.ONE && this.range.type !== RANGE_TYPE.LATEST)
|
|
939
|
+
throw new SemVerError(`Wrong version for matcher ${value}`)
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
isMonoType() {
|
|
943
|
+
return this.range.type === RANGE_TYPE.ONE
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
isResolved() {
|
|
947
|
+
return this.isMonoType()
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
isLatestType() {
|
|
951
|
+
return this.range.type === RANGE_TYPE.LATEST
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
var matcher = value => new Matcher(value);
|
|
956
|
+
|
|
957
|
+
export { Comparator$1 as Comparator, matcher as Matcher, RANGE_TYPE, Range$1 as Range, SemVer$1 as SemVer, SemVerError };
|
|
958
|
+
//# sourceMappingURL=index.esm.js.map
|