0.0.9 • Published 8 years ago

ts-immutable-helper v0.0.9

Weekly downloads
14
License
MIT
Repository
github
Last release
8 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

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago