ice-to-plain
TypeScript icon, indicating that this package has built-in type declarations

0.2.9 • Public • Published

Ice to Plain npm version Build Status

Convert Ice stuff to and from plain JS objects. Supports long, enum, struct, dictionary, exception and class, as well as JS objects, arrays, Maps and Sets.

Installation

$ npm install ice-to-plain

Usage

import {iceToPlain, iceToJson, iceFromPlain} from 'ice-to-plain';
import {isEqual} from 'lodash';

const plain = iceToPlain(someIceValue);
isEqual(someIceValue, iceFromPlain(plain)); // true

// 4-5x faster than JSON.stringify for Ice objects
// but 4-5x slower on regular JS objects
const json = iceToJson(someIceValue);

Readme

Keywords

none

Package Sidebar

Install

npm i ice-to-plain

Weekly Downloads

531

Version

0.2.9

License

GPL-2.0

Unpacked Size

48.4 kB

Total Files

7

Last publish

Collaborators

  • aikoven