Validation.js (374B)
1'use strict'; 2 3/*! 4 * ws: a node.js websocket client 5 * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com> 6 * MIT Licensed 7 */ 8 9var isValidUTF8; 10 11try { 12 isValidUTF8 = require('utf-8-validate'); 13} catch (e) { 14 isValidUTF8 = require('./Validation.fallback'); 15} 16 17module.exports = typeof isValidUTF8 === 'object' 18 ? isValidUTF8.Validation.isValidUTF8 19 : isValidUTF8;