Skip to content

Commit c05c7c8

Browse files
committed
Merge pull request #54 from fscherwi/patch-2
Fix lint issues
2 parents 4864237 + 57c224b commit c05c7c8

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

clone.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function clone(parent, circular, depth, prototype) {
2525
depth = circular.depth;
2626
prototype = circular.prototype;
2727
filter = circular.filter;
28-
circular = circular.circular
28+
circular = circular.circular;
2929
}
3030
// maintain two arrays for circular references, where corresponding parents
3131
// and children have the same index
@@ -46,7 +46,7 @@ function clone(parent, circular, depth, prototype) {
4646
if (parent === null)
4747
return null;
4848

49-
if (depth == 0)
49+
if (depth === 0)
5050
return parent;
5151

5252
var child;
@@ -125,22 +125,22 @@ clone.clonePrototype = function clonePrototype(parent) {
125125

126126
function __objToStr(o) {
127127
return Object.prototype.toString.call(o);
128-
};
128+
}
129129
clone.__objToStr = __objToStr;
130130

131131
function __isDate(o) {
132132
return typeof o === 'object' && __objToStr(o) === '[object Date]';
133-
};
133+
}
134134
clone.__isDate = __isDate;
135135

136136
function __isArray(o) {
137137
return typeof o === 'object' && __objToStr(o) === '[object Array]';
138-
};
138+
}
139139
clone.__isArray = __isArray;
140140

141141
function __isRegExp(o) {
142142
return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
143-
};
143+
}
144144
clone.__isRegExp = __isRegExp;
145145

146146
function __getRegExpFlags(re) {
@@ -149,7 +149,7 @@ function __getRegExpFlags(re) {
149149
if (re.ignoreCase) flags += 'i';
150150
if (re.multiline) flags += 'm';
151151
return flags;
152-
};
152+
}
153153
clone.__getRegExpFlags = __getRegExpFlags;
154154

155155
return clone;

test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var clone = require('./');
33
function inspect(obj) {
44
seen = [];
55
return JSON.stringify(obj, function (key, val) {
6-
if (val != null && typeof val == "object") {
6+
if (val !== null && typeof val == "object") {
77
if (seen.indexOf(val) >= 0) {
88
return '[cyclic]';
99
}
@@ -75,7 +75,7 @@ exports["clone number"] = function (test) {
7575
exports["clone date"] = function (test) {
7676
test.expect(3); // how many tests?
7777

78-
var a = new Date;
78+
var a = new Date ();
7979
var c = clone(a);
8080
test.ok(!!a.getUTCDate && !!a.toUTCString);
8181
test.ok(!!c.getUTCDate && !!c.toUTCString);
@@ -303,7 +303,7 @@ exports['clone object with null children'] = function (test) {
303303

304304
exports['clone instance with getter'] = function (test) {
305305
test.expect(1);
306-
function Ctor() {};
306+
function Ctor() {}
307307
Object.defineProperty(Ctor.prototype, 'prop', {
308308
configurable: true,
309309
enumerable: true,

0 commit comments

Comments
 (0)