immutable-class
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -55,7 +55,3 @@ "use strict"; | ||
var ClassFn = thing.constructor; | ||
var className = ClassFn.name; | ||
return className.length > 1 && | ||
className[0].toUpperCase() === className[0] && | ||
typeof ClassFn['is' + className] === 'function' && | ||
typeof ClassFn.fromJS === 'function' && | ||
return typeof ClassFn.fromJS === 'function' && | ||
typeof thing.toJS === 'function' && | ||
@@ -77,3 +73,3 @@ typeof thing.equals === 'function'; // Has Class#equals | ||
var vA = arrayA[i]; | ||
if (!isImmutableClass(vA) || !vA.equals(arrayB[i])) | ||
if (!(vA && typeof vA.equals === 'function' && vA.equals(arrayB[i]))) | ||
return false; | ||
@@ -80,0 +76,0 @@ } |
{ | ||
"name": "immutable-class", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "A template for creating immutable classes", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -48,7 +48,3 @@ "use strict"; | ||
var ClassFn = thing.constructor; | ||
var className = ClassFn.name; | ||
return className.length > 1 && | ||
className[0].toUpperCase() === className[0] && // First letter is upper case | ||
typeof ClassFn['is' + className] === 'function' && // Has Class.isClass | ||
typeof ClassFn.fromJS === 'function' && // Has Class.fromJS | ||
return typeof ClassFn.fromJS === 'function' && // Has Class.fromJS | ||
typeof thing.toJS === 'function' && // Has Class#toJS | ||
@@ -69,3 +65,3 @@ typeof thing.equals === 'function'; // Has Class#equals | ||
var vA: any = arrayA[i]; | ||
if (!isImmutableClass(vA) || !vA.equals(arrayB[i])) return false; | ||
if (!(vA && typeof vA.equals === 'function' && vA.equals(arrayB[i]))) return false; | ||
} | ||
@@ -72,0 +68,0 @@ return true; |
Sorry, the diff of this file is not supported yet
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
56332
1394