Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

immutable-class

Package Overview
Dependencies
Maintainers
3
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immutable-class - npm Package Compare versions

Comparing version 0.7.4 to 0.7.5

4

build/base-immutable/base-immutable.d.ts

@@ -64,4 +64,4 @@ export interface Validator {

toString(): string;
getDifference(other: BaseImmutable<ValueType, JSType>, ignore?: string[]): string;
equals(other: BaseImmutable<ValueType, JSType>, ignore?: string[]): boolean;
getDifference(other: BaseImmutable<ValueType, JSType>, returnOnFirstDifference?: boolean): string[];
equals(other: BaseImmutable<ValueType, JSType>): boolean;
equivalent(other: BaseImmutable<ValueType, JSType>): boolean;

@@ -68,0 +68,0 @@ get(propName: string): any;

@@ -179,24 +179,26 @@ "use strict";

};
BaseImmutable.prototype.getDifference = function (other, ignore) {
if (ignore === void 0) { ignore = []; }
BaseImmutable.prototype.getDifference = function (other, returnOnFirstDifference) {
if (returnOnFirstDifference === void 0) { returnOnFirstDifference = false; }
if (!other)
return 'No other (!other)';
return ['No other (!other)'];
if (this === other)
return '';
return [];
if (!(other instanceof this.constructor))
return 'Different constructors';
return ['Different constructors'];
var differences = [];
var properties = this.ownProperties();
for (var _i = 0, properties_5 = properties; _i < properties_5.length; _i++) {
var property = properties_5[_i];
if (ignore.indexOf(property.name) > -1)
continue;
var equal = property.equal || equality_1.generalEqual;
if (!equal(this[property.name], other[property.name])) {
return 'Different property: ' + property.name;
var difference = 'Different property: ' + property.name;
if (returnOnFirstDifference)
return [difference];
differences.push(difference);
}
}
return '';
return differences;
};
BaseImmutable.prototype.equals = function (other, ignore) {
return !this.getDifference(other, ignore);
BaseImmutable.prototype.equals = function (other) {
return this.getDifference(other, true).length === 0;
};

@@ -203,0 +205,0 @@ BaseImmutable.prototype.equivalent = function (other) {

{
"name": "immutable-class",
"version": "0.7.4",
"version": "0.7.5",
"description": "A template for creating immutable classes",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc