@dbmx/confy 0.0.73 → 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/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/dataBuckets.js +18 -0
- package/esm/lib/api/dataBuckets.js.map +1 -0
- 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/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/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/utils/authorizations.js +1 -1
- package/esm/utils/confy.js +1 -1
- package/package.json +5 -8
- 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,251 @@
|
|
|
1
|
+
import roles from './roles.js';
|
|
2
|
+
import curry from './node_modules/ramda/es/curry.js';
|
|
3
|
+
import is from './node_modules/ramda/es/is.js';
|
|
4
|
+
import difference from './node_modules/ramda/es/difference.js';
|
|
5
|
+
import intersection from './node_modules/ramda/es/intersection.js';
|
|
6
|
+
import includes from './node_modules/ramda/es/includes.js';
|
|
7
|
+
import map from './node_modules/ramda/es/map.js';
|
|
8
|
+
import either from './node_modules/ramda/es/either.js';
|
|
9
|
+
import prop from './node_modules/ramda/es/prop.js';
|
|
10
|
+
import identity from './node_modules/ramda/es/identity.js';
|
|
11
|
+
import propEq from './node_modules/ramda/es/propEq.js';
|
|
12
|
+
|
|
13
|
+
const ROLES = roles;
|
|
14
|
+
|
|
15
|
+
const hroles = ROLES.reduce((acc, role) => {
|
|
16
|
+
acc[role.id] = role;
|
|
17
|
+
return acc
|
|
18
|
+
}, {});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Checks if a user has all specified roles
|
|
22
|
+
* @function hasAllRoles
|
|
23
|
+
* @tag users
|
|
24
|
+
* @param {Array|string} - Roles to check
|
|
25
|
+
* @param {Object} - User object containing roles
|
|
26
|
+
* @return {boolean} - Returns true if the user has all specified roles, otherwise false
|
|
27
|
+
* @example
|
|
28
|
+
*
|
|
29
|
+
* expect(hasAllRoles(['a', 'b'], { roles: ['a', 'b', 'c'] })).toBeTruthy()
|
|
30
|
+
* expect(hasAllRoles(['a', 'b'], { roles: ['a', 'd'] })).toBeFalsy()
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
const hasAllRoles = curry((roles, user) => {
|
|
34
|
+
if (!user) return false
|
|
35
|
+
const mustHave = is(Array, roles) ? roles : [roles];
|
|
36
|
+
return !difference(mustHave, user.roles || []).length
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Alias for `hasAllRoles`
|
|
41
|
+
* @function hasRole
|
|
42
|
+
*/
|
|
43
|
+
const hasRole = hasAllRoles;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Checks if a user is an administrator
|
|
47
|
+
* @function isAdmin
|
|
48
|
+
* @tag users
|
|
49
|
+
* @param {Object} - User object containing roles
|
|
50
|
+
* @return {boolean} - Returns true if the user is an administrator, otherwise false
|
|
51
|
+
* @example
|
|
52
|
+
*
|
|
53
|
+
* expect(isAdmin({ roles: ['admin'] })).toBeTruthy()
|
|
54
|
+
* expect(isAdmin({ roles: ['admin', 'toto'] })).toBeTruthy()
|
|
55
|
+
* expect(isAdmin({ roles: ['titi', 'toto'] })).toBeFalsy()
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
const isAdmin = hasRole('admin');
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Checks if a user has some of the specified roles
|
|
62
|
+
* @function hasSomeRole
|
|
63
|
+
* @tag users
|
|
64
|
+
* @param {Array|string} - Roles to check
|
|
65
|
+
* @param {Object} - User object containing roles
|
|
66
|
+
* @return {boolean} - Returns true if the user has some of the specified roles, otherwise false
|
|
67
|
+
* @example
|
|
68
|
+
*
|
|
69
|
+
* expect(hasSomeRoles(['a', 'b'], { roles: ['a'] })).toBeTruthy()
|
|
70
|
+
* expect(hasSomeRoles(['a', 'b'], { roles: ['c', 'd'] })).toBeFalsy()
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
curry((roles, user) => {
|
|
74
|
+
if (!user) return false
|
|
75
|
+
const some = is(Array, roles) ? roles : [roles];
|
|
76
|
+
return intersection(some, user.roles || []).length
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Checks if a user has a root role
|
|
81
|
+
* @function hasRootRole
|
|
82
|
+
* @tag users
|
|
83
|
+
* @param {string} - Root role to check
|
|
84
|
+
* @param {Object} - User object containing roles
|
|
85
|
+
* @return {boolean} - Returns true if the user has the root role, otherwise false
|
|
86
|
+
* @example
|
|
87
|
+
*
|
|
88
|
+
* expect(hasRootRole('a:b', { roles: ['a:b:c', '1:2'] })).toBeTruthy()
|
|
89
|
+
* expect(hasRootRole('a:b', { roles: ['1:a:b:c', '1:2'] })).toBeFalsy()
|
|
90
|
+
*
|
|
91
|
+
*/
|
|
92
|
+
curry((role, user) => {
|
|
93
|
+
if (!user) return false
|
|
94
|
+
for (const userRole of user.roles || []) {
|
|
95
|
+
if (userRole.startsWith(role)) return true
|
|
96
|
+
}
|
|
97
|
+
return false
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Checks if a user has the specified permission
|
|
102
|
+
* @function hasPermission
|
|
103
|
+
* @tag users
|
|
104
|
+
* @param {string} - Permission to check
|
|
105
|
+
* @param {Object} - User object containing roles and permissions
|
|
106
|
+
* @return {boolean} - Returns true if the user has all specified permissions, otherwise false
|
|
107
|
+
* @example
|
|
108
|
+
*
|
|
109
|
+
* expect(hasPermission('sxs:spaces:read', { roles: ['sxs:spaces:editor'] })).toBeTruthy()
|
|
110
|
+
* expect(hasPermission('sxs:spaces:*', { roles: ['sxs:spaces:editor'] })).toBeTruthy()
|
|
111
|
+
* expect(hasPermission('jobs:viewer', { roles: ['sxs:spaces:editor'] })).toBeFalsy()
|
|
112
|
+
*
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
const hasPermission = (permission, user) => {
|
|
116
|
+
if (!permission || !user) return false
|
|
117
|
+
if (isAdmin(user)) return true
|
|
118
|
+
const idx = permission.indexOf('*');
|
|
119
|
+
const permissions = [];
|
|
120
|
+
for (const permission of getRolesPermissions(user.roles)) permissions.push(permission);
|
|
121
|
+
if (idx !== -1) {
|
|
122
|
+
const regexp = new RegExp(`^${permission.slice(0, idx)}`);
|
|
123
|
+
for (const permission of permissions) {
|
|
124
|
+
if (regexp.test(permission)) return true
|
|
125
|
+
}
|
|
126
|
+
return false
|
|
127
|
+
} else {
|
|
128
|
+
return permissions?.includes(permission)
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Checks if a user has all specified permissions
|
|
134
|
+
* @function hasPermissions
|
|
135
|
+
* @tag users
|
|
136
|
+
* @param {Array|string} - Permissions to check
|
|
137
|
+
* @param {Object} - User object containing roles and permissions
|
|
138
|
+
* @return {boolean} - Returns true if the user has all specified permissions, otherwise false
|
|
139
|
+
* @example
|
|
140
|
+
*
|
|
141
|
+
* expect(hasPermissions(['jobs*'], { roles: ['sxs:spaces:editor'] })).toBeFalsy()
|
|
142
|
+
* expect(hasPermissions('a:b', { roles: ['admin'] })).toBeTruthy()
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
const hasPermissions = (permissions, user) => {
|
|
146
|
+
if (!permissions || !user) return false
|
|
147
|
+
if (isAdmin(user)) return true
|
|
148
|
+
const some = is(Array, permissions) ? permissions : [permissions];
|
|
149
|
+
for (const permission of some) {
|
|
150
|
+
if (!hasPermission(permission, user)) return false
|
|
151
|
+
}
|
|
152
|
+
return true
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Checks if a user is a member
|
|
157
|
+
* @function hasMember
|
|
158
|
+
* @tag users
|
|
159
|
+
* @param {string} - Member ID to check
|
|
160
|
+
* @param {Object} - User object containing member information
|
|
161
|
+
* @return {boolean} - Returns true if the user is a member, otherwise false
|
|
162
|
+
* @example
|
|
163
|
+
*
|
|
164
|
+
* expect(hasMember('toto', { members: ['toto', 'titi'] })).toBeTruthy()
|
|
165
|
+
* expect(hasMember('toto', { roles: ['admin'] })).toBeTruthy()
|
|
166
|
+
* expect(hasMember('tot', { members: ['toto', 'titi'] })).toBeFalsy()
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
169
|
+
curry((member, user) => {
|
|
170
|
+
if (!user) return false
|
|
171
|
+
if (isAdmin(user)) return true
|
|
172
|
+
const memberIds = getMemberIds(user);
|
|
173
|
+
return includes(member, memberIds)
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
const getMemberIds = user => {
|
|
177
|
+
if (!user || isAdmin(user)) return
|
|
178
|
+
return map(either(prop('id'), identity), user.members || [])
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const STATUS = {
|
|
182
|
+
active: 'active',
|
|
183
|
+
inactive: 'inactive',
|
|
184
|
+
pending: 'pending',
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Checks if a user is active
|
|
189
|
+
* @function isActive
|
|
190
|
+
* @tag users
|
|
191
|
+
* @param {Object} - User object containing status information
|
|
192
|
+
* @return {boolean} - Returns true if the user is active, otherwise false
|
|
193
|
+
* @example
|
|
194
|
+
*
|
|
195
|
+
* isActive({status: 'active'}) // true
|
|
196
|
+
* isActive({status: 'inactive'}) //false
|
|
197
|
+
* isActive({status: 'pending'}) //false
|
|
198
|
+
*
|
|
199
|
+
*/
|
|
200
|
+
propEq('status', STATUS.active);
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Checks if a user is inactive
|
|
204
|
+
* @function isInActive
|
|
205
|
+
* @tag users
|
|
206
|
+
* @param {Object} - User object containing status information
|
|
207
|
+
* @return {boolean} - Returns true if the user is inactive, otherwise false
|
|
208
|
+
* @example
|
|
209
|
+
*
|
|
210
|
+
* isActive({status: 'active'}) // false
|
|
211
|
+
* isActive({status: 'inactive'}) //true
|
|
212
|
+
* isActive({status: 'pending'}) //false
|
|
213
|
+
*
|
|
214
|
+
*/
|
|
215
|
+
propEq('status', STATUS.inactive);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Checks if a user is pending
|
|
219
|
+
* @function isPending
|
|
220
|
+
* @tag users
|
|
221
|
+
* @param {Object} - User object containing status information
|
|
222
|
+
* @return {boolean} - Returns true if the user is pending, otherwise false
|
|
223
|
+
* @example
|
|
224
|
+
*
|
|
225
|
+
* isActive({status: 'active'}) // false
|
|
226
|
+
* isActive({status: 'inactive'}) //false
|
|
227
|
+
* isActive({status: 'pending'}) //true
|
|
228
|
+
*
|
|
229
|
+
*/
|
|
230
|
+
propEq('status', STATUS.pending);
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Retrieves permissions from user roles
|
|
234
|
+
* @function getRolesPermissions
|
|
235
|
+
* @tag users
|
|
236
|
+
* @param {Array|string} - User roles
|
|
237
|
+
* @return {Array} - Array of permissions
|
|
238
|
+
*/
|
|
239
|
+
const getRolesPermissions = roles => {
|
|
240
|
+
if (!roles) return []
|
|
241
|
+
const permissions = [];
|
|
242
|
+
for (const role of is(Array, roles) ? roles : [roles]) {
|
|
243
|
+
for (const permission of hroles[role]?.permissions || []) {
|
|
244
|
+
permissions.push(permission);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return permissions
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export { ROLES, STATUS, getMemberIds, getRolesPermissions, hasAllRoles, hasPermission, hasPermissions, hasRole, isAdmin };
|
|
251
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/@dbmx/users/esm/index.mjs"],"sourcesContent":["import roles from './roles.mjs';\nimport curry from './node_modules/ramda/es/curry.mjs';\nimport is from './node_modules/ramda/es/is.mjs';\nimport difference from './node_modules/ramda/es/difference.mjs';\nimport intersection from './node_modules/ramda/es/intersection.mjs';\nimport includes from './node_modules/ramda/es/includes.mjs';\nimport map from './node_modules/ramda/es/map.mjs';\nimport either from './node_modules/ramda/es/either.mjs';\nimport prop from './node_modules/ramda/es/prop.mjs';\nimport identity from './node_modules/ramda/es/identity.mjs';\nimport propEq from './node_modules/ramda/es/propEq.mjs';\n\nconst ROLES = roles;\n\nconst hroles = ROLES.reduce((acc, role) => {\n acc[role.id] = role;\n return acc\n}, {});\n\n/**\n * Checks if a user has all specified roles\n * @function hasAllRoles\n * @tag users\n * @param {Array|string} - Roles to check\n * @param {Object} - User object containing roles\n * @return {boolean} - Returns true if the user has all specified roles, otherwise false\n * @example\n *\n * expect(hasAllRoles(['a', 'b'], { roles: ['a', 'b', 'c'] })).toBeTruthy()\n * expect(hasAllRoles(['a', 'b'], { roles: ['a', 'd'] })).toBeFalsy()\n *\n */\nconst hasAllRoles = curry((roles, user) => {\n if (!user) return false\n const mustHave = is(Array, roles) ? roles : [roles];\n return !difference(mustHave, user.roles || []).length\n});\n\n/**\n * Alias for `hasAllRoles`\n * @function hasRole\n */\nconst hasRole = hasAllRoles;\n\n/**\n * Alias for `hasAllRoles`\n * @function hasRoles\n */\nconst hasRoles = hasAllRoles;\n\n/**\n * Checks if a user is an administrator\n * @function isAdmin\n * @tag users\n * @param {Object} - User object containing roles\n * @return {boolean} - Returns true if the user is an administrator, otherwise false\n * @example\n *\n * expect(isAdmin({ roles: ['admin'] })).toBeTruthy()\n * expect(isAdmin({ roles: ['admin', 'toto'] })).toBeTruthy()\n * expect(isAdmin({ roles: ['titi', 'toto'] })).toBeFalsy()\n *\n */\nconst isAdmin = hasRole('admin');\n\n/**\n * Checks if a user has some of the specified roles\n * @function hasSomeRole\n * @tag users\n * @param {Array|string} - Roles to check\n * @param {Object} - User object containing roles\n * @return {boolean} - Returns true if the user has some of the specified roles, otherwise false\n * @example\n *\n * expect(hasSomeRoles(['a', 'b'], { roles: ['a'] })).toBeTruthy()\n * expect(hasSomeRoles(['a', 'b'], { roles: ['c', 'd'] })).toBeFalsy()\n *\n */\nconst hasSomeRoles = curry((roles, user) => {\n if (!user) return false\n const some = is(Array, roles) ? roles : [roles];\n return intersection(some, user.roles || []).length\n});\n\n/**\n * Checks if a user has a root role\n * @function hasRootRole\n * @tag users\n * @param {string} - Root role to check\n * @param {Object} - User object containing roles\n * @return {boolean} - Returns true if the user has the root role, otherwise false\n * @example\n *\n * expect(hasRootRole('a:b', { roles: ['a:b:c', '1:2'] })).toBeTruthy()\n * expect(hasRootRole('a:b', { roles: ['1:a:b:c', '1:2'] })).toBeFalsy()\n *\n */\nconst hasRootRole = curry((role, user) => {\n if (!user) return false\n for (const userRole of user.roles || []) {\n if (userRole.startsWith(role)) return true\n }\n return false\n});\n\n/**\n * Checks if a user can wrte on artefacts linked to all specified agencies\n * @function hasAgencies\n * @tag users\n * @param {Array|string} - Agency Ids to check\n * @param {string|{id}} - Member ID\n * @param {Object} - User object containing members and related agencies\n * @return {boolean} - Returns true if the user has all specified agencyIds, otherwise false\n * @example\n *\n * const user = {\n members: [{ id: 'member1', agencies: [{ id: 'AGENCY1' }, { id: 'AGENCY2' }] }],\n }\n\n * expect(hasAgencies(['AGENCY1', 'AGENCY2'], 'unknownMember', user)).toBeFalsy()\n * expect(hasAgencies('AGENCY1', 'member1', user)).toBeTruthy()\n * expect(hasAgencies('AGENCY2', 'member1', user)).toBeTruthy()\n * \n * expect(hasAgencies('AGENCY1.FSD', 'member1', user)).toBeTruthy()\n * expect(hasAgencies(['AGENCY1','AGENCY1.FSD'], 'member1', user)).toBeTruthy()\n * \n * expect(hasAgencies(['AGENCY1', 'AGENCY2'], 'member1', user)).toBeTruthy() \n * expect(hasAgencies(['AGENCY1', 'AGENCY2', 'unknownAgencyId'], 'member1', user)).toBeFalsy() \n * expect(hasAgencies('unknownAgencyId', 'member1', user)).toBeFalsy() \n *\n */\nconst hasAgencies = (agencyIds, memberId, user) => {\n if (!agencyIds || !memberId || !user) return false\n if (isAdmin(user)) return true\n if (!user.members?.length) return false\n\n agencyIds = Array.isArray(agencyIds) ? agencyIds : [agencyIds];\n if (memberId.id) memberId = memberId.id;\n\n const userMember = user.members.find(member => member.id === memberId);\n if (!userMember?.agencies) return true\n if (!userMember.agencies.length) return false\n\n const userAgencyIds = map(prop('id'), userMember.agencies);\n\n for (const agencyId of agencyIds) {\n const hasAccess = userAgencyIds.some(\n userAgencyId => agencyId === userAgencyId || agencyId.startsWith(`${userAgencyId}.`),\n );\n if (!hasAccess) return false\n }\n\n return true\n};\n\n/**\n * Returns a list of writable agencies\n * @function getWritableAgencies\n * @tag users\n * @param {Array} - Agency List\n * @param {string} - Member ID\n * @param {Object} - User object containing members and related agencies\n * @return {Array} - Returns the list of writable agencies for the specified memberId and the specified user\n * @example\n *\n * const user = {\n * members: [\n * {\n * id: 'member1',\n * agencies: [{ id: 'FSD' }],\n * },\n * {\n * id: 'member2',\n * agencies: [{ id: 'SDMX' }],\n * },\n * {\n * id: 'member3',\n * agencies: [{ id: 'ORG' }],\n * },\n * ],\n * }\n *\n * const agencyList = [\n * { id: 'FSD', name: 'FSD' },\n * { id: 'SDMX', name: 'SDMX' },\n * { id: 'ORG', name: 'ORG' },\n * { id: 'ORG.TEST1', name: 'TEST1' },\n * { id: 'ORG.TEST2', name: 'TEST2' },\n * ]\n *\n * expect(getWritableAgencies(agencyList, 'member1', { roles: ['admin'] })).toStrictEqual(agencyList)\n * expect(getWritableAgencies(agencyList, 'member1', user)).toStrictEqual([{ id: 'FSD', name: 'FSD' }])\n * expect(getWritableAgencies(agencyList, 'member2', user)).toStrictEqual([{ id: 'SDMX', name: 'SDMX' }])\n * expect(getWritableAgencies(agencyList, 'member3', user)).toStrictEqual([{ id: 'ORG', name: 'ORG' }, { id: 'ORG.TEST1', name: 'TEST1' }, { id: 'ORG.TEST2', name: 'TEST2' }])\n *\n */\nconst getWritableAgencies = (agencyList, memberId, user) => {\n if (!agencyList?.length || !memberId || !user) return []\n if (isAdmin(user)) return agencyList\n if (!user.members?.length) return []\n\n if (memberId.id) memberId = memberId.id;\n\n const userMember = user.members.find(member => member.id === memberId);\n if (!userMember?.agencies) return agencyList\n if (!userMember.agencies.length) return []\n\n const userAgencyIds = map(prop('id'), userMember.agencies);\n\n return agencyList.filter(agency =>\n userAgencyIds.some(userAgencyId => {\n const agencyId = agency.agencyID ?? agency.id;\n if (!agencyId) return false\n\n return agencyId.startsWith(userAgencyId)\n }),\n )\n};\n\n/**\n * Checks if a user has the specified permission\n * @function hasPermission\n * @tag users\n * @param {string} - Permission to check\n * @param {Object} - User object containing roles and permissions\n * @return {boolean} - Returns true if the user has all specified permissions, otherwise false\n * @example\n *\n * expect(hasPermission('sxs:spaces:read', { roles: ['sxs:spaces:editor'] })).toBeTruthy()\n * expect(hasPermission('sxs:spaces:*', { roles: ['sxs:spaces:editor'] })).toBeTruthy()\n * expect(hasPermission('jobs:viewer', { roles: ['sxs:spaces:editor'] })).toBeFalsy()\n *\n */\n\nconst hasPermission = (permission, user) => {\n if (!permission || !user) return false\n if (isAdmin(user)) return true\n const idx = permission.indexOf('*');\n const permissions = [];\n for (const permission of getRolesPermissions(user.roles)) permissions.push(permission);\n if (idx !== -1) {\n const regexp = new RegExp(`^${permission.slice(0, idx)}`);\n for (const permission of permissions) {\n if (regexp.test(permission)) return true\n }\n return false\n } else {\n return permissions?.includes(permission)\n }\n};\n\n/**\n * Checks if a user has all specified permissions\n * @function hasPermissions\n * @tag users\n * @param {Array|string} - Permissions to check\n * @param {Object} - User object containing roles and permissions\n * @return {boolean} - Returns true if the user has all specified permissions, otherwise false\n * @example\n *\n * expect(hasPermissions(['jobs*'], { roles: ['sxs:spaces:editor'] })).toBeFalsy()\n * expect(hasPermissions('a:b', { roles: ['admin'] })).toBeTruthy()\n *\n */\nconst hasPermissions = (permissions, user) => {\n if (!permissions || !user) return false\n if (isAdmin(user)) return true\n const some = is(Array, permissions) ? permissions : [permissions];\n for (const permission of some) {\n if (!hasPermission(permission, user)) return false\n }\n return true\n};\n\n/**\n * Checks if a user is a member\n * @function hasMember\n * @tag users\n * @param {string} - Member ID to check\n * @param {Object} - User object containing member information\n * @return {boolean} - Returns true if the user is a member, otherwise false\n * @example\n *\n * expect(hasMember('toto', { members: ['toto', 'titi'] })).toBeTruthy()\n * expect(hasMember('toto', { roles: ['admin'] })).toBeTruthy()\n * expect(hasMember('tot', { members: ['toto', 'titi'] })).toBeFalsy()\n *\n */\nconst hasMember = curry((member, user) => {\n if (!user) return false\n if (isAdmin(user)) return true\n const memberIds = getMemberIds(user);\n return includes(member, memberIds)\n});\n\nconst getMemberIds = user => {\n if (!user || isAdmin(user)) return\n return map(either(prop('id'), identity), user.members || [])\n};\n\nconst STATUS = {\n active: 'active',\n inactive: 'inactive',\n pending: 'pending',\n};\n\n/**\n * Checks if a user is active\n * @function isActive\n * @tag users\n * @param {Object} - User object containing status information\n * @return {boolean} - Returns true if the user is active, otherwise false\n * @example\n *\n * isActive({status: 'active'}) // true\n * isActive({status: 'inactive'}) //false\n * isActive({status: 'pending'}) //false\n *\n */\nconst isActive = propEq('status', STATUS.active);\n\n/**\n * Checks if a user is inactive\n * @function isInActive\n * @tag users\n * @param {Object} - User object containing status information\n * @return {boolean} - Returns true if the user is inactive, otherwise false\n * @example\n *\n * isActive({status: 'active'}) // false\n * isActive({status: 'inactive'}) //true\n * isActive({status: 'pending'}) //false\n *\n */\nconst isInActive = propEq('status', STATUS.inactive);\n\n/**\n * Checks if a user is pending\n * @function isPending\n * @tag users\n * @param {Object} - User object containing status information\n * @return {boolean} - Returns true if the user is pending, otherwise false\n * @example\n *\n * isActive({status: 'active'}) // false\n * isActive({status: 'inactive'}) //false\n * isActive({status: 'pending'}) //true\n *\n */\nconst isPending = propEq('status', STATUS.pending);\n\n/**\n * Retrieves permissions from user roles\n * @function getRolesPermissions\n * @tag users\n * @param {Array|string} - User roles\n * @return {Array} - Array of permissions\n */\nconst getRolesPermissions = roles => {\n if (!roles) return []\n const permissions = [];\n for (const role of is(Array, roles) ? roles : [roles]) {\n for (const permission of hroles[role]?.permissions || []) {\n permissions.push(permission);\n }\n }\n return permissions\n};\n\nexport { ROLES, STATUS, getMemberIds, getRolesPermissions, getWritableAgencies, hasAgencies, hasAllRoles, hasMember, hasPermission, hasPermissions, hasRole, hasRoles, hasRootRole, hasSomeRoles, isActive, isAdmin, isInActive, isPending };\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import _concat from './internal/_concat.js';
|
|
2
|
+
import _curry2 from './internal/_curry2.js';
|
|
3
|
+
import _reduce from './internal/_reduce.js';
|
|
4
|
+
import map from './map.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ap applies a list of functions to a list of values.
|
|
8
|
+
*
|
|
9
|
+
* Dispatches to the `ap` method of the second argument, if present. Also
|
|
10
|
+
* treats curried functions as applicatives.
|
|
11
|
+
*
|
|
12
|
+
* @func
|
|
13
|
+
* @memberOf R
|
|
14
|
+
* @since v0.3.0
|
|
15
|
+
* @category Function
|
|
16
|
+
* @sig [a -> b] -> [a] -> [b]
|
|
17
|
+
* @sig Apply f => f (a -> b) -> f a -> f b
|
|
18
|
+
* @sig (r -> a -> b) -> (r -> a) -> (r -> b)
|
|
19
|
+
* @param {*} applyF
|
|
20
|
+
* @param {*} applyX
|
|
21
|
+
* @return {*}
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]
|
|
25
|
+
* R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> ["tasty pizza", "tasty salad", "PIZZA", "SALAD"]
|
|
26
|
+
*
|
|
27
|
+
* // R.ap can also be used as S combinator
|
|
28
|
+
* // when only two functions are passed
|
|
29
|
+
* R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'
|
|
30
|
+
* @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
var ap =
|
|
34
|
+
/*#__PURE__*/
|
|
35
|
+
_curry2(function ap(applyF, applyX) {
|
|
36
|
+
return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {
|
|
37
|
+
return applyF(x)(applyX(x));
|
|
38
|
+
} : _reduce(function (acc, f) {
|
|
39
|
+
return _concat(acc, map(f, applyX));
|
|
40
|
+
}, [], applyF);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { ap as default };
|
|
44
|
+
//# sourceMappingURL=ap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap.js","sources":["../../../../../../../../node_modules/@dbmx/users/esm/node_modules/ramda/es/ap.mjs"],"sourcesContent":["import _concat from './internal/_concat.mjs';\nimport _curry2 from './internal/_curry2.mjs';\nimport _reduce from './internal/_reduce.mjs';\nimport map from './map.mjs';\n\n/**\n * ap applies a list of functions to a list of values.\n *\n * Dispatches to the `ap` method of the second argument, if present. Also\n * treats curried functions as applicatives.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig [a -> b] -> [a] -> [b]\n * @sig Apply f => f (a -> b) -> f a -> f b\n * @sig (r -> a -> b) -> (r -> a) -> (r -> b)\n * @param {*} applyF\n * @param {*} applyX\n * @return {*}\n * @example\n *\n * R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]\n * R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> [\"tasty pizza\", \"tasty salad\", \"PIZZA\", \"SALAD\"]\n *\n * // R.ap can also be used as S combinator\n * // when only two functions are passed\n * R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'\n * @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]\n */\n\nvar ap =\n/*#__PURE__*/\n_curry2(function ap(applyF, applyX) {\n return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {\n return applyF(x)(applyX(x));\n } : _reduce(function (acc, f) {\n return _concat(acc, map(f, applyX));\n }, [], applyF);\n});\n\nexport { ap as default };\n//# sourceMappingURL=ap.mjs.map\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEG,IAAC,EAAE;AACN;AACA,OAAO,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE;AACpC,EAAE,OAAO,OAAO,MAAM,CAAC,iBAAiB,CAAC,KAAK,UAAU,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,OAAO,MAAM,CAAC,EAAE,KAAK,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,OAAO,MAAM,KAAK,UAAU,GAAG,UAAU,CAAC,EAAE;AACjM,IAAI,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC/B,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE;AAChC,IAAI,OAAO,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACvC,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC;AAChB,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _arity from './internal/_arity.js';
|
|
2
|
+
import _curry2 from './internal/_curry2.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates a function that is bound to a context.
|
|
6
|
+
* Note: `R.bind` does not provide the additional argument-binding capabilities of
|
|
7
|
+
* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
|
8
|
+
*
|
|
9
|
+
* @func
|
|
10
|
+
* @memberOf R
|
|
11
|
+
* @since v0.6.0
|
|
12
|
+
* @category Function
|
|
13
|
+
* @category Object
|
|
14
|
+
* @sig (* -> *) -> {*} -> (* -> *)
|
|
15
|
+
* @param {Function} fn The function to bind to context
|
|
16
|
+
* @param {Object} thisObj The context to bind `fn` to
|
|
17
|
+
* @return {Function} A function that will execute in the context of `thisObj`.
|
|
18
|
+
* @see R.partial
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* const log = R.bind(console.log, console);
|
|
22
|
+
* R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
|
|
23
|
+
* // logs {a: 2}
|
|
24
|
+
* @symb R.bind(f, o)(a, b) = f.call(o, a, b)
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var bind =
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
_curry2(function bind(fn, thisObj) {
|
|
30
|
+
return _arity(fn.length, function () {
|
|
31
|
+
return fn.apply(thisObj, arguments);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { bind as default };
|
|
36
|
+
//# sourceMappingURL=bind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind.js","sources":["../../../../../../../../node_modules/@dbmx/users/esm/node_modules/ramda/es/bind.mjs"],"sourcesContent":["import _arity from './internal/_arity.mjs';\nimport _curry2 from './internal/_curry2.mjs';\n\n/**\n * Creates a function that is bound to a context.\n * Note: `R.bind` does not provide the additional argument-binding capabilities of\n * [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\n *\n * @func\n * @memberOf R\n * @since v0.6.0\n * @category Function\n * @category Object\n * @sig (* -> *) -> {*} -> (* -> *)\n * @param {Function} fn The function to bind to context\n * @param {Object} thisObj The context to bind `fn` to\n * @return {Function} A function that will execute in the context of `thisObj`.\n * @see R.partial\n * @example\n *\n * const log = R.bind(console.log, console);\n * R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}\n * // logs {a: 2}\n * @symb R.bind(f, o)(a, b) = f.call(o, a, b)\n */\n\nvar bind =\n/*#__PURE__*/\n_curry2(function bind(fn, thisObj) {\n return _arity(fn.length, function () {\n return fn.apply(thisObj, arguments);\n });\n});\n\nexport { bind as default };\n//# sourceMappingURL=bind.mjs.map\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEG,IAAC,IAAI;AACR;AACA,OAAO,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE;AACnC,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY;AACvC,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC;AACvC,EAAE,CAAC,CAAC;AACJ,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _curry1 from './internal/_curry1.js';
|
|
2
|
+
import curryN from './curryN.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns a curried equivalent of the provided function. The curried function
|
|
6
|
+
* has two unusual capabilities. First, its arguments needn't be provided one
|
|
7
|
+
* at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the
|
|
8
|
+
* following are equivalent:
|
|
9
|
+
*
|
|
10
|
+
* - `g(1)(2)(3)`
|
|
11
|
+
* - `g(1)(2, 3)`
|
|
12
|
+
* - `g(1, 2)(3)`
|
|
13
|
+
* - `g(1, 2, 3)`
|
|
14
|
+
*
|
|
15
|
+
* Secondly, the special placeholder value [`R.__`](#__) may be used to specify
|
|
16
|
+
* "gaps", allowing partial application of any combination of arguments,
|
|
17
|
+
* regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
|
|
18
|
+
* the following are equivalent:
|
|
19
|
+
*
|
|
20
|
+
* - `g(1, 2, 3)`
|
|
21
|
+
* - `g(_, 2, 3)(1)`
|
|
22
|
+
* - `g(_, _, 3)(1)(2)`
|
|
23
|
+
* - `g(_, _, 3)(1, 2)`
|
|
24
|
+
* - `g(_, 2)(1)(3)`
|
|
25
|
+
* - `g(_, 2)(1, 3)`
|
|
26
|
+
* - `g(_, 2)(_, 3)(1)`
|
|
27
|
+
*
|
|
28
|
+
* @func
|
|
29
|
+
* @memberOf R
|
|
30
|
+
* @since v0.1.0
|
|
31
|
+
* @category Function
|
|
32
|
+
* @sig (* -> a) -> (* -> a)
|
|
33
|
+
* @param {Function} fn The function to curry.
|
|
34
|
+
* @return {Function} A new, curried function.
|
|
35
|
+
* @see R.curryN, R.partial
|
|
36
|
+
* @example
|
|
37
|
+
*
|
|
38
|
+
* const addFourNumbers = (a, b, c, d) => a + b + c + d;
|
|
39
|
+
*
|
|
40
|
+
* const curriedAddFourNumbers = R.curry(addFourNumbers);
|
|
41
|
+
* const f = curriedAddFourNumbers(1, 2);
|
|
42
|
+
* const g = f(3);
|
|
43
|
+
* g(4); //=> 10
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
var curry =
|
|
47
|
+
/*#__PURE__*/
|
|
48
|
+
_curry1(function curry(fn) {
|
|
49
|
+
return curryN(fn.length, fn);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { curry as default };
|
|
53
|
+
//# sourceMappingURL=curry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curry.js","sources":["../../../../../../../../node_modules/@dbmx/users/esm/node_modules/ramda/es/curry.mjs"],"sourcesContent":["import _curry1 from './internal/_curry1.mjs';\nimport curryN from './curryN.mjs';\n\n/**\n * Returns a curried equivalent of the provided function. The curried function\n * has two unusual capabilities. First, its arguments needn't be provided one\n * at a time. If `f` is a ternary function and `g` is `R.curry(f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value [`R.__`](#__) may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),\n * the following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig (* -> a) -> (* -> a)\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curryN, R.partial\n * @example\n *\n * const addFourNumbers = (a, b, c, d) => a + b + c + d;\n *\n * const curriedAddFourNumbers = R.curry(addFourNumbers);\n * const f = curriedAddFourNumbers(1, 2);\n * const g = f(3);\n * g(4); //=> 10\n */\n\nvar curry =\n/*#__PURE__*/\n_curry1(function curry(fn) {\n return curryN(fn.length, fn);\n});\n\nexport { curry as default };\n//# sourceMappingURL=curry.mjs.map\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEG,IAAC,KAAK;AACT;AACA,OAAO,CAAC,SAAS,KAAK,CAAC,EAAE,EAAE;AAC3B,EAAE,OAAO,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC;AAC9B,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _arity from './internal/_arity.js';
|
|
2
|
+
import _curry1 from './internal/_curry1.js';
|
|
3
|
+
import _curry2 from './internal/_curry2.js';
|
|
4
|
+
import _curryN from './internal/_curryN.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns a curried equivalent of the provided function, with the specified
|
|
8
|
+
* arity. The curried function has two unusual capabilities. First, its
|
|
9
|
+
* arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the
|
|
10
|
+
* following are equivalent:
|
|
11
|
+
*
|
|
12
|
+
* - `g(1)(2)(3)`
|
|
13
|
+
* - `g(1)(2, 3)`
|
|
14
|
+
* - `g(1, 2)(3)`
|
|
15
|
+
* - `g(1, 2, 3)`
|
|
16
|
+
*
|
|
17
|
+
* Secondly, the special placeholder value [`R.__`](#__) may be used to specify
|
|
18
|
+
* "gaps", allowing partial application of any combination of arguments,
|
|
19
|
+
* regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
|
|
20
|
+
* the following are equivalent:
|
|
21
|
+
*
|
|
22
|
+
* - `g(1, 2, 3)`
|
|
23
|
+
* - `g(_, 2, 3)(1)`
|
|
24
|
+
* - `g(_, _, 3)(1)(2)`
|
|
25
|
+
* - `g(_, _, 3)(1, 2)`
|
|
26
|
+
* - `g(_, 2)(1)(3)`
|
|
27
|
+
* - `g(_, 2)(1, 3)`
|
|
28
|
+
* - `g(_, 2)(_, 3)(1)`
|
|
29
|
+
*
|
|
30
|
+
* @func
|
|
31
|
+
* @memberOf R
|
|
32
|
+
* @since v0.5.0
|
|
33
|
+
* @category Function
|
|
34
|
+
* @sig Number -> (* -> a) -> (* -> a)
|
|
35
|
+
* @param {Number} length The arity for the returned function.
|
|
36
|
+
* @param {Function} fn The function to curry.
|
|
37
|
+
* @return {Function} A new, curried function.
|
|
38
|
+
* @see R.curry
|
|
39
|
+
* @example
|
|
40
|
+
*
|
|
41
|
+
* const sumArgs = (...args) => R.sum(args);
|
|
42
|
+
*
|
|
43
|
+
* const curriedAddFourNumbers = R.curryN(4, sumArgs);
|
|
44
|
+
* const f = curriedAddFourNumbers(1, 2);
|
|
45
|
+
* const g = f(3);
|
|
46
|
+
* g(4); //=> 10
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
var curryN =
|
|
50
|
+
/*#__PURE__*/
|
|
51
|
+
_curry2(function curryN(length, fn) {
|
|
52
|
+
if (length === 1) {
|
|
53
|
+
return _curry1(fn);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return _arity(length, _curryN(length, [], fn));
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export { curryN as default };
|
|
60
|
+
//# sourceMappingURL=curryN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curryN.js","sources":["../../../../../../../../node_modules/@dbmx/users/esm/node_modules/ramda/es/curryN.mjs"],"sourcesContent":["import _arity from './internal/_arity.mjs';\nimport _curry1 from './internal/_curry1.mjs';\nimport _curry2 from './internal/_curry2.mjs';\nimport _curryN from './internal/_curryN.mjs';\n\n/**\n * Returns a curried equivalent of the provided function, with the specified\n * arity. The curried function has two unusual capabilities. First, its\n * arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the\n * following are equivalent:\n *\n * - `g(1)(2)(3)`\n * - `g(1)(2, 3)`\n * - `g(1, 2)(3)`\n * - `g(1, 2, 3)`\n *\n * Secondly, the special placeholder value [`R.__`](#__) may be used to specify\n * \"gaps\", allowing partial application of any combination of arguments,\n * regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),\n * the following are equivalent:\n *\n * - `g(1, 2, 3)`\n * - `g(_, 2, 3)(1)`\n * - `g(_, _, 3)(1)(2)`\n * - `g(_, _, 3)(1, 2)`\n * - `g(_, 2)(1)(3)`\n * - `g(_, 2)(1, 3)`\n * - `g(_, 2)(_, 3)(1)`\n *\n * @func\n * @memberOf R\n * @since v0.5.0\n * @category Function\n * @sig Number -> (* -> a) -> (* -> a)\n * @param {Number} length The arity for the returned function.\n * @param {Function} fn The function to curry.\n * @return {Function} A new, curried function.\n * @see R.curry\n * @example\n *\n * const sumArgs = (...args) => R.sum(args);\n *\n * const curriedAddFourNumbers = R.curryN(4, sumArgs);\n * const f = curriedAddFourNumbers(1, 2);\n * const g = f(3);\n * g(4); //=> 10\n */\n\nvar curryN =\n/*#__PURE__*/\n_curry2(function curryN(length, fn) {\n if (length === 1) {\n return _curry1(fn);\n }\n\n return _arity(length, _curryN(length, [], fn));\n});\n\nexport { curryN as default };\n//# sourceMappingURL=curryN.mjs.map\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEG,IAAC,MAAM;AACV;AACA,OAAO,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE;AACpC,EAAE,IAAI,MAAM,KAAK,CAAC,EAAE;AACpB,IAAI,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,EAAE;;AAEF,EAAE,OAAO,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AAChD,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _curry2 from './internal/_curry2.js';
|
|
2
|
+
import _Set from './internal/_Set.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Finds the set (i.e. no duplicates) of all elements in the first list not
|
|
6
|
+
* contained in the second list. Objects and Arrays are compared in terms of
|
|
7
|
+
* value equality, not reference equality.
|
|
8
|
+
*
|
|
9
|
+
* @func
|
|
10
|
+
* @memberOf R
|
|
11
|
+
* @since v0.1.0
|
|
12
|
+
* @category Relation
|
|
13
|
+
* @sig [*] -> [*] -> [*]
|
|
14
|
+
* @param {Array} list1 The first list.
|
|
15
|
+
* @param {Array} list2 The second list.
|
|
16
|
+
* @return {Array} The elements in `list1` that are not in `list2`.
|
|
17
|
+
* @see R.differenceWith, R.symmetricDifference, R.symmetricDifferenceWith, R.without
|
|
18
|
+
* @example
|
|
19
|
+
*
|
|
20
|
+
* R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]
|
|
21
|
+
* R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]
|
|
22
|
+
* R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
var difference =
|
|
26
|
+
/*#__PURE__*/
|
|
27
|
+
_curry2(function difference(first, second) {
|
|
28
|
+
var out = [];
|
|
29
|
+
var idx = 0;
|
|
30
|
+
var firstLen = first.length;
|
|
31
|
+
var secondLen = second.length;
|
|
32
|
+
var toFilterOut = new _Set();
|
|
33
|
+
|
|
34
|
+
for (var i = 0; i < secondLen; i += 1) {
|
|
35
|
+
toFilterOut.add(second[i]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
while (idx < firstLen) {
|
|
39
|
+
if (toFilterOut.add(first[idx])) {
|
|
40
|
+
out[out.length] = first[idx];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
idx += 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return out;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export { difference as default };
|
|
50
|
+
//# sourceMappingURL=difference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"difference.js","sources":["../../../../../../../../node_modules/@dbmx/users/esm/node_modules/ramda/es/difference.mjs"],"sourcesContent":["import _curry2 from './internal/_curry2.mjs';\nimport _Set from './internal/_Set.mjs';\n\n/**\n * Finds the set (i.e. no duplicates) of all elements in the first list not\n * contained in the second list. Objects and Arrays are compared in terms of\n * value equality, not reference equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Relation\n * @sig [*] -> [*] -> [*]\n * @param {Array} list1 The first list.\n * @param {Array} list2 The second list.\n * @return {Array} The elements in `list1` that are not in `list2`.\n * @see R.differenceWith, R.symmetricDifference, R.symmetricDifferenceWith, R.without\n * @example\n *\n * R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]\n * R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]\n * R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]\n */\n\nvar difference =\n/*#__PURE__*/\n_curry2(function difference(first, second) {\n var out = [];\n var idx = 0;\n var firstLen = first.length;\n var secondLen = second.length;\n var toFilterOut = new _Set();\n\n for (var i = 0; i < secondLen; i += 1) {\n toFilterOut.add(second[i]);\n }\n\n while (idx < firstLen) {\n if (toFilterOut.add(first[idx])) {\n out[out.length] = first[idx];\n }\n\n idx += 1;\n }\n\n return out;\n});\n\nexport { difference as default };\n//# sourceMappingURL=difference.mjs.map\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEG,IAAC,UAAU;AACd;AACA,OAAO,CAAC,SAAS,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE;AAC3C,EAAE,IAAI,GAAG,GAAG,EAAE;AACd,EAAE,IAAI,GAAG,GAAG,CAAC;AACb,EAAE,IAAI,QAAQ,GAAG,KAAK,CAAC,MAAM;AAC7B,EAAE,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM;AAC/B,EAAE,IAAI,WAAW,GAAG,IAAI,IAAI,EAAE;;AAE9B,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE;AACzC,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,EAAE;;AAEF,EAAE,OAAO,GAAG,GAAG,QAAQ,EAAE;AACzB,IAAI,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE;AACrC,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;AAClC,IAAI;;AAEJ,IAAI,GAAG,IAAI,CAAC;AACZ,EAAE;;AAEF,EAAE,OAAO,GAAG;AACZ,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _curry2 from './internal/_curry2.js';
|
|
2
|
+
import _isFunction from './internal/_isFunction.js';
|
|
3
|
+
import lift from './lift.js';
|
|
4
|
+
import or from './or.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A function wrapping calls to the two functions in an `||` operation,
|
|
8
|
+
* returning the result of the first function if it is truth-y and the result
|
|
9
|
+
* of the second function otherwise. Note that this is short-circuited,
|
|
10
|
+
* meaning that the second function will not be invoked if the first returns a
|
|
11
|
+
* truth-y value.
|
|
12
|
+
*
|
|
13
|
+
* In addition to functions, `R.either` also accepts any fantasy-land compatible
|
|
14
|
+
* applicative functor.
|
|
15
|
+
*
|
|
16
|
+
* @func
|
|
17
|
+
* @memberOf R
|
|
18
|
+
* @since v0.12.0
|
|
19
|
+
* @category Logic
|
|
20
|
+
* @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)
|
|
21
|
+
* @param {Function} f a predicate
|
|
22
|
+
* @param {Function} g another predicate
|
|
23
|
+
* @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.
|
|
24
|
+
* @see R.or
|
|
25
|
+
* @example
|
|
26
|
+
*
|
|
27
|
+
* const gt10 = x => x > 10;
|
|
28
|
+
* const even = x => x % 2 === 0;
|
|
29
|
+
* const f = R.either(gt10, even);
|
|
30
|
+
* f(101); //=> true
|
|
31
|
+
* f(8); //=> true
|
|
32
|
+
*
|
|
33
|
+
* R.either(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(55)
|
|
34
|
+
* R.either([false, false, 'a'], [11]) // => [11, 11, "a"]
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
var either =
|
|
38
|
+
/*#__PURE__*/
|
|
39
|
+
_curry2(function either(f, g) {
|
|
40
|
+
return _isFunction(f) ? function _either() {
|
|
41
|
+
return f.apply(this, arguments) || g.apply(this, arguments);
|
|
42
|
+
} : lift(or)(f, g);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export { either as default };
|
|
46
|
+
//# sourceMappingURL=either.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"either.js","sources":["../../../../../../../../node_modules/@dbmx/users/esm/node_modules/ramda/es/either.mjs"],"sourcesContent":["import _curry2 from './internal/_curry2.mjs';\nimport _isFunction from './internal/_isFunction.mjs';\nimport lift from './lift.mjs';\nimport or from './or.mjs';\n\n/**\n * A function wrapping calls to the two functions in an `||` operation,\n * returning the result of the first function if it is truth-y and the result\n * of the second function otherwise. Note that this is short-circuited,\n * meaning that the second function will not be invoked if the first returns a\n * truth-y value.\n *\n * In addition to functions, `R.either` also accepts any fantasy-land compatible\n * applicative functor.\n *\n * @func\n * @memberOf R\n * @since v0.12.0\n * @category Logic\n * @sig (*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)\n * @param {Function} f a predicate\n * @param {Function} g another predicate\n * @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.\n * @see R.or\n * @example\n *\n * const gt10 = x => x > 10;\n * const even = x => x % 2 === 0;\n * const f = R.either(gt10, even);\n * f(101); //=> true\n * f(8); //=> true\n *\n * R.either(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(55)\n * R.either([false, false, 'a'], [11]) // => [11, 11, \"a\"]\n */\n\nvar either =\n/*#__PURE__*/\n_curry2(function either(f, g) {\n return _isFunction(f) ? function _either() {\n return f.apply(this, arguments) || g.apply(this, arguments);\n } : lift(or)(f, g);\n});\n\nexport { either as default };\n//# sourceMappingURL=either.mjs.map\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEG,IAAC,MAAM;AACV;AACA,OAAO,CAAC,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE;AAC9B,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,OAAO,GAAG;AAC7C,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC;AAC/D,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACpB,CAAC;;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _curry2 from './internal/_curry2.js';
|
|
2
|
+
import _equals from './internal/_equals.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Returns `true` if its arguments are equivalent, `false` otherwise. Handles
|
|
6
|
+
* cyclical data structures.
|
|
7
|
+
*
|
|
8
|
+
* Dispatches symmetrically to the `equals` methods of both arguments, if
|
|
9
|
+
* present.
|
|
10
|
+
*
|
|
11
|
+
* @func
|
|
12
|
+
* @memberOf R
|
|
13
|
+
* @since v0.15.0
|
|
14
|
+
* @category Relation
|
|
15
|
+
* @sig a -> b -> Boolean
|
|
16
|
+
* @param {*} a
|
|
17
|
+
* @param {*} b
|
|
18
|
+
* @return {Boolean}
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* R.equals(1, 1); //=> true
|
|
22
|
+
* R.equals(1, '1'); //=> false
|
|
23
|
+
* R.equals([1, 2, 3], [1, 2, 3]); //=> true
|
|
24
|
+
*
|
|
25
|
+
* const a = {}; a.v = a;
|
|
26
|
+
* const b = {}; b.v = b;
|
|
27
|
+
* R.equals(a, b); //=> true
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
var equals =
|
|
31
|
+
/*#__PURE__*/
|
|
32
|
+
_curry2(function equals(a, b) {
|
|
33
|
+
return _equals(a, b, [], []);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export { equals as default };
|
|
37
|
+
//# sourceMappingURL=equals.js.map
|