New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

array_typer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array_typer

Create an array or dictionnary of generic type object

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

array_typer

A Node.js module that create an array or dictionnary of generic type object from an array of Object

Installation

npm install ts_parser --save

Usage

Javascript

var arrayTyper = require('array_typer');

var MyObject = /** @class */ (function () {
  function MyObject(json) {
      this.key = json.key;
  }
  return MyObject;
}());

var json = [{"key": 1},{"key": 2}]

var typedArray = index.typeArray(MyObject, json);

TypeScript

import { typeArray } from 'array_typer';

var json = [{"key": 1},{"key": 2}]

class MyObject
{
  key : number = -1;

  constructor(json: any)
  {
    this.key = json.key
  }
}

var typedArray: MyObject[] = typeArray(MyObject, json));

Test

npm run test

FAQs

Package last updated on 22 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts