@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/isType.ts"],"names":[],"mappings":";;AAMA,MAAM,MAAM,GAAG,CAAC,KAAU,EAAE,IAAY,EAAW,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,WAAW,IAAI,GAAG,CAAC;AAElG,kBAAe,MAAM,CAAC","file":"isType.js","sourcesContent":["/**\n * check value type\n * @param value the value to check\n * @param type type\n * @returns\n */\nconst isType = (value: any, type: string): boolean => toString.call(value) === `[object ${type}]`;\n\nexport default isType;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isUndefined.ts"],"names":[],"mappings":";;AAAA,MAAM,WAAW,GAAG,CAAC,KAAU,EAAsB,EAAE;IACrD,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC,CAAC;AAEF,kBAAe,WAAW,CAAC","file":"isUndefined.js","sourcesContent":["const isUndefined = (value: any): value is undefined => {\n return value === undefined;\n};\n\nexport default isUndefined;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isValid.ts"],"names":[],"mappings":";;AAAA,MAAM,OAAO,GAAG,CAAI,KAAQ,EAA2B,EAAE;IACvD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC,CAAC;AAEF,kBAAe,OAAO,CAAC","file":"isValid.js","sourcesContent":["const isValid = <T>(value: T): value is NonNullable<T> => {\n return value !== null && value !== undefined;\n};\n\nexport default isValid;\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const isNumber_1 = __importDefault(require("./isNumber")), isValidNumber = value => (0,
|
|
14
|
+
isNumber_1.default)(value) && Number.isFinite(value);
|
|
15
|
+
|
|
16
|
+
exports.default = isValidNumber;
|
|
17
|
+
//# sourceMappingURL=isValidNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isValidNumber.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC,MAAM,aAAa,GAAG,CAAC,KAAU,EAAmB,EAAE;IAEpD,OAAO,IAAA,kBAAQ,EAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC","file":"isValidNumber.js","sourcesContent":["import isNumber from './isNumber';\n\nconst isValidNumber = (value: any): value is number => {\n // isFinate 包含来 isNaN 的判断\n return isNumber(value) && Number.isFinite(value);\n};\n\nexport default isValidNumber;\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.isValidUrl = void 0;
|
|
6
|
+
|
|
7
|
+
const isValidUrl = value => new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(value);
|
|
8
|
+
|
|
9
|
+
exports.isValidUrl = isValidUrl, exports.default = exports.isValidUrl;
|
|
10
|
+
//# sourceMappingURL=isValidUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/isValidUrl.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE;IAE1C,MAAM,GAAG,GAAG,0CAA0C,CAAC;IACvD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAChC,CAAC,CAAC;AALW,QAAA,UAAU,cAKrB;AAEF,kBAAe,kBAAU,CAAC","file":"isValidUrl.js","sourcesContent":["export const isValidUrl = (value: string) => {\n // TODO: 匹配其他形式的 url\n const exp = /^(http(s)?:\\/\\/)\\w+[^\\s]+(\\.[^\\s]+){1,}$/;\n const urlPattern = new RegExp(exp);\n return urlPattern.test(value);\n};\n\nexport default isValidUrl;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const lowerFirst = function(str) {
|
|
8
|
+
return str.charAt(0).toLowerCase() + str.substring(1);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
exports.default = lowerFirst;
|
|
12
|
+
//# sourceMappingURL=lowerFirst.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/lowerFirst.ts"],"names":[],"mappings":";;AAAA,MAAM,UAAU,GAAG,UAAU,GAAW;IACtC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC","file":"lowerFirst.js","sourcesContent":["const lowerFirst = function (str: string): string {\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\nexport default lowerFirst;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const median: (values: number[], isSorted?: boolean) => number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.median = void 0;
|
|
6
|
+
|
|
7
|
+
const ascending_1 = require("./ascending"), quantileSorted_1 = require("./quantileSorted"), median = (values, isSorted) => {
|
|
8
|
+
let sorted = values;
|
|
9
|
+
return !0 !== isSorted && (sorted = values.sort(ascending_1.ascending)), (0, quantileSorted_1.quantileSorted)(sorted, .5);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.median = median;
|
|
13
|
+
//# sourceMappingURL=median.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/median.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,qDAAkD;AAE3C,MAAM,MAAM,GAAG,CAAC,MAAgB,EAAE,QAAkB,EAAE,EAAE;IAC7D,IAAI,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,qBAAS,CAAC,CAAC;KACjC;IAED,OAAO,IAAA,+BAAc,EAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACrC,CAAC,CAAC;AAPW,QAAA,MAAM,UAOjB","file":"median.js","sourcesContent":["import { ascending } from './ascending';\nimport { quantileSorted } from './quantileSorted';\n\nexport const median = (values: number[], isSorted?: boolean) => {\n let sorted = values;\n if (isSorted !== true) {\n sorted = values.sort(ascending);\n }\n\n return quantileSorted(sorted, 0.5);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function merge(target: any, ...sources: any[]): any;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const isArray_1 = __importDefault(require("./isArray")), isArrayLike_1 = __importDefault(require("./isArrayLike")), isPlainObject_1 = __importDefault(require("./isPlainObject")), isValid_1 = __importDefault(require("./isValid"));
|
|
14
|
+
|
|
15
|
+
function baseMerge(target, source, shallowArray = !1) {
|
|
16
|
+
if (source) {
|
|
17
|
+
if (target === source) return;
|
|
18
|
+
if ((0, isValid_1.default)(source) && "object" == typeof source) {
|
|
19
|
+
const iterable = Object(source), props = [];
|
|
20
|
+
for (const key in iterable) props.push(key);
|
|
21
|
+
let {length: length} = props, propIndex = -1;
|
|
22
|
+
for (;length--; ) {
|
|
23
|
+
const key = props[++propIndex];
|
|
24
|
+
(0, isValid_1.default)(iterable[key]) && "object" == typeof iterable[key] ? baseMergeDeep(target, source, key, shallowArray) : assignMergeValue(target, key, iterable[key]);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function baseMergeDeep(target, source, key, shallowArray = !1) {
|
|
31
|
+
const objValue = target[key], srcValue = source[key];
|
|
32
|
+
let newValue = source[key], isCommon = !0;
|
|
33
|
+
if ((0, isArray_1.default)(srcValue)) {
|
|
34
|
+
if (shallowArray) newValue = []; else if ((0, isArray_1.default)(objValue)) newValue = objValue; else if ((0,
|
|
35
|
+
isArrayLike_1.default)(objValue)) {
|
|
36
|
+
newValue = new Array(objValue.length);
|
|
37
|
+
let index = -1;
|
|
38
|
+
const length = objValue.length;
|
|
39
|
+
for (;++index < length; ) newValue[index] = objValue[index];
|
|
40
|
+
}
|
|
41
|
+
} else (0, isPlainObject_1.default)(srcValue) ? (newValue = objValue, "function" != typeof objValue && "object" == typeof objValue || (newValue = {})) : isCommon = !1;
|
|
42
|
+
isCommon && baseMerge(newValue, srcValue, shallowArray), assignMergeValue(target, key, newValue);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function assignMergeValue(target, key, value) {
|
|
46
|
+
(void 0 !== value && !eq(target[key], value) || void 0 === value && !(key in target)) && (target[key] = value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function eq(value, other) {
|
|
50
|
+
return value === other || Number.isNaN(value) && Number.isNaN(other);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function merge(target, ...sources) {
|
|
54
|
+
let sourceIndex = -1;
|
|
55
|
+
const length = sources.length;
|
|
56
|
+
for (;++sourceIndex < length; ) {
|
|
57
|
+
baseMerge(target, sources[sourceIndex], !0);
|
|
58
|
+
}
|
|
59
|
+
return target;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.default = merge;
|
|
63
|
+
//# sourceMappingURL=merge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/merge.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,gEAAwC;AACxC,oEAA4C;AAC5C,wDAAgC;AAEhC,SAAS,SAAS,CAAC,MAAW,EAAE,MAAW,EAAE,eAAwB,KAAK;IACxE,IAAI,MAAM,EAAE;QACV,IAAI,MAAM,KAAK,MAAM,EAAE;YACrB,OAAO;SACR;QACD,IAAI,IAAA,iBAAO,EAAC,MAAM,CAAC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAEjD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAChC,MAAM,KAAK,GAAG,EAAE,CAAC;YAEjB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;gBAC1B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aACjB;YACD,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;YACvB,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;YACnB,OAAO,MAAM,EAAE,EAAE;gBACf,MAAM,GAAG,GAAG,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;gBAC/B,IAAI,IAAA,iBAAO,EAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;oBAC/D,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;iBAClD;qBAAM;oBACL,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;iBAC9C;aACF;SACF;KACF;AACH,CAAC;AAID,SAAS,aAAa,CAAC,MAAc,EAAE,MAAc,EAAE,GAAW,EAAE,eAAwB,KAAK;IAC/F,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,QAAQ,GAAG,IAAI,CAAC;IAEpB,IAAI,IAAA,iBAAO,EAAC,QAAQ,CAAC,EAAE;QACrB,IAAI,YAAY,EAAE;YAEhB,QAAQ,GAAG,EAAE,CAAC;SACf;aAAM,IAAI,IAAA,iBAAO,EAAC,QAAQ,CAAC,EAAE;YAC5B,QAAQ,GAAG,QAAQ,CAAC;SACrB;aAAM,IAAI,IAAA,qBAAW,EAAC,QAAQ,CAAC,EAAE;YAEhC,QAAQ,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACtC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;YACf,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC/B,OAAO,EAAE,KAAK,GAAG,MAAM,EAAE;gBACvB,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;aACnC;SACF;KACF;SAKI,IAAI,IAAA,uBAAa,EAAC,QAAQ,CAAC,EAAE;QAChC,QAAQ,GAAG,QAAQ,CAAC;QAEpB,IAAI,OAAO,QAAQ,KAAK,UAAU,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YAClE,QAAQ,GAAG,EAAE,CAAC;SACf;KACF;SAAM;QACL,QAAQ,GAAG,KAAK,CAAC;KAClB;IAED,IAAI,QAAQ,EAAE;QACZ,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;KAC7C;IACD,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAGD,SAAS,gBAAgB,CAAC,MAAc,EAAE,GAAW,EAAE,KAAU;IAC/D,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE;QAEjG,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;KACrB;AACH,CAAC;AAED,SAAS,EAAE,CAAC,KAAU,EAAE,KAAU;IAChC,OAAO,KAAK,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,CAAC;AAID,SAAwB,KAAK,CAAC,MAAW,EAAE,GAAG,OAAc;IAC1D,IAAI,WAAW,GAAG,CAAC,CAAC,CAAC;IACrB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE;QAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;QACpC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KACjC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,wBAQC","file":"merge.js","sourcesContent":["import isArray from './isArray';\nimport isArrayLike from './isArrayLike';\nimport isPlainObject from './isPlainObject';\nimport isValid from './isValid';\n\nfunction baseMerge(target: any, source: any, shallowArray: boolean = false) {\n if (source) {\n if (target === source) {\n return;\n }\n if (isValid(source) && typeof source === 'object') {\n // baseFor\n const iterable = Object(source);\n const props = [];\n // keysIn\n for (const key in iterable) {\n props.push(key);\n }\n let { length } = props;\n let propIndex = -1;\n while (length--) {\n const key = props[++propIndex];\n if (isValid(iterable[key]) && typeof iterable[key] === 'object') {\n baseMergeDeep(target, source, key, shallowArray);\n } else {\n assignMergeValue(target, key, iterable[key]);\n }\n }\n }\n }\n}\n\n// 由于目前 ChartSpace 内部对 spec 会先执行一次深拷贝,merge 暂时不考虑 source 中有环的问题\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction baseMergeDeep(target: object, source: object, key: string, shallowArray: boolean = false) {\n const objValue = target[key];\n const srcValue = source[key];\n let newValue = source[key];\n let isCommon = true;\n // 不考虑 buffer / typedArray 类型\n if (isArray(srcValue)) {\n if (shallowArray) {\n // 依据参数对数组做浅拷贝\n newValue = [];\n } else if (isArray(objValue)) {\n newValue = objValue;\n } else if (isArrayLike(objValue)) {\n // 如果 source 为数组,则 target 的 arrayLike 对象也视作为数组处理\n newValue = new Array(objValue.length);\n let index = -1;\n const length = objValue.length;\n while (++index < length) {\n newValue[index] = objValue[index];\n }\n }\n }\n // else if (isArray(srcValue) && shallowArray) {\n // newValue = [];\n // }\n // 不考虑 argument 类型\n else if (isPlainObject(srcValue)) {\n newValue = objValue;\n // 不考虑 prototype 的额外处理\n if (typeof objValue === 'function' || typeof objValue !== 'object') {\n newValue = {};\n }\n } else {\n isCommon = false;\n }\n // 对 class 等复杂对象或者浅拷贝的 array 不做拷贝处理\n if (isCommon) {\n baseMerge(newValue, srcValue, shallowArray);\n }\n assignMergeValue(target, key, newValue);\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction assignMergeValue(target: object, key: string, value: any) {\n if ((value !== undefined && !eq(target[key], value)) || (value === undefined && !(key in target))) {\n // 不考虑 __proto__ 的赋值处理\n target[key] = value;\n }\n}\n\nfunction eq(value: any, other: any) {\n return value === other || (Number.isNaN(value) && Number.isNaN(other));\n}\n\n// 与原生的 lodash merge 差异在于对数组是否应用最后一个 source 的结果\n// 例如 lineDash 等 spec 的 merge 使用这一操作更合适\nexport default function merge(target: any, ...sources: any[]): any {\n let sourceIndex = -1;\n const length = sources.length;\n while (++sourceIndex < length) {\n const source = sources[sourceIndex];\n baseMerge(target, source, true);\n }\n return target;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Dict } from '../type';
|
|
2
|
+
export type KeyOfDistributive<T> = T extends unknown ? keyof T : never;
|
|
3
|
+
export declare function keys<T extends any>(obj: T): (KeyOfDistributive<T> & string)[];
|
|
4
|
+
export declare function defaults<T extends Dict<any>, S extends Dict<any>>(target: T, source: S, overlay?: boolean): T & S;
|
|
5
|
+
export declare function mixin<T, S>(target: T | Function, source: S | Function, override?: boolean): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function keys(obj) {
|
|
4
|
+
if (!obj) return [];
|
|
5
|
+
if (Object.keys) return Object.keys(obj);
|
|
6
|
+
const keyList = [];
|
|
7
|
+
for (const key in obj) obj.hasOwnProperty(key) && keyList.push(key);
|
|
8
|
+
return keyList;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function defaults(target, source, overlay) {
|
|
12
|
+
const keysArr = keys(source);
|
|
13
|
+
for (let i = 0; i < keysArr.length; i++) {
|
|
14
|
+
const key = keysArr[i];
|
|
15
|
+
(overlay ? null != source[key] : null == target[key]) && (target[key] = source[key]);
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function mixin(target, source, override = !0) {
|
|
21
|
+
if (target = "prototype" in target ? target.prototype : target, source = "prototype" in source ? source.prototype : source,
|
|
22
|
+
Object.getOwnPropertyNames) {
|
|
23
|
+
const keyList = Object.getOwnPropertyNames(source);
|
|
24
|
+
for (let i = 0; i < keyList.length; i++) {
|
|
25
|
+
const key = keyList[i];
|
|
26
|
+
"constructor" !== key && (override ? null != source[key] : null == target[key]) && (target[key] = source[key]);
|
|
27
|
+
}
|
|
28
|
+
} else defaults(target, source, override);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Object.defineProperty(exports, "__esModule", {
|
|
32
|
+
value: !0
|
|
33
|
+
}), exports.mixin = exports.defaults = exports.keys = void 0, exports.keys = keys,
|
|
34
|
+
exports.defaults = defaults, exports.mixin = mixin;
|
|
35
|
+
//# sourceMappingURL=mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/mixin.ts"],"names":[],"mappings":";;;AAKA,SAAgB,IAAI,CAAgB,GAAM;IACxC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,CAAC;KACX;IAID,IAAI,MAAM,CAAC,IAAI,EAAE;QACf,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAY,CAAC;KACpC;IACD,MAAM,OAAO,GAAY,EAAE,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE;QAErB,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;YAC3B,OAAO,CAAC,IAAI,CAAC,GAAU,CAAC,CAAC;SAC1B;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAlBD,oBAkBC;AAED,SAAgB,QAAQ,CAA2C,MAAS,EAAE,MAAS,EAAE,OAAiB;IACxG,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAE,MAAgB,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;YACjE,MAAgB,CAAC,GAAG,CAAC,GAAI,MAAgB,CAAC,GAAG,CAAC,CAAC;SACjD;KACF;IACD,OAAO,MAAe,CAAC;AACzB,CAAC;AATD,4BASC;AAGD,SAAgB,KAAK,CAAO,MAAoB,EAAE,MAAoB,EAAE,WAAoB,IAAI;IAG9F,MAAM,GAAG,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAG3D,MAAM,GAAG,WAAW,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAG3D,IAAI,MAAM,CAAC,mBAAmB,EAAE;QAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACvC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,GAAG,KAAK,aAAa,EAAE;gBACzB,IAAI,QAAQ,CAAC,CAAC,CAAE,MAAc,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAE,MAAc,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE;oBACzE,MAAc,CAAC,GAAG,CAAC,GAAI,MAAc,CAAC,GAAG,CAAC,CAAC;iBAC7C;aACF;SACF;KACF;SAAM;QACL,QAAQ,CAAC,MAAmB,EAAE,MAAmB,EAAE,QAAQ,CAAC,CAAC;KAC9D;AACH,CAAC;AAtBD,sBAsBC","file":"mixin.js","sourcesContent":["import type { Dict } from '../type';\n\nexport type KeyOfDistributive<T> = T extends unknown ? keyof T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-constraint\nexport function keys<T extends any>(obj: T): (KeyOfDistributive<T> & string)[] {\n if (!obj) {\n return [];\n }\n // Return type should be `keyof T` but exclude `number`, becuase\n // `Object.keys` only return string rather than `number | string`.\n type TKeys = KeyOfDistributive<T> & string;\n if (Object.keys) {\n return Object.keys(obj) as TKeys[];\n }\n const keyList: TKeys[] = [];\n for (const key in obj) {\n // eslint-disable-next-line no-prototype-builtins\n if (obj.hasOwnProperty(key)) {\n keyList.push(key as any);\n }\n }\n return keyList;\n}\n\nexport function defaults<T extends Dict<any>, S extends Dict<any>>(target: T, source: S, overlay?: boolean): T & S {\n const keysArr = keys(source);\n for (let i = 0; i < keysArr.length; i++) {\n const key = keysArr[i];\n if (overlay ? source[key] != null : (target as T & S)[key] == null) {\n (target as S & T)[key] = (source as T & S)[key];\n }\n }\n return target as T & S;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function mixin<T, S>(target: T | Function, source: S | Function, override: boolean = true) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n target = 'prototype' in target ? target.prototype : target;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n source = 'prototype' in source ? source.prototype : source;\n // If build target is ES6 class. prototype methods is not enumerable. Use getOwnPropertyNames instead\n // TODO: Determine if source is ES6 class?\n if (Object.getOwnPropertyNames) {\n const keyList = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keyList.length; i++) {\n const key = keyList[i];\n if (key !== 'constructor') {\n if (override ? (source as any)[key] != null : (target as any)[key] == null) {\n (target as any)[key] = (source as any)[key];\n }\n }\n }\n } else {\n defaults(target as Dict<any>, source as Dict<any>, override);\n }\n}\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function isNumberClose(a: number, b: number, relTol?: number, absTol?: number): boolean;
|
|
2
|
+
export declare function isGreater(a: number, b: number, relTol?: number, absTol?: number): boolean;
|
|
3
|
+
export declare function isLess(a: number, b: number, relTol?: number, absTol?: number): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.isLess = exports.isGreater = exports.isNumberClose = void 0;
|
|
6
|
+
|
|
7
|
+
const DEFAULT_ABSOLUTE_TOLERATE = 1e-10, DEFAULT_RELATIVE_TOLERATE = 1e-10;
|
|
8
|
+
|
|
9
|
+
function isNumberClose(a, b, relTol = DEFAULT_RELATIVE_TOLERATE, absTol = DEFAULT_ABSOLUTE_TOLERATE) {
|
|
10
|
+
const abs = absTol, rel = relTol * Math.max(a, b);
|
|
11
|
+
return Math.abs(a - b) <= Math.max(abs, rel);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isGreater(a, b, relTol, absTol) {
|
|
15
|
+
return a > b && !isNumberClose(a, b, relTol, absTol);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isLess(a, b, relTol, absTol) {
|
|
19
|
+
return a < b && !isNumberClose(a, b, relTol, absTol);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.isNumberClose = isNumberClose, exports.isGreater = isGreater, exports.isLess = isLess;
|
|
23
|
+
//# sourceMappingURL=number.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/number.ts"],"names":[],"mappings":";;;AAIA,MAAM,yBAAyB,GAAG,KAAK,CAAC;AACxC,MAAM,yBAAyB,GAAG,KAAK,CAAC;AASxC,SAAgB,aAAa,CAC3B,CAAS,EACT,CAAS,EACT,SAAiB,yBAAyB,EAC1C,SAAiB,yBAAyB;IAE1C,MAAM,GAAG,GAAG,MAAM,CAAC;IACnB,MAAM,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC;AATD,sCASC;AASD,SAAgB,SAAS,CAAC,CAAS,EAAE,CAAS,EAAE,MAAe,EAAE,MAAe;IAC9E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAFD,8BAEC;AASD,SAAgB,MAAM,CAAC,CAAS,EAAE,CAAS,EAAE,MAAe,EAAE,MAAe;IAC3E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAFD,wBAEC","file":"number.js","sourcesContent":["/**\n * @description 处理数值相关的方法\n */\n\nconst DEFAULT_ABSOLUTE_TOLERATE = 1e-10;\nconst DEFAULT_RELATIVE_TOLERATE = 1e-10;\n\n/**\n * 判断两数是否接近相等,函数参数参照 python isClose 方法\n * @param {number} a\n * @param {number} b\n * @param refTol 指定的相对容差比例,将乘以两数的最大值作为相对容差\n * @param absTol 指定的绝对容差\n */\nexport function isNumberClose(\n a: number,\n b: number,\n relTol: number = DEFAULT_RELATIVE_TOLERATE,\n absTol: number = DEFAULT_ABSOLUTE_TOLERATE\n) {\n const abs = absTol;\n const rel = relTol * Math.max(a, b);\n return Math.abs(a - b) <= Math.max(abs, rel);\n}\n\n/**\n * 判断 a 是否大于 b,并排除容差范围\n * @param a\n * @param b\n * @param relTol 指定的相对容差比例,将乘以两数的最大值作为相对容差\n * @param absTol 指定的绝对容差\n */\nexport function isGreater(a: number, b: number, relTol?: number, absTol?: number) {\n return a > b && !isNumberClose(a, b, relTol, absTol);\n}\n\n/**\n * 判断 a 是否小于 b,并排除容差范围\n * @param a\n * @param b\n * @param relTol 指定的相对容差比例,将乘以两数的最大值作为相对容差\n * @param absTol 指定的绝对容差\n */\nexport function isLess(a: number, b: number, relTol?: number, absTol?: number) {\n return a < b && !isNumberClose(a, b, relTol, absTol);\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const repeat = (str, repeatCount = 0) => {
|
|
8
|
+
let s = "", i = repeatCount - 1;
|
|
9
|
+
for (;i >= 0; ) s = `${s}${str}`, i -= 1;
|
|
10
|
+
return s;
|
|
11
|
+
}, pad = (str, length, padChar = " ", align = "right") => {
|
|
12
|
+
const c = padChar, s = str + "", n = length - s.length;
|
|
13
|
+
return n <= 0 ? s : "left" === align ? repeat(c, n) + s : "center" === align ? repeat(c, Math.floor(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.default = pad;
|
|
17
|
+
//# sourceMappingURL=pad.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/pad.ts"],"names":[],"mappings":";;AAAA,MAAM,MAAM,GAAG,CAAC,GAAoB,EAAE,cAAsB,CAAC,EAAE,EAAE;IAC/D,IAAI,CAAC,GAAG,EAAE,CAAC;IACX,IAAI,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC;IACxB,OAAO,CAAC,IAAI,CAAC,EAAE;QACb,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC;QACjB,CAAC,IAAI,CAAC,CAAC;KACR;IACD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAuBF,MAAM,GAAG,GAAG,CAAC,GAAoB,EAAE,MAAc,EAAE,UAAkB,GAAG,EAAE,QAAgB,OAAO,EAAE,EAAE;IACnG,MAAM,CAAC,GAAG,OAAO,CAAC;IAClB,MAAM,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;IACnB,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAE5B,IAAI,CAAC,IAAI,CAAC,EAAE;QACV,OAAO,CAAC,CAAC;KACV;IAED,IAAI,KAAK,KAAK,MAAM,EAAE;QACpB,OAAO,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;KACzB;IAED,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChH,CAAC,CAAC;AAEF,kBAAe,GAAG,CAAC","file":"pad.js","sourcesContent":["const repeat = (str: string | number, repeatCount: number = 0) => {\n let s = '';\n let i = repeatCount - 1;\n while (i >= 0) {\n s = `${s}${str}`;\n i -= 1;\n }\n return s;\n};\n\n/**\n * Pads `string` on the left and right, left or right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * pad('abc', 8)\n * // => ' abc '\n *\n * pad('abc', 8, '_-')\n * // => '_-abc_-_'\n *\n * pad('abc', 2)\n * // => 'abc'\n */\nconst pad = (str: string | number, length: number, padChar: string = ' ', align: string = 'right') => {\n const c = padChar;\n const s = str + '';\n const n = length - s.length;\n\n if (n <= 0) {\n return s;\n }\n\n if (align === 'left') {\n return repeat(c, n) + s;\n }\n\n return align === 'center' ? repeat(c, Math.floor(n / 2)) + s + repeat(c, Math.ceil(n / 2)) : s + repeat(c, n);\n};\n\nexport default pad;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function pick<T, U extends keyof T>(obj: T, keys: Array<U>): Pick<T, U>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const isPlainObject_1 = __importDefault(require("./isPlainObject")), hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
14
|
+
|
|
15
|
+
function pick(obj, keys) {
|
|
16
|
+
if (!obj || !(0, isPlainObject_1.default)(obj)) return obj;
|
|
17
|
+
const result = {};
|
|
18
|
+
return keys.forEach((k => {
|
|
19
|
+
hasOwnProperty.call(obj, k) && (result[k] = obj[k]);
|
|
20
|
+
})), result;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.default = pick;
|
|
24
|
+
//# sourceMappingURL=pick.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/pick.ts"],"names":[],"mappings":";;;;;AAAA,oEAA4C;AAE5C,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAEvD,SAAwB,IAAI,CAAuB,GAAM,EAAE,IAAc;IACvE,IAAI,CAAC,GAAG,IAAI,CAAC,IAAA,uBAAa,EAAC,GAAG,CAAC,EAAE;QAC/B,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,MAAM,GAAG,EAAgB,CAAC;IAChC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QACf,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE;YAC/B,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;SACpB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAXD,uBAWC","file":"pick.js","sourcesContent":["import isPlainObject from './isPlainObject';\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\n\nexport default function pick<T, U extends keyof T>(obj: T, keys: Array<U>): Pick<T, U> {\n if (!obj || !isPlainObject(obj)) {\n return obj;\n }\n const result = {} as Pick<T, U>;\n keys.forEach(k => {\n if (hasOwnProperty.call(obj, k)) {\n result[k] = obj[k];\n }\n });\n return result;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function pickWithout<T extends Record<string, any>>(obj: T, keys: (string | RegExp)[]): Partial<T>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const isPlainObject_1 = __importDefault(require("./isPlainObject")), isString_1 = __importDefault(require("./isString"));
|
|
14
|
+
|
|
15
|
+
function pickWithout(obj, keys) {
|
|
16
|
+
if (!obj || !(0, isPlainObject_1.default)(obj)) return obj;
|
|
17
|
+
const result = {};
|
|
18
|
+
return Object.keys(obj).forEach((k => {
|
|
19
|
+
const v = obj[k];
|
|
20
|
+
let match = !1;
|
|
21
|
+
keys.forEach((itKey => {
|
|
22
|
+
((0, isString_1.default)(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
23
|
+
})), match || (result[k] = v);
|
|
24
|
+
})), result;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.default = pickWithout;
|
|
28
|
+
//# sourceMappingURL=pickWithout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/pickWithout.ts"],"names":[],"mappings":";;;;;AAAA,oEAA4C;AAC5C,0DAAkC;AAElC,SAAwB,WAAW,CAAgC,GAAM,EAAE,IAAyB;IAClG,IAAI,CAAC,GAAG,IAAI,CAAC,IAAA,uBAAa,EAAC,GAAG,CAAC,EAAE;QAC/B,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,MAAM,GAAG,EAAE,CAAC;IAElB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAS,EAAE,EAAE;QACrC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEjB,IAAI,KAAK,GAAG,KAAK,CAAC;QAElB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACnB,IAAI,IAAA,kBAAQ,EAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE;gBAClC,KAAK,GAAG,IAAI,CAAC;aACd;iBAAM,IAAI,KAAK,YAAY,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;gBACpD,KAAK,GAAG,IAAI,CAAC;aACd;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;SACf;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAoB,CAAC;AAC9B,CAAC;AAzBD,8BAyBC","file":"pickWithout.js","sourcesContent":["import isPlainObject from './isPlainObject';\nimport isString from './isString';\n\nexport default function pickWithout<T extends Record<string, any>>(obj: T, keys: (string | RegExp)[]): Partial<T> {\n if (!obj || !isPlainObject(obj)) {\n return obj;\n }\n const result = {};\n\n Object.keys(obj).forEach((k: string) => {\n const v = obj[k];\n\n let match = false;\n\n keys.forEach(itKey => {\n if (isString(itKey) && itKey === k) {\n match = true;\n } else if (itKey instanceof RegExp && k.match(itKey)) {\n match = true;\n }\n });\n\n if (!match) {\n result[k] = v;\n }\n });\n\n return result as Partial<T>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function quantileSorted(values: any[], percent: number, valueof?: (entry: any, index: number, arr: any[]) => number): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.quantileSorted = void 0;
|
|
6
|
+
|
|
7
|
+
const toNumber_1 = require("./toNumber");
|
|
8
|
+
|
|
9
|
+
function quantileSorted(values, percent, valueof = toNumber_1.toNumber) {
|
|
10
|
+
const n = values.length;
|
|
11
|
+
if (!n) return;
|
|
12
|
+
if (percent <= 0 || n < 2) return valueof(values[0], 0, values);
|
|
13
|
+
if (percent >= 1) return valueof(values[n - 1], n - 1, values);
|
|
14
|
+
const i = (n - 1) * percent, i0 = Math.floor(i), value0 = valueof(values[i0], i0, values);
|
|
15
|
+
return value0 + (valueof(values[i0 + 1], i0 + 1, values) - value0) * (i - i0);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
exports.quantileSorted = quantileSorted;
|
|
19
|
+
//# sourceMappingURL=quantileSorted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/quantileSorted.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,SAAgB,cAAc,CAC5B,MAAa,EACb,OAAe,EACf,UAA6D,mBAAQ;IAErE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IACxB,IAAI,CAAC,CAAC,EAAE;QACN,OAAO;KACR;IACD,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QACzB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;KACtC;IACD,IAAI,OAAO,IAAI,CAAC,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;KAC9C;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC;IAC5B,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;IACvD,OAAO,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;AAC/C,CAAC;AApBD,wCAoBC","file":"quantileSorted.js","sourcesContent":["import { toNumber } from './toNumber';\n\nexport function quantileSorted(\n values: any[],\n percent: number,\n valueof: (entry: any, index: number, arr: any[]) => number = toNumber\n) {\n const n = values.length;\n if (!n) {\n return;\n }\n if (percent <= 0 || n < 2) {\n return valueof(values[0], 0, values);\n }\n if (percent >= 1) {\n return valueof(values[n - 1], n - 1, values);\n }\n const i = (n - 1) * percent;\n const i0 = Math.floor(i);\n const value0 = valueof(values[i0], i0, values);\n const value1 = valueof(values[i0 + 1], i0 + 1, values);\n return value0 + (value1 - value0) * (i - i0);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function range(start: number, stop?: number, step?: number): number[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
}), exports.range = void 0;
|
|
12
|
+
|
|
13
|
+
const isValid_1 = __importDefault(require("./isValid"));
|
|
14
|
+
|
|
15
|
+
function range(start, stop, step) {
|
|
16
|
+
(0, isValid_1.default)(stop) || (stop = start, start = 0), (0, isValid_1.default)(step) || (step = 1);
|
|
17
|
+
let i = -1;
|
|
18
|
+
const n = 0 | Math.max(0, Math.ceil((stop - start) / step)), range = new Array(n);
|
|
19
|
+
for (;++i < n; ) range[i] = start + i * step;
|
|
20
|
+
return range;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.range = range;
|
|
24
|
+
//# sourceMappingURL=range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/range.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAEhC,SAAgB,KAAK,CAAC,KAAa,EAAE,IAAa,EAAE,IAAa;IAC/D,IAAI,CAAC,IAAA,iBAAO,EAAC,IAAI,CAAC,EAAE;QAClB,IAAI,GAAG,KAAK,CAAC;QACb,KAAK,GAAG,CAAC,CAAC;KACX;IACD,IAAI,CAAC,IAAA,iBAAO,EAAC,IAAI,CAAC,EAAE;QAClB,IAAI,GAAG,CAAC,CAAC;KACV;IAED,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACX,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE;QACd,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC;KAC7B;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAlBD,sBAkBC","file":"range.js","sourcesContent":["import isValid from './isValid';\n\nexport function range(start: number, stop?: number, step?: number): number[] {\n if (!isValid(stop)) {\n stop = start;\n start = 0;\n }\n if (!isValid(step)) {\n step = 1;\n }\n\n let i = -1;\n const n = Math.max(0, Math.ceil((stop - start) / step)) | 0;\n const range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const debounce_1 = __importDefault(require("./debounce")), isObject_1 = __importDefault(require("./isObject"));
|
|
14
|
+
|
|
15
|
+
function throttle(func, wait, options) {
|
|
16
|
+
let leading = !0, trailing = !0;
|
|
17
|
+
if ("function" != typeof func) throw new TypeError("Expected a function");
|
|
18
|
+
return (0, isObject_1.default)(options) && (leading = "leading" in options ? !!options.leading : leading,
|
|
19
|
+
trailing = "trailing" in options ? !!options.trailing : trailing), (0, debounce_1.default)(func, wait, {
|
|
20
|
+
leading: leading,
|
|
21
|
+
trailing: trailing,
|
|
22
|
+
maxWait: wait
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.default = throttle;
|
|
27
|
+
//# sourceMappingURL=throttle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/throttle.ts"],"names":[],"mappings":";;;;;AAGA,0DAAkC;AAClC,0DAAkC;AAElC,SAAS,QAAQ,CACf,IAAyB,EACzB,IAAY,EACZ,OAAmD;IAEnD,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,IAAI,QAAQ,GAAG,IAAI,CAAC;IAEpB,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE;QAC9B,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC5C;IACD,IAAI,IAAA,kBAAQ,EAAC,OAAO,CAAC,EAAE;QACrB,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7D,QAAQ,GAAG,UAAU,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;KAClE;IACD,OAAO,IAAA,kBAAQ,EAAC,IAAI,EAAE,IAAI,EAAE;QAC1B,OAAO;QACP,QAAQ;QACR,OAAO,EAAE,IAAI;KACd,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,QAAQ,CAAC","file":"throttle.js","sourcesContent":["/**\n * @see https://github.com/lodash/lodash/blob/master/throttle.js\n */\nimport debounce from './debounce';\nimport isObject from './isObject';\n\nfunction throttle<T, S>(\n func: (...args: T[]) => S,\n wait: number,\n options?: { leading?: boolean; trailing?: boolean }\n): (...args: T[]) => S {\n let leading = true;\n let trailing = true;\n\n if (typeof func !== 'function') {\n throw new TypeError('Expected a function');\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n leading,\n trailing,\n maxWait: wait\n });\n}\n\nexport default throttle;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tickStep(start: number, stop: number, count: number): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.tickStep = void 0;
|
|
6
|
+
|
|
7
|
+
const e10 = Math.sqrt(50), e5 = Math.sqrt(10), e2 = Math.sqrt(2);
|
|
8
|
+
|
|
9
|
+
function tickStep(start, stop, count) {
|
|
10
|
+
const step0 = Math.abs(stop - start) / Math.max(0, count);
|
|
11
|
+
let step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10));
|
|
12
|
+
const error = step0 / step1;
|
|
13
|
+
return error >= e10 ? step1 *= 10 : error >= e5 ? step1 *= 5 : error >= e2 && (step1 *= 2),
|
|
14
|
+
stop < start ? -step1 : step1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.tickStep = tickStep;
|
|
18
|
+
//# sourceMappingURL=tickStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/tickStep.ts"],"names":[],"mappings":";;;AAAA,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC1B,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAExB,SAAgB,QAAQ,CAAC,KAAa,EAAE,IAAY,EAAE,KAAa;IACjE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1D,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,MAAM,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IAE5B,IAAI,KAAK,IAAI,GAAG,EAAE;QAChB,KAAK,IAAI,EAAE,CAAC;KACb;SAAM,IAAI,KAAK,IAAI,EAAE,EAAE;QACtB,KAAK,IAAI,CAAC,CAAC;KACZ;SAAM,IAAI,KAAK,IAAI,EAAE,EAAE;QACtB,KAAK,IAAI,CAAC,CAAC;KACZ;IACD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACvC,CAAC;AAbD,4BAaC","file":"tickStep.js","sourcesContent":["const e10 = Math.sqrt(50);\nconst e5 = Math.sqrt(10);\nconst e2 = Math.sqrt(2);\n\nexport function tickStep(start: number, stop: number, count: number) {\n const step0 = Math.abs(stop - start) / Math.max(0, count);\n let step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10));\n const error = step0 / step1;\n\n if (error >= e10) {\n step1 *= 10;\n } else if (error >= e5) {\n step1 *= 5;\n } else if (error >= e2) {\n step1 *= 2;\n }\n return stop < start ? -step1 : step1;\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
default: mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: !0
|
|
11
|
+
}), exports.toDate = void 0;
|
|
12
|
+
|
|
13
|
+
const isNil_1 = __importDefault(require("./isNil")), isString_1 = __importDefault(require("./isString")), TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;
|
|
14
|
+
|
|
15
|
+
function toDate(val) {
|
|
16
|
+
if (val instanceof Date) return val;
|
|
17
|
+
if ((0, isString_1.default)(val)) {
|
|
18
|
+
const match = TIME_REG.exec(val);
|
|
19
|
+
if (!match) return new Date(NaN);
|
|
20
|
+
if (!match[8]) return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0);
|
|
21
|
+
let hour = +match[4] || 0;
|
|
22
|
+
return "Z" !== match[8].toUpperCase() && (hour -= +match[8].slice(0, 3)), new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0));
|
|
23
|
+
}
|
|
24
|
+
return (0, isNil_1.default)(val) ? new Date(NaN) : new Date(Math.round(val));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.toDate = toDate;
|
|
28
|
+
//# sourceMappingURL=toDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/common/toDate.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,0DAAkC;AAKlC,MAAM,QAAQ,GACZ,yIAAyI,CAAC;AAE5I,SAAgB,MAAM,CAAC,GAAiB;IACtC,IAAI,GAAG,YAAY,IAAI,EAAE;QACvB,OAAO,GAAG,CAAC;KACZ;SAAM,IAAI,IAAA,kBAAQ,EAAC,GAAG,CAAC,EAAE;QAMxB,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEjC,IAAI,CAAC,KAAK,EAAE;YAEV,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;SACtB;QAGD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YAGb,OAAO,IAAI,IAAI,CACb,CAAC,KAAK,CAAC,CAAC,CAAC,EACT,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EACpB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EACd,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EACd,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAChB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EACd,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACzC,CAAC;SACH;QASD,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE;YAClC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/B;QACD,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,GAAG,CACN,CAAC,KAAK,CAAC,CAAC,CAAC,EACT,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EACpB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EACd,IAAI,EACJ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAChB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EACd,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACzC,CACF,CAAC;KACH;SAAM,IAAI,IAAA,eAAK,EAAC,GAAG,CAAC,EAAE;QACrB,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;KACtB;IAED,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAa,CAAC,CAAC,CAAC;AAC7C,CAAC;AA1DD,wBA0DC","file":"toDate.js","sourcesContent":["import isNil from './isNil';\nimport isString from './isString';\n\nexport type DateLikeType = number | string | Date;\n\n// eslint-disable-next-line no-useless-escape\nconst TIME_REG =\n /^(?:(\\d{4})(?:[-\\/](\\d{1,2})(?:[-\\/](\\d{1,2})(?:[T ](\\d{1,2})(?::(\\d{1,2})(?::(\\d{1,2})(?:[.,](\\d+))?)?)?(Z|[\\+\\-]\\d\\d:?\\d\\d)?)?)?)?)?$/; // eslint-disable-line\n\nexport function toDate(val: DateLikeType): Date {\n if (val instanceof Date) {\n return val;\n } else if (isString(val)) {\n // Different browsers parse date in different way, so we parse it manually.\n // Some other issues:\n // new Date('1970-01-01') is UTC,\n // new Date('1970/01/01') and new Date('1970-1-01') is local.\n // See issue #3623\n const match = TIME_REG.exec(val);\n\n if (!match) {\n // return Invalid Date.\n return new Date(NaN);\n }\n\n // Use local time when no timezone offset specifed.\n if (!match[8]) {\n // match[n] can only be string or undefined.\n // But take care of '12' + 1 => '121'.\n return new Date(\n +match[1],\n +(match[2] || 1) - 1,\n +match[3] || 1,\n +match[4] || 0,\n +(match[5] || 0),\n +match[6] || 0,\n match[7] ? +match[7].substring(0, 3) : 0\n );\n }\n // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time,\n // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment).\n // For example, system timezone is set as \"Time Zone: America/Toronto\",\n // then these code will get different result:\n // `new Date(1478411999999).getTimezoneOffset(); // get 240`\n // `new Date(1478412000000).getTimezoneOffset(); // get 300`\n // So we should not use `new Date`, but use `Date.UTC`.\n\n let hour = +match[4] || 0;\n if (match[8].toUpperCase() !== 'Z') {\n hour -= +match[8].slice(0, 3);\n }\n return new Date(\n Date.UTC(\n +match[1],\n +(match[2] || 1) - 1,\n +match[3] || 1,\n hour,\n +(match[5] || 0),\n +match[6] || 0,\n match[7] ? +match[7].substring(0, 3) : 0\n )\n );\n } else if (isNil(val)) {\n return new Date(NaN);\n }\n\n return new Date(Math.round(val as number));\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function toNumber(a: any): number;
|