Skip to content

Commit e01dfc4

Browse files
author
mrsteele
committed
fix: Resolving arrow functions in index.js.
1 parent 2bc4b47 commit e01dfc4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
'use strict';
22

33
const flatTypes = ["string", "number", "boolean"];
4-
const isFlat = val => {
4+
const isFlat = function(val) {
55
return flatTypes.indexOf(typeof(val)) !== -1;
66
}
77

8-
const truncate = (obj, maxDepth, curDepth) => {
8+
const truncate = function(obj, maxDepth, curDepth) {
99
curDepth = curDepth || 0;
1010

1111
if (curDepth < maxDepth) {
@@ -15,7 +15,7 @@ const truncate = (obj, maxDepth, curDepth) => {
1515
return obj;
1616
} else if (Array.isArray(obj)) {
1717
let newObj = [];
18-
obj.map(value => {
18+
obj.map(function(value) {
1919
if (isFlat(value)) {
2020
newObj.push(value);
2121
} else {
@@ -37,7 +37,7 @@ const truncate = (obj, maxDepth, curDepth) => {
3737
}
3838
}
3939

40-
module.exports = (obj, maxDepth) => {
40+
module.exports = function(obj, maxDepth) {
4141
try {
4242
return truncate(obj, maxDepth || 10);
4343
} catch (e) {

0 commit comments

Comments
 (0)