mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
291 B
TypeScript
11 lines
291 B
TypeScript
import detectCharacterEncoding = require("detect-character-encoding");
|
|
|
|
const buf: Buffer = null as any;
|
|
|
|
const result: detectCharacterEncoding.Result | null = detectCharacterEncoding(buf);
|
|
|
|
if (result) {
|
|
const str: string = result.encoding;
|
|
const num: number = result.confidence;
|
|
}
|