New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-file-include

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-file-include - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

9

index.js
'use strict';
var concat = require('concat-stream'),
flatten = require('flatnest').flatten,
merge = require('merge').recursive,

@@ -95,6 +96,10 @@ through = require('through2'),

// grab keys & sort by longest keys 1st to iterate in that order
var keys = Object.keys(data).sort();
var variables = flatten(data);
var keys = Object.keys(variables).sort();
var i = keys.length - 1;
var key;
for ( ; ~i; i -= 1) {
text = text.replace(new RegExp(prefix + keys[i] + suffix, 'g'), data[keys[i]]);
if(key = keys[i]) {
text = text.replace(new RegExp(prefix + key + suffix, 'g'), variables[key]);
}
}

@@ -101,0 +106,0 @@

{
"name": "gulp-file-include",
"version": "0.10.0",
"version": "0.11.0",
"description": "a gulp plugin for file include",

@@ -41,6 +41,11 @@ "main": "index.js",

"concat-stream": "^1.4.7",
"flatnest": "^0.2.2",
"gulp-util": "^3.0.4",
"merge": "^1.2.0",
"through2": "^0.6.3"
}
"through2": "^2.0.0"
},
"files": [
"index.js",
"Readme.md"
]
}

@@ -59,3 +59,7 @@ [![NPM version][npm-img]][npm-url]

"name": "haoxin",
"age": 12345
"age": 12345,
"socials": {
"fb": "facebook.com/include",
"tw": "twitter.com/include"
}
})

@@ -75,2 +79,4 @@ </body>

<label>@@age</label>
<strong>@@socials.fb</strong>
<strong>@@socials.tw</strong>
```

@@ -101,2 +107,4 @@

<label>12345</label>
<strong>facebook.com/include</strong>
<strong>twitter.com/include</strong>
</body>

@@ -153,3 +161,3 @@ </html>

```html
```
@@include('some.html', { "nav": true })

@@ -156,0 +164,0 @@

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