From 732820e0c90c9f2da28f837e8f9030cb93127121 Mon Sep 17 00:00:00 2001 From: jiaming743 <743192023@qq.com> Date: Wed, 28 Aug 2019 15:37:00 +0800 Subject: [PATCH] formatter code style --- src/util/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/index.js b/src/util/index.js index 3d9af76..e8f512d 100644 --- a/src/util/index.js +++ b/src/util/index.js @@ -1,10 +1,10 @@ import { deepClone } from '@jiaminghi/c-render/lib/plugin/util' -export function filterNonNumber(array) { +export function filterNonNumber (array) { return array.filter(n => typeof n === 'number') } -export function deepMerge(target, merged) { +export function deepMerge (target, merged) { for (var key in merged) { target[key] = target[key] && typeof target[key] === 'object' ? deepMerge(target[key], merged[key]) : target[key] = merged[key] @@ -13,13 +13,13 @@ export function deepMerge(target, merged) { return target } -export function mulAdd(nums) { +export function mulAdd (nums) { nums = filterNonNumber(nums) return nums.reduce((all, num) => all + num, 0) } -export function mergeSameStackData(item, series) { +export function mergeSameStackData (item, series) { const stack = item.stack if (!stack) return [...item.data] @@ -37,7 +37,7 @@ export function mergeSameStackData(item, series) { .map((foo, i) => mulAdd(datas.map(d => d[i]))) } -export function getTwoPointDistance(pointOne, pointTwo) { +export function getTwoPointDistance (pointOne, pointTwo) { const minusX = Math.abs(pointOne[0] - pointTwo[0]) const minusY = Math.abs(pointOne[1] - pointTwo[1])