@stdlib/streams-node-debug
Advanced tools
Sorry, the diff of this file is not supported yet
| /// <reference path="../docs/types/index.d.ts" /> | ||
| import inspectStream from '../docs/types/index'; | ||
| export = inspectStream; |
| "use strict";var n=function(e,r){return function(){return r||e((r={exports:{}}).exports,r),r.exports}};var b=n(function(me,h){ | ||
| h.exports="debug-stream" | ||
| });var M=n(function(ge,O){ | ||
| var U=require("debug"),k=b(),z=U(k);O.exports=z | ||
| });var j=n(function(be,G){G.exports={objectMode:!1,allowHalfOpen:!1,readableObjectMode:!1,name:""}});var E=n(function(de,y){ | ||
| var K=require('@stdlib/assert-is-plain-object/dist'),o=require('@stdlib/assert-has-own-property/dist'),d=require('@stdlib/assert-is-boolean/dist').isPrimitive,Q=require('@stdlib/assert-is-nonnegative-number/dist').isPrimitive,X=require('@stdlib/assert-is-string/dist').isPrimitive,u=require('@stdlib/error-tools-fmtprodmsg/dist');function Y(e,r){return K(r)?o(r,"name")&&(e.name=r.name,!X(e.name))?new TypeError(u('1M52W',"name",e.name)):o(r,"objectMode")&&(e.objectMode=r.objectMode,!d(e.objectMode))?new TypeError(u('1M52o',"objectMode",e.objectMode)):o(r,"readableObjectMode")&&(e.readableObjectMode=r.readableObjectMode,!d(e.readableObjectMode))?new TypeError(u('1M52o',"readableObjectMode",e.readableObjectMode)):o(r,"allowHalfOpen")&&(e.allowHalfOpen=r.allowHalfOpen,!d(e.allowHalfOpen))?new TypeError(u('1M52o',"allowHalfOpen",e.allowHalfOpen)):o(r,"highWaterMark")&&(e.highWaterMark=r.highWaterMark,!Q(e.highWaterMark))?new TypeError(u('1M54k',"highWaterMark",e.highWaterMark)):null:new TypeError(u('1M52V',r));}y.exports=Y | ||
| });var S=n(function(ce,p){ | ||
| var Z=require("debug");p.exports=Z | ||
| });var g=n(function(we,N){ | ||
| var H=require('@stdlib/streams-node-inspect/dist'),T=require('@stdlib/assert-is-function/dist'),_=require('@stdlib/assert-is-buffer/dist'),$=require('@stdlib/error-tools-fmtprodmsg/dist'),ee=require('@stdlib/object-assign/dist'),re=require('@stdlib/utils-inherit/dist'),c=M(),ae=j(),x=b(),C=E(),ie=S();function l(e,r){var a,i,s,f,v;if(!(this instanceof l))return arguments.length>1?new l(e,r):arguments.length===1?new l(e):new l;if(a=ee({},ae),arguments.length>1){if(!T(r))throw new TypeError($('1M52b',r));v=r,f=C(a,e)}else arguments.length&&(T(e)?v=e:f=C(a,e));if(f)throw f;return a.name?i=x+":"+a.name:i=x,s=ie(i),c("Creating a transform stream configured with the following options: %s.",JSON.stringify(a)),H.call(this,a,L),this;function L(t,m){if(v)return c("Received a new chunk. Chunk: %s. Index: %d.",t.toString(),m),v(s,t,m);_(t)&&(t=t.toString()),t=JSON.stringify(t),c("Received a new chunk. Chunk: %s. Index: %d.",t,m),s("Chunk: %s. Index: %d.",t,m)}}re(l,H);N.exports=l | ||
| });var I=n(function(qe,F){ | ||
| var P=require('@stdlib/assert-is-function/dist'),V=require('@stdlib/assert-is-plain-object/dist'),w=require('@stdlib/error-tools-fmtprodmsg/dist'),W=require('@stdlib/object-assign/dist'),A=g();function te(e,r){var a,i;if(arguments.length>1){if(!V(e))throw new TypeError(w('1M52V',e));if(a=W({},e),i=r,!P(r))throw new TypeError(w('1M52b',r))}else if(arguments.length)if(P(e))a={},i=e;else{if(!V(e))throw new TypeError(w('1M52V',e));a=W({},e)}else a={};return a.objectMode=!0,i===void 0?new A(a):new A(a,i)}F.exports=te | ||
| });var D=n(function(he,B){ | ||
| var ne=require('@stdlib/assert-is-plain-object/dist'),ue=require('@stdlib/error-tools-fmtprodmsg/dist'),le=require('@stdlib/object-assign/dist'),R=g();function se(e){var r;if(arguments.length){if(!ne(e))throw new TypeError(ue('1M52V',e));r=le({},e)}else r={};return a;function a(i,s){return r.name=i,arguments.length>1?new R(r,s):new R(r)}}B.exports=se | ||
| });var J=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),q=g(),oe=I(),fe=D();J(q,"objectMode",oe);J(q,"factory",fe);module.exports=q; | ||
| /** @license Apache-2.0 */ | ||
| //# sourceMappingURL=index.js.map |
| { | ||
| "version": 3, | ||
| "sources": ["../lib/namespace.js", "../lib/debug.js", "../lib/defaults.json", "../lib/validate.js", "../lib/logger.js", "../lib/main.js", "../lib/object_mode.js", "../lib/factory.js", "../lib/index.js"], | ||
| "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// EXPORTS //\n\nmodule.exports = 'debug-stream';\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar logger = require( 'debug' );\nvar NAMESPACE = require( './namespace.js' );\n\n\n// MAIN //\n\nvar debug = logger( NAMESPACE );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "{\n\t\"objectMode\": false,\n\t\"allowHalfOpen\": false,\n\t\"readableObjectMode\": false,\n\t\"name\": \"\"\n}\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar hasOwnProp = require( '@stdlib/assert-has-own-property' );\nvar isBoolean = require( '@stdlib/assert-is-boolean' ).isPrimitive;\nvar isNonNegative = require( '@stdlib/assert-is-nonnegative-number' ).isPrimitive;\nvar isString = require( '@stdlib/assert-is-string' ).isPrimitive;\nvar format = require( '@stdlib/string-format' );\n\n\n// MAIN //\n\n/**\n* Validates function options.\n*\n* @private\n* @param {Object} opts - destination object\n* @param {Options} options - function options\n* @param {string} [options.name] - debug namespace\n* @param {boolean} [options.objectMode] - specifies whether a stream should operate in object mode\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`\n* @param {boolean} [options.allowHalfOpen] - specifies whether the stream should remain open even if one side ends\n* @param {boolean} [options.readableObjectMode] - specifies whether the readable side should be in object mode\n* @returns {(Error|null)} null or an error object\n*/\nfunction validate( opts, options ) {\n\tif ( !isObject( options ) ) {\n\t\treturn new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t}\n\tif ( hasOwnProp( options, 'name' ) ) {\n\t\topts.name = options.name;\n\t\tif ( !isString( opts.name ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'name', opts.name ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'objectMode' ) ) {\n\t\topts.objectMode = options.objectMode;\n\t\tif ( !isBoolean( opts.objectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'readableObjectMode' ) ) {\n\t\topts.readableObjectMode = options.readableObjectMode;\n\t\tif ( !isBoolean( opts.readableObjectMode ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'readableObjectMode', opts.readableObjectMode ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'allowHalfOpen' ) ) {\n\t\topts.allowHalfOpen = options.allowHalfOpen;\n\t\tif ( !isBoolean( opts.allowHalfOpen ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'allowHalfOpen', opts.allowHalfOpen ) );\n\t\t}\n\t}\n\tif ( hasOwnProp( options, 'highWaterMark' ) ) {\n\t\topts.highWaterMark = options.highWaterMark;\n\t\tif ( !isNonNegative( opts.highWaterMark ) ) {\n\t\t\treturn new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) );\n\t\t}\n\t}\n\treturn null;\n}\n\n\n// EXPORTS //\n\nmodule.exports = validate;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar debug = require( 'debug' );\n\n\n// EXPORTS //\n\nmodule.exports = debug;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar InspectStream = require( '@stdlib/streams-node-inspect' );\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isBuffer = require( '@stdlib/assert-is-buffer' );\nvar format = require( '@stdlib/string-format' );\nvar assign = require( '@stdlib/object-assign' );\nvar inherit = require( '@stdlib/utils-inherit' );\nvar debug = require( './debug.js' );\nvar DEFAULTS = require( './defaults.json' );\nvar NAMESPACE = require( './namespace.js' );\nvar validate = require( './validate.js' );\nvar logger = require( './logger.js' );\n\n\n// MAIN //\n\n/**\n* Debug stream constructor.\n*\n* @constructor\n* @param {Options} [options] - stream options\n* @param {string} [options.name] - debug namespace\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`\n* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends\n* @param {boolean} [options.readableObjectMode=false] - specifies whether the readable side should be in object mode\n* @param {Callback} [clbk] - callback to invoke upon receiving data\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} must a valid callback argument\n* @returns {DebugStream} debug stream\n*\n* @example\n* var stream = new DebugStream({\n* 'name': 'my-stream'\n* });\n*\n* stream.write( 'a' );\n* stream.write( 'b' );\n* stream.write( 'c' );\n* stream.end();\n*/\nfunction DebugStream( options, clbk ) {\n\tvar opts;\n\tvar name;\n\tvar log;\n\tvar err;\n\tvar cb;\n\tif ( !(this instanceof DebugStream) ) {\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new DebugStream( options, clbk );\n\t\t}\n\t\tif ( arguments.length === 1 ) {\n\t\t\treturn new DebugStream( options );\n\t\t}\n\t\treturn new DebugStream();\n\t}\n\topts = assign( {}, DEFAULTS );\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t\tcb = clbk;\n\t\terr = validate( opts, options );\n\t} else if ( arguments.length ) {\n\t\tif ( isFunction( options ) ) {\n\t\t\tcb = options;\n\t\t} else {\n\t\t\terr = validate( opts, options );\n\t\t}\n\t}\n\tif ( err ) {\n\t\tthrow err;\n\t}\n\tif ( opts.name ) {\n\t\tname = NAMESPACE + ':' + opts.name;\n\t} else {\n\t\tname = NAMESPACE;\n\t}\n\tlog = logger( name );\n\n\tdebug( 'Creating a transform stream configured with the following options: %s.', JSON.stringify( opts ) );\n\tInspectStream.call( this, opts, inspect );\n\n\treturn this;\n\n\t/**\n\t* Callback invoked upon receiving a new chunk.\n\t*\n\t* @private\n\t* @param {*} chunk - received chunk\n\t* @param {NonNegativeInteger} idx - chunk index\n\t* @returns {void}\n\t*/\n\tfunction inspect( chunk, idx ) {\n\t\tif ( cb ) {\n\t\t\tdebug( 'Received a new chunk. Chunk: %s. Index: %d.', chunk.toString(), idx );\n\t\t\treturn cb( log, chunk, idx );\n\t\t}\n\t\tif ( isBuffer( chunk ) ) {\n\t\t\tchunk = chunk.toString();\n\t\t}\n\t\tchunk = JSON.stringify( chunk );\n\t\tdebug( 'Received a new chunk. Chunk: %s. Index: %d.', chunk, idx );\n\t\tlog( 'Chunk: %s. Index: %d.', chunk, idx );\n\t}\n}\n\n/*\n* Inherit from the `InspectStream` prototype.\n*/\ninherit( DebugStream, InspectStream );\n\n\n// EXPORTS //\n\nmodule.exports = DebugStream;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isFunction = require( '@stdlib/assert-is-function' );\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar format = require( '@stdlib/string-format' );\nvar assign = require( '@stdlib/object-assign' );\nvar Stream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Returns a debug stream with `objectMode` set to `true`.\n*\n* @param {Options} [options] - stream options\n* @param {string} [options.name] - debug namespace\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`\n* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends\n* @param {boolean} [options.readableObjectMode=false] - specifies whether the readable side should be in object mode\n* @param {Callback} [clbk] - callback to invoke upon receiving data\n* @throws {TypeError} options argument must be an object\n* @throws {TypeError} must provide valid options\n* @throws {TypeError} must provide a valid callback argument\n* @returns {DebugStream} debug stream\n*\n* @example\n* var stream = objectMode({\n* 'name': 'my-stream'\n* });\n*\n* stream.write( {'value': 'a'} );\n* stream.write( {'value': 'b'} );\n* stream.write( {'value': 'c'} );\n* stream.end();\n*/\nfunction objectMode( options, clbk ) {\n\tvar opts;\n\tvar cb;\n\tif ( arguments.length > 1 ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t\tcb = clbk;\n\t\tif ( !isFunction( clbk ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) );\n\t\t}\n\t} else if ( arguments.length ) {\n\t\tif ( isFunction( options ) ) {\n\t\t\topts = {};\n\t\t\tcb = options;\n\t\t} else {\n\t\t\tif ( !isObject( options ) ) {\n\t\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t\t}\n\t\t\topts = assign( {}, options );\n\t\t}\n\t} else {\n\t\topts = {};\n\t}\n\topts.objectMode = true;\n\tif ( cb === void 0 ) {\n\t\treturn new Stream( opts );\n\t}\n\treturn new Stream( opts, cb );\n}\n\n\n// EXPORTS //\n\nmodule.exports = objectMode;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar isObject = require( '@stdlib/assert-is-plain-object' );\nvar format = require( '@stdlib/string-format' );\nvar assign = require( '@stdlib/object-assign' );\nvar Stream = require( './main.js' );\n\n\n// MAIN //\n\n/**\n* Creates a reusable debug stream factory.\n*\n* @param {Options} [options] - stream options\n* @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode\n* @param {NonNegativeNumber} [options.highWaterMark] - specifies the `Buffer` level for when `write()` starts returning `false`\n* @param {boolean} [options.allowHalfOpen=false] - specifies whether the stream should remain open even if one side ends\n* @param {boolean} [options.readableObjectMode=false] - specifies whether the readable side should be in object mode\n* @throws {TypeError} options argument must be an object\n* @returns {Function} debug stream factory\n*\n* @example\n* var opts = {\n* 'objectMode': true,\n* 'highWaterMark': 64\n* };\n*\n* var factory = streamFactory( opts );\n*\n* // Assign each stream to a separate debug namespace...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( factory( 'stream '+i ) );\n* }\n*/\nfunction streamFactory( options ) {\n\tvar opts;\n\tif ( arguments.length ) {\n\t\tif ( !isObject( options ) ) {\n\t\t\tthrow new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );\n\t\t}\n\t\topts = assign( {}, options );\n\t} else {\n\t\topts = {};\n\t}\n\treturn debugStream;\n\n\t/**\n\t* Creates a transform stream for debugging stream pipelines.\n\t*\n\t* @private\n\t* @param {string} name - debug namespace\n\t* @param {Callback} [clbk] - callback to invoke upon receiving data\n\t* @throws {TypeError} must provide valid options\n\t* @throws {TypeError} must provide a valid callback argument\n\t* @returns {DebugStream} debug stream\n\t*/\n\tfunction debugStream( name, clbk ) {\n\t\topts.name = name;\n\t\tif ( arguments.length > 1 ) {\n\t\t\treturn new Stream( opts, clbk );\n\t\t}\n\t\treturn new Stream( opts );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = streamFactory;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Transform stream for debugging stream pipelines.\n*\n* @module @stdlib/streams-node-debug\n*\n* @example\n* var debugStream = require( '@stdlib/streams-node-debug' );\n*\n* var stream = debugStream({\n* 'name': 'my-stream'\n* });\n*\n* stream.write( 'a' );\n* stream.write( 'b' );\n* stream.write( 'c' );\n* stream.end();\n*\n* @example\n* var debugStream = require( '@stdlib/streams-node-debug' );\n*\n* var stream = debugStream.objectMode({\n* 'name': 'my-stream'\n* });\n*\n* stream.write( {'value': 'a'} );\n* stream.write( {'value': 'b'} );\n* stream.write( {'value': 'c'} );\n* stream.end();\n*\n* @example\n* var debugStream = require( '@stdlib/streams-node-debug' );\n*\n* var opts = {\n* 'objectMode': true,\n* 'highWaterMark': 64\n* };\n*\n* var factory = debugStream.factory( opts );\n*\n* // Assign each stream to a separate 'debug' namespace...\n* var streams = [];\n* var i;\n* for ( i = 0; i < 10; i++ ) {\n* streams.push( factory( 'stream '+i ) );\n* }\n*/\n\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar main = require( './main.js' );\nvar objectMode = require( './object_mode.js' );\nvar factory = require( './factory.js' );\n\n\n// MAIN //\n\nsetReadOnly( main, 'objectMode', objectMode );\nsetReadOnly( main, 'factory', factory );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"], | ||
| "mappings": "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", | ||
| "names": ["require_namespace", "__commonJSMin", "exports", "module", "require_debug", "__commonJSMin", "exports", "module", "logger", "NAMESPACE", "debug", "require_defaults", "__commonJSMin", "exports", "module", "require_validate", "__commonJSMin", "exports", "module", "isObject", "hasOwnProp", "isBoolean", "isNonNegative", "isString", "format", "validate", "opts", "options", "require_logger", "__commonJSMin", "exports", "module", "debug", "require_main", "__commonJSMin", "exports", "module", "InspectStream", "isFunction", "isBuffer", "format", "assign", "inherit", "debug", "DEFAULTS", "NAMESPACE", "validate", "logger", "DebugStream", "options", "clbk", "opts", "name", "log", "err", "cb", "inspect", "chunk", "idx", "require_object_mode", "__commonJSMin", "exports", "module", "isFunction", "isObject", "format", "assign", "Stream", "objectMode", "options", "clbk", "opts", "cb", "require_factory", "__commonJSMin", "exports", "module", "isObject", "format", "assign", "Stream", "streamFactory", "options", "opts", "debugStream", "name", "clbk", "setReadOnly", "main", "objectMode", "factory"] | ||
| } |
@@ -19,3 +19,3 @@ /* | ||
| // TypeScript Version: 2.0 | ||
| // TypeScript Version: 4.1 | ||
@@ -22,0 +22,0 @@ /// <reference types="node"/> |
+4
-3
@@ -24,3 +24,4 @@ /** | ||
| var isObject = require( '@stdlib/assert-is-plain-object' ); | ||
| var copy = require( '@stdlib/utils-copy' ); | ||
| var format = require( '@stdlib/string-format' ); | ||
| var assign = require( '@stdlib/object-assign' ); | ||
| var Stream = require( './main.js' ); | ||
@@ -61,5 +62,5 @@ | ||
| if ( !isObject( options ) ) { | ||
| throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' ); | ||
| throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); | ||
| } | ||
| opts = copy( options ); | ||
| opts = assign( {}, options ); | ||
| } else { | ||
@@ -66,0 +67,0 @@ opts = {}; |
+4
-4
@@ -72,3 +72,3 @@ /** | ||
| var setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' ); | ||
| var stream = require( './main.js' ); | ||
| var main = require( './main.js' ); | ||
| var objectMode = require( './object_mode.js' ); | ||
@@ -80,4 +80,4 @@ var factory = require( './factory.js' ); | ||
| setReadOnly( stream, 'objectMode', objectMode ); | ||
| setReadOnly( stream, 'factory', factory ); | ||
| setReadOnly( main, 'objectMode', objectMode ); | ||
| setReadOnly( main, 'factory', factory ); | ||
@@ -87,2 +87,2 @@ | ||
| module.exports = stream; | ||
| module.exports = main; |
+4
-3
@@ -26,3 +26,4 @@ /** | ||
| var isBuffer = require( '@stdlib/assert-is-buffer' ); | ||
| var copy = require( '@stdlib/utils-copy' ); | ||
| var format = require( '@stdlib/string-format' ); | ||
| var assign = require( '@stdlib/object-assign' ); | ||
| var inherit = require( '@stdlib/utils-inherit' ); | ||
@@ -78,6 +79,6 @@ var debug = require( './debug.js' ); | ||
| } | ||
| opts = copy( DEFAULTS ); | ||
| opts = assign( {}, DEFAULTS ); | ||
| if ( arguments.length > 1 ) { | ||
| if ( !isFunction( clbk ) ) { | ||
| throw new TypeError( 'invalid argument. Callback argument must be a function. Value: `' + clbk + '`.' ); | ||
| throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) ); | ||
| } | ||
@@ -84,0 +85,0 @@ cb = clbk; |
@@ -25,3 +25,4 @@ /** | ||
| var isObject = require( '@stdlib/assert-is-plain-object' ); | ||
| var copy = require( '@stdlib/utils-copy' ); | ||
| var format = require( '@stdlib/string-format' ); | ||
| var assign = require( '@stdlib/object-assign' ); | ||
| var Stream = require( './main.js' ); | ||
@@ -61,8 +62,8 @@ | ||
| if ( !isObject( options ) ) { | ||
| throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' ); | ||
| throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); | ||
| } | ||
| opts = copy( options ); | ||
| opts = assign( {}, options ); | ||
| cb = clbk; | ||
| if ( !isFunction( clbk ) ) { | ||
| throw new TypeError( 'invalid argument. Callback argument must be a function. Value: `' + clbk + '`.' ); | ||
| throw new TypeError( format( 'invalid argument. Callback argument must be a function. Value: `%s`.', clbk ) ); | ||
| } | ||
@@ -75,5 +76,5 @@ } else if ( arguments.length ) { | ||
| if ( !isObject( options ) ) { | ||
| throw new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' ); | ||
| throw new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); | ||
| } | ||
| opts = copy( options ); | ||
| opts = assign( {}, options ); | ||
| } | ||
@@ -80,0 +81,0 @@ } else { |
+7
-6
@@ -28,2 +28,3 @@ /** | ||
| var isString = require( '@stdlib/assert-is-string' ).isPrimitive; | ||
| var format = require( '@stdlib/string-format' ); | ||
@@ -48,3 +49,3 @@ | ||
| if ( !isObject( options ) ) { | ||
| return new TypeError( 'invalid argument. Options argument must be an object. Value: `' + options + '`.' ); | ||
| return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); | ||
| } | ||
@@ -54,3 +55,3 @@ if ( hasOwnProp( options, 'name' ) ) { | ||
| if ( !isString( opts.name ) ) { | ||
| return new TypeError( 'invalid option. `name` option must be a primitive string. Option: `' + opts.name + '`.' ); | ||
| return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'name', opts.name ) ); | ||
| } | ||
@@ -61,3 +62,3 @@ } | ||
| if ( !isBoolean( opts.objectMode ) ) { | ||
| return new TypeError( 'invalid option. `objectMode` option must be a primitive boolean. Option: `' + opts.objectMode + '`.' ); | ||
| return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'objectMode', opts.objectMode ) ); | ||
| } | ||
@@ -68,3 +69,3 @@ } | ||
| if ( !isBoolean( opts.readableObjectMode ) ) { | ||
| return new TypeError( 'invalid option. `readableObjectMode` option must be a primitive boolean. Option: `' + opts.readableObjectMode + '`.' ); | ||
| return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'readableObjectMode', opts.readableObjectMode ) ); | ||
| } | ||
@@ -75,3 +76,3 @@ } | ||
| if ( !isBoolean( opts.allowHalfOpen ) ) { | ||
| return new TypeError( 'invalid option. `allowHalfOpen` option must be a primitive boolean. Option: `' + opts.allowHalfOpen + '`.' ); | ||
| return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'allowHalfOpen', opts.allowHalfOpen ) ); | ||
| } | ||
@@ -82,3 +83,3 @@ } | ||
| if ( !isNonNegative( opts.highWaterMark ) ) { | ||
| return new TypeError( 'invalid option. `highWaterMark` option must be a nonnegative number. Option: `' + opts.highWaterMark + '`.' ); | ||
| return new TypeError( format( 'invalid option. `%s` option must be a nonnegative number. Option: `%s`.', 'highWaterMark', opts.highWaterMark ) ); | ||
| } | ||
@@ -85,0 +86,0 @@ } |
+0
-304
@@ -178,305 +178,1 @@ | ||
| END OF TERMS AND CONDITIONS | ||
| Boost Software License - Version 1.0 - August 17th, 2003 | ||
| Permission is hereby granted, free of charge, to any person or organization | ||
| obtaining a copy of the software and accompanying documentation covered by this | ||
| license (the "Software") to use, reproduce, display, distribute, execute, and | ||
| transmit the Software, and to prepare derivative works of the Software, and to | ||
| permit third-parties to whom the Software is furnished to do so, all subject to | ||
| the following: | ||
| The copyright notices in the Software and this entire statement, including the | ||
| above license grant, this restriction and the following disclaimer, must be | ||
| included in all copies of the Software, in whole or in part, and all derivative | ||
| works of the Software, unless such copies or derivative works are solely in the | ||
| form of machine-executable object code generated by a source language processor. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
| FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
| COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES | ||
| OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF | ||
| OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| DEPENDENCIES | ||
| The library links against the following external libraries, which have their own | ||
| licenses: | ||
| * OpenBLAS <https://raw.githubusercontent.com/xianyi/OpenBLAS/ | ||
| def146efed8d5908ea04e22668feeab7099599a0/LICENSE> | ||
| Copyright (c) 2011-2014, The OpenBLAS Project | ||
| All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in | ||
| the documentation and/or other materials provided with the | ||
| distribution. | ||
| 3. Neither the name of the OpenBLAS project nor the names of | ||
| its contributors may be used to endorse or promote products | ||
| derived from this software without specific prior written | ||
| permission. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | ||
| GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | ||
| THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| * Electron <https://raw.githubusercontent.com/electron/electron/ | ||
| c4cfb3e7110266b9d7ad80e1ae097c4db564501c/LICENSE> | ||
| Copyright (c) 2013-2017 GitHub Inc. | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| * Boost <http://www.boost.org/LICENSE_1_0.txt> | ||
| Boost Software License - Version 1.0 - August 17th, 2003 | ||
| Permission is hereby granted, free of charge, to any person or organization | ||
| obtaining a copy of the software and accompanying documentation covered by | ||
| this license (the "Software") to use, reproduce, display, distribute, | ||
| execute, and transmit the Software, and to prepare derivative works of the | ||
| Software, and to permit third-parties to whom the Software is furnished to | ||
| do so, all subject to the following: | ||
| The copyright notices in the Software and this entire statement, including | ||
| the above license grant, this restriction and the following disclaimer, | ||
| must be included in all copies of the Software, in whole or in part, and | ||
| all derivative works of the Software, unless such copies or derivative | ||
| works are solely in the form of machine-executable object code generated by | ||
| a source language processor. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT | ||
| SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE | ||
| FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, | ||
| ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| DEALINGS IN THE SOFTWARE. | ||
| * Cephes <http://www.netlib.org/cephes/readme> | ||
| Copyright (c) 1984-2000 Stephen L. Moshier | ||
| Some software in this archive may be from the book _Methods and Programs for | ||
| Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) | ||
| or from the Cephes Mathematical Library, a commercial product. In either event, | ||
| it is copyrighted by the author. What you see here may be used freely but it | ||
| comes with no support or guarantee. | ||
| Stephen L. Moshier | ||
| moshier@na-net.ornl.gov | ||
| ATTRIBUTION | ||
| The library contains implementations from the following external libraries, | ||
| which have their own licenses: | ||
| * FreeBSD <https://svnweb.freebsd.org/> | ||
| Copyright (C) 1993-2004 by Sun Microsystems, Inc. All rights reserved. | ||
| Developed at SunPro, a Sun Microsystems, Inc. business. | ||
| Permission to use, copy, modify, and distribute this | ||
| software is freely granted, provided that this notice | ||
| is preserved. | ||
| * FDLIBM <http://www.netlib.org/fdlibm/> | ||
| Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. | ||
| Developed at SunPro, a Sun Microsystems, Inc. business. | ||
| Permission to use, copy, modify, and distribute this | ||
| software is freely granted, provided that this notice | ||
| is preserved. | ||
| * Go <https://raw.githubusercontent.com/golang/go/master/LICENSE> | ||
| Copyright (c) 2009 The Go Authors. All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
| * Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| * Redistributions in binary form must reproduce the above | ||
| copyright notice, this list of conditions and the following disclaimer | ||
| in the documentation and/or other materials provided with the | ||
| distribution. | ||
| * Neither the name of Google Inc. nor the names of its | ||
| contributors may be used to endorse or promote products derived from | ||
| this software without specific prior written permission. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| * SLATEC Common Mathematical Library <http://www.netlib.no/netlib/slatec/> | ||
| Public domain. | ||
| * ESLint <https://raw.githubusercontent.com/eslint/eslint/master/LICENSE> | ||
| Copyright JS Foundation and other contributors, https://js.foundation | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in | ||
| all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| THE SOFTWARE. | ||
| * StatsFuns.jl <https://raw.githubusercontent.com/JuliaStats/StatsFuns.jl/ | ||
| e66dd973650c375bc1739c820e5b96bb5bd000a8/LICENSE.md> | ||
| Copyright (c) 2015: Dahua Lin. | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| * SpecialFunctions.jl <https://raw.githubusercontent.com/JuliaMath/ | ||
| SpecialFunctions.jl/02a173fbe24a61c4b392aec17a9764ac5727feb1/LICENSE> | ||
| The MIT License (MIT) | ||
| Copyright (c) 2017 Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and others: | ||
| https://github.com/JuliaMath/SpecialFunctions.jl/graphs/contributors | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. | ||
| * MT19937 <http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/ | ||
| mt19937ar.c> | ||
| Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, | ||
| All rights reserved. | ||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions | ||
| are met: | ||
| 1. Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| 2. Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in the | ||
| documentation and/or other materials provided with the distribution. | ||
| 3. The names of its contributors may not be used to endorse or promote | ||
| products derived from this software without specific prior written | ||
| permission. | ||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Copyright (c) 2016-2022 The Stdlib Authors. | ||
| Copyright (c) 2016-2023 The Stdlib Authors. |
+25
-23
| { | ||
| "name": "@stdlib/streams-node-debug", | ||
| "version": "0.0.7", | ||
| "version": "0.1.0", | ||
| "description": "Transform stream for debugging stream pipelines.", | ||
@@ -40,27 +40,29 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@stdlib/assert-has-own-property": "^0.0.x", | ||
| "@stdlib/assert-is-boolean": "^0.0.x", | ||
| "@stdlib/assert-is-buffer": "^0.0.x", | ||
| "@stdlib/assert-is-function": "^0.0.x", | ||
| "@stdlib/assert-is-nonnegative-number": "^0.0.x", | ||
| "@stdlib/assert-is-plain-object": "^0.0.x", | ||
| "@stdlib/assert-is-string": "^0.0.x", | ||
| "@stdlib/streams-node-inspect": "^0.0.x", | ||
| "@stdlib/utils-copy": "^0.0.x", | ||
| "@stdlib/utils-define-nonenumerable-read-only-property": "^0.0.x", | ||
| "@stdlib/utils-inherit": "^0.0.x", | ||
| "debug": "^2.6.9" | ||
| "@stdlib/assert-has-own-property": "^0.1.0", | ||
| "@stdlib/assert-is-boolean": "^0.1.0", | ||
| "@stdlib/assert-is-buffer": "^0.1.0", | ||
| "@stdlib/assert-is-function": "^0.1.0", | ||
| "@stdlib/assert-is-nonnegative-number": "^0.1.0", | ||
| "@stdlib/assert-is-plain-object": "^0.1.0", | ||
| "@stdlib/assert-is-string": "^0.1.0", | ||
| "@stdlib/object-assign": "^0.1.0", | ||
| "@stdlib/streams-node-inspect": "^0.1.0", | ||
| "@stdlib/string-format": "^0.1.0", | ||
| "@stdlib/utils-define-nonenumerable-read-only-property": "^0.1.0", | ||
| "@stdlib/utils-inherit": "^0.1.0", | ||
| "debug": "^2.6.9", | ||
| "@stdlib/error-tools-fmtprodmsg": "^0.1.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@stdlib/bench": "^0.0.x", | ||
| "@stdlib/buffer-from-string": "^0.0.x", | ||
| "@stdlib/streams-node-stdout": "^0.0.x", | ||
| "@stdlib/streams-node-transform": "^0.0.x", | ||
| "@stdlib/utils-next-tick": "^0.0.x", | ||
| "@stdlib/utils-noop": "^0.0.x", | ||
| "@stdlib/utils-parse-json": "^0.0.x", | ||
| "@stdlib/bench": "^0.1.0", | ||
| "@stdlib/buffer-from-string": "^0.1.0", | ||
| "@stdlib/streams-node-stdout": "^0.1.0", | ||
| "@stdlib/streams-node-transform": "^0.1.0", | ||
| "@stdlib/utils-next-tick": "^0.1.0", | ||
| "@stdlib/utils-noop": "^0.1.0", | ||
| "@stdlib/utils-parse-json": "^0.1.0", | ||
| "proxyquire": "^2.0.0", | ||
| "tape": "git+https://github.com/kgryte/tape.git#fix/globby", | ||
| "istanbul": "^0.4.1", | ||
| "tap-spec": "5.x.x" | ||
| "tap-min": "git+https://github.com/Planeshifter/tap-min.git" | ||
| }, | ||
@@ -102,5 +104,5 @@ "engines": { | ||
| "funding": { | ||
| "type": "patreon", | ||
| "url": "https://www.patreon.com/athan" | ||
| "type": "opencollective", | ||
| "url": "https://opencollective.com/stdlib" | ||
| } | ||
| } |
+24
-12
@@ -21,2 +21,13 @@ <!-- | ||
| <details> | ||
| <summary> | ||
| About stdlib... | ||
| </summary> | ||
| <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p> | ||
| <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p> | ||
| <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p> | ||
| <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p> | ||
| </details> | ||
| # Debug Stream | ||
@@ -269,4 +280,4 @@ | ||
| - <span class="package-name">[`@stdlib/streams/node/debug-sink`][@stdlib/streams/node/debug-sink]</span><span class="delimiter">: </span><span class="description">writable stream for debugging stream pipelines.</span> | ||
| - <span class="package-name">[`@stdlib/streams/node/inspect`][@stdlib/streams/node/inspect]</span><span class="delimiter">: </span><span class="description">transform stream for inspecting streamed data.</span> | ||
| - <span class="package-name">[`@stdlib/streams-node/debug-sink`][@stdlib/streams/node/debug-sink]</span><span class="delimiter">: </span><span class="description">writable stream for debugging stream pipelines.</span> | ||
| - <span class="package-name">[`@stdlib/streams-node/inspect`][@stdlib/streams/node/inspect]</span><span class="delimiter">: </span><span class="description">transform stream for inspecting streamed data.</span> | ||
@@ -303,3 +314,3 @@ </section> | ||
| Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors]. | ||
| Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors]. | ||
@@ -317,4 +328,4 @@ </section> | ||
| [test-image]: https://github.com/stdlib-js/streams-node-debug/actions/workflows/test.yml/badge.svg | ||
| [test-url]: https://github.com/stdlib-js/streams-node-debug/actions/workflows/test.yml | ||
| [test-image]: https://github.com/stdlib-js/streams-node-debug/actions/workflows/test.yml/badge.svg?branch=v0.1.0 | ||
| [test-url]: https://github.com/stdlib-js/streams-node-debug/actions/workflows/test.yml?query=branch:v0.1.0 | ||
@@ -331,2 +342,9 @@ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/streams-node-debug/main.svg | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
| [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im | ||
| [stdlib]: https://github.com/stdlib-js/stdlib | ||
| [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors | ||
| [umd]: https://github.com/umdjs/umd | ||
@@ -338,10 +356,4 @@ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules | ||
| [esm-url]: https://github.com/stdlib-js/streams-node-debug/tree/esm | ||
| [branches-url]: https://github.com/stdlib-js/streams-node-debug/blob/main/branches.md | ||
| [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg | ||
| [chat-url]: https://gitter.im/stdlib-js/stdlib/ | ||
| [stdlib]: https://github.com/stdlib-js/stdlib | ||
| [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors | ||
| [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/streams-node-debug/main/LICENSE | ||
@@ -348,0 +360,0 @@ |
-128
| {{alias}}( [options,] [clbk] ) | ||
| Returns a transform stream for debugging stream pipelines. | ||
| If the `DEBUG` environment variable is not set, no data is logged. | ||
| Providing a `name` option is *strongly* encouraged, as the `DEBUG` | ||
| environment variable can be used to filter debuggers. | ||
| Parameters | ||
| ---------- | ||
| options: Object (optional) | ||
| Options. | ||
| options.name: string (optional) | ||
| Debug namespace. | ||
| options.objectMode: boolean (optional) | ||
| Specifies whether a stream should operate in "objectMode". Default: | ||
| false. | ||
| options.highWaterMark: integer (optional) | ||
| Specifies the maximum number of bytes to store in an internal buffer | ||
| before ceasing to push downstream. | ||
| options.allowHalfOpen: boolean (optional) | ||
| Specifies whether a stream should remain open even if one side ends. | ||
| Default: false. | ||
| options.readableObjectMode: boolean (optional) | ||
| Specifies whether the readable side should be in "objectMode". Default: | ||
| false. | ||
| clbk: Function (optional) | ||
| Callback to invoke upon receiving data. | ||
| Returns | ||
| ------- | ||
| stream: TransformStream | ||
| Transform stream. | ||
| Examples | ||
| -------- | ||
| > var s = {{alias}}( { 'name': 'foo' } ); | ||
| > s.write( 'a' ); | ||
| > s.write( 'b' ); | ||
| > s.write( 'c' ); | ||
| > s.end(); | ||
| {{alias}}.factory( [options] ) | ||
| Returns a function for creating transform streams for debugging stream | ||
| pipelines. | ||
| Parameters | ||
| ---------- | ||
| options: Object (optional) | ||
| Options. | ||
| options.objectMode: boolean (optional) | ||
| Specifies whether a stream should operate in "objectMode". Default: | ||
| false. | ||
| options.highWaterMark: integer (optional) | ||
| Specifies the maximum number of bytes to store in an internal buffer | ||
| before ceasing to push downstream. | ||
| options.allowHalfOpen: boolean (optional) | ||
| Specifies whether a stream should remain open even if one side ends. | ||
| Default: false. | ||
| options.readableObjectMode: boolean (optional) | ||
| Specifies whether the readable side should be in "objectMode". Default: | ||
| false. | ||
| Returns | ||
| ------- | ||
| createStream( name[, clbk] ): Function | ||
| Function for creating transform streams. | ||
| Examples | ||
| -------- | ||
| > var opts = { 'objectMode': true, 'highWaterMark': 64 }; | ||
| > var createStream = {{alias}}.factory( opts ); | ||
| {{alias}}.objectMode( [options,] [clbk] ) | ||
| Returns an "objectMode" transform stream for debugging stream pipelines. | ||
| Parameters | ||
| ---------- | ||
| options: Object (optional) | ||
| Options. | ||
| options.name: string (optional) | ||
| Debug namespace. | ||
| options.highWaterMark: integer (optional) | ||
| Specifies the maximum number of objects to store in an internal buffer | ||
| before ceasing to push downstream. | ||
| options.allowHalfOpen: boolean (optional) | ||
| Specifies whether a stream should remain open even if one side ends. | ||
| Default: false. | ||
| options.readableObjectMode: boolean (optional) | ||
| Specifies whether the readable side should be in "objectMode". Default: | ||
| false. | ||
| clbk: Function (optional) | ||
| Callback to invoke upon receiving data. | ||
| Returns | ||
| ------- | ||
| stream: TransformStream | ||
| Transform stream operating in "objectMode". | ||
| Examples | ||
| -------- | ||
| > var s = {{alias}}.objectMode( { 'name': 'foo' } ); | ||
| > s.write( { 'value': 'a' } ); | ||
| > s.write( { 'value': 'b' } ); | ||
| > s.write( { 'value': 'c' } ); | ||
| > s.end(); | ||
| See Also | ||
| -------- | ||
| /* | ||
| * @license Apache-2.0 | ||
| * | ||
| * Copyright (c) 2021 The Stdlib Authors. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| // tslint:disable: no-unused-expression | ||
| import DebugStream = require( './index' ); | ||
| /** | ||
| * Callback function invoked upon receiving data. | ||
| * | ||
| * @param debug - logging function | ||
| * @param chunk - data chunk | ||
| * @param idx - chunk index | ||
| */ | ||
| function clbk( debug: Function, chunk: any, idx: number ) { | ||
| debug( 'Received a new chunk...' ); | ||
| debug( 'Chunk: %s', chunk ); | ||
| debug( 'Index: %s', idx ); | ||
| } | ||
| // TESTS // | ||
| // The constructor returns a stream... | ||
| { | ||
| new DebugStream(); // $ExpectType Transform | ||
| new DebugStream( clbk ); // $ExpectType Transform | ||
| new DebugStream( { 'objectMode': true } ); // $ExpectType Transform | ||
| new DebugStream( { 'objectMode': true }, clbk ); // $ExpectType Transform | ||
| } | ||
| // The constructor is callable... | ||
| { | ||
| const debugStream = DebugStream; | ||
| debugStream(); // $ExpectType Transform | ||
| debugStream( clbk ); // $ExpectType Transform | ||
| debugStream( { 'objectMode': true } ); // $ExpectType Transform | ||
| debugStream( { 'objectMode': true }, clbk ); // $ExpectType Transform | ||
| } | ||
| // The constructor has an `objectMode` method which returns a stream... | ||
| { | ||
| DebugStream.objectMode(); // $ExpectType Transform | ||
| DebugStream.objectMode( clbk ); // $ExpectType Transform | ||
| DebugStream.objectMode( { 'allowHalfOpen': true } ); // $ExpectType Transform | ||
| DebugStream.objectMode( { 'allowHalfOpen': true }, clbk ); // $ExpectType Transform | ||
| } | ||
| // The constructor has a `factory` method which returns a function for creating streams... | ||
| { | ||
| let f = DebugStream.factory(); | ||
| f( 'my-stream', clbk ); // $ExpectType Transform | ||
| f = DebugStream.factory( {} ); | ||
| f( 'my-stream', clbk ); // $ExpectType Transform | ||
| f = DebugStream.factory( { 'objectMode': true } ); | ||
| f( 'my-stream', clbk ); // $ExpectType Transform | ||
| } | ||
| // The compiler throws an error if the constructor is provided a first argument which is not an options object or callback function... | ||
| { | ||
| new DebugStream( 'abc', clbk ); // $ExpectError | ||
| new DebugStream( 123, clbk ); // $ExpectError | ||
| new DebugStream( true, clbk ); // $ExpectError | ||
| new DebugStream( false, clbk ); // $ExpectError | ||
| new DebugStream( [], clbk ); // $ExpectError | ||
| new DebugStream( null, clbk ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the constructor is provided a last argument which is not an options object or callback function... | ||
| { | ||
| new DebugStream( {}, 'abc' ); // $ExpectError | ||
| new DebugStream( {}, 123 ); // $ExpectError | ||
| new DebugStream( {}, true ); // $ExpectError | ||
| new DebugStream( {}, false ); // $ExpectError | ||
| new DebugStream( {}, [] ); // $ExpectError | ||
| new DebugStream( {}, {} ); // $ExpectError | ||
| new DebugStream( {}, null ); // $ExpectError | ||
| new DebugStream( 'abc' ); // $ExpectError | ||
| new DebugStream( 123 ); // $ExpectError | ||
| new DebugStream( true ); // $ExpectError | ||
| new DebugStream( false ); // $ExpectError | ||
| new DebugStream( [] ); // $ExpectError | ||
| new DebugStream( null ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the `objectMode` method is provided a first argument which is not an options object or callback function... | ||
| { | ||
| DebugStream.objectMode( 'abc', clbk ); // $ExpectError | ||
| DebugStream.objectMode( 123, clbk ); // $ExpectError | ||
| DebugStream.objectMode( true, clbk ); // $ExpectError | ||
| DebugStream.objectMode( false, clbk ); // $ExpectError | ||
| DebugStream.objectMode( [], clbk ); // $ExpectError | ||
| DebugStream.objectMode( null, clbk ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the `objectMode` method is provided a last argument which is not an options object or callback function... | ||
| { | ||
| DebugStream.objectMode( {}, 'abc' ); // $ExpectError | ||
| DebugStream.objectMode( {}, 123 ); // $ExpectError | ||
| DebugStream.objectMode( {}, true ); // $ExpectError | ||
| DebugStream.objectMode( {}, false ); // $ExpectError | ||
| DebugStream.objectMode( {}, [] ); // $ExpectError | ||
| DebugStream.objectMode( {}, {} ); // $ExpectError | ||
| DebugStream.objectMode( {}, null ); // $ExpectError | ||
| DebugStream.objectMode( 'abc' ); // $ExpectError | ||
| DebugStream.objectMode( 123 ); // $ExpectError | ||
| DebugStream.objectMode( true ); // $ExpectError | ||
| DebugStream.objectMode( false ); // $ExpectError | ||
| DebugStream.objectMode( [] ); // $ExpectError | ||
| DebugStream.objectMode( null ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the `factory` method is provided an argument which is not an options object... | ||
| { | ||
| DebugStream.factory( 'abc' ); // $ExpectError | ||
| DebugStream.factory( 123 ); // $ExpectError | ||
| DebugStream.factory( true ); // $ExpectError | ||
| DebugStream.factory( false ); // $ExpectError | ||
| DebugStream.factory( [] ); // $ExpectError | ||
| DebugStream.factory( null ); // $ExpectError | ||
| } | ||
| // The compiler throws an error if the function returned by the `factory` method is provided an invalid number of arguments... | ||
| { | ||
| let f = DebugStream.factory(); | ||
| f( 'my-stream', clbk, clbk ); // $ExpectError | ||
| f = DebugStream.factory( {} ); | ||
| f( 'my-stream', clbk, clbk ); // $ExpectError | ||
| f = DebugStream.factory( { 'objectMode': true } ); | ||
| f( 'my-stream', clbk, clbk ); // $ExpectError | ||
| } |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Mixed license
LicensePackage contains multiple licenses.
Found 1 instance in 1 package
Unidentified License
LicenseSomething that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
76065
9.01%18
12.5%0
-100%374
3.31%14
16.67%809
-11%2
100%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated