@praha/byethrow 0.0.1
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/LICENSE +21 -0
- package/README.md +77 -0
- package/dist/cjs/exports.cjs +186 -0
- package/dist/cjs/exports.d.ts +15 -0
- package/dist/cjs/functions/and-then.cjs +44 -0
- package/dist/cjs/functions/and-then.d.ts +45 -0
- package/dist/cjs/functions/and-through.cjs +50 -0
- package/dist/cjs/functions/and-through.d.ts +57 -0
- package/dist/cjs/functions/bind.cjs +50 -0
- package/dist/cjs/functions/bind.d.ts +61 -0
- package/dist/cjs/functions/do.cjs +37 -0
- package/dist/cjs/functions/do.d.ts +17 -0
- package/dist/cjs/functions/fail.cjs +50 -0
- package/dist/cjs/functions/fail.d.ts +38 -0
- package/dist/cjs/functions/is-failure.cjs +36 -0
- package/dist/cjs/functions/is-failure.d.ts +22 -0
- package/dist/cjs/functions/is-success.cjs +36 -0
- package/dist/cjs/functions/is-success.d.ts +22 -0
- package/dist/cjs/functions/map-error.cjs +46 -0
- package/dist/cjs/functions/map-error.d.ts +37 -0
- package/dist/cjs/functions/map.cjs +46 -0
- package/dist/cjs/functions/map.d.ts +37 -0
- package/dist/cjs/functions/pipe.cjs +40 -0
- package/dist/cjs/functions/pipe.d.ts +58 -0
- package/dist/cjs/functions/succeed.cjs +50 -0
- package/dist/cjs/functions/succeed.d.ts +39 -0
- package/dist/cjs/functions/try.cjs +52 -0
- package/dist/cjs/functions/try.d.ts +84 -0
- package/dist/cjs/functions/unwrap-error.cjs +40 -0
- package/dist/cjs/functions/unwrap-error.d.ts +31 -0
- package/dist/cjs/functions/unwrap.cjs +40 -0
- package/dist/cjs/functions/unwrap.d.ts +31 -0
- package/dist/cjs/index.cjs +39 -0
- package/dist/cjs/index.d.ts +69 -0
- package/dist/cjs/internals/helpers/is-promise.cjs +36 -0
- package/dist/cjs/internals/helpers/is-promise.d.ts +9 -0
- package/dist/cjs/internals/types/has-promise.cjs +18 -0
- package/dist/cjs/internals/types/has-promise.d.ts +17 -0
- package/dist/cjs/result.cjs +18 -0
- package/dist/cjs/result.d.ts +193 -0
- package/dist/esm/exports.d.ts +15 -0
- package/dist/esm/exports.js +15 -0
- package/dist/esm/functions/and-then.d.ts +45 -0
- package/dist/esm/functions/and-then.js +10 -0
- package/dist/esm/functions/and-through.d.ts +57 -0
- package/dist/esm/functions/and-through.js +16 -0
- package/dist/esm/functions/bind.d.ts +61 -0
- package/dist/esm/functions/bind.js +16 -0
- package/dist/esm/functions/do.d.ts +17 -0
- package/dist/esm/functions/do.js +3 -0
- package/dist/esm/functions/fail.d.ts +38 -0
- package/dist/esm/functions/fail.js +16 -0
- package/dist/esm/functions/is-failure.d.ts +22 -0
- package/dist/esm/functions/is-failure.js +2 -0
- package/dist/esm/functions/is-success.d.ts +22 -0
- package/dist/esm/functions/is-success.js +2 -0
- package/dist/esm/functions/map-error.d.ts +37 -0
- package/dist/esm/functions/map-error.js +12 -0
- package/dist/esm/functions/map.d.ts +37 -0
- package/dist/esm/functions/map.js +12 -0
- package/dist/esm/functions/pipe.d.ts +58 -0
- package/dist/esm/functions/pipe.js +6 -0
- package/dist/esm/functions/succeed.d.ts +39 -0
- package/dist/esm/functions/succeed.js +16 -0
- package/dist/esm/functions/try.d.ts +84 -0
- package/dist/esm/functions/try.js +18 -0
- package/dist/esm/functions/unwrap-error.d.ts +31 -0
- package/dist/esm/functions/unwrap-error.js +6 -0
- package/dist/esm/functions/unwrap.d.ts +31 -0
- package/dist/esm/functions/unwrap.js +6 -0
- package/dist/esm/index.d.ts +69 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/internals/helpers/is-promise.d.ts +9 -0
- package/dist/esm/internals/helpers/is-promise.js +2 -0
- package/dist/esm/internals/types/has-promise.d.ts +17 -0
- package/dist/esm/internals/types/has-promise.js +0 -0
- package/dist/esm/result.d.ts +193 -0
- package/dist/esm/result.js +0 -0
- package/package.json +61 -0
package/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) PrAha, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# @praha/byethrow
|
2
|
+
|
3
|
+
[](https://www.npmjs.com/package/@praha/byethrow)
|
4
|
+
[](https://www.npmjs.com/package/@praha/byethrow)
|
5
|
+
[](https://github.com/praha-inc/byethrow/blob/main/LICENSE)
|
6
|
+
[](https://github.com/orgs/praha-inc/followers)
|
7
|
+
|
8
|
+
A lightweight, tree-shakable Result type package with a simple, consistent API designed.
|
9
|
+
|
10
|
+
## ✨ Features
|
11
|
+
|
12
|
+
- 🌲 Tree-shakable: Only include what you use.
|
13
|
+
- 🧱 Lightweight & object-based: No classes, no magic—just plain objects.
|
14
|
+
- 🔄 Consistent API: Designed for readability and predictability.
|
15
|
+
- 🔀 Unified sync/async handling: Works seamlessly with both Result<T, E> and Promise<Result<T, E>>.
|
16
|
+
- 🎯 Focused functionality: Result-centric utilities without unnecessary aliases or confusing variants.
|
17
|
+
|
18
|
+
## 🧠 Motivation
|
19
|
+
|
20
|
+
Handling errors in JavaScript and TypeScript often leads to unstructured code. The typical try/catch approach doesn’t scale well and mixes error handling with business logic. `@praha/byethrow` addresses this by introducing a simple Result type, empowering you to model computation outcomes clearly—while keeping control flow explicit and maintainable.
|
21
|
+
|
22
|
+
If you're a fan of libraries like `neverthrow` or effect-ts, this tool will feel familiar. While `neverthrow` may occasionally lack certain features, and `effect-ts` or `fp-ts` can introduce unnecessary complexity or overhead for many use cases, `@praha/byethrow` strikes a thoughtful balance—remaining lightweight and focused, while still offering everything you need to handle both synchronous and asynchronous fallible operations.
|
23
|
+
|
24
|
+
## 📦 Installation
|
25
|
+
|
26
|
+
```bash
|
27
|
+
npm install @praha/byethrow
|
28
|
+
```
|
29
|
+
|
30
|
+
## 📚 Documentation
|
31
|
+
|
32
|
+
Detailed API docs are available at:
|
33
|
+
👉 https://praha-inc.github.io/byethrow
|
34
|
+
|
35
|
+
## 🚀 Quick Example
|
36
|
+
|
37
|
+
Here's a simple example showing how it is used:
|
38
|
+
|
39
|
+
```ts
|
40
|
+
import { Result } from '@praha/byethrow';
|
41
|
+
|
42
|
+
const validateId = (id: string) => {
|
43
|
+
if (!id.startsWith('u')) {
|
44
|
+
return Result.fail(new Error('Invalid ID format'));
|
45
|
+
}
|
46
|
+
return Result.succeed();
|
47
|
+
};
|
48
|
+
|
49
|
+
const findUser = Result.try({
|
50
|
+
try: (id: string) => {
|
51
|
+
return { id, name: 'John Doe' };
|
52
|
+
},
|
53
|
+
catch: (error) => new Error('Failed to find user', { cause: error }),
|
54
|
+
});
|
55
|
+
|
56
|
+
const result = Result.pipe(
|
57
|
+
Result.succeed('u123'),
|
58
|
+
Result.andThrough(validateId),
|
59
|
+
Result.andThen(findUser),
|
60
|
+
);
|
61
|
+
|
62
|
+
if (Result.isSuccess(result)) {
|
63
|
+
console.log(result.value); // User found: John Doe
|
64
|
+
}
|
65
|
+
```
|
66
|
+
|
67
|
+
## 🤝 Contributing
|
68
|
+
|
69
|
+
Contributions, issues and feature requests are welcome.
|
70
|
+
|
71
|
+
Feel free to check [issues page](https://github.com/praha-inc/byethrow/issues) if you want to contribute.
|
72
|
+
|
73
|
+
## 📝 License
|
74
|
+
|
75
|
+
Copyright © [PrAha, Inc.](https://www.praha-inc.com/)
|
76
|
+
|
77
|
+
This project is [```MIT```](https://github.com/praha-inc/byethrow/blob/main/packages/byethrow/LICENSE) licensed.
|
@@ -0,0 +1,186 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __webpack_modules__ = {
|
3
|
+
"./functions/and-then": function(module) {
|
4
|
+
module.exports = require("./functions/and-then.cjs");
|
5
|
+
},
|
6
|
+
"./functions/and-through": function(module) {
|
7
|
+
module.exports = require("./functions/and-through.cjs");
|
8
|
+
},
|
9
|
+
"./functions/bind": function(module) {
|
10
|
+
module.exports = require("./functions/bind.cjs");
|
11
|
+
},
|
12
|
+
"./functions/do": function(module) {
|
13
|
+
module.exports = require("./functions/do.cjs");
|
14
|
+
},
|
15
|
+
"./functions/fail": function(module) {
|
16
|
+
module.exports = require("./functions/fail.cjs");
|
17
|
+
},
|
18
|
+
"./functions/is-failure": function(module) {
|
19
|
+
module.exports = require("./functions/is-failure.cjs");
|
20
|
+
},
|
21
|
+
"./functions/is-success": function(module) {
|
22
|
+
module.exports = require("./functions/is-success.cjs");
|
23
|
+
},
|
24
|
+
"./functions/map-error": function(module) {
|
25
|
+
module.exports = require("./functions/map-error.cjs");
|
26
|
+
},
|
27
|
+
"./functions/map": function(module) {
|
28
|
+
module.exports = require("./functions/map.cjs");
|
29
|
+
},
|
30
|
+
"./functions/pipe": function(module) {
|
31
|
+
module.exports = require("./functions/pipe.cjs");
|
32
|
+
},
|
33
|
+
"./functions/succeed": function(module) {
|
34
|
+
module.exports = require("./functions/succeed.cjs");
|
35
|
+
},
|
36
|
+
"./functions/try": function(module) {
|
37
|
+
module.exports = require("./functions/try.cjs");
|
38
|
+
},
|
39
|
+
"./functions/unwrap-error": function(module) {
|
40
|
+
module.exports = require("./functions/unwrap-error.cjs");
|
41
|
+
},
|
42
|
+
"./functions/unwrap": function(module) {
|
43
|
+
module.exports = require("./functions/unwrap.cjs");
|
44
|
+
},
|
45
|
+
"./result": function(module) {
|
46
|
+
module.exports = require("./result.cjs");
|
47
|
+
}
|
48
|
+
};
|
49
|
+
var __webpack_module_cache__ = {};
|
50
|
+
function __webpack_require__(moduleId) {
|
51
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
52
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
53
|
+
var module = __webpack_module_cache__[moduleId] = {
|
54
|
+
exports: {}
|
55
|
+
};
|
56
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
57
|
+
return module.exports;
|
58
|
+
}
|
59
|
+
(()=>{
|
60
|
+
__webpack_require__.n = (module)=>{
|
61
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
62
|
+
__webpack_require__.d(getter, {
|
63
|
+
a: getter
|
64
|
+
});
|
65
|
+
return getter;
|
66
|
+
};
|
67
|
+
})();
|
68
|
+
(()=>{
|
69
|
+
__webpack_require__.d = (exports1, definition)=>{
|
70
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
71
|
+
enumerable: true,
|
72
|
+
get: definition[key]
|
73
|
+
});
|
74
|
+
};
|
75
|
+
})();
|
76
|
+
(()=>{
|
77
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
78
|
+
})();
|
79
|
+
(()=>{
|
80
|
+
__webpack_require__.r = (exports1)=>{
|
81
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
82
|
+
value: 'Module'
|
83
|
+
});
|
84
|
+
Object.defineProperty(exports1, '__esModule', {
|
85
|
+
value: true
|
86
|
+
});
|
87
|
+
};
|
88
|
+
})();
|
89
|
+
var __webpack_exports__ = {};
|
90
|
+
(()=>{
|
91
|
+
__webpack_require__.r(__webpack_exports__);
|
92
|
+
var _result__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./result");
|
93
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
94
|
+
for(var __WEBPACK_IMPORT_KEY__ in _result__WEBPACK_IMPORTED_MODULE_0__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
95
|
+
return _result__WEBPACK_IMPORTED_MODULE_0__[key];
|
96
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
97
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
98
|
+
var _functions_and_then__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./functions/and-then");
|
99
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
100
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_and_then__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
101
|
+
return _functions_and_then__WEBPACK_IMPORTED_MODULE_1__[key];
|
102
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
103
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
104
|
+
var _functions_and_through__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./functions/and-through");
|
105
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
106
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_and_through__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
107
|
+
return _functions_and_through__WEBPACK_IMPORTED_MODULE_2__[key];
|
108
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
109
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
110
|
+
var _functions_bind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./functions/bind");
|
111
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
112
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_bind__WEBPACK_IMPORTED_MODULE_3__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
113
|
+
return _functions_bind__WEBPACK_IMPORTED_MODULE_3__[key];
|
114
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
115
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
116
|
+
var _functions_do__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./functions/do");
|
117
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
118
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_do__WEBPACK_IMPORTED_MODULE_4__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
119
|
+
return _functions_do__WEBPACK_IMPORTED_MODULE_4__[key];
|
120
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
121
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
122
|
+
var _functions_fail__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./functions/fail");
|
123
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
124
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_fail__WEBPACK_IMPORTED_MODULE_5__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
125
|
+
return _functions_fail__WEBPACK_IMPORTED_MODULE_5__[key];
|
126
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
127
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
128
|
+
var _functions_is_failure__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./functions/is-failure");
|
129
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
130
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_is_failure__WEBPACK_IMPORTED_MODULE_6__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
131
|
+
return _functions_is_failure__WEBPACK_IMPORTED_MODULE_6__[key];
|
132
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
133
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
134
|
+
var _functions_is_success__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("./functions/is-success");
|
135
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
136
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_is_success__WEBPACK_IMPORTED_MODULE_7__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
137
|
+
return _functions_is_success__WEBPACK_IMPORTED_MODULE_7__[key];
|
138
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
139
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
140
|
+
var _functions_map__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./functions/map");
|
141
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
142
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_map__WEBPACK_IMPORTED_MODULE_8__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
143
|
+
return _functions_map__WEBPACK_IMPORTED_MODULE_8__[key];
|
144
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
145
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
146
|
+
var _functions_map_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("./functions/map-error");
|
147
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
148
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_map_error__WEBPACK_IMPORTED_MODULE_9__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
149
|
+
return _functions_map_error__WEBPACK_IMPORTED_MODULE_9__[key];
|
150
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
151
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
152
|
+
var _functions_pipe__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./functions/pipe");
|
153
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
154
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_pipe__WEBPACK_IMPORTED_MODULE_10__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
155
|
+
return _functions_pipe__WEBPACK_IMPORTED_MODULE_10__[key];
|
156
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
157
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
158
|
+
var _functions_succeed__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__("./functions/succeed");
|
159
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
160
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_succeed__WEBPACK_IMPORTED_MODULE_11__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
161
|
+
return _functions_succeed__WEBPACK_IMPORTED_MODULE_11__[key];
|
162
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
163
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
164
|
+
var _functions_try__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__("./functions/try");
|
165
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
166
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_try__WEBPACK_IMPORTED_MODULE_12__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
167
|
+
return _functions_try__WEBPACK_IMPORTED_MODULE_12__[key];
|
168
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
169
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
170
|
+
var _functions_unwrap__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__("./functions/unwrap");
|
171
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
172
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_unwrap__WEBPACK_IMPORTED_MODULE_13__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
173
|
+
return _functions_unwrap__WEBPACK_IMPORTED_MODULE_13__[key];
|
174
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
175
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
176
|
+
var _functions_unwrap_error__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__("./functions/unwrap-error");
|
177
|
+
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
178
|
+
for(var __WEBPACK_IMPORT_KEY__ in _functions_unwrap_error__WEBPACK_IMPORTED_MODULE_14__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
|
179
|
+
return _functions_unwrap_error__WEBPACK_IMPORTED_MODULE_14__[key];
|
180
|
+
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
181
|
+
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
182
|
+
})();
|
183
|
+
for(var __webpack_i__ in __webpack_exports__)exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
184
|
+
Object.defineProperty(exports, '__esModule', {
|
185
|
+
value: true
|
186
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export * from './result';
|
2
|
+
export * from './functions/and-then';
|
3
|
+
export * from './functions/and-through';
|
4
|
+
export * from './functions/bind';
|
5
|
+
export * from './functions/do';
|
6
|
+
export * from './functions/fail';
|
7
|
+
export * from './functions/is-failure';
|
8
|
+
export * from './functions/is-success';
|
9
|
+
export * from './functions/map';
|
10
|
+
export * from './functions/map-error';
|
11
|
+
export * from './functions/pipe';
|
12
|
+
export * from './functions/succeed';
|
13
|
+
export * from './functions/try';
|
14
|
+
export * from './functions/unwrap';
|
15
|
+
export * from './functions/unwrap-error';
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __webpack_require__ = {};
|
3
|
+
(()=>{
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
|
+
enumerable: true,
|
7
|
+
get: definition[key]
|
8
|
+
});
|
9
|
+
};
|
10
|
+
})();
|
11
|
+
(()=>{
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
13
|
+
})();
|
14
|
+
(()=>{
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
17
|
+
value: 'Module'
|
18
|
+
});
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
20
|
+
value: true
|
21
|
+
});
|
22
|
+
};
|
23
|
+
})();
|
24
|
+
var __webpack_exports__ = {};
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
27
|
+
andThen: ()=>andThen
|
28
|
+
});
|
29
|
+
const external_is_failure_cjs_namespaceObject = require("./is-failure.cjs");
|
30
|
+
const is_promise_cjs_namespaceObject = require("../internals/helpers/is-promise.cjs");
|
31
|
+
const andThen = (fn)=>(result)=>{
|
32
|
+
const apply = (r)=>{
|
33
|
+
if ((0, external_is_failure_cjs_namespaceObject.isFailure)(r)) return r;
|
34
|
+
return fn(r.value);
|
35
|
+
};
|
36
|
+
return (0, is_promise_cjs_namespaceObject.isPromise)(result) ? result.then(apply) : apply(result);
|
37
|
+
};
|
38
|
+
exports.andThen = __webpack_exports__.andThen;
|
39
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
40
|
+
"andThen"
|
41
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
42
|
+
Object.defineProperty(exports, '__esModule', {
|
43
|
+
value: true
|
44
|
+
});
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import type { InferFailure, InferSuccess, ResultFor, ResultMaybeAsync } from '../result';
|
2
|
+
/**
|
3
|
+
* Chains the next computation using the success value of a {@link Result} or {@link ResultAsync}.
|
4
|
+
* If the original result is a {@link Failure}, it is returned unchanged.
|
5
|
+
* Otherwise, the provided function is called, and its result is returned as-is.
|
6
|
+
*
|
7
|
+
* @function
|
8
|
+
* @typeParam R1 - The input {@link Result} or {@link ResultAsync}.
|
9
|
+
* @typeParam R2 - The result type returned by `fn`.
|
10
|
+
*
|
11
|
+
* @example Success Case
|
12
|
+
* ```ts
|
13
|
+
* import { Result } from '@praha/byethrow';
|
14
|
+
*
|
15
|
+
* const result = Result.pipe(
|
16
|
+
* Result.succeed(3),
|
17
|
+
* Result.andThen((x) => Result.succeed(x * 2)),
|
18
|
+
* );
|
19
|
+
* // { type: 'Success', value: 6 }
|
20
|
+
* ```
|
21
|
+
*
|
22
|
+
* @example Failure Case (input is a Failure)
|
23
|
+
* ```ts
|
24
|
+
* const result = Result.pipe(
|
25
|
+
* Result.fail('error'),
|
26
|
+
* Result.andThen((x) => Result.succeed(x * 2)),
|
27
|
+
* );
|
28
|
+
* // result: { type: 'Failure', error: 'error' }
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* @example Failure Case (function returns a Failure)
|
32
|
+
* ```ts
|
33
|
+
* const result = Result.pipe(
|
34
|
+
* Result.succeed(3),
|
35
|
+
* Result.andThen((x) => Result.fail('error: ' + x)),
|
36
|
+
* );
|
37
|
+
* // result: { type: 'Failure', error: 'error: 3' }
|
38
|
+
* ```
|
39
|
+
*
|
40
|
+
* @category Combinators
|
41
|
+
*/
|
42
|
+
export declare const andThen: {
|
43
|
+
<R1 extends ResultMaybeAsync<any, any>, R2 extends ResultMaybeAsync<any, any>>(fn: (a: InferSuccess<R1>) => R2): (result: R1) => ResultFor<R1 | R2, InferSuccess<R2>, InferFailure<R1> | InferFailure<R2>>;
|
44
|
+
<F extends (a: any) => ResultMaybeAsync<any, any>>(fn: F): <R1 extends ResultMaybeAsync<Parameters<F>[0], any>>(result: R1) => ResultFor<R1 | ReturnType<F>, InferSuccess<F>, InferFailure<R1> | InferFailure<F>>;
|
45
|
+
};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __webpack_require__ = {};
|
3
|
+
(()=>{
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
|
+
enumerable: true,
|
7
|
+
get: definition[key]
|
8
|
+
});
|
9
|
+
};
|
10
|
+
})();
|
11
|
+
(()=>{
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
13
|
+
})();
|
14
|
+
(()=>{
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
17
|
+
value: 'Module'
|
18
|
+
});
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
20
|
+
value: true
|
21
|
+
});
|
22
|
+
};
|
23
|
+
})();
|
24
|
+
var __webpack_exports__ = {};
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
27
|
+
andThrough: ()=>andThrough
|
28
|
+
});
|
29
|
+
const external_is_failure_cjs_namespaceObject = require("./is-failure.cjs");
|
30
|
+
const is_promise_cjs_namespaceObject = require("../internals/helpers/is-promise.cjs");
|
31
|
+
const andThrough = (fn)=>(result)=>{
|
32
|
+
const apply = (r)=>{
|
33
|
+
if ((0, external_is_failure_cjs_namespaceObject.isFailure)(r)) return r;
|
34
|
+
const next = fn(r.value);
|
35
|
+
if (next instanceof Promise) return next.then((n)=>{
|
36
|
+
if ((0, external_is_failure_cjs_namespaceObject.isFailure)(n)) return n;
|
37
|
+
return r;
|
38
|
+
});
|
39
|
+
if ((0, external_is_failure_cjs_namespaceObject.isFailure)(next)) return next;
|
40
|
+
return r;
|
41
|
+
};
|
42
|
+
return (0, is_promise_cjs_namespaceObject.isPromise)(result) ? result.then(apply) : apply(result);
|
43
|
+
};
|
44
|
+
exports.andThrough = __webpack_exports__.andThrough;
|
45
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
46
|
+
"andThrough"
|
47
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
49
|
+
value: true
|
50
|
+
});
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import type { InferFailure, InferSuccess, ResultFor, ResultMaybeAsync } from '../result';
|
2
|
+
/**
|
3
|
+
* Runs an additional computation using the success value of a {@link Result} or {@link ResultAsync},
|
4
|
+
* but **returns the original result** if the additional computation is successful.
|
5
|
+
*
|
6
|
+
* If either the original result or the side effect result is a {@link Failure}, that failure is returned.
|
7
|
+
* Useful for running validations or side effects without altering the main result on success.
|
8
|
+
*
|
9
|
+
* @function
|
10
|
+
* @typeParam R1 - The input {@link Result} or {@link ResultAsync}.
|
11
|
+
* @typeParam R2 - The result type returned by `fn`.
|
12
|
+
*
|
13
|
+
* @example Success Case
|
14
|
+
* ```ts
|
15
|
+
* import { Result } from '@praha/byethrow';
|
16
|
+
*
|
17
|
+
* const result = Result.pipe(
|
18
|
+
* Result.succeed(5),
|
19
|
+
* Result.andThrough((x) => {
|
20
|
+
* return x > 0 ? Result.succeed(null) : Result.fail('Must be > 0');
|
21
|
+
* }),
|
22
|
+
* );
|
23
|
+
* // { type: 'Success', value: 5 }
|
24
|
+
* ```
|
25
|
+
*
|
26
|
+
* @example Failure Case (input is a Failure)
|
27
|
+
* ```ts
|
28
|
+
* import { Result } from '@praha/byethrow';
|
29
|
+
*
|
30
|
+
* const result = Result.pipe(
|
31
|
+
* Result.fail('error),
|
32
|
+
* Result.andThrough((x) => {
|
33
|
+
* return x > 0 ? Result.succeed(null) : Result.fail('Must be > 0');
|
34
|
+
* }),
|
35
|
+
* );
|
36
|
+
* // { type: 'Failure', error: 'error' }
|
37
|
+
* ```
|
38
|
+
*
|
39
|
+
* @example Failure Case (function returns a Failure)
|
40
|
+
* ```ts
|
41
|
+
* import { Result } from '@praha/byethrow';
|
42
|
+
*
|
43
|
+
* const result = Result.pipe(
|
44
|
+
* Result.succeed(-10),
|
45
|
+
* Result.andThrough((x) => {
|
46
|
+
* return x > 0 ? Result.succeed(null) : Result.fail('Must be > 0');
|
47
|
+
* }),
|
48
|
+
* );
|
49
|
+
* // { type: 'Failure', error: 'Must be > 0' }
|
50
|
+
* ```
|
51
|
+
*
|
52
|
+
* @category Combinators
|
53
|
+
*/
|
54
|
+
export declare const andThrough: {
|
55
|
+
<R1 extends ResultMaybeAsync<any, any>, R2 extends ResultMaybeAsync<any, any>>(fn: (a: InferSuccess<R1>) => R2): (result: R1) => ResultFor<R1 | R2, InferSuccess<R1>, InferFailure<R1> | InferFailure<R2>>;
|
56
|
+
<F extends (a: any) => ResultMaybeAsync<any, any>>(fn: F): <R1 extends ResultMaybeAsync<Parameters<F>[0], any>>(result: R1) => ResultFor<R1 | ReturnType<F>, InferSuccess<R1>, InferFailure<R1> | InferFailure<F>>;
|
57
|
+
};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __webpack_require__ = {};
|
3
|
+
(()=>{
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
|
+
enumerable: true,
|
7
|
+
get: definition[key]
|
8
|
+
});
|
9
|
+
};
|
10
|
+
})();
|
11
|
+
(()=>{
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
13
|
+
})();
|
14
|
+
(()=>{
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
17
|
+
value: 'Module'
|
18
|
+
});
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
20
|
+
value: true
|
21
|
+
});
|
22
|
+
};
|
23
|
+
})();
|
24
|
+
var __webpack_exports__ = {};
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
27
|
+
bind: ()=>bind
|
28
|
+
});
|
29
|
+
const external_is_failure_cjs_namespaceObject = require("./is-failure.cjs");
|
30
|
+
const external_succeed_cjs_namespaceObject = require("./succeed.cjs");
|
31
|
+
const is_promise_cjs_namespaceObject = require("../internals/helpers/is-promise.cjs");
|
32
|
+
const bind = (name, fn)=>(result)=>{
|
33
|
+
const apply = (r)=>{
|
34
|
+
if ((0, external_is_failure_cjs_namespaceObject.isFailure)(r)) return r;
|
35
|
+
const fr = fn(r.value);
|
36
|
+
const attach = (fr)=>(0, external_is_failure_cjs_namespaceObject.isFailure)(fr) ? fr : (0, external_succeed_cjs_namespaceObject.succeed)({
|
37
|
+
...r.value,
|
38
|
+
[name]: fr.value
|
39
|
+
});
|
40
|
+
return (0, is_promise_cjs_namespaceObject.isPromise)(fr) ? fr.then(attach) : attach(fr);
|
41
|
+
};
|
42
|
+
return (0, is_promise_cjs_namespaceObject.isPromise)(result) ? result.then(apply) : apply(result);
|
43
|
+
};
|
44
|
+
exports.bind = __webpack_exports__.bind;
|
45
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
46
|
+
"bind"
|
47
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
48
|
+
Object.defineProperty(exports, '__esModule', {
|
49
|
+
value: true
|
50
|
+
});
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import type { InferFailure, InferSuccess, ResultFor, ResultMaybeAsync } from '../result';
|
2
|
+
/**
|
3
|
+
* Chains another {@link Result}-producing computation and **merges its success value**
|
4
|
+
* into the existing object under the specified key.
|
5
|
+
*
|
6
|
+
* - If the original result is a {@link Failure}, it is returned as-is.
|
7
|
+
* - If the next result is a {@link Failure}, it is returned as-is.
|
8
|
+
* - If both are {@link Success}, a new object is returned by shallow-merging:
|
9
|
+
* the original success object and `{ [name]: nextSuccess }`.
|
10
|
+
*
|
11
|
+
* This is useful for building up objects in a compositional and type-safe way,
|
12
|
+
* especially in validation or data-fetching pipelines.
|
13
|
+
*
|
14
|
+
* @function
|
15
|
+
* @typeParam N - The key to assign the result of the `fn` computation.
|
16
|
+
* @typeParam R1 - The input {@link Result} or {@link ResultAsync}.
|
17
|
+
* @typeParam R2 - The result type returned by `fn`.
|
18
|
+
*
|
19
|
+
* @example Success Case
|
20
|
+
* ```ts
|
21
|
+
* import { Result } from '@praha/byethrow';
|
22
|
+
*
|
23
|
+
* const result = Result.pipe(
|
24
|
+
* Result.succeed({ name: 'Alice' }),
|
25
|
+
* Result.bind('age', (user) => Result.succeed(20)),
|
26
|
+
* );
|
27
|
+
* // { type: 'Success', value: { name: 1, age: 20 } }
|
28
|
+
* ```
|
29
|
+
*
|
30
|
+
* @example Failure Case (input is a Failure)
|
31
|
+
* ```ts
|
32
|
+
* import { Result } from '@praha/byethrow';
|
33
|
+
*
|
34
|
+
* const result = Result.pipe(
|
35
|
+
* Result.fail('error'),
|
36
|
+
* Result.bind('age', (user) => Result.succeed(20)),
|
37
|
+
* );
|
38
|
+
* // { type: 'Failure', error: 'error' }
|
39
|
+
* ```
|
40
|
+
*
|
41
|
+
* @example Failure Case (function returns a Failure)
|
42
|
+
* ```ts
|
43
|
+
* import { Result } from '@praha/byethrow';
|
44
|
+
*
|
45
|
+
* const result = Result.pipe(
|
46
|
+
* Result.succeed({ name: 'Alice' }),
|
47
|
+
* Result.bind('age', (user) => Result.fail('error')),
|
48
|
+
* );
|
49
|
+
* // { type: 'Failure', error: 'error' }
|
50
|
+
* ```
|
51
|
+
*
|
52
|
+
* @category Combinators
|
53
|
+
*/
|
54
|
+
export declare const bind: {
|
55
|
+
<N extends string, R1 extends ResultMaybeAsync<any, any>, R2 extends ResultMaybeAsync<any, any>>(name: N, fn: (a: InferSuccess<R1>) => R2): (result: R1) => InferSuccess<R1> extends object ? ResultFor<R1 | R2, {
|
56
|
+
[K in N | keyof InferSuccess<R1>]: K extends keyof InferSuccess<R1> ? InferSuccess<R1>[K] : InferSuccess<R2>;
|
57
|
+
}, InferFailure<R1> | InferFailure<R2>> : unknown;
|
58
|
+
<N extends string, F extends (a: any) => ResultMaybeAsync<any, any>>(name: N, fn: F): <R1 extends ResultMaybeAsync<Parameters<F>[0], any>>(result: R1) => Parameters<F>[0] extends object ? ResultFor<R1 | ReturnType<F>, {
|
59
|
+
[K in N | keyof Parameters<F>[0]]: K extends keyof Parameters<F>[0] ? Parameters<F>[0][K] : InferSuccess<F>;
|
60
|
+
}, InferFailure<R1> | InferFailure<F>> : unknown;
|
61
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __webpack_require__ = {};
|
3
|
+
(()=>{
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
|
+
enumerable: true,
|
7
|
+
get: definition[key]
|
8
|
+
});
|
9
|
+
};
|
10
|
+
})();
|
11
|
+
(()=>{
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
13
|
+
})();
|
14
|
+
(()=>{
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
17
|
+
value: 'Module'
|
18
|
+
});
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
20
|
+
value: true
|
21
|
+
});
|
22
|
+
};
|
23
|
+
})();
|
24
|
+
var __webpack_exports__ = {};
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
27
|
+
do: ()=>do_
|
28
|
+
});
|
29
|
+
const external_succeed_cjs_namespaceObject = require("./succeed.cjs");
|
30
|
+
const do_ = ()=>(0, external_succeed_cjs_namespaceObject.succeed)({});
|
31
|
+
exports["do"] = __webpack_exports__["do"];
|
32
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
33
|
+
"do"
|
34
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
35
|
+
Object.defineProperty(exports, '__esModule', {
|
36
|
+
value: true
|
37
|
+
});
|