UNPKG

@rickosborne/rebound

Version:

Rick Osborne's utilities for working with bounded numbers

24 lines (23 loc) 1.44 kB
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); import { addProperties } from "@rickosborne/foundation"; import { rangeFromChecked } from "./range.mjs"; 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 : rangeFromChecked(bounds); return 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"); export { addTypedProperties }; //# sourceMappingURL=typed-function.mjs.map