Skip to content

Commit

Permalink
formatter code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaming743 committed Aug 28, 2019
1 parent 864e4cf commit 732820e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/util/index.js
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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]
Expand All @@ -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])
Expand Down

0 comments on commit 732820e

Please sign in to comment.