DefinitelyTyped/utf8/utf8-tests.ts
Nick Zelei 2a24bbb7ca Add definitions for utf8 module (#10329)
* added utf8 module typings

added utf8 module typings

* added tests for utf8

added tests for utf8

* moved import to es6 compatible

moved import to es6 compatible

* updated var to const

updated var to const

* removed interface and moved into module

removed interface and moved into module

* update const with let as it can be changed

update const with let as it can be changed
2016-07-29 21:12:55 -07:00

20 lines
378 B
TypeScript

/// <reference path="utf8.d.ts" />
import * as utf8 from "utf8";
function test_encode(): void {
utf8.encode("\x49");
utf8.encode("\uD800\uDC01");
}
function test_decode(): void {
utf8.decode("\xC2\x49");
utf8.decode("\xF0\x90\x80\x81");
}
function test_version(): void {
if (typeof utf8.version === "string") {
console.log(utf8.version);
}
}