PHP 8.2.30
Preview: singleton.js Size: 1.56 KB
/home/byroehnu/easepaybiz.easetack.com/node_modules/@jsdevtools/ono/cjs/singleton.js

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ono = void 0;
const constructor_1 = require("./constructor");
const singleton = ono;
exports.ono = singleton;
ono.error = new constructor_1.Ono(Error);
ono.eval = new constructor_1.Ono(EvalError);
ono.range = new constructor_1.Ono(RangeError);
ono.reference = new constructor_1.Ono(ReferenceError);
ono.syntax = new constructor_1.Ono(SyntaxError);
ono.type = new constructor_1.Ono(TypeError);
ono.uri = new constructor_1.Ono(URIError);
const onoMap = ono;
/**
 * Creates a new error with the specified message, properties, and/or inner error.
 * If an inner error is provided, then the new error will match its type, if possible.
 */
function ono(...args) {
    let originalError = args[0];
    // Is the first argument an Error-like object?
    if (typeof originalError === "object" && typeof originalError.name === "string") {
        // Try to find an Ono singleton method that matches this error type
        for (let typedOno of Object.values(onoMap)) {
            if (typeof typedOno === "function" && typedOno.name === "ono") {
                let species = typedOno[Symbol.species];
                if (species && species !== Error && (originalError instanceof species || originalError.name === species.name)) {
                    // Create an error of the same type
                    return typedOno.apply(undefined, args);
                }
            }
        }
    }
    // By default, create a base Error object
    return ono.error.apply(undefined, args);
}
//# sourceMappingURL=singleton.js.map

Directory Contents

Dirs: 0 × Files: 31

Name Size Perms Modified Actions
127 B lr--r--r-- 2026-03-14 01:49:05
Edit Download
116 B lrw-r--r-- 2026-03-05 00:20:12
Edit Download
1.72 KB lrw-r--r-- 2026-03-05 00:19:55
Edit Download
1.08 KB lrw-r--r-- 2026-03-05 00:20:06
Edit Download
482 B lrw-r--r-- 2026-03-05 00:20:12
Edit Download
3.00 KB lrw-r--r-- 2026-03-05 00:19:56
Edit Download
1.53 KB lrw-r--r-- 2026-03-05 00:20:08
Edit Download
133 B lrw-r--r-- 2026-03-05 00:20:12
Edit Download
1.18 KB lrw-r--r-- 2026-03-05 00:19:57
Edit Download
420 B lrw-r--r-- 2026-03-05 00:20:08
Edit Download
574 B lrw-r--r-- 2026-03-05 00:20:12
Edit Download
723 B lrw-r--r-- 2026-03-05 00:19:58
Edit Download
222 B lrw-r--r-- 2026-03-05 00:20:09
Edit Download
523 B lrw-r--r-- 2026-03-05 00:20:12
Edit Download
1.70 KB lrw-r--r-- 2026-03-05 00:19:59
Edit Download
803 B lrw-r--r-- 2026-03-05 00:20:09
Edit Download
507 B lrw-r--r-- 2026-03-05 00:20:13
Edit Download
1.93 KB lrw-r--r-- 2026-03-05 00:19:59
Edit Download
1.59 KB lrw-r--r-- 2026-03-05 00:20:10
Edit Download
108 B lrw-r--r-- 2026-03-05 00:20:13
Edit Download
1.56 KB lrw-r--r-- 2026-03-05 00:20:01
Edit Download
1.24 KB lrw-r--r-- 2026-03-05 00:20:10
Edit Download
933 B lrw-r--r-- 2026-03-05 00:20:13
Edit Download
3.27 KB lrw-r--r-- 2026-03-05 00:20:02
Edit Download
2.17 KB lrw-r--r-- 2026-03-05 00:20:11
Edit Download
540 B lrw-r--r-- 2026-03-05 00:20:13
Edit Download
1.69 KB lrw-r--r-- 2026-03-05 00:20:03
Edit Download
1.24 KB lrw-r--r-- 2026-03-05 00:20:11
Edit Download
8.09 KB lrw-r--r-- 2026-03-05 00:20:13
Edit Download
142 B lrw-r--r-- 2026-03-05 00:20:04
Edit Download
115 B lrw-r--r-- 2026-03-05 00:20:11
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).