Comparing version 1.3.3 to 2.0.0-canary-1
32
index.js
@@ -16,15 +16,17 @@ 'use strict'; | ||
// Error context | ||
var context = lines.slice(start, end).map(function(text, i){ | ||
var curr = i + start + 1; | ||
var preamble = (curr == line ? ' > ' : ' ') | ||
+ curr | ||
+ '| '; | ||
var out = preamble + text; | ||
if (curr === line && column > 0) { | ||
out += '\n'; | ||
out += Array(preamble.length + column).join('-') + '^'; | ||
} | ||
return out; | ||
}).join('\n'); | ||
fullMessage = (filename || 'Pug') + ':' + location + '\n' + context + '\n\n' + message; | ||
var context = lines | ||
.slice(start, end) | ||
.map(function(text, i) { | ||
var curr = i + start + 1; | ||
var preamble = (curr == line ? ' > ' : ' ') + curr + '| '; | ||
var out = preamble + text; | ||
if (curr === line && column > 0) { | ||
out += '\n'; | ||
out += Array(preamble.length + column).join('-') + '^'; | ||
} | ||
return out; | ||
}) | ||
.join('\n'); | ||
fullMessage = | ||
(filename || 'Pug') + ':' + location + '\n' + context + '\n\n' + message; | ||
} else { | ||
@@ -40,3 +42,3 @@ fullMessage = (filename || 'Pug') + ':' + location + '\n\n' + message; | ||
err.src = src; | ||
err.toJSON = function () { | ||
err.toJSON = function() { | ||
return { | ||
@@ -47,3 +49,3 @@ code: this.code, | ||
column: this.column, | ||
filename: this.filename | ||
filename: this.filename, | ||
}; | ||
@@ -50,0 +52,0 @@ }; |
{ | ||
"name": "pug-error", | ||
"version": "1.3.3", | ||
"version": "2.0.0-canary-1", | ||
"description": "Standard error objects for pug", | ||
@@ -16,4 +16,3 @@ "keywords": [ | ||
"author": "Forbes Lindesay", | ||
"license": "MIT", | ||
"gitHead": "1bdf628a70fda7a0d840c52f3abce54b1c6b0130" | ||
"license": "MIT" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
50
4595
2
1