!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/wa.picotech.app/public_html/node_modules/@thi.ng/errors/   drwxr-xr-x
Free 28.38 GB of 117.98 GB (24.06%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ensure.js (3.44 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import { assert } from "./assert.js";
/**
 * Higher-order function to define ensurance assertions. Takes a `pred`icate
 * function and an `expected` (type) name, returns a new function which accepts
 * 2 args (an arbitrary value `x` and optional error `msg`). When called, checks
 * `x` for non-null and if so applies given `pred`icate. If result is false (or
 * `x` is nullish) and iff {@link assert} is enabled, throws a
 * {@link AssertionError} with given `msg` (or a constructed default msg).
 * Otherwise function is a no-op.
 *
 * @param pred
 * @param expected
 */
export const defEnsure = (pred, expected) => (x, msg) => {
    x != null
        ? assert(() => pred(x), msg || `expected ${expected}, got ${typeof x}`)
        : assert(false, `expected ${expected}, got ${x}`);
    return x;
};
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a JS array and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureArray = defEnsure((x) => Array.isArray(x), `array`);
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a bigint and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureBigInt = defEnsure((x) => typeof x === "bigint", "bigint");
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a boolean and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureBoolean = defEnsure((x) => typeof x === "boolean", "boolean");
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a function and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureFunction = defEnsure((x) => typeof x === "function", "function");
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * an ES6 iterable and if not throws {@link AssertionError}, optionally with
 * given `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureIterable = defEnsure((x) => typeof x[Symbol.iterator] === "function", "iterable");
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a number and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureNumber = defEnsure((x) => typeof x === "number", "number");
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a string and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureString = defEnsure((x) => typeof x === "string", "string");
/**
 * Only enabled if {@link assert} is enabled (otherwise no-op). Checks if `x` is
 * a symbol and if not throws {@link AssertionError}, optionally with given
 * `msg`.
 *
 * @remarks
 * See {@link defEnsure} for details.
 *
 * @param x
 * @param msg
 */
export const ensureSymbol = defEnsure((x) => typeof x === "symbol", "symbol");

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0032 ]--