rayan-saleh
embeded gradio
7d9f678
raw
history blame contribute delete
844 Bytes
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isObject = exports.pick = exports.assertNever = void 0;
/**
* Utility for enforcing exhaustiveness checks in the type system.
*
* @see https://basarat.gitbook.io/typescript/type-system/discriminated-unions#throw-in-exhaustive-checks
*
* @param value The variable with no remaining values
*/
function assertNever(value) {
throw new Error(`Unexpected value should never occur: ${value}`);
}
exports.assertNever = assertNever;
function pick(base, keys) {
const entries = keys.map(key => [key, base === null || base === void 0 ? void 0 : base[key]]);
return Object.fromEntries(entries);
}
exports.pick = pick;
function isObject(o) {
return typeof o === "object" && o !== null;
}
exports.isObject = isObject;
//# sourceMappingURL=utils.js.map