MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / utf8Length

Function utf8Length

Three.js/js/peer.js:570–577  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

568}
569
570function utf8Length(str){
571 if (str.length > 600) {
572 // Blob method faster for large strings
573 return (new Blob([str])).size;
574 } else {
575 return str.replace(/[^\u0000-\u007F]/g, _utf8Replace).length;
576 }
577}
578/**
579 * Light EventEmitter. Ported from Node.js/events.js
580 * Eric Zhang

Callers 1

peer.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected