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

immutable-class

Package Overview
Dependencies
Maintainers
1
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.3.9 to 0.3.10

2

build/immutable-class.d.ts

@@ -1,2 +0,2 @@

// Generated by dts-bundle v0.3.0
// Generated by dts-bundle v0.4.3

@@ -3,0 +3,0 @@ declare module 'immutable-class' {

{
"name": "immutable-class",
"version": "0.3.9",
"version": "0.3.10",
"description": "A template for creating immutable classes",

@@ -27,9 +27,9 @@ "keywords": [

"dependencies": {
"chai": "3.4.1"
"chai": "3.5.0"
},
"devDependencies": {
"mocha": "2.3.4",
"typescript": "1.7.5",
"mocha": "2.4.5",
"typescript": "1.8.7",
"dts-bundle": "0.4.3"
}
}

@@ -9,12 +9,12 @@ # Immutable Class

An object is considered a immutable class of it meats the following criteria:
An object `Blah` is considered a immutable class of it meats the following criteria:
- It is a JS 'class' that starts with an uppercase letter
- It has a static ```ClassName.isClassName``` method for checking if something is an instance of the given class
- It has a static ```ClassName.fromJS``` method for deserializing classes
- It has an instance valueOf method that return a minimally serialized object (preserving all sub classes as immutable classes)
- It has an instance toJS method that return a fully serialized object (recursively serializing all sub classes)
- It has an instance toJSON method that returns the same as the toJS method allowing the object to be passed into `JSON.stringify`
- It has an instance toString method that is implemented in some way (and returns a `string`)
- It has an instance equals method that can be used to compare this object to other classes to check for equivalence.
- It has a static `Blah.isBlah` method for checking if something is an instance of the given class
- It has a static `Blah.fromJS` method for deserializing classes
- It has an instance `blah.valueOf` method that return a minimally serialized object (preserving all sub classes as immutable classes)
- It has an instance `blah.toJS` method that return a fully serialized object (recursively serializing all sub classes)
- It has an instance `blah.toJSON` method that returns the same as the toJS method allowing the object to be passed into `JSON.stringify`
- It has an instance `blah.toString` method that is implemented in some way (and returns a `string`)
- It has an instance `blah.equals` method that can be used to compare this object to other classes to check for equivalence.

@@ -21,0 +21,0 @@ ## Testing tools

Sorry, the diff of this file is not supported yet

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