mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-04-27 15:45:07 +00:00
init
This commit is contained in:
15
node_modules/@sentry/utils/esm/buildPolyfills/README.md
generated
vendored
Normal file
15
node_modules/@sentry/utils/esm/buildPolyfills/README.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
## Build Polyfills
|
||||
|
||||
This is a collection of syntax and import/export polyfills either copied directly from or heavily inspired by those used by [Rollup](https://github.com/rollup/rollup) and [Sucrase](https://github.com/alangpierce/sucrase). When either tool uses one of these polyfills during a build, it injects the function source code into each file needing the function, which can lead to a great deal of duplication. For our builds, we have therefore implemented something similar to [`tsc`'s `importHelpers` behavior](https://www.typescriptlang.org/tsconfig#importHelpers): Instead of leaving the polyfills injected in multiple places, we instead replace each injected function with an `import` or `require` statement.
|
||||
|
||||
Note that not all polyfills are currently used by the SDK, but all are included here for future compatitibility, should they ever be needed. Also, since we're never going to be calling these directly from within another TS file, their types are fairly generic. In some cases testing required more specific types, which can be found in the test files.
|
||||
|
||||
--------
|
||||
|
||||
_Code from both Rollup and Sucrase is used under the MIT license, copyright 2017 and 2012-2018, respectively._
|
||||
|
||||
_Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:_
|
||||
|
||||
_The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software._
|
||||
|
||||
_THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE._
|
||||
32
node_modules/@sentry/utils/esm/buildPolyfills/_asyncNullishCoalesce.js
generated
vendored
Normal file
32
node_modules/@sentry/utils/esm/buildPolyfills/_asyncNullishCoalesce.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { _nullishCoalesce } from './_nullishCoalesce.js';
|
||||
|
||||
// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f
|
||||
|
||||
/**
|
||||
* Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the
|
||||
* result of an async operation.
|
||||
*
|
||||
* Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
|
||||
* LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
|
||||
*
|
||||
* Adapted from Sucrase (https://github.com/alangpierce/sucrase)
|
||||
*
|
||||
* @param lhs The value of the expression to the left of the `??`
|
||||
* @param rhsFn A function returning the value of the expression to the right of the `??`
|
||||
* @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
|
||||
*/
|
||||
async function _asyncNullishCoalesce(lhs, rhsFn) {
|
||||
return _nullishCoalesce(lhs, rhsFn);
|
||||
}
|
||||
|
||||
// Sucrase version:
|
||||
// async function _asyncNullishCoalesce(lhs, rhsFn) {
|
||||
// if (lhs != null) {
|
||||
// return lhs;
|
||||
// } else {
|
||||
// return await rhsFn();
|
||||
// }
|
||||
// }
|
||||
|
||||
export { _asyncNullishCoalesce };
|
||||
//# sourceMappingURL=_asyncNullishCoalesce.js.map
|
||||
1
node_modules/@sentry/utils/esm/buildPolyfills/_asyncNullishCoalesce.js.map
generated
vendored
Normal file
1
node_modules/@sentry/utils/esm/buildPolyfills/_asyncNullishCoalesce.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_asyncNullishCoalesce.js","sources":["../../../src/buildPolyfills/_asyncNullishCoalesce.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _nullishCoalesce } from './_nullishCoalesce';\n\n/**\n * Polyfill for the nullish coalescing operator (`??`), when used in situations where at least one of the values is the\n * result of an async operation.\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport async function _asyncNullishCoalesce(lhs: unknown, rhsFn: () => unknown): Promise<unknown> {\n return _nullishCoalesce(lhs, rhsFn);\n}\n\n// Sucrase version:\n// async function _asyncNullishCoalesce(lhs, rhsFn) {\n// if (lhs != null) {\n// return lhs;\n// } else {\n// return await rhsFn();\n// }\n// }\n"],"names":[],"mappings":";;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,qBAAqB,CAAC,GAAG,EAAW,KAAK,EAAmC;AAClG,EAAE,OAAO,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AACrC,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
||||
59
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChain.js
generated
vendored
Normal file
59
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChain.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
|
||||
* descriptors, and functions, for situations in which at least one part of the expression is async.
|
||||
*
|
||||
* Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
|
||||
* https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
|
||||
*
|
||||
* @param ops Array result of expression conversion
|
||||
* @returns The value of the expression
|
||||
*/
|
||||
async function _asyncOptionalChain(ops) {
|
||||
let lastAccessLHS = undefined;
|
||||
let value = ops[0];
|
||||
let i = 1;
|
||||
while (i < ops.length) {
|
||||
const op = ops[i] ;
|
||||
const fn = ops[i + 1] ;
|
||||
i += 2;
|
||||
// by checking for loose equality to `null`, we catch both `null` and `undefined`
|
||||
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
||||
// really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it
|
||||
return;
|
||||
}
|
||||
if (op === 'access' || op === 'optionalAccess') {
|
||||
lastAccessLHS = value;
|
||||
value = await fn(value);
|
||||
} else if (op === 'call' || op === 'optionalCall') {
|
||||
value = await fn((...args) => (value ).call(lastAccessLHS, ...args));
|
||||
lastAccessLHS = undefined;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// Sucrase version:
|
||||
// async function _asyncOptionalChain(ops) {
|
||||
// let lastAccessLHS = undefined;
|
||||
// let value = ops[0];
|
||||
// let i = 1;
|
||||
// while (i < ops.length) {
|
||||
// const op = ops[i];
|
||||
// const fn = ops[i + 1];
|
||||
// i += 2;
|
||||
// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
||||
// return undefined;
|
||||
// }
|
||||
// if (op === 'access' || op === 'optionalAccess') {
|
||||
// lastAccessLHS = value;
|
||||
// value = await fn(value);
|
||||
// } else if (op === 'call' || op === 'optionalCall') {
|
||||
// value = await fn((...args) => value.call(lastAccessLHS, ...args));
|
||||
// lastAccessLHS = undefined;
|
||||
// }
|
||||
// }
|
||||
// return value;
|
||||
// }
|
||||
|
||||
export { _asyncOptionalChain };
|
||||
//# sourceMappingURL=_asyncOptionalChain.js.map
|
||||
1
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChain.js.map
generated
vendored
Normal file
1
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChain.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_asyncOptionalChain.js","sources":["../../../src/buildPolyfills/_asyncOptionalChain.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, for situations in which at least one part of the expression is async.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport async function _asyncOptionalChain(ops: unknown[]): Promise<unknown> {\n let lastAccessLHS: unknown = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] as string;\n const fn = ops[i + 1] as (intermediateValue: unknown) => Promise<unknown>;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = await fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = await fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}\n\n// Sucrase version:\n// async function _asyncOptionalChain(ops) {\n// let lastAccessLHS = undefined;\n// let value = ops[0];\n// let i = 1;\n// while (i < ops.length) {\n// const op = ops[i];\n// const fn = ops[i + 1];\n// i += 2;\n// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n// return undefined;\n// }\n// if (op === 'access' || op === 'optionalAccess') {\n// lastAccessLHS = value;\n// value = await fn(value);\n// } else if (op === 'call' || op === 'optionalCall') {\n// value = await fn((...args) => value.call(lastAccessLHS, ...args));\n// lastAccessLHS = undefined;\n// }\n// }\n// return value;\n// }\n"],"names":[],"mappings":"AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,mBAAmB,CAAC,GAAG,EAA+B;AAC5E,EAAE,IAAI,aAAa,GAAY,SAAS,CAAA;AACxC,EAAE,IAAI,KAAM,GAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AACpB,EAAE,IAAI,CAAE,GAAE,CAAC,CAAA;AACX,EAAE,OAAO,CAAA,GAAI,GAAG,CAAC,MAAM,EAAE;AACzB,IAAI,MAAM,EAAG,GAAE,GAAG,CAAC,CAAC,CAAE,EAAA;AACtB,IAAI,MAAM,KAAK,GAAG,CAAC,CAAE,GAAE,CAAC,CAAE,EAAA;AAC1B,IAAI,CAAA,IAAK,CAAC,CAAA;AACV;AACA,IAAI,IAAI,CAAC,EAAA,KAAO,gBAAiB,IAAG,EAAG,KAAI,cAAc,KAAK,KAAM,IAAG,IAAI,EAAE;AAC7E;AACA,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,IAAI,EAAG,KAAI,YAAY,EAAA,KAAO,gBAAgB,EAAE;AACpD,MAAM,aAAA,GAAgB,KAAK,CAAA;AAC3B,MAAM,QAAQ,MAAM,EAAE,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAI,MAAO,IAAI,EAAA,KAAO,MAAA,IAAU,EAAA,KAAO,cAAc,EAAE;AACvD,MAAM,KAAA,GAAQ,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI,KAAgB,CAAC,KAAM,GAAoB,IAAI,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;AACvG,MAAM,aAAA,GAAgB,SAAS,CAAA;AAC/B,KAAI;AACJ,GAAE;AACF,EAAE,OAAO,KAAK,CAAA;AACd,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
||||
32
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChainDelete.js
generated
vendored
Normal file
32
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChainDelete.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { _asyncOptionalChain } from './_asyncOptionalChain.js';
|
||||
|
||||
// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f
|
||||
|
||||
/**
|
||||
* Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
|
||||
* descriptors, and functions, in cases where the value of the expression is to be deleted.
|
||||
*
|
||||
* Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
|
||||
* https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
|
||||
*
|
||||
* @param ops Array result of expression conversion
|
||||
* @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
|
||||
* property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
|
||||
* case `false`.
|
||||
*/
|
||||
async function _asyncOptionalChainDelete(ops) {
|
||||
const result = (await _asyncOptionalChain(ops)) ;
|
||||
// If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,
|
||||
// return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in
|
||||
// which case we return whatever the `delete` returned, which will be a boolean.
|
||||
return result == null ? true : (result );
|
||||
}
|
||||
|
||||
// Sucrase version:
|
||||
// async function asyncOptionalChainDelete(ops) {
|
||||
// const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);
|
||||
// return result == null ? true : result;
|
||||
// }
|
||||
|
||||
export { _asyncOptionalChainDelete };
|
||||
//# sourceMappingURL=_asyncOptionalChainDelete.js.map
|
||||
1
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChainDelete.js.map
generated
vendored
Normal file
1
node_modules/@sentry/utils/esm/buildPolyfills/_asyncOptionalChainDelete.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_asyncOptionalChainDelete.js","sources":["../../../src/buildPolyfills/_asyncOptionalChainDelete.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _asyncOptionalChain } from './_asyncOptionalChain';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, in cases where the value of the expression is to be deleted.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable\n * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which\n * case `false`.\n */\nexport async function _asyncOptionalChainDelete(ops: unknown[]): Promise<boolean> {\n const result = (await _asyncOptionalChain(ops)) as Promise<boolean | null>;\n // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,\n // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in\n // which case we return whatever the `delete` returned, which will be a boolean.\n return result == null ? true : (result as Promise<boolean>);\n}\n\n// Sucrase version:\n// async function asyncOptionalChainDelete(ops) {\n// const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops);\n// return result == null ? true : result;\n// }\n"],"names":[],"mappings":";;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,yBAAyB,CAAC,GAAG,EAA+B;AAClF,EAAE,MAAM,UAAU,MAAM,mBAAmB,CAAC,GAAG,CAAC,CAAE,EAAA;AAClD;AACA;AACA;AACA,EAAE,OAAO,UAAU,IAAA,GAAO,IAAK,IAAG,MAAA,EAA2B,CAAA;AAC7D,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
||||
52
node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js
generated
vendored
Normal file
52
node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f
|
||||
//
|
||||
// The MIT License (MIT)
|
||||
//
|
||||
// Copyright (c) 2012-2018 various contributors (see AUTHORS)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
/**
|
||||
* Polyfill for the nullish coalescing operator (`??`).
|
||||
*
|
||||
* Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the
|
||||
* LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.
|
||||
*
|
||||
* Adapted from Sucrase (https://github.com/alangpierce/sucrase)
|
||||
*
|
||||
* @param lhs The value of the expression to the left of the `??`
|
||||
* @param rhsFn A function returning the value of the expression to the right of the `??`
|
||||
* @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value
|
||||
*/
|
||||
function _nullishCoalesce(lhs, rhsFn) {
|
||||
// by checking for loose equality to `null`, we catch both `null` and `undefined`
|
||||
return lhs != null ? lhs : rhsFn();
|
||||
}
|
||||
|
||||
// Sucrase version:
|
||||
// function _nullishCoalesce(lhs, rhsFn) {
|
||||
// if (lhs != null) {
|
||||
// return lhs;
|
||||
// } else {
|
||||
// return rhsFn();
|
||||
// }
|
||||
// }
|
||||
|
||||
export { _nullishCoalesce };
|
||||
//# sourceMappingURL=_nullishCoalesce.js.map
|
||||
1
node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js.map
generated
vendored
Normal file
1
node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_nullishCoalesce.js","sources":["../../../src/buildPolyfills/_nullishCoalesce.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/**\n * Polyfill for the nullish coalescing operator (`??`).\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nexport function _nullishCoalesce(lhs: unknown, rhsFn: () => unknown): unknown {\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n return lhs != null ? lhs : rhsFn();\n}\n\n// Sucrase version:\n// function _nullishCoalesce(lhs, rhsFn) {\n// if (lhs != null) {\n// return lhs;\n// } else {\n// return rhsFn();\n// }\n// }\n"],"names":[],"mappings":"AAAA;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;AACO,SAAS,gBAAgB,CAAC,GAAG,EAAW,KAAK,EAA0B;AAC9E;AACA,EAAE,OAAO,OAAO,IAAA,GAAO,GAAI,GAAE,KAAK,EAAE,CAAA;AACpC,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
||||
59
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js
generated
vendored
Normal file
59
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
|
||||
* descriptors, and functions.
|
||||
*
|
||||
* Adapted from Sucrase (https://github.com/alangpierce/sucrase)
|
||||
* See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
|
||||
*
|
||||
* @param ops Array result of expression conversion
|
||||
* @returns The value of the expression
|
||||
*/
|
||||
function _optionalChain(ops) {
|
||||
let lastAccessLHS = undefined;
|
||||
let value = ops[0];
|
||||
let i = 1;
|
||||
while (i < ops.length) {
|
||||
const op = ops[i] ;
|
||||
const fn = ops[i + 1] ;
|
||||
i += 2;
|
||||
// by checking for loose equality to `null`, we catch both `null` and `undefined`
|
||||
if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
||||
// really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it
|
||||
return;
|
||||
}
|
||||
if (op === 'access' || op === 'optionalAccess') {
|
||||
lastAccessLHS = value;
|
||||
value = fn(value);
|
||||
} else if (op === 'call' || op === 'optionalCall') {
|
||||
value = fn((...args) => (value ).call(lastAccessLHS, ...args));
|
||||
lastAccessLHS = undefined;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// Sucrase version
|
||||
// function _optionalChain(ops) {
|
||||
// let lastAccessLHS = undefined;
|
||||
// let value = ops[0];
|
||||
// let i = 1;
|
||||
// while (i < ops.length) {
|
||||
// const op = ops[i];
|
||||
// const fn = ops[i + 1];
|
||||
// i += 2;
|
||||
// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {
|
||||
// return undefined;
|
||||
// }
|
||||
// if (op === 'access' || op === 'optionalAccess') {
|
||||
// lastAccessLHS = value;
|
||||
// value = fn(value);
|
||||
// } else if (op === 'call' || op === 'optionalCall') {
|
||||
// value = fn((...args) => value.call(lastAccessLHS, ...args));
|
||||
// lastAccessLHS = undefined;
|
||||
// }
|
||||
// }
|
||||
// return value;
|
||||
// }
|
||||
|
||||
export { _optionalChain };
|
||||
//# sourceMappingURL=_optionalChain.js.map
|
||||
1
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js.map
generated
vendored
Normal file
1
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_optionalChain.js","sources":["../../../src/buildPolyfills/_optionalChain.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport type { GenericFunction } from './types';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nexport function _optionalChain(ops: unknown[]): unknown {\n let lastAccessLHS: unknown = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] as string;\n const fn = ops[i + 1] as (intermediateValue: unknown) => unknown;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = fn((...args: unknown[]) => (value as GenericFunction).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}\n\n// Sucrase version\n// function _optionalChain(ops) {\n// let lastAccessLHS = undefined;\n// let value = ops[0];\n// let i = 1;\n// while (i < ops.length) {\n// const op = ops[i];\n// const fn = ops[i + 1];\n// i += 2;\n// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n// return undefined;\n// }\n// if (op === 'access' || op === 'optionalAccess') {\n// lastAccessLHS = value;\n// value = fn(value);\n// } else if (op === 'call' || op === 'optionalCall') {\n// value = fn((...args) => value.call(lastAccessLHS, ...args));\n// lastAccessLHS = undefined;\n// }\n// }\n// return value;\n// }\n"],"names":[],"mappings":"AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,GAAG,EAAsB;AACxD,EAAE,IAAI,aAAa,GAAY,SAAS,CAAA;AACxC,EAAE,IAAI,KAAM,GAAE,GAAG,CAAC,CAAC,CAAC,CAAA;AACpB,EAAE,IAAI,CAAE,GAAE,CAAC,CAAA;AACX,EAAE,OAAO,CAAA,GAAI,GAAG,CAAC,MAAM,EAAE;AACzB,IAAI,MAAM,EAAG,GAAE,GAAG,CAAC,CAAC,CAAE,EAAA;AACtB,IAAI,MAAM,KAAK,GAAG,CAAC,CAAE,GAAE,CAAC,CAAE,EAAA;AAC1B,IAAI,CAAA,IAAK,CAAC,CAAA;AACV;AACA,IAAI,IAAI,CAAC,EAAA,KAAO,gBAAiB,IAAG,EAAG,KAAI,cAAc,KAAK,KAAM,IAAG,IAAI,EAAE;AAC7E;AACA,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,IAAI,EAAG,KAAI,YAAY,EAAA,KAAO,gBAAgB,EAAE;AACpD,MAAM,aAAA,GAAgB,KAAK,CAAA;AAC3B,MAAM,KAAM,GAAE,EAAE,CAAC,KAAK,CAAC,CAAA;AACvB,KAAI,MAAO,IAAI,EAAA,KAAO,MAAA,IAAU,EAAA,KAAO,cAAc,EAAE;AACvD,MAAM,KAAA,GAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,KAAgB,CAAC,QAA0B,IAAI,CAAC,aAAa,EAAE,GAAG,IAAI,CAAC,CAAC,CAAA;AACjG,MAAM,aAAA,GAAgB,SAAS,CAAA;AAC/B,KAAI;AACJ,GAAE;AACF,EAAE,OAAO,KAAK,CAAA;AACd,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
||||
33
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChainDelete.js
generated
vendored
Normal file
33
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChainDelete.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { _optionalChain } from './_optionalChain.js';
|
||||
|
||||
// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f
|
||||
|
||||
/**
|
||||
* Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,
|
||||
* descriptors, and functions, in cases where the value of the expression is to be deleted.
|
||||
*
|
||||
* Adapted from Sucrase (https://github.com/alangpierce/sucrase) See
|
||||
* https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15
|
||||
*
|
||||
* @param ops Array result of expression conversion
|
||||
* @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable
|
||||
* property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which
|
||||
* case `false`.
|
||||
*/
|
||||
function _optionalChainDelete(ops) {
|
||||
const result = _optionalChain(ops) ;
|
||||
// If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,
|
||||
// return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in
|
||||
// which case we return whatever the `delete` returned, which will be a boolean.
|
||||
return result == null ? true : result;
|
||||
}
|
||||
|
||||
// Sucrase version:
|
||||
// function _optionalChainDelete(ops) {
|
||||
// const result = _optionalChain(ops);
|
||||
// // by checking for loose equality to `null`, we catch both `null` and `undefined`
|
||||
// return result == null ? true : result;
|
||||
// }
|
||||
|
||||
export { _optionalChainDelete };
|
||||
//# sourceMappingURL=_optionalChainDelete.js.map
|
||||
1
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChainDelete.js.map
generated
vendored
Normal file
1
node_modules/@sentry/utils/esm/buildPolyfills/_optionalChainDelete.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"_optionalChainDelete.js","sources":["../../../src/buildPolyfills/_optionalChainDelete.ts"],"sourcesContent":["// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nimport { _optionalChain } from './_optionalChain';\n\n/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions, in cases where the value of the expression is to be deleted.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase) See\n * https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The return value of the `delete` operator: `true`, unless the deletion target is an own, non-configurable\n * property (one which can't be deleted or turned into an accessor, and whose enumerability can't be changed), in which\n * case `false`.\n */\nexport function _optionalChainDelete(ops: unknown[]): boolean {\n const result = _optionalChain(ops) as boolean | null;\n // If `result` is `null`, it means we didn't get to the end of the chain and so nothing was deleted (in which case,\n // return `true` since that's what `delete` does when it no-ops). If it's non-null, we know the delete happened, in\n // which case we return whatever the `delete` returned, which will be a boolean.\n return result == null ? true : result;\n}\n\n// Sucrase version:\n// function _optionalChainDelete(ops) {\n// const result = _optionalChain(ops);\n// // by checking for loose equality to `null`, we catch both `null` and `undefined`\n// return result == null ? true : result;\n// }\n"],"names":[],"mappings":";;AAAA;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,GAAG,EAAsB;AAC9D,EAAE,MAAM,MAAO,GAAE,cAAc,CAAC,GAAG,CAAE,EAAA;AACrC;AACA;AACA;AACA,EAAE,OAAO,MAAO,IAAG,OAAO,IAAA,GAAO,MAAM,CAAA;AACvC,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
|
||||
Reference in New Issue
Block a user