immutable-class
Advanced tools
Comparing version 0.9.3 to 0.9.4
@@ -61,3 +61,3 @@ export declare type Validator = (x: any) => void; | ||
getDifference(other: BaseImmutable<ValueType, JSType> | undefined, returnOnFirstDifference?: boolean): string[]; | ||
equals(other: BaseImmutable<ValueType, JSType> | undefined): boolean; | ||
equals(other: BaseImmutable<ValueType, JSType>): boolean; | ||
equivalent(other: BaseImmutable<ValueType, JSType>): boolean; | ||
@@ -64,0 +64,0 @@ get(propName: string): any; |
@@ -54,2 +54,20 @@ "use strict"; | ||
}); | ||
describe('getDifference', function () { | ||
var car0 = car_mock_1.Car.fromJS({ name: 'poet' }); | ||
it('no other', function () { | ||
chai_1.expect(car0.getDifference(null)).to.deep.equal(['__no_other__']); | ||
}); | ||
it('single diff', function () { | ||
var car1 = car_mock_1.Car.fromJS({ name: 'artist' }); | ||
chai_1.expect(car0.getDifference(car1)).to.deep.equal(['name']); | ||
}); | ||
it('multi diff (multi)', function () { | ||
var car1 = car_mock_1.Car.fromJS({ name: 'artist', fuel: 'electric' }); | ||
chai_1.expect(car0.getDifference(car1)).to.deep.equal(['name', 'fuel']); | ||
}); | ||
it('multi diff (single)', function () { | ||
var car1 = car_mock_1.Car.fromJS({ name: 'artist', fuel: 'electric' }); | ||
chai_1.expect(car0.getDifference(car1, true)).to.deep.equal(['name']); | ||
}); | ||
}); | ||
describe('equals', function () { | ||
@@ -56,0 +74,0 @@ it('is not equal if new value is explicitly set', function () { |
@@ -101,2 +101,9 @@ "use strict"; | ||
}); | ||
it('overrides large', function () { | ||
var overrides = []; | ||
for (var i = 0; i < 40000; i++) { | ||
overrides.push({ name: 'Over' + i, score: i }); | ||
} | ||
chai_1.expect(named_array_1.NamedArray.overridesByName(someArray, overrides).length).to.equal(40003); | ||
}); | ||
}); | ||
@@ -103,0 +110,0 @@ describe("deleteByName", function () { |
export declare function isArrayOf(things: any, constructor: any): boolean; | ||
export declare function isImmutableClass(thing: any): boolean; | ||
export declare function typeCheck<T>(_x: T): void; |
@@ -22,1 +22,3 @@ "use strict"; | ||
exports.isImmutableClass = isImmutableClass; | ||
function typeCheck(_x) { } | ||
exports.typeCheck = typeCheck; |
{ | ||
"name": "immutable-class", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "A template for creating immutable classes", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
126585
44
2681