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

constructor-utils

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

constructor-utils - npm Package Compare versions

Comparing version 0.0.15 to 0.0.16

index.d.ts

2

ConstructorUtils.js

@@ -24,2 +24,4 @@ "use strict";

var _this = this;
if (!(json instanceof Array))
throw new Error("Cannot convert given data to array of constructors. Given object is not an array.");
return json.map(function (item) { return _this.plainToConstructor(cls, item, options); });

@@ -26,0 +28,0 @@ };

2

package.json
{
"name": "constructor-utils",
"version": "0.0.15",
"version": "0.0.16",
"description": "Constructor utilities to simplify work with classes and constructors. Provides plain javascript objects to classes transformation utilities.",

@@ -5,0 +5,0 @@ "license": "Apache-2.0",

@@ -8,2 +8,6 @@ # constructor-utils

**0.0.16**
* renamed `constructor-utils` to `constructor-utils` package namespace.
**0.0.15**

@@ -21,3 +25,3 @@

* Library has changed its name from `serializer.ts` to `constructor-utils`.
* Added `constructor-utils/constructor-utils` namespace.
* Added `constructor-utils` namespace.

@@ -30,3 +34,16 @@ ## Installation

`npm install constructor-utils --save`
2. If you are using system.js you may want to add this into `map` and `package` config:
```json
{
"map": {
"constructor-utils": "node_modules/constructor-utils"
},
"packages": {
"constructor-utils": { "main": "index.js", "defaultExtension": "js" }
}
}
```
2. Use [typings](https://github.com/typings/typings) to install all required definition dependencies.

@@ -114,3 +131,3 @@

```javascript
import {plainToConstructor, plainToConstructorArray} from "constructor-utils/constructor-utils";
import {plainToConstructor, plainToConstructorArray} from "constructor-utils";

@@ -127,3 +144,3 @@ let users = plainToConstructor(User, userJson); // to convert user plain object a single user

```javascript
import {constructorToPlain} from "constructor-utils/constructor-utils";
import {constructorToPlain} from "constructor-utils";
let photo = constructorToPlain(photo);

@@ -144,3 +161,3 @@ ```

```javascript
import {Type, plainToConstructor} from "constructor-utils/constructor-utils";
import {Type, plainToConstructor} from "constructor-utils";

@@ -172,3 +189,3 @@ export class Album {

```javascript
import {Skip} from "constructor-utils/constructor-utils";
import {Skip} from "constructor-utils";

@@ -196,3 +213,3 @@ export class User {

```javascript
import {Skip, Type} from "constructor-utils/constructor-utils";
import {Skip, Type} from "constructor-utils";

@@ -223,3 +240,3 @@ export class User {

```javascript
import {ArrayType} from "constructor-utils/constructor-utils";
import {ArrayType} from "constructor-utils";

@@ -248,3 +265,3 @@ export class AlbumCollection extends Array<Album> {

```javascript
import {plainToConstructorArray} from "constructor-utils/constructor-utils";
import {plainToConstructorArray} from "constructor-utils";

@@ -251,0 +268,0 @@ this.http

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