UNPKG

@rickosborne/rebound

Version:

Rick Osborne's utilities for working with bounded numbers

43 lines (42 loc) 2.38 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); 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); var typed_function_exports = {}; __export(typed_function_exports, { addTypedProperties: () => addTypedProperties }); module.exports = __toCommonJS(typed_function_exports); var import_foundation = require("@rickosborne/foundation"); var import_range = require("./range.cjs"); const addTypedProperties = /* @__PURE__ */ __name((target, bounds, typeName, fnName) => { const { isInt, isUpperInc, isLowerInc, label, lower, upper } = bounds; const range = "range" in bounds && typeof bounds.range === "string" ? bounds.range : (0, import_range.rangeFromChecked)(bounds); return (0, import_foundation.addProperties)(target, { isLowerInc: { value: isLowerInc, enumerable: true, configurable: false, writable: false }, isInt: { value: isInt, enumerable: true, configurable: false, writable: false }, isUpperInc: { value: isUpperInc, enumerable: true, configurable: false, writable: false }, label: { value: label, enumerable: true, configurable: false, writable: false }, lower: { value: lower, enumerable: true, configurable: false, writable: false }, name: { value: fnName, enumerable: false, configurable: true, writable: false }, range: { value: range, enumerable: true, configurable: false, writable: false }, typeName: { value: typeName, enumerable: true, configurable: false, writable: false }, upper: { value: upper, enumerable: true, configurable: false, writable: false } }); }, "addTypedProperties"); //# sourceMappingURL=typed-function.cjs.map