UNPKG

detect-character-encoding

Version:
12 lines (8 loc) 241 B
'use strict'; const bindings = require('bindings')('icuWrapper.node'); module.exports = buf => { if (!Buffer.isBuffer(buf)) { throw new TypeError('Argument to detect-character-encoding must be a buffer.'); } return bindings(buf); };