UNPKG

vue-app-sdk

Version:
22 lines (21 loc) 553 B
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const toInteger = require("./toInteger.cjs"); var FUNC_ERROR_TEXT = "Expected a function"; function before(n, func) { var result; if (typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger.default(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = void 0; } return result; }; } exports.default = before;