0.0.9 • Published 10 years ago

ts-immutable-helper v0.0.9

Weekly downloads
14
License
MIT
Repository
github
Last release
10 years ago

ts-immutable-helper

An implementation of ImmutableHelper using TypeScript (TS 2 compatible).

Description

The helper implements basic functionality such as "clone" object and "freeze" object.

Dependencies

Installation

First you need to install the npm module:

npm install ts-immutable-helper --save

Use

import {ImmutableHelper} from 'ts-immutable-helper/index';

ImmutableHelper.toClone<IDefinition>({
    a: 1,
    b: ['s1', 's2', {
        b: 1
    }]
});
import {ImmutableHelper} from 'ts-immutable-helper/index';

ImmutableHelper.toImmutable<IDefinition>({
    a: 1,
    b: ['s1', 's2', {
        b: 1
    }]
});
import {ImmutableHelper} from 'ts-immutable-helper/index';

class Person {
    constructor(private name: string, private id: number) {
    }

    getName(): string {
        return this.name;
    }
}

ImmutableHelper.toImmutable(new Person("Tomas", 123));

Publish

npm deploy

License

Licensed under MIT.

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago