lib/natural/tfidf/tfidf.js
function isEncoding(encoding) {
    if (typeof Buffer.isEncoding !== 'undefined')
        return Buffer.isEncoding(encoding);
    switch ((encoding + '').toLowerCase()) {
        case 'hex':
        case 'utf8':
        case 'utf-8':
        case 'ascii':
        case 'binary':
        case 'base64':
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
        case 'raw':
            return true;
    }
    return false;
}
function isEncoding(encoding) {
    if (typeof Buffer.isEncoding !== 'undefined')
        return Buffer.isEncoding(encoding);
    switch ((encoding + '').toLowerCase()) {
        case 'hex':
        case 'utf8':
        case 'utf-8':
        case 'ascii':
        case 'binary':
        case 'base64':
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
        case 'raw':
            return true;
    }
    return false;
}
function isEncoding ( encoding ) { if ( typeof Buffer . isEncoding !== 'undefined' ) return Buffer . isEncoding ( encoding ) ; switch ( ( encoding + '' ) . toLowerCase ( ) ) { case 'hex' : case 'utf8' : case 'utf-8' : case 'ascii' : case 'binary' : case 'base64' : case 'ucs2' : case 'ucs-2' : case 'utf16le' : case 'utf-16le' : case 'raw' : return true ; } return false ; }
backwards compatibility for < node 0.10
backwards compatibility for < node 0 . 10