Skip to content

Commit

Permalink
perf(clone): less conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
yidinghan committed Aug 29, 2017
1 parent e03cac9 commit f1379f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { format } = require('util');
* @param {*} obj
*/
const clone = (obj) => {
if (obj === undefined || obj === null || ({}).toString.call(obj) !== '[object Object]') {
if (obj === null || typeof obj !== 'object') {
return obj;
}

Expand Down

0 comments on commit f1379f7

Please sign in to comment.