Socket
Socket
Sign inDemoInstall

pug-runtime

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pug-runtime - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # Change Log

## 2.0.2
### Changed
- `require('fs')` calls will now be ignored by browser bundlers, through using
`browser` field in `package.json`. Fallbacks for cases where `fs` module is
not available were already in place prior to this release.
## 2.0.1

@@ -7,0 +13,0 @@ ### Changed

7

index.js

@@ -136,5 +136,6 @@ 'use strict';

}
if (typeof val.toISOString === 'function') {
val = val.toISOString();
} else if (typeof val !== 'string') {
if (typeof val.toJSON === 'function') {
val = val.toJSON();
}
if (typeof val !== 'string') {
val = JSON.stringify(val);

@@ -141,0 +142,0 @@ if (!escaped && val.indexOf('"') !== -1) {

@@ -8,7 +8,7 @@ module.exports = {

"style": "function pug_style(r){if(!r)return\"\";if(\"object\"==typeof r){var e=\"\",t=\"\";for(var n in r)pug_has_own_property.call(r,n)&&(e=e+t+n+\":\"+r[n],t=\";\");return e}return r=\"\"+r,\";\"===r[r.length-1]?r.slice(0,-1):r}",
"attr": "function pug_attr(t,e,n,r){if(e===!1||null==e||!e&&(\"class\"===t||\"style\"===t))return\"\";if(e===!0)return\" \"+(r?t:t+'=\"'+t+'\"');if(\"function\"==typeof e.toISOString)e=e.toISOString();else if(\"string\"!=typeof e&&(e=JSON.stringify(e),!n&&-1!==e.indexOf('\"')))return\" \"+t+\"='\"+e.replace(/'/g,\"'\")+\"'\";return n&&(e=pug_escape(e)),\" \"+t+'=\"'+e+'\"'}",
"attr": "function pug_attr(t,e,n,f){return e!==!1&&null!=e&&(e||\"class\"!==t&&\"style\"!==t)?e===!0?\" \"+(f?t:t+'=\"'+t+'\"'):(\"function\"==typeof e.toJSON&&(e=e.toJSON()),\"string\"==typeof e||(e=JSON.stringify(e),n||e.indexOf('\"')===-1)?(n&&(e=pug_escape(e)),\" \"+t+'=\"'+e+'\"'):\" \"+t+\"='\"+e.replace(/'/g,\"'\")+\"'\"):\"\"}",
"attrs": "function pug_attrs(t,r){var a=\"\";for(var s in t)if(pug_has_own_property.call(t,s)){var u=t[s];if(\"class\"===s){u=pug_classes(u),a=pug_attr(s,u,!1,r)+a;continue}\"style\"===s&&(u=pug_style(u)),a+=pug_attr(s,u,!1,r)}return a}",
"match_html": "var pug_match_html=/[\"&<>]/;",
"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=\"&quot;\";break;case 38:n=\"&amp;\";break;case 60:n=\"&lt;\";break;case 62:n=\"&gt;\";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,r,t){if(!(n instanceof Error))throw n;if(!(\"undefined\"==typeof window&&e||t))throw n.message+=\" on line \"+r,n;try{t=t||require(\"fs\").readFileSync(e,\"utf8\")}catch(i){pug_rethrow(n,null,r)}var a=3,o=t.split(\"\\n\"),h=Math.max(r-a,0),s=Math.min(o.length,r+a),a=o.slice(h,s).map(function(n,e){var t=e+h+1;return(t==r?\" > \":\" \")+t+\"| \"+n}).join(\"\\n\");throw n.path=e,n.message=(e||\"Pug\")+\":\"+r+\"\\n\"+a+\"\\n\\n\"+n.message,n}"
"rethrow": "function pug_rethrow(n,e,r,t){if(!(n instanceof Error))throw n;if(!(\"undefined\"==typeof window&&e||t))throw n.message+=\" on line \"+r,n;try{t=t||require(\"fs\").readFileSync(e,\"utf8\")}catch(e){pug_rethrow(n,null,r)}var i=3,a=t.split(\"\\n\"),o=Math.max(r-i,0),h=Math.min(a.length,r+i),i=a.slice(o,h).map(function(n,e){var t=e+o+1;return(t==r?\" > \":\" \")+t+\"| \"+n}).join(\"\\n\");throw n.path=e,n.message=(e||\"Pug\")+\":\"+r+\"\\n\"+i+\"\\n\\n\"+n.message,n}"
}
{
"name": "pug-runtime",
"version": "2.0.1",
"version": "2.0.2",
"description": "The runtime components for the pug templating language",

@@ -10,3 +10,3 @@ "keywords": [

"devDependencies": {
"istanbul": "^0.3.5",
"istanbul": "*",
"testit": "^2.0.2",

@@ -34,4 +34,7 @@ "uglify-js": "^2.6.1"

},
"browser": {
"fs": false
},
"author": "ForbesLindesay",
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc