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/../querystring/../@protobufjs/../once/../wrap-ansi/../statuses/../vary/../@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

مشاهدة ملف: out-of-bounds.js

import { defError } from "./deferror.js";
export const OutOfBoundsError = defError(() => "index out of bounds");
export const outOfBounds = (index) => {
    throw new OutOfBoundsError(index);
};
/**
 * Throws an {@link OutOfBoundsError} if `index` outside the `[min..max)` range.
 *
 * @param index -
 * @param min -
 * @param max -
 */
export const ensureIndex = (index, min, max) => (index < min || index >= max) && outOfBounds(index);
/**
 * Throws an {@link OutOfBoundsError} if either `x` or `y` is outside their
 * respective `[0..max)` range.
 *
 * @param x -
 * @param y -
 * @param maxX -
 * @param maxY -
 */
export const ensureIndex2 = (x, y, maxX, maxY) => (x < 0 || x >= maxX || y < 0 || y >= maxY) && outOfBounds([x, y]);