module.exports = (function() { var __MODS__ = {}; var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; __DEFINE__(1682324647584, function(require, module, exports) { /* Copyright (c) 2014-2018, Matteo Collina Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ const { Transform } = require('readable-stream') const { StringDecoder } = require('string_decoder') const kLast = Symbol('last') const kDecoder = Symbol('decoder') function transform (chunk, enc, cb) { var list if (this.overflow) { // Line buffer is full. Skip to start of next line. var buf = this[kDecoder].write(chunk) list = buf.split(this.matcher) if (list.length === 1) return cb() // Line ending not found. Discard entire chunk. // Line ending found. Discard trailing fragment of previous line and reset overflow state. list.shift() this.overflow = false } else { this[kLast] += this[kDecoder].write(chunk) list = this[kLast].split(this.matcher) } this[kLast] = list.pop() for (var i = 0; i < list.length; i++) { try { push(this, this.mapper(list[i])) } catch (error) { return cb(error) } } this.overflow = this[kLast].length > this.maxLength if (this.overflow && !this.skipOverflow) return cb(new Error('maximum buffer reached')) cb() } function flush (cb) { // forward any gibberish left in there this[kLast] += this[kDecoder].end() if (this[kLast]) { try { push(this, this.mapper(this[kLast])) } catch (error) { return cb(error) } } cb() } function push (self, val) { if (val !== undefined) { self.push(val) } } function noop (incoming) { return incoming } function split (matcher, mapper, options) { // Set defaults for any arguments not supplied. matcher = matcher || /\r?\n/ mapper = mapper || noop options = options || {} // Test arguments explicitly. switch (arguments.length) { case 1: // If mapper is only argument. if (typeof matcher === 'function') { mapper = matcher matcher = /\r?\n/ // If options is only argument. } else if (typeof matcher === 'object' && !(matcher instanceof RegExp)) { options = matcher matcher = /\r?\n/ } break case 2: // If mapper and options are arguments. if (typeof matcher === 'function') { options = mapper mapper = matcher matcher = /\r?\n/ // If matcher and options are arguments. } else if (typeof mapper === 'object') { options = mapper mapper = noop } } options = Object.assign({}, options) options.transform = transform options.flush = flush options.readableObjectMode = true const stream = new Transform(options) stream[kLast] = '' stream[kDecoder] = new StringDecoder('utf8') stream.matcher = matcher stream.mapper = mapper stream.maxLength = options.maxLength stream.skipOverflow = options.skipOverflow stream.overflow = false return stream } module.exports = split }, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) return __REQUIRE__(1682324647584); })() //miniprogram-npm-outsideDeps=["readable-stream","string_decoder"] //# sourceMappingURL=index.js.map