UNPKG

@julo-ui/function-utils

Version:

Function Utilities across Julo UI package

67 lines (60 loc) 1.89 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts var src_exports = {}; __export(src_exports, { _noop: () => noop_default, callAllFn: () => call_all_fn_default, isFn: () => is_fn_default, isTrullyEmpty: () => is_trully_empty_default, runIfFn: () => run_if_fn_default }); module.exports = __toCommonJS(src_exports); // src/call-all-fn.ts function callAllFn(...fns) { return (...args) => fns.forEach((fn) => fn == null ? void 0 : fn(...args)); } var call_all_fn_default = callAllFn; // src/is-fn.ts function isFn(value) { return typeof value === "function"; } var is_fn_default = isFn; // src/noop.ts var _noop = () => { }; var noop_default = _noop; // src/run-if-fn.ts function runIfFn(valueOrFn, ...args) { return is_fn_default(valueOrFn) ? valueOrFn(...args) : valueOrFn; } var run_if_fn_default = runIfFn; // src/is-trully-empty.ts function isTrullyEmpty(value) { return value === void 0 || value === null; } var is_trully_empty_default = isTrullyEmpty; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { _noop, callAllFn, isFn, isTrullyEmpty, runIfFn });