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

json2typescript

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2typescript - npm Package Compare versions

Comparing version 0.9.3 to 0.9.4

2

package.json
{
"name": "json2typescript",
"version": "0.9.3",
"version": "0.9.4",
"description": "Provides TypeScript methods to map a JSON string to a JavaScript object on runtime",

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

@@ -26,2 +26,3 @@ # json2typescript

* v0.9.4: Class properties are now not overridden to `undefined` if there is no decorator and no matching json value.
* v0.9.3: It is now possible to map an JSON object to an TypeScript array, then the object keys become the array keys. Also, class properties can be set to optional. See below in the chapter "decorators" for more information.

@@ -28,0 +29,0 @@ * v0.9.2: Added method `serializeString()`, changed `property` names and behaviour

/**
* Offers a simple API for mapping json objects to TypeScript/JavaScript classes and vice versa.
* @author Andreas Aeschlimann, DHlab, University of Basel, Switzerland
* @version 0.9.3
* @version 0.9.4
* @licence MIT

@@ -158,4 +158,9 @@ * @see https://www.npmjs.com/package/json2typescript full documentation

if (JsonConvert.deserializeObject_propertyHasDecorator(mapping, propertyKey) === false) {
classInstance[propertyKey] = json[propertyKey];
// Make sure values are not overridden by undefined json values
if (typeof(json[propertyKey]) !== "undefined")
classInstance[propertyKey] = json[propertyKey];
return;
}

@@ -162,0 +167,0 @@

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