basic-utils
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -7,25 +7,26 @@ 'use strict'; | ||
exports.mkDirSync = MkDir.sync; | ||
exports.mkDir = MkDir; | ||
exports.rmDirSync = RmDir.sync; | ||
exports.rmDir = RmDir; | ||
module.exports = { | ||
mkDirSync: MkDir.sync, | ||
mkDir: MkDir, | ||
rmDirSync: RmDir.sync, | ||
rmDir: RmDir, | ||
isFile: (file) => { | ||
exports.isFile = (file) => { | ||
try { | ||
return Fs.statSync(file).isFile(); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
}, | ||
isDir: (p) => { | ||
try { | ||
return Fs.statSync(file).isFile(); | ||
try { | ||
return Fs.statSync(p).isDirectory(); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
}; | ||
exports.isDir = (p) => { | ||
try { | ||
return Fs.statSync(p).isDirectory(); | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
}; |
@@ -87,2 +87,3 @@ 'use strict'; | ||
} | ||
return (/^[0-9a-fA-F]{24}$/).test(value); | ||
@@ -140,3 +141,2 @@ }; | ||
return Number.isInteger(value) ? value >= -128 && value <= 127 : false; | ||
}; | ||
@@ -152,3 +152,2 @@ | ||
return Number.isInteger(value) ? value >= -32768 && value <= 32767 : false; | ||
}; | ||
@@ -164,3 +163,2 @@ | ||
return Number.isInteger(value) ? value >= -2147483648 && value <= 2147483647 : false; | ||
}; | ||
@@ -185,2 +183,3 @@ | ||
} | ||
return true; | ||
@@ -214,3 +213,2 @@ }; | ||
return false; | ||
}; | ||
@@ -217,0 +215,0 @@ |
@@ -86,2 +86,3 @@ 'use strict'; | ||
} | ||
return txt; | ||
@@ -91,5 +92,5 @@ }; | ||
exports.format = function () { | ||
exports.format = function (...params) { | ||
const args = Array.from(arguments); | ||
const args = Array.from(params); | ||
let str = args.shift(); | ||
@@ -103,2 +104,3 @@ const items = args; | ||
} | ||
return str; | ||
@@ -118,3 +120,2 @@ }; | ||
} | ||
}; | ||
@@ -131,3 +132,2 @@ | ||
} | ||
}; | ||
@@ -148,3 +148,3 @@ | ||
omitKey = [omitKey]; | ||
}; | ||
} | ||
@@ -159,2 +159,3 @@ return Object.keys(obj) | ||
} | ||
return null; | ||
@@ -161,0 +162,0 @@ }; |
{ | ||
"name": "basic-utils", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "basic js utils", | ||
@@ -21,4 +21,4 @@ "main": "lib/index.js", | ||
"code": "^5.2.0", | ||
"coveralls": "^3.0.0", | ||
"lab": "^15.4.1" | ||
"coveralls": "^3.0.2", | ||
"lab": "^16.1.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "dependencies": { |
@@ -96,2 +96,3 @@ 'use strict'; | ||
}; | ||
const any = function (hello) { | ||
@@ -101,2 +102,3 @@ | ||
}; | ||
expect(Utils.isFunction(func)).to.be.true(); | ||
@@ -148,2 +150,3 @@ expect(Utils.isFunction(any)).to.be.true(); | ||
}; | ||
const func = (hello) => { | ||
@@ -153,2 +156,3 @@ | ||
}; | ||
const undef = undefined; | ||
@@ -175,2 +179,3 @@ const def = 'notNull'; | ||
}; | ||
const func = (hello) => { | ||
@@ -180,2 +185,3 @@ | ||
}; | ||
const undef = undefined; | ||
@@ -182,0 +188,0 @@ const def = 'notNull'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38665
1141