Skip to content

Commit 68034df

Browse files
committed
build error fix
1 parent ca0e8c7 commit 68034df

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/Data-provider/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import TimeAgo from 'javascript-time-ago'
33
// Load locale-specific relative date/time formatting rules.
44
import en from 'javascript-time-ago/locale/en'
55
import config from '../config/index'
6-
import {
7-
toReadableBytes,
8-
sortObject,
9-
insertAtIndex
10-
} from "./utils"
6+
import util from "./utils"
7+
8+
let {toReadableBytes,
9+
sortObject,
10+
insertAtIndex}=util
1111

1212
Object.keys(config).forEach(key => {
1313
window[key] = config[key];

src/Data-provider/utils.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ function sortObject(obj) {
3232
var unit = units[exponent];
3333
return (neg ? '-' : '') + num + ' ' + unit;
3434
}
35+
// helper function to add element at index
36+
function insertAtIndex (arr, index, newItem){
37+
return [...arr.slice(0, index),newItem,...arr.slice(index)]
3538

36-
const insertAtIndex = (arr, index, newItem) => [...arr.slice(0, index),newItem,...arr.slice(index)]
39+
}
3740

38-
module.exports={
39-
toReadableBytes,
40-
sortObject,
41-
insertAtIndex
42-
}
41+
export default {
42+
toReadableBytes,
43+
sortObject,
44+
insertAtIndex
45+
}

0 commit comments

Comments
 (0)