All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.cjs.buildPolyfills._asyncOptionalChainDelete.js.map Maven / Gradle / Ivy

There is a newer version: 8.38.0
Show newest version
{"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 {\n  const result = (await _asyncOptionalChain(ops)) as Promise;\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);\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":["_asyncOptionalChain"],"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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,yBAAyB,CAAC,GAAG,EAA+B;AAClF,EAAE,MAAM,UAAU,MAAMA,uCAAmB,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;;;;"}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy