@common.js/non-error 0.1.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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @common.js/non-error
2
+
3
+ The [non-error](https://www.npmjs.com/package/non-error) package exported as CommonJS modules.
4
+
5
+ Exported from [non-error@0.1.0](https://www.npmjs.com/package/non-error/v/0.1.0) using https://github.com/etienne-martin/common.js.
package/index.d.ts ADDED
@@ -0,0 +1,162 @@
1
+ export type Options = {
2
+ /**
3
+ The superclass to extend from instead of `Error`.
4
+
5
+ This can be useful if you need `NonError` to extend a custom error class.
6
+
7
+ @default Error
8
+
9
+ @example
10
+ ```
11
+ import NonError from 'non-error';
12
+
13
+ const error = new NonError('test', {superclass: TypeError});
14
+
15
+ console.log(error instanceof TypeError);
16
+ //=> true
17
+
18
+ console.log(error instanceof NonError);
19
+ //=> true
20
+ ```
21
+ */
22
+ readonly superclass?: ErrorConstructor;
23
+ };
24
+
25
+ /**
26
+ Wraps a non-error value into an `Error` object.
27
+
28
+ This class is meant to be used when a value that is not an `Error` needs to be thrown or used as an error. JavaScript allows throwing any value, but this is considered bad practice. This class helps enforce proper error handling by converting any thrown value into a proper `Error` instance.
29
+
30
+ @example
31
+ ```
32
+ import NonError from 'non-error';
33
+
34
+ const error = new NonError('Something went wrong');
35
+
36
+ console.log(error.message);
37
+ //=> 'Non-error value: Something went wrong'
38
+
39
+ console.log(error.value);
40
+ //=> 'Something went wrong'
41
+
42
+ console.log(error.isNonError);
43
+ //=> true
44
+
45
+ // Works with any value type
46
+ new NonError(404);
47
+ new NonError({code: 'ERR_NOT_FOUND'});
48
+ new NonError(undefined);
49
+ ```
50
+ */
51
+ export default class NonError extends Error {
52
+ /**
53
+ The error name.
54
+ */
55
+ readonly name: 'NonError';
56
+
57
+ /**
58
+ The error stack trace.
59
+
60
+ Always present for `NonError` instances.
61
+ */
62
+ readonly stack: string;
63
+
64
+ /**
65
+ Identify `NonError` instances. Always `true`.
66
+ */
67
+ readonly isNonError: true;
68
+
69
+ /**
70
+ The original unwrapped value.
71
+
72
+ @example
73
+ ```
74
+ import NonError from 'non-error';
75
+
76
+ const error = new NonError(404);
77
+ console.log(error.value);
78
+ //=> 404
79
+ ```
80
+ */
81
+ readonly value: unknown;
82
+
83
+ /**
84
+ @param value - The value to wrap. The error message will be a string representation of this value, and the original value will be stored in the `value` property. If value is already a `NonError` instance, it is returned as-is. If value is an `Error` instance, a `TypeError` is thrown (throw the Error directly instead).
85
+ */
86
+ constructor(value: unknown, options?: Options);
87
+
88
+ /**
89
+ Check if a value is a `NonError` instance.
90
+
91
+ @param value - The value to check.
92
+ @returns `true` if the value is an instance of `NonError`, `false` otherwise.
93
+
94
+ @example
95
+ ```
96
+ import NonError from 'non-error';
97
+
98
+ const error = new NonError('test');
99
+ console.log(NonError.isNonError(error));
100
+ //=> true
101
+
102
+ console.log(NonError.isNonError(new Error('test')));
103
+ //=> false
104
+ ```
105
+ */
106
+ static isNonError(value: unknown): value is NonError;
107
+
108
+ /**
109
+ Executes the callback immediately and wraps any non-error throws in `NonError`. Real `Error` instances are re-thrown unchanged.
110
+
111
+ Supports both sync and async functions.
112
+
113
+ @param callback - A function to execute immediately.
114
+ @returns The return value of the callback.
115
+
116
+ @example
117
+ ```
118
+ import NonError from 'non-error';
119
+
120
+ // Non-error throws get wrapped
121
+ try {
122
+ NonError.try(() => {
123
+ throw 'string error';
124
+ });
125
+ } catch (error) {
126
+ console.log(error.isNonError);
127
+ //=> true
128
+ }
129
+
130
+ // Real errors pass through unchanged
131
+ try {
132
+ NonError.try(() => {
133
+ throw new TypeError('type error');
134
+ });
135
+ } catch (error) {
136
+ console.log(error instanceof TypeError);
137
+ //=> true
138
+ }
139
+ ```
140
+ */
141
+ static try<T>(callback: () => T): T;
142
+
143
+ /**
144
+ Returns a wrapped function that catches non-error throws and wraps them in `NonError`. Real `Error` instances are re-thrown unchanged.
145
+
146
+ Supports both sync and async functions.
147
+
148
+ Useful for array methods, promise chains, and callbacks that are invoked synchronously or by code with error handling.
149
+
150
+ @param function_ - A function to wrap.
151
+ @returns A wrapped version of the function.
152
+
153
+ @example
154
+ ```
155
+ import NonError from 'non-error';
156
+
157
+ // Array operations
158
+ const results = items.map(NonError.wrap(transform));
159
+ ```
160
+ */
161
+ static wrap<A extends readonly unknown[], R>(function_: (...arguments_: A) => R): (...arguments_: A) => R;
162
+ }
package/index.js ADDED
@@ -0,0 +1,478 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "default", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return NonError;
9
+ }
10
+ });
11
+ function _arrayLikeToArray(arr, len) {
12
+ if (len == null || len > arr.length) len = arr.length;
13
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
14
+ return arr2;
15
+ }
16
+ function _arrayWithoutHoles(arr) {
17
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
18
+ }
19
+ function _assertThisInitialized(self) {
20
+ if (self === void 0) {
21
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
22
+ }
23
+ return self;
24
+ }
25
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
26
+ try {
27
+ var info = gen[key](arg);
28
+ var value = info.value;
29
+ } catch (error) {
30
+ reject(error);
31
+ return;
32
+ }
33
+ if (info.done) {
34
+ resolve(value);
35
+ } else {
36
+ Promise.resolve(value).then(_next, _throw);
37
+ }
38
+ }
39
+ function _asyncToGenerator(fn) {
40
+ return function() {
41
+ var self = this, args = arguments;
42
+ return new Promise(function(resolve, reject) {
43
+ var gen = fn.apply(self, args);
44
+ function _next(value) {
45
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
46
+ }
47
+ function _throw(err) {
48
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
49
+ }
50
+ _next(undefined);
51
+ });
52
+ };
53
+ }
54
+ function _classCallCheck(instance, Constructor) {
55
+ if (!(instance instanceof Constructor)) {
56
+ throw new TypeError("Cannot call a class as a function");
57
+ }
58
+ }
59
+ function isNativeReflectConstruct() {
60
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
61
+ if (Reflect.construct.sham) return false;
62
+ if (typeof Proxy === "function") return true;
63
+ try {
64
+ Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
65
+ return true;
66
+ } catch (e) {
67
+ return false;
68
+ }
69
+ }
70
+ function _construct(Parent, args, Class) {
71
+ if (isNativeReflectConstruct()) {
72
+ _construct = Reflect.construct;
73
+ } else {
74
+ _construct = function _construct(Parent, args, Class) {
75
+ var a = [
76
+ null
77
+ ];
78
+ a.push.apply(a, args);
79
+ var Constructor = Function.bind.apply(Parent, a);
80
+ var instance = new Constructor();
81
+ if (Class) _setPrototypeOf(instance, Class.prototype);
82
+ return instance;
83
+ };
84
+ }
85
+ return _construct.apply(null, arguments);
86
+ }
87
+ function _defineProperties(target, props) {
88
+ for(var i = 0; i < props.length; i++){
89
+ var descriptor = props[i];
90
+ descriptor.enumerable = descriptor.enumerable || false;
91
+ descriptor.configurable = true;
92
+ if ("value" in descriptor) descriptor.writable = true;
93
+ Object.defineProperty(target, descriptor.key, descriptor);
94
+ }
95
+ }
96
+ function _createClass(Constructor, protoProps, staticProps) {
97
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
98
+ if (staticProps) _defineProperties(Constructor, staticProps);
99
+ return Constructor;
100
+ }
101
+ function _getPrototypeOf(o) {
102
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
103
+ return o.__proto__ || Object.getPrototypeOf(o);
104
+ };
105
+ return _getPrototypeOf(o);
106
+ }
107
+ function _inherits(subClass, superClass) {
108
+ if (typeof superClass !== "function" && superClass !== null) {
109
+ throw new TypeError("Super expression must either be null or a function");
110
+ }
111
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
112
+ constructor: {
113
+ value: subClass,
114
+ writable: true,
115
+ configurable: true
116
+ }
117
+ });
118
+ if (superClass) _setPrototypeOf(subClass, superClass);
119
+ }
120
+ function _instanceof(left, right) {
121
+ if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
122
+ return !!right[Symbol.hasInstance](left);
123
+ } else {
124
+ return left instanceof right;
125
+ }
126
+ }
127
+ function _isNativeFunction(fn) {
128
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
129
+ }
130
+ function _iterableToArray(iter) {
131
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
132
+ }
133
+ function _nonIterableSpread() {
134
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
135
+ }
136
+ function _possibleConstructorReturn(self, call) {
137
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
138
+ return call;
139
+ }
140
+ return _assertThisInitialized(self);
141
+ }
142
+ function _setPrototypeOf(o, p) {
143
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
144
+ o.__proto__ = p;
145
+ return o;
146
+ };
147
+ return _setPrototypeOf(o, p);
148
+ }
149
+ function _toConsumableArray(arr) {
150
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
151
+ }
152
+ var _typeof = function(obj) {
153
+ "@swc/helpers - typeof";
154
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
155
+ };
156
+ function _unsupportedIterableToArray(o, minLen) {
157
+ if (!o) return;
158
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
159
+ var n = Object.prototype.toString.call(o).slice(8, -1);
160
+ if (n === "Object" && o.constructor) n = o.constructor.name;
161
+ if (n === "Map" || n === "Set") return Array.from(n);
162
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
163
+ }
164
+ function _wrapNativeSuper(Class) {
165
+ var _cache = typeof Map === "function" ? new Map() : undefined;
166
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
167
+ if (Class === null || !_isNativeFunction(Class)) return Class;
168
+ if (typeof Class !== "function") {
169
+ throw new TypeError("Super expression must either be null or a function");
170
+ }
171
+ if (typeof _cache !== "undefined") {
172
+ if (_cache.has(Class)) return _cache.get(Class);
173
+ _cache.set(Class, Wrapper);
174
+ }
175
+ function Wrapper() {
176
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
177
+ }
178
+ Wrapper.prototype = Object.create(Class.prototype, {
179
+ constructor: {
180
+ value: Wrapper,
181
+ enumerable: false,
182
+ writable: true,
183
+ configurable: true
184
+ }
185
+ });
186
+ return _setPrototypeOf(Wrapper, Class);
187
+ };
188
+ return _wrapNativeSuper(Class);
189
+ }
190
+ function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
191
+ _classCheckPrivateStaticAccess(receiver, classConstructor);
192
+ return method;
193
+ }
194
+ function _classCheckPrivateStaticAccess(receiver, classConstructor) {
195
+ if (receiver !== classConstructor) {
196
+ throw new TypeError("Private static access of wrong provenance");
197
+ }
198
+ }
199
+ function _isNativeReflectConstruct() {
200
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
201
+ if (Reflect.construct.sham) return false;
202
+ if (typeof Proxy === "function") return true;
203
+ try {
204
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
205
+ return true;
206
+ } catch (e) {
207
+ return false;
208
+ }
209
+ }
210
+ function _createSuper(Derived) {
211
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
212
+ return function _createSuperInternal() {
213
+ var Super = _getPrototypeOf(Derived), result;
214
+ if (hasNativeReflectConstruct) {
215
+ var NewTarget = _getPrototypeOf(this).constructor;
216
+ result = Reflect.construct(Super, arguments, NewTarget);
217
+ } else {
218
+ result = Super.apply(this, arguments);
219
+ }
220
+ return _possibleConstructorReturn(this, result);
221
+ };
222
+ }
223
+ var __generator = (void 0) && (void 0).__generator || function(thisArg, body) {
224
+ var f, y, t, g, _ = {
225
+ label: 0,
226
+ sent: function() {
227
+ if (t[0] & 1) throw t[1];
228
+ return t[1];
229
+ },
230
+ trys: [],
231
+ ops: []
232
+ };
233
+ return g = {
234
+ next: verb(0),
235
+ "throw": verb(1),
236
+ "return": verb(2)
237
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
238
+ return this;
239
+ }), g;
240
+ function verb(n) {
241
+ return function(v) {
242
+ return step([
243
+ n,
244
+ v
245
+ ]);
246
+ };
247
+ }
248
+ function step(op) {
249
+ if (f) throw new TypeError("Generator is already executing.");
250
+ while(_)try {
251
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
252
+ if (y = 0, t) op = [
253
+ op[0] & 2,
254
+ t.value
255
+ ];
256
+ switch(op[0]){
257
+ case 0:
258
+ case 1:
259
+ t = op;
260
+ break;
261
+ case 4:
262
+ _.label++;
263
+ return {
264
+ value: op[1],
265
+ done: false
266
+ };
267
+ case 5:
268
+ _.label++;
269
+ y = op[1];
270
+ op = [
271
+ 0
272
+ ];
273
+ continue;
274
+ case 7:
275
+ op = _.ops.pop();
276
+ _.trys.pop();
277
+ continue;
278
+ default:
279
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
280
+ _ = 0;
281
+ continue;
282
+ }
283
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
284
+ _.label = op[1];
285
+ break;
286
+ }
287
+ if (op[0] === 6 && _.label < t[1]) {
288
+ _.label = t[1];
289
+ t = op;
290
+ break;
291
+ }
292
+ if (t && _.label < t[2]) {
293
+ _.label = t[2];
294
+ _.ops.push(op);
295
+ break;
296
+ }
297
+ if (t[2]) _.ops.pop();
298
+ _.trys.pop();
299
+ continue;
300
+ }
301
+ op = body.call(thisArg, _);
302
+ } catch (e) {
303
+ op = [
304
+ 6,
305
+ e
306
+ ];
307
+ y = 0;
308
+ } finally{
309
+ f = t = 0;
310
+ }
311
+ if (op[0] & 5) throw op[1];
312
+ return {
313
+ value: op[0] ? op[1] : void 0,
314
+ done: true
315
+ };
316
+ }
317
+ };
318
+ var isNonErrorSymbol = Symbol("isNonError");
319
+ function defineProperty(object, key, value) {
320
+ Object.defineProperty(object, key, {
321
+ value: value,
322
+ writable: false,
323
+ enumerable: false,
324
+ configurable: false
325
+ });
326
+ }
327
+ function stringify(value) {
328
+ if (value === undefined) {
329
+ return "undefined";
330
+ }
331
+ if (value === null) {
332
+ return "null";
333
+ }
334
+ if (typeof value === "string") {
335
+ return value;
336
+ }
337
+ if (typeof value === "number" || typeof value === "boolean") {
338
+ return String(value);
339
+ }
340
+ if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "bigint") {
341
+ return "".concat(value, "n");
342
+ }
343
+ if ((typeof value === "undefined" ? "undefined" : _typeof(value)) === "symbol") {
344
+ return value.toString();
345
+ }
346
+ if (typeof value === "function") {
347
+ return "[Function".concat(value.name ? " ".concat(value.name) : " (anonymous)", "]");
348
+ }
349
+ // TODO: Use `Error.isError` when targeting Node.js 24
350
+ if (_instanceof(value, Error)) {
351
+ try {
352
+ return String(value);
353
+ } catch (e) {
354
+ return "<Unserializable error>";
355
+ }
356
+ }
357
+ try {
358
+ return JSON.stringify(value);
359
+ } catch (e2) {
360
+ try {
361
+ return String(value);
362
+ } catch (e1) {
363
+ return "<Unserializable value>";
364
+ }
365
+ }
366
+ }
367
+ var NonError = /*#__PURE__*/ function(Error1) {
368
+ "use strict";
369
+ _inherits(NonError, Error1);
370
+ var _super = _createSuper(NonError);
371
+ function NonError(value) {
372
+ var ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, tmp = ref.superclass, Superclass = tmp === void 0 ? Error : tmp;
373
+ _classCallCheck(this, NonError);
374
+ var _this;
375
+ // If already a NonError, return it as-is
376
+ if (NonError.isNonError(value)) {
377
+ return _possibleConstructorReturn(_this, value); // eslint-disable-line no-constructor-return
378
+ }
379
+ if (_instanceof(value, Error)) {
380
+ throw new TypeError("Do not pass Error instances to NonError. Throw the error directly instead.");
381
+ }
382
+ _this = _super.call(this, "Non-error value: ".concat(stringify(value)));
383
+ if (Superclass !== Error) {
384
+ // Change this instance's prototype to Superclass.prototype
385
+ // This makes instanceof Superclass work
386
+ Object.setPrototypeOf(_assertThisInitialized(_this), Superclass.prototype);
387
+ }
388
+ defineProperty(_assertThisInitialized(_this), "name", "NonError");
389
+ defineProperty(_assertThisInitialized(_this), isNonErrorSymbol, true);
390
+ defineProperty(_assertThisInitialized(_this), "isNonError", true);
391
+ defineProperty(_assertThisInitialized(_this), "value", value);
392
+ return _this;
393
+ }
394
+ _createClass(NonError, null, [
395
+ {
396
+ key: "isNonError",
397
+ value: function isNonError(value) {
398
+ return (value === null || value === void 0 ? void 0 : value[isNonErrorSymbol]) === true;
399
+ }
400
+ },
401
+ {
402
+ key: "try",
403
+ value: function _try(callback) {
404
+ return _classStaticPrivateMethodGet(NonError, NonError, handleCallback).call(NonError, callback, []);
405
+ }
406
+ },
407
+ {
408
+ key: "wrap",
409
+ value: function wrap(callback) {
410
+ return function() {
411
+ for(var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++){
412
+ arguments_[_key] = arguments[_key];
413
+ }
414
+ return _classStaticPrivateMethodGet(NonError, NonError, handleCallback).call(NonError, callback, arguments_);
415
+ };
416
+ }
417
+ },
418
+ {
419
+ key: Symbol.hasInstance,
420
+ value: // This makes instanceof work even when using the `superclass` option
421
+ function value(instance) {
422
+ return NonError.isNonError(instance);
423
+ }
424
+ }
425
+ ]);
426
+ return NonError;
427
+ }(_wrapNativeSuper(Error));
428
+ function handleCallback(callback, arguments_) {
429
+ try {
430
+ var result = callback.apply(void 0, _toConsumableArray(arguments_));
431
+ // If the result is thenable (Promise-like), handle async rejections
432
+ if (result && typeof result.then === "function") {
433
+ return _asyncToGenerator(function() {
434
+ var error;
435
+ return __generator(this, function(_state) {
436
+ switch(_state.label){
437
+ case 0:
438
+ _state.trys.push([
439
+ 0,
440
+ 2,
441
+ ,
442
+ 3
443
+ ]);
444
+ return [
445
+ 4,
446
+ result
447
+ ];
448
+ case 1:
449
+ return [
450
+ 2,
451
+ _state.sent()
452
+ ];
453
+ case 2:
454
+ error = _state.sent();
455
+ // TODO: Use `Error.isError` when targeting Node.js 24
456
+ if (_instanceof(error, Error)) {
457
+ throw error;
458
+ }
459
+ throw new NonError(error);
460
+ case 3:
461
+ return [
462
+ 2
463
+ ];
464
+ }
465
+ });
466
+ })();
467
+ }
468
+ return result;
469
+ } catch (error) {
470
+ // TODO: Use `Error.isError` when targeting Node.js 24
471
+ // If it's already an Error, re-throw as-is
472
+ if (_instanceof(error, Error)) {
473
+ throw error;
474
+ }
475
+ // Otherwise, wrap it in NonError
476
+ throw new NonError(error);
477
+ }
478
+ }
package/license ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ 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:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ 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.
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@common.js/non-error",
3
+ "version": "0.1.0",
4
+ "description": "non-error package exported as CommonJS modules",
5
+ "license": "MIT",
6
+ "repository": "etienne-martin/common.js",
7
+ "funding": "https://github.com/sponsors/sindresorhus",
8
+ "type": "commonjs",
9
+ "sideEffects": false,
10
+ "engines": {
11
+ "node": ">=20"
12
+ },
13
+ "scripts": {
14
+ "test": "xo && ava && tsd"
15
+ },
16
+ "files": [
17
+ "index.js",
18
+ "index.d.ts"
19
+ ],
20
+ "devDependencies": {
21
+ "ava": "^6.4.1",
22
+ "tsd": "^0.33.0",
23
+ "xo": "^1.2.2"
24
+ },
25
+ "homepage": "https://github.com/etienne-martin/common.js#readme",
26
+ "dependencies": {},
27
+ "main": "./index.js",
28
+ "types": "./index.d.ts"
29
+ }