sinch-rtc
Version:
RTC JavaScript/Web SDK
16 lines • 929 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.pipeAsync = exports.pipe = exports.isEmpty = exports.nameof = void 0;
const nameof = (object) => object.constructor.name;
exports.nameof = nameof;
const isEmpty = (object) => object &&
Object.keys(object).length === 0 &&
Object.getPrototypeOf(object) === Object.prototype;
exports.isEmpty = isEmpty;
// Performs left-to-right function composition. The first argument may have any arity; the remaining arguments must be unary
const pipe = (...fns) => (param) => fns.reduce((x, f) => f(x), param);
exports.pipe = pipe;
// Performs left-to-right function composition and supports asynchronous functions. The first argument may have any arity; the remaining arguments must be unary
const pipeAsync = (...fns) => (arg) => fns.reduce((p, f) => p.then(f), Promise.resolve(arg));
exports.pipeAsync = pipeAsync;
//# sourceMappingURL=Utils.js.map