@visactor/vutils 0.9.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/README.zh-CN.md +0 -0
- package/cjs/angle.d.ts +12 -0
- package/cjs/angle.js +40 -0
- package/cjs/angle.js.map +1 -0
- package/cjs/color/Color.d.ts +181 -0
- package/cjs/color/Color.js +298 -0
- package/cjs/color/Color.js.map +1 -0
- package/cjs/color/hexToRgb.d.ts +1 -0
- package/cjs/color/hexToRgb.js +13 -0
- package/cjs/color/hexToRgb.js.map +1 -0
- package/cjs/color/hslToRgb.d.ts +5 -0
- package/cjs/color/hslToRgb.js +21 -0
- package/cjs/color/hslToRgb.js.map +1 -0
- package/cjs/color/index.d.ts +6 -0
- package/cjs/color/index.js +80 -0
- package/cjs/color/index.js.map +1 -0
- package/cjs/color/interpolate.d.ts +2 -0
- package/cjs/color/interpolate.js +18 -0
- package/cjs/color/interpolate.js.map +1 -0
- package/cjs/color/rgbToHex.d.ts +1 -0
- package/cjs/color/rgbToHex.js +10 -0
- package/cjs/color/rgbToHex.js.map +1 -0
- package/cjs/color/rgbToHsl.d.ts +5 -0
- package/cjs/color/rgbToHsl.js +19 -0
- package/cjs/color/rgbToHsl.js.map +1 -0
- package/cjs/common/array.d.ts +9 -0
- package/cjs/common/array.js +64 -0
- package/cjs/common/array.js.map +1 -0
- package/cjs/common/ascending.d.ts +1 -0
- package/cjs/common/ascending.js +10 -0
- package/cjs/common/ascending.js.map +1 -0
- package/cjs/common/bisect.d.ts +1 -0
- package/cjs/common/bisect.js +24 -0
- package/cjs/common/bisect.js.map +1 -0
- package/cjs/common/clamp.d.ts +2 -0
- package/cjs/common/clamp.js +12 -0
- package/cjs/common/clamp.js.map +1 -0
- package/cjs/common/clampRange.d.ts +2 -0
- package/cjs/common/clampRange.js +16 -0
- package/cjs/common/clampRange.js.map +1 -0
- package/cjs/common/clamper.d.ts +1 -0
- package/cjs/common/clamper.js +11 -0
- package/cjs/common/clamper.js.map +1 -0
- package/cjs/common/clone.d.ts +1 -0
- package/cjs/common/clone.js +42 -0
- package/cjs/common/clone.js.map +1 -0
- package/cjs/common/cloneDeep.d.ts +1 -0
- package/cjs/common/cloneDeep.js +31 -0
- package/cjs/common/cloneDeep.js.map +1 -0
- package/cjs/common/constant.d.ts +2 -0
- package/cjs/common/constant.js +17 -0
- package/cjs/common/constant.js.map +1 -0
- package/cjs/common/debounce.d.ts +7 -0
- package/cjs/common/debounce.js +76 -0
- package/cjs/common/debounce.js.map +1 -0
- package/cjs/common/deviation.d.ts +1 -0
- package/cjs/common/deviation.js +15 -0
- package/cjs/common/deviation.js.map +1 -0
- package/cjs/common/get.d.ts +3 -0
- package/cjs/common/get.js +20 -0
- package/cjs/common/get.js.map +1 -0
- package/cjs/common/getType.d.ts +2 -0
- package/cjs/common/getType.js +9 -0
- package/cjs/common/getType.js.map +1 -0
- package/cjs/common/has.d.ts +3 -0
- package/cjs/common/has.js +10 -0
- package/cjs/common/has.js.map +1 -0
- package/cjs/common/index.d.ts +56 -0
- package/cjs/common/index.js +485 -0
- package/cjs/common/index.js.map +1 -0
- package/cjs/common/interpolate.d.ts +4 -0
- package/cjs/common/interpolate.js +55 -0
- package/cjs/common/interpolate.js.map +1 -0
- package/cjs/common/isArray.d.ts +2 -0
- package/cjs/common/isArray.js +17 -0
- package/cjs/common/isArray.js.map +1 -0
- package/cjs/common/isArrayLike.d.ts +2 -0
- package/cjs/common/isArrayLike.js +12 -0
- package/cjs/common/isArrayLike.js.map +1 -0
- package/cjs/common/isBase64.d.ts +2 -0
- package/cjs/common/isBase64.js +10 -0
- package/cjs/common/isBase64.js.map +1 -0
- package/cjs/common/isBoolean.d.ts +2 -0
- package/cjs/common/isBoolean.js +17 -0
- package/cjs/common/isBoolean.js.map +1 -0
- package/cjs/common/isDate.d.ts +2 -0
- package/cjs/common/isDate.js +16 -0
- package/cjs/common/isDate.js.map +1 -0
- package/cjs/common/isEmpty.d.ts +2 -0
- package/cjs/common/isEmpty.js +26 -0
- package/cjs/common/isEmpty.js.map +1 -0
- package/cjs/common/isEqual.d.ts +1 -0
- package/cjs/common/isEqual.js +49 -0
- package/cjs/common/isEqual.js.map +1 -0
- package/cjs/common/isFunction.d.ts +2 -0
- package/cjs/common/isFunction.js +10 -0
- package/cjs/common/isFunction.js.map +1 -0
- package/cjs/common/isNil.d.ts +2 -0
- package/cjs/common/isNil.js +10 -0
- package/cjs/common/isNil.js.map +1 -0
- package/cjs/common/isNull.d.ts +2 -0
- package/cjs/common/isNull.js +10 -0
- package/cjs/common/isNull.js.map +1 -0
- package/cjs/common/isNumber.d.ts +2 -0
- package/cjs/common/isNumber.js +19 -0
- package/cjs/common/isNumber.js.map +1 -0
- package/cjs/common/isNumeric.d.ts +2 -0
- package/cjs/common/isNumeric.js +10 -0
- package/cjs/common/isNumeric.js.map +1 -0
- package/cjs/common/isObject.d.ts +2 -0
- package/cjs/common/isObject.js +12 -0
- package/cjs/common/isObject.js.map +1 -0
- package/cjs/common/isObjectLike.d.ts +2 -0
- package/cjs/common/isObjectLike.js +10 -0
- package/cjs/common/isObjectLike.js.map +1 -0
- package/cjs/common/isPlainObject.d.ts +2 -0
- package/cjs/common/isPlainObject.js +22 -0
- package/cjs/common/isPlainObject.js.map +1 -0
- package/cjs/common/isPrototype.d.ts +2 -0
- package/cjs/common/isPrototype.js +13 -0
- package/cjs/common/isPrototype.js.map +1 -0
- package/cjs/common/isRegExp.d.ts +2 -0
- package/cjs/common/isRegExp.js +16 -0
- package/cjs/common/isRegExp.js.map +1 -0
- package/cjs/common/isShallowEqual.d.ts +1 -0
- package/cjs/common/isShallowEqual.js +34 -0
- package/cjs/common/isShallowEqual.js.map +1 -0
- package/cjs/common/isString.d.ts +2 -0
- package/cjs/common/isString.js +19 -0
- package/cjs/common/isString.js.map +1 -0
- package/cjs/common/isType.d.ts +2 -0
- package/cjs/common/isType.js +10 -0
- package/cjs/common/isType.js.map +1 -0
- package/cjs/common/isUndefined.d.ts +2 -0
- package/cjs/common/isUndefined.js +10 -0
- package/cjs/common/isUndefined.js.map +1 -0
- package/cjs/common/isValid.d.ts +2 -0
- package/cjs/common/isValid.js +10 -0
- package/cjs/common/isValid.js.map +1 -0
- package/cjs/common/isValidNumber.d.ts +2 -0
- package/cjs/common/isValidNumber.js +17 -0
- package/cjs/common/isValidNumber.js.map +1 -0
- package/cjs/common/isValidUrl.d.ts +2 -0
- package/cjs/common/isValidUrl.js +10 -0
- package/cjs/common/isValidUrl.js.map +1 -0
- package/cjs/common/lowerFirst.d.ts +2 -0
- package/cjs/common/lowerFirst.js +12 -0
- package/cjs/common/lowerFirst.js.map +1 -0
- package/cjs/common/median.d.ts +1 -0
- package/cjs/common/median.js +13 -0
- package/cjs/common/median.js.map +1 -0
- package/cjs/common/merge.d.ts +1 -0
- package/cjs/common/merge.js +63 -0
- package/cjs/common/merge.js.map +1 -0
- package/cjs/common/mixin.d.ts +5 -0
- package/cjs/common/mixin.js +35 -0
- package/cjs/common/mixin.js.map +1 -0
- package/cjs/common/number.d.ts +3 -0
- package/cjs/common/number.js +23 -0
- package/cjs/common/number.js.map +1 -0
- package/cjs/common/pad.d.ts +2 -0
- package/cjs/common/pad.js +17 -0
- package/cjs/common/pad.js.map +1 -0
- package/cjs/common/pick.d.ts +1 -0
- package/cjs/common/pick.js +24 -0
- package/cjs/common/pick.js.map +1 -0
- package/cjs/common/pickWithout.d.ts +1 -0
- package/cjs/common/pickWithout.js +28 -0
- package/cjs/common/pickWithout.js.map +1 -0
- package/cjs/common/quantileSorted.d.ts +1 -0
- package/cjs/common/quantileSorted.js +19 -0
- package/cjs/common/quantileSorted.js.map +1 -0
- package/cjs/common/range.d.ts +1 -0
- package/cjs/common/range.js +24 -0
- package/cjs/common/range.js.map +1 -0
- package/cjs/common/throttle.d.ts +5 -0
- package/cjs/common/throttle.js +27 -0
- package/cjs/common/throttle.js.map +1 -0
- package/cjs/common/tickStep.d.ts +1 -0
- package/cjs/common/tickStep.js +18 -0
- package/cjs/common/tickStep.js.map +1 -0
- package/cjs/common/toDate.d.ts +2 -0
- package/cjs/common/toDate.js +28 -0
- package/cjs/common/toDate.js.map +1 -0
- package/cjs/common/toNumber.d.ts +1 -0
- package/cjs/common/toNumber.js +10 -0
- package/cjs/common/toNumber.js.map +1 -0
- package/cjs/common/toValidNumber.d.ts +1 -0
- package/cjs/common/toValidNumber.js +22 -0
- package/cjs/common/toValidNumber.js.map +1 -0
- package/cjs/common/truncate.d.ts +2 -0
- package/cjs/common/truncate.js +19 -0
- package/cjs/common/truncate.js.map +1 -0
- package/cjs/common/upperFirst.d.ts +2 -0
- package/cjs/common/upperFirst.js +12 -0
- package/cjs/common/upperFirst.js.map +1 -0
- package/cjs/common/uuid.d.ts +2 -0
- package/cjs/common/uuid.js +19 -0
- package/cjs/common/uuid.js.map +1 -0
- package/cjs/common/variance.d.ts +1 -0
- package/cjs/common/variance.js +17 -0
- package/cjs/common/variance.js.map +1 -0
- package/cjs/data-structure/bounds.d.ts +81 -0
- package/cjs/data-structure/bounds.js +139 -0
- package/cjs/data-structure/bounds.js.map +1 -0
- package/cjs/data-structure/hashTable.d.ts +35 -0
- package/cjs/data-structure/hashTable.js +114 -0
- package/cjs/data-structure/hashTable.js.map +1 -0
- package/cjs/data-structure/index.d.ts +4 -0
- package/cjs/data-structure/index.js +22 -0
- package/cjs/data-structure/index.js.map +1 -0
- package/cjs/data-structure/matrix.d.ts +80 -0
- package/cjs/data-structure/matrix.js +113 -0
- package/cjs/data-structure/matrix.js.map +1 -0
- package/cjs/data-structure/point.d.ts +62 -0
- package/cjs/data-structure/point.js +81 -0
- package/cjs/data-structure/point.js.map +1 -0
- package/cjs/dom.d.ts +10 -0
- package/cjs/dom.js +86 -0
- package/cjs/dom.js.map +1 -0
- package/cjs/geo/index.d.ts +2 -0
- package/cjs/geo/index.js +21 -0
- package/cjs/geo/index.js.map +1 -0
- package/cjs/geo/interface.d.ts +1 -0
- package/cjs/geo/interface.js +6 -0
- package/cjs/geo/interface.js.map +1 -0
- package/cjs/geo/invariant.d.ts +9 -0
- package/cjs/geo/invariant.js +45 -0
- package/cjs/geo/invariant.js.map +1 -0
- package/cjs/graphics/algorithm/aabb.d.ts +6 -0
- package/cjs/graphics/algorithm/aabb.js +58 -0
- package/cjs/graphics/algorithm/aabb.js.map +1 -0
- package/cjs/graphics/algorithm/index.d.ts +3 -0
- package/cjs/graphics/algorithm/index.js +22 -0
- package/cjs/graphics/algorithm/index.js.map +1 -0
- package/cjs/graphics/algorithm/interface.d.ts +20 -0
- package/cjs/graphics/algorithm/interface.js +6 -0
- package/cjs/graphics/algorithm/interface.js.map +1 -0
- package/cjs/graphics/algorithm/intersect.d.ts +25 -0
- package/cjs/graphics/algorithm/intersect.js +143 -0
- package/cjs/graphics/algorithm/intersect.js.map +1 -0
- package/cjs/graphics/algorithm/obb.d.ts +5 -0
- package/cjs/graphics/algorithm/obb.js +80 -0
- package/cjs/graphics/algorithm/obb.js.map +1 -0
- package/cjs/graphics/graph-util.d.ts +23 -0
- package/cjs/graphics/graph-util.js +47 -0
- package/cjs/graphics/graph-util.js.map +1 -0
- package/cjs/graphics/image.d.ts +2 -0
- package/cjs/graphics/image.js +18 -0
- package/cjs/graphics/image.js.map +1 -0
- package/cjs/graphics/index.d.ts +5 -0
- package/cjs/graphics/index.js +23 -0
- package/cjs/graphics/index.js.map +1 -0
- package/cjs/graphics/polygon.d.ts +5 -0
- package/cjs/graphics/polygon.js +54 -0
- package/cjs/graphics/polygon.js.map +1 -0
- package/cjs/graphics/text/index.d.ts +2 -0
- package/cjs/graphics/text/index.js +39 -0
- package/cjs/graphics/text/index.js.map +1 -0
- package/cjs/graphics/text/measure/index.d.ts +4 -0
- package/cjs/graphics/text/measure/index.js +22 -0
- package/cjs/graphics/text/measure/index.js.map +1 -0
- package/cjs/graphics/text/measure/interface.d.ts +31 -0
- package/cjs/graphics/text/measure/interface.js +6 -0
- package/cjs/graphics/text/measure/interface.js.map +1 -0
- package/cjs/graphics/text/measure/test.d.ts +14 -0
- package/cjs/graphics/text/measure/test.js +67 -0
- package/cjs/graphics/text/measure/test.js.map +1 -0
- package/cjs/graphics/text/measure/textMeasure.d.ts +38 -0
- package/cjs/graphics/text/measure/textMeasure.js +183 -0
- package/cjs/graphics/text/measure/textMeasure.js.map +1 -0
- package/cjs/graphics/text/measure/util.d.ts +2 -0
- package/cjs/graphics/text/measure/util.js +11 -0
- package/cjs/graphics/text/measure/util.js.map +1 -0
- package/cjs/graphics/text/stringWidth.d.ts +2 -0
- package/cjs/graphics/text/stringWidth.js +49 -0
- package/cjs/graphics/text/stringWidth.js.map +1 -0
- package/cjs/index.d.ts +15 -0
- package/cjs/index.js +47 -0
- package/cjs/index.js.map +1 -0
- package/cjs/logger.d.ts +12 -0
- package/cjs/logger.js +36 -0
- package/cjs/logger.js.map +1 -0
- package/cjs/lru.d.ts +25 -0
- package/cjs/lru.js +43 -0
- package/cjs/lru.js.map +1 -0
- package/cjs/math.d.ts +66 -0
- package/cjs/math.js +57 -0
- package/cjs/math.js.map +1 -0
- package/cjs/padding.d.ts +7 -0
- package/cjs/padding.js +41 -0
- package/cjs/padding.js.map +1 -0
- package/cjs/time/formatUtils.d.ts +17 -0
- package/cjs/time/formatUtils.js +95 -0
- package/cjs/time/formatUtils.js.map +1 -0
- package/cjs/time/index.d.ts +2 -0
- package/cjs/time/index.js +21 -0
- package/cjs/time/index.js.map +1 -0
- package/cjs/time/interval.d.ts +77 -0
- package/cjs/time/interval.js +324 -0
- package/cjs/time/interval.js.map +1 -0
- package/cjs/type.d.ts +5 -0
- package/cjs/type.js +6 -0
- package/cjs/type.js.map +1 -0
- package/dist/visactor_vutils.js +1 -0
- package/dist/visactor_vutils.min.js +1 -0
- package/es/angle.d.ts +12 -0
- package/es/angle.js +31 -0
- package/es/angle.js.map +1 -0
- package/es/color/Color.d.ts +181 -0
- package/es/color/Color.js +283 -0
- package/es/color/Color.js.map +1 -0
- package/es/color/hexToRgb.d.ts +1 -0
- package/es/color/hexToRgb.js +7 -0
- package/es/color/hexToRgb.js.map +1 -0
- package/es/color/hslToRgb.d.ts +5 -0
- package/es/color/hslToRgb.js +15 -0
- package/es/color/hslToRgb.js.map +1 -0
- package/es/color/index.d.ts +6 -0
- package/es/color/index.js +12 -0
- package/es/color/index.js.map +1 -0
- package/es/color/interpolate.d.ts +2 -0
- package/es/color/interpolate.js +10 -0
- package/es/color/interpolate.js.map +1 -0
- package/es/color/rgbToHex.d.ts +1 -0
- package/es/color/rgbToHex.js +4 -0
- package/es/color/rgbToHex.js.map +1 -0
- package/es/color/rgbToHsl.d.ts +5 -0
- package/es/color/rgbToHsl.js +13 -0
- package/es/color/rgbToHsl.js.map +1 -0
- package/es/common/array.d.ts +9 -0
- package/es/common/array.js +50 -0
- package/es/common/array.js.map +1 -0
- package/es/common/ascending.d.ts +1 -0
- package/es/common/ascending.js +4 -0
- package/es/common/ascending.js.map +1 -0
- package/es/common/bisect.d.ts +1 -0
- package/es/common/bisect.js +12 -0
- package/es/common/bisect.js.map +1 -0
- package/es/common/clamp.d.ts +2 -0
- package/es/common/clamp.js +6 -0
- package/es/common/clamp.js.map +1 -0
- package/es/common/clampRange.d.ts +2 -0
- package/es/common/clampRange.js +10 -0
- package/es/common/clampRange.js.map +1 -0
- package/es/common/clamper.d.ts +1 -0
- package/es/common/clamper.js +5 -0
- package/es/common/clamper.js.map +1 -0
- package/es/common/clone.d.ts +1 -0
- package/es/common/clone.js +32 -0
- package/es/common/clone.js.map +1 -0
- package/es/common/cloneDeep.d.ts +1 -0
- package/es/common/cloneDeep.js +26 -0
- package/es/common/cloneDeep.js.map +1 -0
- package/es/common/constant.d.ts +2 -0
- package/es/common/constant.js +6 -0
- package/es/common/constant.js.map +1 -0
- package/es/common/debounce.d.ts +7 -0
- package/es/common/debounce.js +68 -0
- package/es/common/debounce.js.map +1 -0
- package/es/common/deviation.d.ts +1 -0
- package/es/common/deviation.js +7 -0
- package/es/common/deviation.js.map +1 -0
- package/es/common/get.d.ts +3 -0
- package/es/common/get.js +10 -0
- package/es/common/get.js.map +1 -0
- package/es/common/getType.d.ts +2 -0
- package/es/common/getType.js +3 -0
- package/es/common/getType.js.map +1 -0
- package/es/common/has.d.ts +3 -0
- package/es/common/has.js +4 -0
- package/es/common/has.js.map +1 -0
- package/es/common/index.d.ts +56 -0
- package/es/common/index.js +112 -0
- package/es/common/index.js.map +1 -0
- package/es/common/interpolate.d.ts +4 -0
- package/es/common/interpolate.js +45 -0
- package/es/common/interpolate.js.map +1 -0
- package/es/common/isArray.d.ts +2 -0
- package/es/common/isArray.js +6 -0
- package/es/common/isArray.js.map +1 -0
- package/es/common/isArrayLike.d.ts +2 -0
- package/es/common/isArrayLike.js +6 -0
- package/es/common/isArrayLike.js.map +1 -0
- package/es/common/isBase64.d.ts +2 -0
- package/es/common/isBase64.js +4 -0
- package/es/common/isBase64.js.map +1 -0
- package/es/common/isBoolean.d.ts +2 -0
- package/es/common/isBoolean.js +6 -0
- package/es/common/isBoolean.js.map +1 -0
- package/es/common/isDate.d.ts +2 -0
- package/es/common/isDate.js +6 -0
- package/es/common/isDate.js.map +1 -0
- package/es/common/isEmpty.d.ts +2 -0
- package/es/common/isEmpty.js +22 -0
- package/es/common/isEmpty.js.map +1 -0
- package/es/common/isEqual.d.ts +1 -0
- package/es/common/isEqual.js +39 -0
- package/es/common/isEqual.js.map +1 -0
- package/es/common/isFunction.d.ts +2 -0
- package/es/common/isFunction.js +4 -0
- package/es/common/isFunction.js.map +1 -0
- package/es/common/isNil.d.ts +2 -0
- package/es/common/isNil.js +4 -0
- package/es/common/isNil.js.map +1 -0
- package/es/common/isNull.d.ts +2 -0
- package/es/common/isNull.js +4 -0
- package/es/common/isNull.js.map +1 -0
- package/es/common/isNumber.d.ts +2 -0
- package/es/common/isNumber.js +9 -0
- package/es/common/isNumber.js.map +1 -0
- package/es/common/isNumeric.d.ts +2 -0
- package/es/common/isNumeric.js +4 -0
- package/es/common/isNumeric.js.map +1 -0
- package/es/common/isObject.d.ts +2 -0
- package/es/common/isObject.js +6 -0
- package/es/common/isObject.js.map +1 -0
- package/es/common/isObjectLike.d.ts +2 -0
- package/es/common/isObjectLike.js +4 -0
- package/es/common/isObjectLike.js.map +1 -0
- package/es/common/isPlainObject.d.ts +2 -0
- package/es/common/isPlainObject.js +14 -0
- package/es/common/isPlainObject.js.map +1 -0
- package/es/common/isPrototype.d.ts +2 -0
- package/es/common/isPrototype.js +7 -0
- package/es/common/isPrototype.js.map +1 -0
- package/es/common/isRegExp.d.ts +2 -0
- package/es/common/isRegExp.js +6 -0
- package/es/common/isRegExp.js.map +1 -0
- package/es/common/isShallowEqual.d.ts +1 -0
- package/es/common/isShallowEqual.js +22 -0
- package/es/common/isShallowEqual.js.map +1 -0
- package/es/common/isString.d.ts +2 -0
- package/es/common/isString.js +9 -0
- package/es/common/isString.js.map +1 -0
- package/es/common/isType.d.ts +2 -0
- package/es/common/isType.js +4 -0
- package/es/common/isType.js.map +1 -0
- package/es/common/isUndefined.d.ts +2 -0
- package/es/common/isUndefined.js +4 -0
- package/es/common/isUndefined.js.map +1 -0
- package/es/common/isValid.d.ts +2 -0
- package/es/common/isValid.js +4 -0
- package/es/common/isValid.js.map +1 -0
- package/es/common/isValidNumber.d.ts +2 -0
- package/es/common/isValidNumber.js +6 -0
- package/es/common/isValidNumber.js.map +1 -0
- package/es/common/isValidUrl.d.ts +2 -0
- package/es/common/isValidUrl.js +4 -0
- package/es/common/isValidUrl.js.map +1 -0
- package/es/common/lowerFirst.d.ts +2 -0
- package/es/common/lowerFirst.js +6 -0
- package/es/common/lowerFirst.js.map +1 -0
- package/es/common/median.d.ts +1 -0
- package/es/common/median.js +9 -0
- package/es/common/median.js.map +1 -0
- package/es/common/merge.d.ts +1 -0
- package/es/common/merge.js +54 -0
- package/es/common/merge.js.map +1 -0
- package/es/common/mixin.d.ts +5 -0
- package/es/common/mixin.js +28 -0
- package/es/common/mixin.js.map +1 -0
- package/es/common/number.d.ts +3 -0
- package/es/common/number.js +15 -0
- package/es/common/number.js.map +1 -0
- package/es/common/pad.d.ts +2 -0
- package/es/common/pad.js +11 -0
- package/es/common/pad.js.map +1 -0
- package/es/common/pick.d.ts +1 -0
- package/es/common/pick.js +12 -0
- package/es/common/pick.js.map +1 -0
- package/es/common/pickWithout.d.ts +1 -0
- package/es/common/pickWithout.js +16 -0
- package/es/common/pickWithout.js.map +1 -0
- package/es/common/quantileSorted.d.ts +1 -0
- package/es/common/quantileSorted.js +11 -0
- package/es/common/quantileSorted.js.map +1 -0
- package/es/common/range.d.ts +1 -0
- package/es/common/range.js +10 -0
- package/es/common/range.js.map +1 -0
- package/es/common/throttle.d.ts +5 -0
- package/es/common/throttle.js +17 -0
- package/es/common/throttle.js.map +1 -0
- package/es/common/tickStep.d.ts +1 -0
- package/es/common/tickStep.js +10 -0
- package/es/common/tickStep.js.map +1 -0
- package/es/common/toDate.d.ts +2 -0
- package/es/common/toDate.js +18 -0
- package/es/common/toDate.js.map +1 -0
- package/es/common/toNumber.d.ts +1 -0
- package/es/common/toNumber.js +4 -0
- package/es/common/toNumber.js.map +1 -0
- package/es/common/toValidNumber.d.ts +1 -0
- package/es/common/toValidNumber.js +8 -0
- package/es/common/toValidNumber.js.map +1 -0
- package/es/common/truncate.d.ts +2 -0
- package/es/common/truncate.js +9 -0
- package/es/common/truncate.js.map +1 -0
- package/es/common/upperFirst.d.ts +2 -0
- package/es/common/upperFirst.js +6 -0
- package/es/common/upperFirst.js.map +1 -0
- package/es/common/uuid.d.ts +2 -0
- package/es/common/uuid.js +13 -0
- package/es/common/uuid.js.map +1 -0
- package/es/common/variance.d.ts +1 -0
- package/es/common/variance.js +11 -0
- package/es/common/variance.js.map +1 -0
- package/es/data-structure/bounds.d.ts +81 -0
- package/es/data-structure/bounds.js +127 -0
- package/es/data-structure/bounds.js.map +1 -0
- package/es/data-structure/hashTable.d.ts +35 -0
- package/es/data-structure/hashTable.js +104 -0
- package/es/data-structure/hashTable.js.map +1 -0
- package/es/data-structure/index.d.ts +4 -0
- package/es/data-structure/index.js +8 -0
- package/es/data-structure/index.js.map +1 -0
- package/es/data-structure/matrix.d.ts +80 -0
- package/es/data-structure/matrix.js +106 -0
- package/es/data-structure/matrix.js.map +1 -0
- package/es/data-structure/point.d.ts +62 -0
- package/es/data-structure/point.js +65 -0
- package/es/data-structure/point.js.map +1 -0
- package/es/dom.d.ts +10 -0
- package/es/dom.js +75 -0
- package/es/dom.js.map +1 -0
- package/es/geo/index.d.ts +2 -0
- package/es/geo/index.js +4 -0
- package/es/geo/index.js.map +1 -0
- package/es/geo/interface.d.ts +1 -0
- package/es/geo/interface.js +2 -0
- package/es/geo/interface.js.map +1 -0
- package/es/geo/invariant.d.ts +9 -0
- package/es/geo/invariant.js +40 -0
- package/es/geo/invariant.js.map +1 -0
- package/es/graphics/algorithm/aabb.d.ts +6 -0
- package/es/graphics/algorithm/aabb.js +49 -0
- package/es/graphics/algorithm/aabb.js.map +1 -0
- package/es/graphics/algorithm/index.d.ts +3 -0
- package/es/graphics/algorithm/index.js +6 -0
- package/es/graphics/algorithm/index.js.map +1 -0
- package/es/graphics/algorithm/interface.d.ts +20 -0
- package/es/graphics/algorithm/interface.js +2 -0
- package/es/graphics/algorithm/interface.js.map +1 -0
- package/es/graphics/algorithm/intersect.d.ts +25 -0
- package/es/graphics/algorithm/intersect.js +135 -0
- package/es/graphics/algorithm/intersect.js.map +1 -0
- package/es/graphics/algorithm/obb.d.ts +5 -0
- package/es/graphics/algorithm/obb.js +68 -0
- package/es/graphics/algorithm/obb.js.map +1 -0
- package/es/graphics/graph-util.d.ts +23 -0
- package/es/graphics/graph-util.js +39 -0
- package/es/graphics/graph-util.js.map +1 -0
- package/es/graphics/image.d.ts +2 -0
- package/es/graphics/image.js +12 -0
- package/es/graphics/image.js.map +1 -0
- package/es/graphics/index.d.ts +5 -0
- package/es/graphics/index.js +10 -0
- package/es/graphics/index.js.map +1 -0
- package/es/graphics/polygon.d.ts +5 -0
- package/es/graphics/polygon.js +47 -0
- package/es/graphics/polygon.js.map +1 -0
- package/es/graphics/text/index.d.ts +2 -0
- package/es/graphics/text/index.js +4 -0
- package/es/graphics/text/index.js.map +1 -0
- package/es/graphics/text/measure/index.d.ts +4 -0
- package/es/graphics/text/measure/index.js +8 -0
- package/es/graphics/text/measure/index.js.map +1 -0
- package/es/graphics/text/measure/interface.d.ts +31 -0
- package/es/graphics/text/measure/interface.js +2 -0
- package/es/graphics/text/measure/interface.js.map +1 -0
- package/es/graphics/text/measure/test.d.ts +14 -0
- package/es/graphics/text/measure/test.js +65 -0
- package/es/graphics/text/measure/test.js.map +1 -0
- package/es/graphics/text/measure/textMeasure.d.ts +38 -0
- package/es/graphics/text/measure/textMeasure.js +181 -0
- package/es/graphics/text/measure/textMeasure.js.map +1 -0
- package/es/graphics/text/measure/util.d.ts +2 -0
- package/es/graphics/text/measure/util.js +5 -0
- package/es/graphics/text/measure/util.js.map +1 -0
- package/es/graphics/text/stringWidth.d.ts +2 -0
- package/es/graphics/text/stringWidth.js +43 -0
- package/es/graphics/text/stringWidth.js.map +1 -0
- package/es/index.d.ts +15 -0
- package/es/index.js +30 -0
- package/es/index.js.map +1 -0
- package/es/logger.d.ts +12 -0
- package/es/logger.js +38 -0
- package/es/logger.js.map +1 -0
- package/es/lru.d.ts +25 -0
- package/es/lru.js +36 -0
- package/es/lru.js.map +1 -0
- package/es/math.d.ts +66 -0
- package/es/math.js +76 -0
- package/es/math.js.map +1 -0
- package/es/padding.d.ts +7 -0
- package/es/padding.js +31 -0
- package/es/padding.js.map +1 -0
- package/es/time/formatUtils.d.ts +17 -0
- package/es/time/formatUtils.js +72 -0
- package/es/time/formatUtils.js.map +1 -0
- package/es/time/index.d.ts +2 -0
- package/es/time/index.js +4 -0
- package/es/time/index.js.map +1 -0
- package/es/time/interval.d.ts +77 -0
- package/es/time/interval.js +227 -0
- package/es/time/interval.js.map +1 -0
- package/es/type.d.ts +5 -0
- package/es/type.js +2 -0
- package/es/type.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/clamper.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,OAAO,CAAC,CAAS,EAAE,CAAS;IAC1C,IAAI,CAAC,CAAC;IACN,IAAI,CAAC,GAAG,CAAC,EAAE;QACT,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,CAAC,CAAC;QACN,CAAC,GAAG,CAAC,CAAC;KACP;IACD,OAAO,CAAC,CAAS,EAAE,EAAE;QACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC;AACJ,CAAC","file":"clamper.js","sourcesContent":["export function clamper(a: number, b: number): (x: number) => number {\n let t;\n if (a > b) {\n t = a;\n a = b;\n b = t;\n }\n return (x: number) => {\n return Math.max(a, Math.min(b, x));\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function clone(parent: any, circular?: boolean, depth?: number, prototype?: any): any;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import isArray from "./isArray";
|
|
2
|
+
|
|
3
|
+
import isDate from "./isDate";
|
|
4
|
+
|
|
5
|
+
import isRegExp from "./isRegExp";
|
|
6
|
+
|
|
7
|
+
function getRegExpFlags(re) {
|
|
8
|
+
let flags = "";
|
|
9
|
+
return re.global && (flags += "g"), re.ignoreCase && (flags += "i"), re.multiline && (flags += "m"),
|
|
10
|
+
flags;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function clone(parent, circular = !1, depth = 0, prototype = void 0) {
|
|
14
|
+
const allParents = [], allChildren = [];
|
|
15
|
+
return void 0 === circular && (circular = !0), void 0 === depth && (depth = 1 / 0),
|
|
16
|
+
function _clone(parent, depth) {
|
|
17
|
+
if (null === parent) return null;
|
|
18
|
+
if (0 === depth) return parent;
|
|
19
|
+
let child;
|
|
20
|
+
if ("object" != typeof parent) return parent;
|
|
21
|
+
if (isArray(parent) ? child = [] : isRegExp(parent) ? (child = new RegExp(parent.source, getRegExpFlags(parent)),
|
|
22
|
+
parent.lastIndex && (child.lastIndex = parent.lastIndex)) : child = isDate(parent) ? new Date(parent.getTime()) : void 0 === prototype ? Object.create(Object.getPrototypeOf(parent)) : Object.create(prototype),
|
|
23
|
+
circular) {
|
|
24
|
+
const index = allParents.indexOf(parent);
|
|
25
|
+
if (-1 !== index) return allChildren[index];
|
|
26
|
+
allParents.push(parent), allChildren.push(child);
|
|
27
|
+
}
|
|
28
|
+
for (const i in parent) child[i] = _clone(parent[i], depth - 1);
|
|
29
|
+
return child;
|
|
30
|
+
}(parent, depth);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=clone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/clone.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,SAAS,cAAc,CAAC,EAAO;IAC7B,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,EAAE,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;IAC5B,EAAE,CAAC,UAAU,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;IAChC,EAAE,CAAC,SAAS,IAAI,CAAC,KAAK,IAAI,GAAG,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC;AACf,CAAC;AAID,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,MAAW,EAAE,QAAQ,GAAG,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,YAAiB,SAAS;IAGhG,MAAM,UAAU,GAAe,EAAE,CAAC;IAClC,MAAM,WAAW,GAAe,EAAE,CAAC;IAEnC,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACnC,QAAQ,GAAG,IAAI,CAAC;KACjB;IAED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C;YACxB,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;YACtB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;SACzC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/B,CAAC","file":"clone.js","sourcesContent":["import isArray from './isArray';\nimport isDate from './isDate';\nimport isRegExp from './isRegExp';\n\nfunction getRegExpFlags(re: any) {\n let flags = '';\n re.global && (flags += 'g');\n re.ignoreCase && (flags += 'i');\n re.multiline && (flags += 'm');\n return flags;\n}\n\n// Adapted from https://github.com/pvorb/clone by Paul Vorbach\n// License: https://github.com/pvorb/clone/blob/master/LICENSE\nexport default function clone(parent: any, circular = false, depth = 0, prototype: any = undefined) {\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n const allParents: Array<any> = [];\n const allChildren: Array<any> = [];\n\n if (typeof circular === 'undefined') {\n circular = true;\n }\n\n if (typeof depth === 'undefined') {\n depth = Infinity;\n }\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent: any, depth: number) {\n // cloning null always returns null\n if (parent === null) {\n return null;\n }\n\n if (depth === 0) {\n return parent;\n }\n\n let child;\n if (typeof parent !== 'object') {\n return parent;\n }\n\n if (isArray(parent)) {\n child = [];\n } else if (isRegExp(parent)) {\n child = new RegExp(parent.source, getRegExpFlags(parent));\n if (parent.lastIndex) {\n child.lastIndex = parent.lastIndex;\n }\n } else if (isDate(parent)) {\n child = new Date(parent.getTime());\n } else {\n if (typeof prototype === 'undefined') {\n child = Object.create(Object.getPrototypeOf(parent));\n } else {\n child = Object.create(prototype);\n }\n }\n\n if (circular) {\n const index = allParents.indexOf(parent);\n\n if (index !== -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n for (const i in parent) {\n child[i] = _clone(parent[i], depth - 1);\n }\n\n return child;\n }\n return _clone(parent, depth);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function cloneDeep(value: any): any;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import isArray from "./isArray";
|
|
2
|
+
|
|
3
|
+
import isBoolean from "./isBoolean";
|
|
4
|
+
|
|
5
|
+
import isDate from "./isDate";
|
|
6
|
+
|
|
7
|
+
import isNumber from "./isNumber";
|
|
8
|
+
|
|
9
|
+
import isString from "./isString";
|
|
10
|
+
|
|
11
|
+
import isValid from "./isValid";
|
|
12
|
+
|
|
13
|
+
export default function cloneDeep(value) {
|
|
14
|
+
let result;
|
|
15
|
+
if (!isValid(value) || "object" != typeof value) return value;
|
|
16
|
+
const isArr = isArray(value), length = value.length;
|
|
17
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean(value) || isNumber(value) || isString(value) ? value : isDate(value) ? new Date(+value) : void 0;
|
|
18
|
+
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
19
|
+
let index = -1;
|
|
20
|
+
if (result) for (;++index < (props || value).length; ) {
|
|
21
|
+
const key = props ? props[index] : index, subValue = value[key];
|
|
22
|
+
result[key] = cloneDeep(subValue);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=cloneDeep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/cloneDeep.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAU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,CAAC","file":"cloneDeep.js","sourcesContent":["import isArray from './isArray';\nimport isBoolean from './isBoolean';\nimport isDate from './isDate';\nimport isNumber from './isNumber';\nimport isString from './isString';\nimport isValid from './isValid';\n\nexport default function cloneDeep(value: any): any {\n let result;\n if (!isValid(value) || typeof value !== 'object') {\n return value;\n }\n\n const isArr = isArray(value);\n const length = value.length;\n // 不考虑特殊数组的额外处理\n if (isArr) {\n result = new Array(length);\n }\n // 不考虑 buffer / arguments 类型的处理以及 prototype 的额外处理\n else if (typeof value === 'object') {\n result = {};\n }\n // 不建议使用作为 Boolean / Number / String 作为构造器\n else if (isBoolean(value) || isNumber(value) || isString(value)) {\n result = value;\n } else if (isDate(value)) {\n result = new Date(+value);\n }\n // 不考虑 ArrayBuffer / DataView / TypedArray / map / set / regexp / symbol 类型\n else {\n result = undefined;\n }\n\n // 不考虑 map / set / TypedArray 类型的赋值\n\n // 不考虑对象的 symbol 属性\n const props = isArr ? undefined : Object.keys(Object(value));\n\n let index = -1;\n if (result) {\n while (++index < (props || value).length) {\n const key = props ? props[index] : index;\n const subValue = value[key];\n result[key] = cloneDeep(subValue);\n }\n }\n return result;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/constant.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,QAAQ,GAAG,CAAC,KAAU,EAAE,EAAE;IAC9B,OAAO,UAAU,CAAC,KAAK,CAAC;QACtB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,GAAG,EAAE;YACH,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;AACR,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","file":"constant.js","sourcesContent":["import isFunction from './isFunction';\n\nconst constant = (value: any) => {\n return isFunction(value)\n ? value\n : () => {\n return value;\n };\n};\n\nexport default constant;\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import isObject from "./isObject";
|
|
2
|
+
|
|
3
|
+
import isValidNumber from "./isValidNumber";
|
|
4
|
+
|
|
5
|
+
let hasRaf = !1;
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
hasRaf = "function" == typeof requestAnimationFrame && "function" == typeof cancelAnimationFrame;
|
|
9
|
+
} catch (err) {
|
|
10
|
+
hasRaf = !1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function debounce(func, wait, options) {
|
|
14
|
+
let lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = !1, maxing = !1, trailing = !0;
|
|
15
|
+
const useRAF = !wait && 0 !== wait && hasRaf;
|
|
16
|
+
if ("function" != typeof func) throw new TypeError("Expected a function");
|
|
17
|
+
function invokeFunc(time) {
|
|
18
|
+
const args = lastArgs, thisArg = lastThis;
|
|
19
|
+
return lastArgs = lastThis = void 0, lastInvokeTime = time, result = func.apply(thisArg, args),
|
|
20
|
+
result;
|
|
21
|
+
}
|
|
22
|
+
function startTimer(pendingFunc, wait) {
|
|
23
|
+
return useRAF ? (cancelAnimationFrame(timerId), requestAnimationFrame(pendingFunc)) : setTimeout(pendingFunc, wait);
|
|
24
|
+
}
|
|
25
|
+
function shouldInvoke(time) {
|
|
26
|
+
const timeSinceLastCall = time - lastCallTime;
|
|
27
|
+
return void 0 === lastCallTime || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && time - lastInvokeTime >= maxWait;
|
|
28
|
+
}
|
|
29
|
+
function timerExpired() {
|
|
30
|
+
const time = Date.now();
|
|
31
|
+
if (shouldInvoke(time)) return trailingEdge(time);
|
|
32
|
+
timerId = startTimer(timerExpired, function(time) {
|
|
33
|
+
const timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - (time - lastCallTime);
|
|
34
|
+
return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
35
|
+
}(time));
|
|
36
|
+
}
|
|
37
|
+
function trailingEdge(time) {
|
|
38
|
+
return timerId = void 0, trailing && lastArgs ? invokeFunc(time) : (lastArgs = lastThis = void 0,
|
|
39
|
+
result);
|
|
40
|
+
}
|
|
41
|
+
function debounced(...args) {
|
|
42
|
+
const time = Date.now(), isInvoking = shouldInvoke(time);
|
|
43
|
+
if (lastArgs = args, lastThis = this, lastCallTime = time, isInvoking) {
|
|
44
|
+
if (void 0 === timerId) return function(time) {
|
|
45
|
+
return lastInvokeTime = time, timerId = startTimer(timerExpired, wait), leading ? invokeFunc(time) : result;
|
|
46
|
+
}(lastCallTime);
|
|
47
|
+
if (maxing) return timerId = startTimer(timerExpired, wait), invokeFunc(lastCallTime);
|
|
48
|
+
}
|
|
49
|
+
return void 0 === timerId && (timerId = startTimer(timerExpired, wait)), result;
|
|
50
|
+
}
|
|
51
|
+
return wait = +wait || 0, isObject(options) && (leading = !!options.leading, maxing = "maxWait" in options,
|
|
52
|
+
maxing && (maxWait = Math.max(isValidNumber(options.maxWait) ? options.maxWait : 0, wait)),
|
|
53
|
+
trailing = "trailing" in options ? !!options.trailing : trailing), debounced.cancel = function() {
|
|
54
|
+
void 0 !== timerId && function(id) {
|
|
55
|
+
if (useRAF) return cancelAnimationFrame(id);
|
|
56
|
+
clearTimeout(id);
|
|
57
|
+
}(timerId), lastInvokeTime = 0, lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
58
|
+
}, debounced.flush = function() {
|
|
59
|
+
return void 0 === timerId ? result : trailingEdge(Date.now());
|
|
60
|
+
}, debounced.pending = function() {
|
|
61
|
+
return void 0 !== timerId;
|
|
62
|
+
}, debounced;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
hasRaf = !1;
|
|
66
|
+
|
|
67
|
+
export default debounce;
|
|
68
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/debounce.ts"],"names":[],"mappings":"AAGA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAW5C,IA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;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxB,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QAEtC,QAAQ,GAAG,IAAI,CAAC;QAEhB,QAAQ,GAAG,IAAI,CAAC;QAChB,YAAY,GAAG,IAAI,CAAC;QAEpB,IAAI,UAAU,EAAE;YACd,IAAI,OAAO,KAAK,SAAS,EAAE;gBACzB,OAAO,WAAW,CAAC,YAAY,CAAC,CAAC;aAClC;YACD,IAAI,MAAM,EAAE;gBAEV,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;gBACzC,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;aACjC;SACF;QACD,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,OAAO,GAAG,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;SAC1C;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;IAC1B,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;IACxB,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;IAC5B,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,eAAe,QAAQ,CAAC","file":"debounce.js","sourcesContent":["/**\n * @see https://github.com/lodash/lodash/blob/master/debounce.js\n */\nimport isObject from './isObject';\nimport isValidNumber from './isValidNumber';\n\nexport type FunctionControlOptions = {\n // 是否在等待开始时调用\n leading?: boolean;\n // 是否在等待结束后调用\n trailing?: boolean;\n // 最长等待时间\n maxWait?: number;\n};\n\nlet hasRaf: boolean = false;\ntry {\n hasRaf = typeof requestAnimationFrame === 'function' && typeof cancelAnimationFrame === 'function';\n} catch (err) {\n hasRaf = false;\n}\nhasRaf = false;\n\nfunction debounce<T, S>(\n func: (...args: T[]) => S,\n wait: number,\n options?: FunctionControlOptions\n): (...args: T[]) => S {\n let lastArgs: any;\n let lastThis: any;\n let maxWait: number;\n let result: any;\n // eslint-disable-next-line no-undef\n let timerId: number | NodeJS.Timeout | undefined;\n let lastCallTime: number | undefined;\n\n let lastInvokeTime = 0;\n let leading = false;\n let maxing = false;\n let trailing = true;\n\n // Bypass `requestAnimationFrame` by explicitly setting `wait=0`.\n const useRAF = !wait && wait !== 0 && hasRaf;\n\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n wait = +wait || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n if (maxing) {\n maxWait = Math.max(isValidNumber(options.maxWait) ? options.maxWait : 0, wait);\n }\n\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time: number) {\n const args = lastArgs;\n const thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function startTimer(pendingFunc: any, wait: number) {\n if (useRAF) {\n cancelAnimationFrame(timerId as number);\n return requestAnimationFrame(pendingFunc);\n }\n return setTimeout(pendingFunc, wait);\n }\n\n function cancelTimer(id: number) {\n if (useRAF) {\n return cancelAnimationFrame(id);\n }\n clearTimeout(id);\n }\n\n function leadingEdge(time: number) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = startTimer(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time: number) {\n const timeSinceLastCall = time - (lastCallTime as number);\n const timeSinceLastInvoke = time - lastInvokeTime;\n const timeWaiting = wait - timeSinceLastCall;\n\n return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;\n }\n\n function shouldInvoke(time: number) {\n const timeSinceLastCall = time - (lastCallTime as number);\n const timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (\n lastCallTime === undefined ||\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxing && timeSinceLastInvoke >= maxWait)\n );\n }\n\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = startTimer(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time: number) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n cancelTimer(timerId as number);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n\n function pending() {\n return timerId !== undefined;\n }\n\n function debounced(...args: any[]) {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n\n lastArgs = args;\n // @ts-ignore\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = startTimer(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = startTimer(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n debounced.pending = pending;\n return debounced;\n}\n\nexport default debounce;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deviation(values: any[], valueof?: (entry: any, index?: number, arr?: any[]) => number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/deviation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,UAAU,SAAS,CAAC,MAAa,EAAE,OAA6D;IACpG,MAAM,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC","file":"deviation.js","sourcesContent":["import { variance } from './variance';\n\nexport function deviation(values: any[], valueof?: (entry: any, index?: number, arr?: any[]) => number) {\n const v = variance(values, valueof);\n return v ? Math.sqrt(v) : v;\n}\n"]}
|
package/es/common/get.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import isString from "./isString";
|
|
2
|
+
|
|
3
|
+
const get = (obj, path, defaultValue) => {
|
|
4
|
+
const paths = isString(path) ? path.split(".") : path;
|
|
5
|
+
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
6
|
+
return void 0 === obj ? defaultValue : obj;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default get;
|
|
10
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/get.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,GAAG,GAAG,CAAC,GAAc,EAAE,IAAuB,EAAE,YAAkB,EAAO,EAAE;IAC/E,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,IAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAElE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KACvC;IACD,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;AAChD,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC","file":"get.js","sourcesContent":["import type { Dict } from '../type';\nimport isString from './isString';\n\nconst get = (obj: Dict<any>, path: string | string[], defaultValue?: any): any => {\n const paths = isString(path) ? (path as string).split('.') : path;\n\n for (let p = 0; p < paths.length; p++) {\n obj = obj ? obj[paths[p]] : undefined;\n }\n return obj === undefined ? defaultValue : obj;\n};\n\nexport default get;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/getType.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG,CAAC,KAAU,EAAU,EAAE;IACrC,OAAO,EAAE,CAAC,QAAQ;SACf,IAAI,CAAC,KAAK,CAAC;SACX,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","file":"getType.js","sourcesContent":["const getType = (value: any): string => {\n return {}.toString\n .call(value)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n};\n\nexport default getType;\n"]}
|
package/es/common/has.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/has.ts"],"names":[],"mappings":"AAGA,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAmBvD,MAAM,GAAG,GAAG,CAAC,MAAiB,EAAE,GAAQ,EAAW,EAAE;IACnD,OAAO,MAAM,IAAI,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC5D,CAAC,CAAC;AAEF,eAAe,GAAG,CAAC","file":"has.js","sourcesContent":["import type { Dict } from './../type';\n\n/** Used to check objects for own properties. */\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * Checks if `key` is a direct property of `object`.\n *\n * @param {Object} object The object to query.\n * @param {string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n * @example\n *\n * const object = { 'a': { 'b': 2 } }\n * const other = create({ 'a': create({ 'b': 2 }) })\n *\n * has(object, 'a')\n * // => true\n *\n * has(other, 'a')\n * // => false\n */\nconst has = (object: Dict<any>, key: any): boolean => {\n return object != null && hasOwnProperty.call(object, key);\n};\n\nexport default has;\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export { default as isBoolean } from './isBoolean';
|
|
2
|
+
export { default as isFunction } from './isFunction';
|
|
3
|
+
export { default as isNil } from './isNil';
|
|
4
|
+
export { default as isNull } from './isNull';
|
|
5
|
+
export { default as isValid } from './isValid';
|
|
6
|
+
export { default as isObject } from './isObject';
|
|
7
|
+
export { default as isObjectLike } from './isObjectLike';
|
|
8
|
+
export { default as isPlainObject } from './isPlainObject';
|
|
9
|
+
export { default as isType } from './isType';
|
|
10
|
+
export { default as isUndefined } from './isUndefined';
|
|
11
|
+
export { default as isString } from './isString';
|
|
12
|
+
export { default as isArray } from './isArray';
|
|
13
|
+
export { default as isArrayLike } from './isArrayLike';
|
|
14
|
+
export { default as isDate } from './isDate';
|
|
15
|
+
export { default as isNumber } from './isNumber';
|
|
16
|
+
export { default as isNumeric } from './isNumeric';
|
|
17
|
+
export { default as isValidNumber } from './isValidNumber';
|
|
18
|
+
export { default as isValidUrl } from './isValidUrl';
|
|
19
|
+
export { default as isRegExp } from './isRegExp';
|
|
20
|
+
export { default as isBase64 } from './isBase64';
|
|
21
|
+
export { default as isEmpty } from './isEmpty';
|
|
22
|
+
export { default as get } from './get';
|
|
23
|
+
export { default as has } from './has';
|
|
24
|
+
export { default as clone } from './clone';
|
|
25
|
+
export { default as cloneDeep } from './cloneDeep';
|
|
26
|
+
export { default as merge } from './merge';
|
|
27
|
+
export { default as pick } from './pick';
|
|
28
|
+
export { default as pickWithout } from './pickWithout';
|
|
29
|
+
export { isEqual } from './isEqual';
|
|
30
|
+
export { isShallowEqual } from './isShallowEqual';
|
|
31
|
+
export * from './mixin';
|
|
32
|
+
export * from './array';
|
|
33
|
+
export { range } from './range';
|
|
34
|
+
export { ascending } from './ascending';
|
|
35
|
+
export * from './quantileSorted';
|
|
36
|
+
export { bisect } from './bisect';
|
|
37
|
+
export { deviation } from './deviation';
|
|
38
|
+
export { median } from './median';
|
|
39
|
+
export { variance } from './variance';
|
|
40
|
+
export { tickStep } from './tickStep';
|
|
41
|
+
export * from './number';
|
|
42
|
+
export { default as constant } from './constant';
|
|
43
|
+
export { default as pad } from './pad';
|
|
44
|
+
export { default as truncate } from './truncate';
|
|
45
|
+
export { default as uuid } from './uuid';
|
|
46
|
+
export { default as clamp } from './clamp';
|
|
47
|
+
export { default as clampRange } from './clampRange';
|
|
48
|
+
export { clamper } from './clamper';
|
|
49
|
+
export { default as debounce } from './debounce';
|
|
50
|
+
export { default as throttle } from './throttle';
|
|
51
|
+
export * from './interpolate';
|
|
52
|
+
export { toDate } from './toDate';
|
|
53
|
+
export { toNumber } from './toNumber';
|
|
54
|
+
export { toValidNumber } from './toValidNumber';
|
|
55
|
+
export { default as lowerFirst } from './lowerFirst';
|
|
56
|
+
export { default as upperFirst } from './upperFirst';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export { default as isBoolean } from "./isBoolean";
|
|
2
|
+
|
|
3
|
+
export { default as isFunction } from "./isFunction";
|
|
4
|
+
|
|
5
|
+
export { default as isNil } from "./isNil";
|
|
6
|
+
|
|
7
|
+
export { default as isNull } from "./isNull";
|
|
8
|
+
|
|
9
|
+
export { default as isValid } from "./isValid";
|
|
10
|
+
|
|
11
|
+
export { default as isObject } from "./isObject";
|
|
12
|
+
|
|
13
|
+
export { default as isObjectLike } from "./isObjectLike";
|
|
14
|
+
|
|
15
|
+
export { default as isPlainObject } from "./isPlainObject";
|
|
16
|
+
|
|
17
|
+
export { default as isType } from "./isType";
|
|
18
|
+
|
|
19
|
+
export { default as isUndefined } from "./isUndefined";
|
|
20
|
+
|
|
21
|
+
export { default as isString } from "./isString";
|
|
22
|
+
|
|
23
|
+
export { default as isArray } from "./isArray";
|
|
24
|
+
|
|
25
|
+
export { default as isArrayLike } from "./isArrayLike";
|
|
26
|
+
|
|
27
|
+
export { default as isDate } from "./isDate";
|
|
28
|
+
|
|
29
|
+
export { default as isNumber } from "./isNumber";
|
|
30
|
+
|
|
31
|
+
export { default as isNumeric } from "./isNumeric";
|
|
32
|
+
|
|
33
|
+
export { default as isValidNumber } from "./isValidNumber";
|
|
34
|
+
|
|
35
|
+
export { default as isValidUrl } from "./isValidUrl";
|
|
36
|
+
|
|
37
|
+
export { default as isRegExp } from "./isRegExp";
|
|
38
|
+
|
|
39
|
+
export { default as isBase64 } from "./isBase64";
|
|
40
|
+
|
|
41
|
+
export { default as isEmpty } from "./isEmpty";
|
|
42
|
+
|
|
43
|
+
export { default as get } from "./get";
|
|
44
|
+
|
|
45
|
+
export { default as has } from "./has";
|
|
46
|
+
|
|
47
|
+
export { default as clone } from "./clone";
|
|
48
|
+
|
|
49
|
+
export { default as cloneDeep } from "./cloneDeep";
|
|
50
|
+
|
|
51
|
+
export { default as merge } from "./merge";
|
|
52
|
+
|
|
53
|
+
export { default as pick } from "./pick";
|
|
54
|
+
|
|
55
|
+
export { default as pickWithout } from "./pickWithout";
|
|
56
|
+
|
|
57
|
+
export { isEqual } from "./isEqual";
|
|
58
|
+
|
|
59
|
+
export { isShallowEqual } from "./isShallowEqual";
|
|
60
|
+
|
|
61
|
+
export * from "./mixin";
|
|
62
|
+
|
|
63
|
+
export * from "./array";
|
|
64
|
+
|
|
65
|
+
export { range } from "./range";
|
|
66
|
+
|
|
67
|
+
export { ascending } from "./ascending";
|
|
68
|
+
|
|
69
|
+
export * from "./quantileSorted";
|
|
70
|
+
|
|
71
|
+
export { bisect } from "./bisect";
|
|
72
|
+
|
|
73
|
+
export { deviation } from "./deviation";
|
|
74
|
+
|
|
75
|
+
export { median } from "./median";
|
|
76
|
+
|
|
77
|
+
export { variance } from "./variance";
|
|
78
|
+
|
|
79
|
+
export { tickStep } from "./tickStep";
|
|
80
|
+
|
|
81
|
+
export * from "./number";
|
|
82
|
+
|
|
83
|
+
export { default as constant } from "./constant";
|
|
84
|
+
|
|
85
|
+
export { default as pad } from "./pad";
|
|
86
|
+
|
|
87
|
+
export { default as truncate } from "./truncate";
|
|
88
|
+
|
|
89
|
+
export { default as uuid } from "./uuid";
|
|
90
|
+
|
|
91
|
+
export { default as clamp } from "./clamp";
|
|
92
|
+
|
|
93
|
+
export { default as clampRange } from "./clampRange";
|
|
94
|
+
|
|
95
|
+
export { clamper } from "./clamper";
|
|
96
|
+
|
|
97
|
+
export { default as debounce } from "./debounce";
|
|
98
|
+
|
|
99
|
+
export { default as throttle } from "./throttle";
|
|
100
|
+
|
|
101
|
+
export * from "./interpolate";
|
|
102
|
+
|
|
103
|
+
export { toDate } from "./toDate";
|
|
104
|
+
|
|
105
|
+
export { toNumber } from "./toNumber";
|
|
106
|
+
|
|
107
|
+
export { toValidNumber } from "./toValidNumber";
|
|
108
|
+
|
|
109
|
+
export { default as lowerFirst } from "./lowerFirst";
|
|
110
|
+
|
|
111
|
+
export { default as upperFirst } from "./upperFirst";
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE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GhD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC","file":"index.js","sourcesContent":["// type check\nexport { default as isBoolean } from './isBoolean';\nexport { default as isFunction } from './isFunction';\nexport { default as isNil } from './isNil';\nexport { default as isNull } from './isNull';\nexport { default as isValid } from './isValid';\nexport { default as isObject } from './isObject';\nexport { default as isObjectLike } from './isObjectLike';\nexport { default as isPlainObject } from './isPlainObject';\nexport { default as isType } from './isType';\nexport { default as isUndefined } from './isUndefined';\nexport { default as isString } from './isString';\nexport { default as isArray } from './isArray';\nexport { default as isArrayLike } from './isArrayLike';\nexport { default as isDate } from './isDate';\nexport { default as isNumber } from './isNumber';\nexport { default as isNumeric } from './isNumeric';\nexport { default as isValidNumber } from './isValidNumber';\nexport { default as isValidUrl } from './isValidUrl';\nexport { default as isRegExp } from './isRegExp';\nexport { default as isBase64 } from './isBase64';\n\nexport { default as isEmpty } from './isEmpty';\n\n// object\nexport { default as get } from './get';\nexport { default as has } from './has';\nexport { default as clone } from './clone';\nexport { default as cloneDeep } from './cloneDeep';\nexport { default as merge } from './merge';\nexport { default as pick } from './pick';\nexport { default as pickWithout } from './pickWithout';\nexport { isEqual } from './isEqual';\nexport { isShallowEqual } from './isShallowEqual';\nexport * from './mixin';\n\n// array\nexport * from './array';\nexport { range } from './range';\nexport { ascending } from './ascending';\nexport * from './quantileSorted';\nexport { bisect } from './bisect';\nexport { deviation } from './deviation';\nexport { median } from './median';\nexport { variance } from './variance';\n\n// tick\nexport { tickStep } from './tickStep';\n\n// number\nexport * from './number';\n\n// function\nexport { default as constant } from './constant';\n\n// pad\nexport { default as pad } from './pad';\nexport { default as truncate } from './truncate';\n\n// uuid\nexport { default as uuid } from './uuid';\n\n// clamp\nexport { default as clamp } from './clamp';\nexport { default as clampRange } from './clampRange';\nexport { clamper } from './clamper';\n\n// debounce & throttle\nexport { default as debounce } from './debounce';\nexport { default as throttle } from './throttle';\n\n// interpolate\nexport * from './interpolate';\n\n// type convert\nexport { toDate } from './toDate';\nexport { toNumber } from './toNumber';\nexport { toValidNumber } from './toValidNumber';\n\n// string\nexport { default as lowerFirst } from './lowerFirst';\nexport { default as upperFirst } from './upperFirst';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function interpolateNumber(a: number, b: number): (x: number) => number;
|
|
2
|
+
export declare function interpolateNumberRound(a: number, b: number): (x: number) => number;
|
|
3
|
+
export declare function interpolateDate(a: Date, b: Date): (t: number) => Date;
|
|
4
|
+
export declare function interpolateString(a: any, b: any): (() => any) | ((t: any) => string);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function interpolateNumber(a, b) {
|
|
2
|
+
return t => a * (1 - t) + b * t;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function interpolateNumberRound(a, b) {
|
|
6
|
+
return function(t) {
|
|
7
|
+
return Math.round(a * (1 - t) + b * t);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function interpolateDate(a, b) {
|
|
12
|
+
const aVal = a.valueOf(), bVal = b.valueOf(), d = new Date;
|
|
13
|
+
return t => (d.setTime(aVal * (1 - t) + bVal * t), d);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, reB = new RegExp(reA.source, "g");
|
|
17
|
+
|
|
18
|
+
function zero(b) {
|
|
19
|
+
return function() {
|
|
20
|
+
return b;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function one(b) {
|
|
25
|
+
return function(t) {
|
|
26
|
+
return b(t) + "";
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function interpolateString(a, b) {
|
|
31
|
+
let am, bm, bs, bi = reA.lastIndex = reB.lastIndex = 0, i = -1;
|
|
32
|
+
const s = [], q = [];
|
|
33
|
+
for (a += "", b += ""; (am = reA.exec(a)) && (bm = reB.exec(b)); ) (bs = bm.index) > bi && (bs = b.slice(bi, bs),
|
|
34
|
+
s[i] ? s[i] += bs : s[++i] = bs), (am = am[0]) === (bm = bm[0]) ? s[i] ? s[i] += bm : s[++i] = bm : (s[++i] = null,
|
|
35
|
+
q.push({
|
|
36
|
+
i: i,
|
|
37
|
+
x: interpolateNumber(am, bm)
|
|
38
|
+
})), bi = reB.lastIndex;
|
|
39
|
+
return bi < b.length && (bs = b.slice(bi), s[i] ? s[i] += bs : s[++i] = bs), s.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length,
|
|
40
|
+
function(t) {
|
|
41
|
+
for (let o, i = 0; i < b; ++i) s[(o = q[i]).i] = o.x(t);
|
|
42
|
+
return s.join("");
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=interpolate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/interpolate.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,iBAAiB,CAAC,CAAS,EAAE,CAAS;IACpD,OAAO,CAAC,CAAS,EAAE,EAAE;QACnB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,CAAS,EAAE,CAAS;IACzD,OAAO,UAAU,CAAC;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,CAAO,EAAE,CAAO;IAC9C,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC;IAEzB,MA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,CAAC,CAAC;QACX,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;YACf,UAAU,CAAM;gBACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;oBAC7B,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC1B;gBACD,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACpB,CAAC,CAAC,CAAC;AACT,CAAC","file":"interpolate.js","sourcesContent":["export function interpolateNumber(a: number, b: number): (x: number) => number {\n return (t: number) => {\n return a * (1 - t) + b * t;\n };\n}\n\nexport function interpolateNumberRound(a: number, b: number): (x: number) => number {\n return function (t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n\nexport function interpolateDate(a: Date, b: Date) {\n const aVal = a.valueOf();\n const bVal = b.valueOf();\n\n const d = new Date();\n return (t: number) => {\n d.setTime(aVal * (1 - t) + bVal * t);\n return d;\n };\n}\n\nconst reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g;\nconst reB = new RegExp(reA.source, 'g');\n\nfunction zero(b: any) {\n return function () {\n return b;\n };\n}\n\nfunction one(b: any) {\n return function (t: any) {\n return b(t) + '';\n };\n}\n\nexport function interpolateString(a: any, b: any) {\n let bi = (reA.lastIndex = reB.lastIndex = 0); // scan index for next number in b\n let am: any; // current match in a\n let bm: any; // current match in b\n let bs; // string preceding current number in b, if any\n let i = -1; // index in s\n const s: any[] = []; // string constants and placeholders\n const q: any[] = []; // number interpolators\n\n // Coerce inputs to strings.\n (a = a + ''), (b = b + '');\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a)) && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) {\n // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) {\n s[i] += bs;\n } // coalesce with previous string\n else {\n s[++i] = bs;\n }\n }\n if ((am = am[0]) === (bm = bm[0])) {\n // numbers in a & b match\n if (s[i]) {\n s[i] += bm;\n } // coalesce with previous string\n else {\n s[++i] = bm;\n }\n } else {\n // interpolate non-matching numbers\n s[++i] = null;\n q.push({ i: i, x: interpolateNumber(am, bm) });\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) {\n s[i] += bs;\n } // coalesce with previous string\n else {\n s[++i] = bs;\n }\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2\n ? q[0]\n ? one(q[0].x)\n : zero(b)\n : ((b = q.length),\n function (t: any) {\n for (let i = 0, o; i < b; ++i) {\n s[(o = q[i]).i] = o.x(t);\n }\n return s.join('');\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isArray.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,OAAO,GAAG,CAAC,KAAU,EAAuB,EAAE;IAClD,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","file":"isArray.js","sourcesContent":["import isType from './isType';\n\nconst isArray = (value: any): value is Array<any> => {\n return Array.isArray ? Array.isArray(value) : isType(value, 'Array');\n};\n\nexport default isArray;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isArrayLike.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,UAAU,KAAU;IACtC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","file":"isArrayLike.js","sourcesContent":["const isArrayLike = function (value: any): boolean {\n return value !== null && typeof value !== 'function' && Number.isFinite(value.length);\n};\n\nexport default isArrayLike;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isBase64.ts"],"names":[],"mappings":"AAMA,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAW,EAAE;IAC1C,MAAM,GAAG,GAAG,+FAA+F,CAAC;IAC5G,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","file":"isBase64.js","sourcesContent":["/**\n * 迁移至 sirius\n * Checks if `value` is classified as a `Base64` string;\n * @param {string} The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n */\nconst isBase64 = (value: string): boolean => {\n const exp = /^data:image\\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g;\n const urlPattern = new RegExp(exp);\n return urlPattern.test(value);\n};\n\nexport default isBase64;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAe9B,MAAM,SAAS,GAAG,CAAC,KAAU,EAAE,QAAiB,KAAK,EAAoB,EAAE;IACzE,IAAI,KAAK,EAAE;QACT,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;KACnC;IACD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","file":"isBoolean.js","sourcesContent":["import isType from './isType';\n\n/**\n * Checks if `value` is classified as a boolean primitive or object.\n * @param {*} value The value to check.\n * @param {boolean} fuzzy Whether to perform fuzzy judgment, for better performance,default to `false`.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * isBoolean(false)\n * // => true\n *\n * isBoolean(null)\n * // => false\n */\nconst isBoolean = (value: any, fuzzy: boolean = false): value is boolean => {\n if (fuzzy) {\n return typeof value === 'boolean';\n }\n return value === true || value === false || isType(value, 'Boolean');\n};\n\nexport default isBoolean;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isDate.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,MAAM,MAAM,GAAG,CAAC,KAAU,EAAiB,EAAE;IAC3C,OAAO,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC","file":"isDate.js","sourcesContent":["import isType from './isType';\n\nconst isDate = (value: any): value is Date => {\n return isType(value, 'Date');\n};\n\nexport default isDate;\n"]}
|