tjson-js
Version:
Tagged JSON (TJSON): a JSON-based microformat with rich type annotations
12 lines (10 loc) • 362 B
text/typescript
import { suite, test } from "mocha-typescript";
import { expect } from "chai";
import { DataType } from "../../src/datatype";
import { SetType } from "../../src/datatype/set";
class SetTypeTest {
"parses arrays"() {
let intType = DataType.get("i");
expect((new SetType(intType)).decode(["1", "2", "3"])).to.eql(new Set([1, 2, 3]));
}
}