Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/../uploads/../../../../instantly.picotech.app/homes/../../wa.picotech.app/public_html/node_modules/escape-html/../music-metadata/../express/../whatwg-url/../ms/../bytes/../uuid/../domutils/../abort-controller/../@socket.io/../@thi.ng/errors
الملفات الموجودة في هذا الـ Path:
.
..
CHANGELOG.md
LICENSE
README.md
assert.d.ts
assert.js
deferror.d.ts
deferror.js
ensure.d.ts
ensure.js
illegal-arguments.d.ts
illegal-arguments.js
illegal-arity.d.ts
illegal-arity.js
illegal-state.d.ts
illegal-state.js
index.d.ts
index.js
io.d.ts
io.js
out-of-bounds.d.ts
out-of-bounds.js
package.json
unsupported.d.ts
unsupported.js

مشاهدة ملف: assert.js

import { defError } from "./deferror.js";
export const AssertionError = defError(() => "Assertion failed");
/**
 * Takes a `test` result or predicate function without args and throws error
 * with given `msg` if test failed (i.e. is falsy).
 *
 * @remarks
 * The function is only enabled if `process.env.NODE_ENV != "production"` or if
 * the `UMBRELLA_ASSERTS` or `VITE_UMBRELLA_ASSERTS` env var is set to 1.
 */
export const assert = (typeof process !== "undefined" && process.env !== undefined
    ? process.env.NODE_ENV !== "production" ||
        !!process.env.UMBRELLA_ASSERTS
    : import.meta.env
        ? import.meta.env.MODE !== "production" ||
            !!import.meta.env.UMBRELLA_ASSERTS ||
            !!import.meta.env.VITE_UMBRELLA_ASSERTS
        : true)
    ? (test, msg) => {
        if ((typeof test === "function" && !test()) || !test) {
            throw new AssertionError(typeof msg === "function" ? msg() : msg);
        }
    }
    : () => { };