UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

27 lines (26 loc) 575 B
import { struct as E } from "../../../utils/struct/main.js"; import { getter as o, enumerable as n } from "../../../utils/struct/property.js"; const e = Symbol("<<NO_ERR>>"); function c(r) { /* istanbul ignore if -- @preserve */ if (r === e) throw new TypeError("Illegal error"); } const f = () => { let r = e; const s = () => { r = e; }, a = (t) => { c(t), r = t; }; return E({ error: o(() => r === e ? void 0 : r), hasError: o(() => r !== e), reset: n(s), set: n(a) }); }; export { f as createErrorContainer, f as default };