New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

value-enhancer

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

value-enhancer - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

7

dist/index.js

@@ -168,2 +168,9 @@ 'use strict';

}
toString() {
return String(this.value);
}
toJSON(key) {
const value = this.value;
return value && value.toJSON ? value.toJSON(key) : value;
}
};

@@ -170,0 +177,0 @@

2

package.json
{
"name": "value-enhancer",
"version": "2.1.0",
"version": "2.2.0",
"private": false,

@@ -5,0 +5,0 @@ "description": "A tiny library to enhance value with reactive wrapper.",

@@ -80,2 +80,32 @@ import { SubscriberMode, Subscribers } from "./subscribers";

}
/**
* @returns the string representation of `this.value`.
*
* @example
* ```js
* const v$ = val(val(val(1)));
* console.log(`${v$}`); // "1"
* ```
*/
public toString(): string {
return String(this.value);
}
/**
* @returns the JSON representation of `this.value`.
*
* @example
* ```js
* const v$ = val(val(val({ a: 1 })));
* JSON.stringify(v$); // '{"a":1}'
* ```
*/
public toJSON(key: string): unknown {
const value = this.value as
| undefined
| null
| { toJSON?: (key: string) => unknown };
return value && value.toJSON ? value.toJSON(key) : value;
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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