@yoot/yoot
Version:
The core library for yoot, providing a CDN-agnostic, chainable API for image URL transformations and adapter integration.
58 lines (57 loc) • 1.13 kB
JavaScript
function f(t) {
if (typeof t != "object" || t === null) return !1;
const n = Object.getPrototypeOf(t);
return n === null || n === Object.prototype;
}
function u(t) {
try {
return new URL(String(t)), !0;
} catch {
return !1;
}
}
function o(t) {
return t ? i(t.width) && i(t.height) : !1;
}
const s = o;
function c(t) {
return typeof t == "function";
}
function p(t) {
return typeof t == "string";
}
function i(t) {
return typeof t == "number" && isFinite(t);
}
function y(t) {
return e(t) || t === "";
}
function e(t) {
return t == null;
}
function l(t, n) {
return (typeof t == "string" || typeof t == "number" || typeof t == "symbol") && t in n;
}
function b(t, n) {
if (!t)
throw new r(typeof n == "function" ? n() : n);
}
class r extends Error {
constructor(n) {
super(n), Object.setPrototypeOf(this, r.prototype);
}
}
export {
o as hasDimensions,
s as hasIntrinsicDimensions,
b as invariant,
y as isEmpty,
c as isFunction,
l as isKeyOf,
e as isNullish,
i as isNumber,
f as isPlainObject,
p as isString,
u as isUrl
};
//# sourceMappingURL=utils.js.map