MES手机端
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
526 B

  1. var Parser = require('./lib/parser');
  2. function getGlobal() {
  3. return (1,eval)('this');
  4. }
  5. module.exports = {
  6. create: function(buffer, global) {
  7. global = global || getGlobal();
  8. if(buffer instanceof global.ArrayBuffer) {
  9. var DOMBufferStream = require('./lib/dom-bufferstream');
  10. return new Parser(new DOMBufferStream(buffer, 0, buffer.byteLength, true, global));
  11. } else {
  12. var NodeBufferStream = require('./lib/bufferstream');
  13. return new Parser(new NodeBufferStream(buffer, 0, buffer.length, true));
  14. }
  15. }
  16. };