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
1
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.6.0 to 0.7.0

28

index.js

@@ -96,17 +96,7 @@ 'use strict';

function include(file, text) {
var filebase = basepath === "@file" ? path.dirname(file.path) : basepath === "@root" ? process.cwd() : basepath;
var matches = includeRegExp.exec(text);
switch (basepath) {
case '@file':
basepath = path.dirname(file.path);
break;
case '@root':
basepath = process.cwd();
break;
default:
break;
}
filebase = path.resolve(process.cwd(), filebase);
basepath = path.resolve(process.cwd(), basepath);
// for checking if we are not including the current file again

@@ -117,3 +107,3 @@ var currentFilename = path.resolve(file.base, file.path);

var match = matches[0];
var includePath = path.resolve(basepath, matches[1]);
var includePath = path.resolve(filebase, matches[1]);

@@ -137,2 +127,14 @@ if (currentFilename.toLowerCase() === includePath.toLowerCase()) {

var recMatches = includeRegExp.exec(includeContent);
if (recMatches && basepath == "@file") {
var recFile = new gutil.File({
cwd: process.cwd(),
base: file.base,
path: includePath,
contents: new Buffer(includeContent)
});
recFile = include(recFile, includeContent);
includeContent = String(recFile.contents);
}
text = text.replace(match, includeContent);

@@ -139,0 +141,0 @@

{
"name": "gulp-file-include",
"version": "0.6.0",
"version": "0.7.0",
"description": "a gulp plugin for file include",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -41,4 +41,2 @@ [![NPM version][npm-img]][npm-url]

**important**: `@file` is relative to the `file` pass to gulp, not the file `include expression` in, see [example](example)
```js

@@ -45,0 +43,0 @@ fileinclude({

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