@openmrs/esm-error-handling 4.2.1-pre.621 → 4.3.0
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/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[35m@openmrs/esm-error-handling:build[0m: cache hit, replaying output [
|
|
1
|
+
[35m@openmrs/esm-error-handling:build[0m: cache hit, replaying output [2m5c7c907d86fa041e[0m
|
|
2
2
|
[35m@openmrs/esm-error-handling:build: [0masset [1m[32mopenmrs-esm-error-handling.js[39m[22m 3.07 KiB [1m[32m[emitted][39m[22m [1m[32m[minimized][39m[22m (name: main) 1 related asset
|
|
3
3
|
[35m@openmrs/esm-error-handling:build: [0mruntime modules 1.76 KiB 6 modules
|
|
4
4
|
[35m@openmrs/esm-error-handling:build: [0mbuilt modules 5.33 KiB [1m[33m[built][39m[22m
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
[35m@openmrs/esm-error-handling:build: [0m [1m../../../node_modules/systemjs-webpack-interop/public-path.js[39m[22m 2.36 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
9
9
|
[35m@openmrs/esm-error-handling:build: [0m [1m./src/index.ts[39m[22m 2.02 KiB [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
10
10
|
[35m@openmrs/esm-error-handling:build: [0m [1mexternal "@openmrs/esm-globals"[39m[22m 42 bytes [1m[33m[built][39m[22m [1m[33m[code generated][39m[22m
|
|
11
|
-
[35m@openmrs/esm-error-handling:build: [0mwebpack 5.
|
|
11
|
+
[35m@openmrs/esm-error-handling:build: [0mwebpack 5.77.0 compiled [1m[32msuccessfully[39m[22m in 12071 ms
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openmrs-esm-error-handling.js","mappings":"uMAAA,MAAMA,EAAmB,SAEzBC,EAAQ,EAAiB,SAAwBC,GAY7C,GAXGA,IACHA,EAAe,IAUV,IAAmBC,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,MAAO7B,GACP8B,EAAU,yDAER,OAFiEtC,OAAOyC,KACxEJ,GAEJ,CACA,OAAOpE,MAAMqE,EACf,CAAO,YAAc9C,IAAV6C,EACFpE,MAAO,sCAEPA,MAAMoE,EAAMK,WAEvB,CAzDAjC,OAAOkC,QAAU,SAAU3E,GAOzB,OANAD,QAAQC,MAAM,qBAAsBA,IACpC4E,EAAAA,EAAAA,2BAA0B,CACxBC,YAAa7E,QAAAA,EAAS,sCACtB8E,KAAM,QACNC,MAAO,WAEF,CACT,EAEAtC,OAAOuC,qBAAuB,SAAUC,G,IAIlCA,EAHJlF,QAAQC,MAAM,wBAAyBiF,EAAMC,SAC7CN,EAAAA,EAAAA,2BAA0B,CACxBC,YACc,QAAZI,EAAAA,EAAMC,cAAND,IAAAA,EAAAA,EAAgB,iDAClBH,KAAM,QACNC,MAAO,SAEX,C","sources":["webpack://@openmrs/esm-error-handling/../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@openmrs/esm-error-handling/../../../node_modules/systemjs-webpack-interop/public-path.js","webpack://@openmrs/esm-error-handling/external system \"@openmrs/esm-globals\"","webpack://@openmrs/esm-error-handling/webpack/bootstrap","webpack://@openmrs/esm-error-handling/webpack/runtime/__system_context__","webpack://@openmrs/esm-error-handling/webpack/runtime/define property getters","webpack://@openmrs/esm-error-handling/webpack/runtime/global","webpack://@openmrs/esm-error-handling/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-error-handling/webpack/runtime/make namespace object","webpack://@openmrs/esm-error-handling/webpack/runtime/publicPath","webpack://@openmrs/esm-error-handling/../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@openmrs/esm-error-handling/./src/index.ts"],"sourcesContent":["const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","module.exports = __WEBPACK_EXTERNAL_MODULE__728__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.y = __system_context__;","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","/** @module @category Error Handling */\nimport { dispatchNotificationShown } from \"@openmrs/esm-globals\";\n\nwindow.onerror = function (error) {\n console.error(\"Unexpected error: \", error);\n dispatchNotificationShown({\n description: error ?? \"Oops! An unexpected error occurred.\",\n kind: \"error\",\n title: \"Error\",\n });\n return false;\n};\n\nwindow.onunhandledrejection = function (event) {\n console.error(\"Unhandled rejection: \", event.reason);\n dispatchNotificationShown({\n description:\n event.reason ?? \"Oops! An unhandled promise rejection occurred.\",\n kind: \"error\",\n title: \"Error\",\n });\n};\n\nexport function reportError(err) {\n const error = ensureErrorObject(err);\n setTimeout(() => {\n throw error;\n });\n}\n\nexport function createErrorHandler() {\n const outgoingErr = Error();\n return (incomingErr) => {\n const finalErr = ensureErrorObject(incomingErr);\n finalErr.stack += `\\nAsync stacktrace:\\n${outgoingErr.stack}`;\n reportError(incomingErr);\n };\n}\n\nfunction ensureErrorObject(thing: any) {\n let message;\n\n if (thing instanceof Error) {\n return thing;\n } else if (thing === null) {\n return Error(`'null' was thrown as an error`);\n } else if (typeof thing === \"object\") {\n try {\n message = `Object thrown as error: ${JSON.stringify(thing)}`;\n } catch (e) {\n message = `Object thrown as error with the following properties: ${Object.keys(\n thing\n )}`;\n }\n return Error(message);\n } else if (thing === undefined) {\n return Error(`'undefined' was thrown as an error`);\n } else {\n return Error(thing.toString());\n }\n}\n"],"names":["resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","module","__WEBPACK_EXTERNAL_MODULE__728__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","y","__system_context__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","src","scripts","getElementsByTagName","replace","p","autoPublicPath","reportError","err","ensureErrorObject","setTimeout","createErrorHandler","outgoingErr","incomingErr","stack","thing","message","JSON","stringify","keys","toString","onerror","dispatchNotificationShown","description","kind","title","onunhandledrejection","event","reason"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"openmrs-esm-error-handling.js","mappings":"uMAAA,MAAMA,EAAmB,SAEzBC,EAAQ,EAAiB,SAAwBC,GAY7C,GAXGA,IACHA,EAAe,IAUV,IAAmBC,OAAS,IAAmBA,KAAKC,IAEvD,MADAC,QAAQC,MAAM,qBAAsB,KAC9BC,MACJ,uHAIJ,IAA0BP,EACxB,IAAmBG,KAAKC,IACxBF,EAGN,C,gBCoDAD,EAAQ,EAlCR,SAA0BO,EAAWC,GAKnC,IAAIC,EAAIC,SAASC,cAAc,KAC/BF,EAAEG,KAAOL,EAKT,IAHA,IAAIM,EAA6B,MAAlBJ,EAAEI,SAAS,GAAaJ,EAAEI,SAAW,IAAMJ,EAAEI,SACxDC,EAAmB,EAC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AEAtC,OAAOuC,qBAAuB,SAAUC,G,IAIlCA,EAHJlF,QAAQC,MAAM,wBAAyBiF,EAAMC,SAC7CN,EAAAA,EAAAA,2BAA0B,CACxBC,YACc,QAAZI,EAAAA,EAAMC,cAAND,IAAAA,EAAAA,EAAgB,iDAClBH,KAAM,QACNC,MAAO,SAEX,C","sources":["webpack://@openmrs/esm-error-handling/../../../node_modules/systemjs-webpack-interop/auto-public-path/auto-public-path.js","webpack://@openmrs/esm-error-handling/../../../node_modules/systemjs-webpack-interop/public-path.js","webpack://@openmrs/esm-error-handling/external system \"@openmrs/esm-globals\"","webpack://@openmrs/esm-error-handling/webpack/bootstrap","webpack://@openmrs/esm-error-handling/webpack/runtime/__system_context__","webpack://@openmrs/esm-error-handling/webpack/runtime/define property getters","webpack://@openmrs/esm-error-handling/webpack/runtime/global","webpack://@openmrs/esm-error-handling/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-error-handling/webpack/runtime/make namespace object","webpack://@openmrs/esm-error-handling/webpack/runtime/publicPath","webpack://@openmrs/esm-error-handling/../../../node_modules/systemjs-webpack-interop/auto-public-path/1.js","webpack://@openmrs/esm-error-handling/./src/index.ts"],"sourcesContent":["const resolveDirectory = require(\"../public-path\").resolveDirectory;\n\nexports.autoPublicPath = function autoPublicPath(rootDirLevel) {\n if (!rootDirLevel) {\n rootDirLevel = 1;\n }\n\n if (typeof __webpack_public_path__ !== \"undefined\") {\n if (typeof __system_context__ === \"undefined\") {\n throw Error(\n \"systemjs-webpack-interop requires webpack@>=5.0.0-beta.15 and output.libraryTarget set to 'system'\"\n );\n }\n\n if (!__system_context__.meta || !__system_context__.meta.url) {\n console.error(\"__system_context__\", __system_context__);\n throw Error(\n \"systemjs-webpack-interop was provided an unknown SystemJS context. Expected context.meta.url, but none was provided\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(\n __system_context__.meta.url,\n rootDirLevel\n );\n }\n};\n","exports.setPublicPath = function setPublicPath(\n systemjsModuleName,\n rootDirectoryLevel\n) {\n if (!rootDirectoryLevel) {\n rootDirectoryLevel = 1;\n }\n if (\n typeof systemjsModuleName !== \"string\" ||\n systemjsModuleName.trim().length === 0\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'\"\n );\n }\n\n if (\n typeof rootDirectoryLevel !== \"number\" ||\n rootDirectoryLevel <= 0 ||\n isNaN(rootDirectoryLevel) ||\n !isInteger(rootDirectoryLevel)\n ) {\n throw Error(\n \"systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'\"\n );\n }\n\n var moduleUrl;\n try {\n moduleUrl = window.System.resolve(systemjsModuleName);\n if (!moduleUrl) {\n throw Error();\n }\n } catch (err) {\n throw Error(\n \"systemjs-webpack-interop: There is no such module '\" +\n systemjsModuleName +\n \"' in the SystemJS registry. Did you misspell the name of your module?\"\n );\n }\n\n __webpack_public_path__ = resolveDirectory(moduleUrl, rootDirectoryLevel);\n};\n\nfunction resolveDirectory(urlString, rootDirectoryLevel) {\n // Our friend IE11 doesn't support new URL()\n // https://github.com/single-spa/single-spa/issues/612\n // https://gist.github.com/jlong/2428561\n\n var a = document.createElement(\"a\");\n a.href = urlString;\n\n var pathname = a.pathname[0] === \"/\" ? a.pathname : \"/\" + a.pathname;\n var numDirsProcessed = 0,\n index = pathname.length;\n while (numDirsProcessed !== rootDirectoryLevel && index >= 0) {\n var char = pathname[--index];\n if (char === \"/\") {\n numDirsProcessed++;\n }\n }\n\n if (numDirsProcessed !== rootDirectoryLevel) {\n throw Error(\n \"systemjs-webpack-interop: rootDirectoryLevel (\" +\n rootDirectoryLevel +\n \") is greater than the number of directories (\" +\n numDirsProcessed +\n \") in the URL path \" +\n urlString\n );\n }\n\n var finalPath = pathname.slice(0, index + 1);\n\n return a.protocol + \"//\" + a.host + finalPath;\n}\n\nexports.resolveDirectory = resolveDirectory;\n\n// borrowed from https://github.com/parshap/js-is-integer/blob/master/index.js\nvar isInteger =\n Number.isInteger ||\n function isInteger(val) {\n return typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n };\n","module.exports = __WEBPACK_EXTERNAL_MODULE__728__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.y = __system_context__;","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","const autoPublicPath = require(\"./auto-public-path\").autoPublicPath;\n\nautoPublicPath(1);\n","/** @module @category Error Handling */\nimport { dispatchNotificationShown } from \"@openmrs/esm-globals\";\n\nwindow.onerror = function (error) {\n console.error(\"Unexpected error: \", error);\n dispatchNotificationShown({\n description: error ?? \"Oops! An unexpected error occurred.\",\n kind: \"error\",\n title: \"Error\",\n });\n return false;\n};\n\nwindow.onunhandledrejection = function (event) {\n console.error(\"Unhandled rejection: \", event.reason);\n dispatchNotificationShown({\n description:\n event.reason ?? \"Oops! An unhandled promise rejection occurred.\",\n kind: \"error\",\n title: \"Error\",\n });\n};\n\nexport function reportError(err) {\n const error = ensureErrorObject(err);\n setTimeout(() => {\n throw error;\n });\n}\n\nexport function createErrorHandler() {\n const outgoingErr = Error();\n return (incomingErr) => {\n const finalErr = ensureErrorObject(incomingErr);\n finalErr.stack += `\\nAsync stacktrace:\\n${outgoingErr.stack}`;\n reportError(incomingErr);\n };\n}\n\nfunction ensureErrorObject(thing: any) {\n let message;\n\n if (thing instanceof Error) {\n return thing;\n } else if (thing === null) {\n return Error(`'null' was thrown as an error`);\n } else if (typeof thing === \"object\") {\n try {\n message = `Object thrown as error: ${JSON.stringify(thing)}`;\n } catch (e) {\n message = `Object thrown as error with the following properties: ${Object.keys(\n thing\n )}`;\n }\n return Error(message);\n } else if (thing === undefined) {\n return Error(`'undefined' was thrown as an error`);\n } else {\n return Error(thing.toString());\n }\n}\n"],"names":["resolveDirectory","exports","rootDirLevel","meta","url","console","error","Error","urlString","rootDirectoryLevel","a","document","createElement","href","pathname","numDirsProcessed","index","length","finalPath","slice","protocol","host","Number","isInteger","module","__WEBPACK_EXTERNAL_MODULE__728__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","y","__system_context__","d","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","scriptUrl","importScripts","location","currentScript","src","scripts","getElementsByTagName","replace","p","autoPublicPath","reportError","err","ensureErrorObject","setTimeout","createErrorHandler","outgoingErr","incomingErr","stack","thing","message","JSON","stringify","keys","toString","onerror","dispatchNotificationShown","description","kind","title","onunhandledrejection","event","reason"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-error-handling",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "An ES module to help with error handling",
|
|
6
6
|
"browser": "dist/openmrs-esm-error-handling.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@openmrs/esm-globals": "4.x"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@openmrs/esm-globals": "^4.
|
|
42
|
+
"@openmrs/esm-globals": "^4.3.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "839d51d2e28c9965be63d2a671d6e8ceed6ffb9e"
|
|
45
45
|
}
|