dump of current js files

This commit is contained in:
Salakar
2017-03-02 13:09:41 +00:00
parent 8d84622228
commit 7e8dbcbb35
9 changed files with 25 additions and 14 deletions

View File

@@ -38,7 +38,7 @@ export function deepGet(object, path, joiner = '/') {
const len = keys.length;
while (i < len) {
const key = keys[i += 1];
const key = keys[i++];
if (!tmp || !hasOwnProperty.call(tmp, key)) return null;
tmp = tmp[key];
}
@@ -62,7 +62,7 @@ export function deepExists(object, path, joiner = '/') {
const len = keys.length;
while (i < len) {
const key = keys[i += 1];
const key = keys[i++];
if (!tmp || !hasOwnProperty.call(tmp, key)) return false;
tmp = tmp[key];
}
@@ -205,8 +205,9 @@ export function each(array: Array, chunkSize?: number, iterator: Function, cb: F
}
export function typeOf(value) {
if (value === null) return 'null';
if (Array.isArray(value)) return 'array';
return value === null ? 'null' : typeof value;
return typeof value;
}
/**