Comparing version 1.0.5 to 1.0.6
@@ -118,9 +118,3 @@ 'use strict'; | ||
lines.push(gap3 + 'success: ' + d.success); | ||
if (d.result instanceof BatchError) { | ||
lines.push(gap3 + 'result: ' + d.result.toString(level + 3)); | ||
} else { | ||
lines.push(gap3 + 'result: ' + $npm.u.inspect(d.result)); | ||
} | ||
lines.push(gap3 + 'result: ' + $npm.utils.formatError(d.result, level + 3)); | ||
if (d.origin) { | ||
@@ -127,0 +121,0 @@ lines.push(gap3 + 'origin: ' + $npm.u.inspect(d.origin)); |
@@ -116,19 +116,4 @@ 'use strict'; | ||
var names = ['BatchError', 'PageError', 'SequenceError']; | ||
var error; | ||
if (this.error instanceof Error) { | ||
if (names.indexOf(this.error.name) === -1) { | ||
error = $npm.u.inspect(this.error) + '\n' + $npm.utils.getStack(this.error, level + 1); | ||
} else { | ||
error = this.error.toString(level + 1); | ||
} | ||
} else { | ||
error = $npm.u.inspect(this.error); | ||
} | ||
lines.push(gap1 + 'error: ' + error); | ||
lines.push(gap1 + 'error: ' + $npm.utils.formatError(this.error, level + 1)); | ||
lines.push(gap0 + '}'); | ||
return lines.join($npm.os.EOL); | ||
@@ -135,0 +120,0 @@ }; |
@@ -106,19 +106,4 @@ 'use strict'; | ||
var names = ['BatchError', 'PageError', 'SequenceError']; | ||
var error; | ||
if (this.error instanceof Error) { | ||
if (names.indexOf(this.error.name) === -1) { | ||
error = $npm.u.inspect(this.error) + '\n' + $npm.utils.getStack(this.error, level + 1); | ||
} else { | ||
error = this.error.toString(level + 1); | ||
} | ||
} else { | ||
error = $npm.u.inspect(this.error); | ||
} | ||
lines.push(gap1 + 'error: ' + error); | ||
lines.push(gap1 + 'error: ' + $npm.utils.formatError(this.error, level + 1)); | ||
lines.push(gap0 + '}'); | ||
return lines.join($npm.os.EOL); | ||
@@ -125,0 +110,0 @@ }; |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var exp = { | ||
getStack: stat.getStack, | ||
formatError: stat.formatError, | ||
isPromise: stat.isPromise, | ||
@@ -11,0 +11,0 @@ isReadableStream: stat.isReadableStream, |
'use strict'; | ||
var stream = require('stream'); | ||
var util = require('util'); | ||
@@ -50,4 +51,16 @@ ///////////////////////////////////// | ||
function formatError(error, level) { | ||
var names = ['BatchError', 'PageError', 'SequenceError']; | ||
if (error instanceof Error) { | ||
if (names.indexOf(error.name) === -1) { | ||
return '[' + error.name + ': ' + error.message + ']\n' + getStack(error, level); | ||
} else { | ||
return error.toString(level); | ||
} | ||
} | ||
return util.inspect(error); | ||
} | ||
module.exports = { | ||
getStack: getStack, | ||
formatError: formatError, | ||
isPromise: isPromise, | ||
@@ -54,0 +67,0 @@ isReadableStream: isReadableStream, |
{ | ||
"name": "spex", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Specialized Promise Extensions", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56280
15
1405
1
0