pug-runtime
Advanced tools
Comparing version 3.0.0 to 3.0.1-canary-10
16
index.js
@@ -250,14 +250,18 @@ 'use strict'; | ||
} | ||
var context, lines, start, end; | ||
try { | ||
str = str || require('fs').readFileSync(filename, 'utf8'); | ||
str = str || require('fs').readFileSync(filename, {encoding: 'utf8'}); | ||
context = 3; | ||
lines = str.split('\n'); | ||
start = Math.max(lineno - context, 0); | ||
end = Math.min(lines.length, lineno + context); | ||
} catch (ex) { | ||
err.message += | ||
' - could not read from ' + filename + ' (' + ex.message + ')'; | ||
pug_rethrow(err, null, lineno); | ||
return; | ||
} | ||
var context = 3, | ||
lines = str.split('\n'), | ||
start = Math.max(lineno - context, 0), | ||
end = Math.min(lines.length, lineno + context); | ||
// Error context | ||
var context = lines | ||
context = lines | ||
.slice(start, end) | ||
@@ -264,0 +268,0 @@ .map(function(line, i) { |
@@ -12,3 +12,3 @@ module.exports = { | ||
"escape": "function pug_escape(e){var a=\"\"+e,t=pug_match_html.exec(a);if(!t)return e;var r,c,n,s=\"\";for(r=t.index,c=0;r<a.length;r++){switch(a.charCodeAt(r)){case 34:n=\""\";break;case 38:n=\"&\";break;case 60:n=\"<\";break;case 62:n=\">\";break;default:continue}c!==r&&(s+=a.substring(c,r)),c=r+1,s+=n}return c!==r?s+a.substring(c,r):s}", | ||
"rethrow": "function pug_rethrow(n,e,t,r){if(!(n instanceof Error))throw n;if(!(\"undefined\"==typeof window&&e||r))throw n.message+=\" on line \"+t,n;try{r=r||require(\"fs\").readFileSync(e,\"utf8\")}catch(e){pug_rethrow(n,null,t)}var a=3,i=r.split(\"\\n\"),o=Math.max(t-a,0),h=Math.min(i.length,t+a),a=i.slice(o,h).map(function(n,e){var r=e+o+1;return(r==t?\" > \":\" \")+r+\"| \"+n}).join(\"\\n\");n.path=e;try{n.message=(e||\"Pug\")+\":\"+t+\"\\n\"+a+\"\\n\\n\"+n.message}catch(n){}throw n}" | ||
"rethrow": "function pug_rethrow(e,n,r,t){if(!(e instanceof Error))throw e;if(!(\"undefined\"==typeof window&&n||t))throw e.message+=\" on line \"+r,e;var o,a,i,s;try{t=t||require(\"fs\").readFileSync(n,{encoding:\"utf8\"}),o=3,a=t.split(\"\\n\"),i=Math.max(r-o,0),s=Math.min(a.length,r+o)}catch(t){return e.message+=\" - could not read from \"+n+\" (\"+t.message+\")\",void pug_rethrow(e,null,r)}o=a.slice(i,s).map(function(e,n){var t=n+i+1;return(t==r?\" > \":\" \")+t+\"| \"+e}).join(\"\\n\"),e.path=n;try{e.message=(n||\"Pug\")+\":\"+r+\"\\n\"+o+\"\\n\\n\"+e.message}catch(e){}throw e}" | ||
} |
{ | ||
"name": "pug-runtime", | ||
"version": "3.0.0", | ||
"version": "3.0.1-canary-10", | ||
"description": "The runtime components for the pug templating language", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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 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
16962
359
2