Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-includes

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-includes - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

2

package.json
{
"name": "grunt-includes",
"description": "Include other files within a file.",
"version": "0.3.0",
"version": "0.3.1",
"author": "vanetix <matmcfarland@gmail.com>",

@@ -6,0 +6,0 @@ "main": "Gruntfile.js",

@@ -37,5 +37,14 @@ # grunt-includes [![Build Status](https://travis-ci.org/vanetix/grunt-includes.png?branch=master)](https://travis-ci.org/vanetix/grunt-includes)

Type: `RegExp`
Default: `/^(\s*)include\s+"(\S+)"\s*$/`
Matches: `include "some/file.html"`
Sets the regular expression used to find *include* statements. The file path should always be the `$1`.
Sets the regular expression used to find *include* statements.
A regex group is used to identify the important parts of the include statement. When constructing your own regex, it can contain up to two groups (denoted by parentheses `()` in the regular expression):
1. The indentation whitespace to be appended to the front of the included file's contents
2. The file location
**All regular expressions used must contain at least one group.** If only one group is used, it will be assumed to contain the file path.
## Usage

@@ -42,0 +51,0 @@

@@ -138,3 +138,3 @@ /*

function recurse(p, opts, included, indents) {
var src, next, match, error, comment, newline, compiled;
var src, next, match, error, comment, newline, compiled, indent, fileLocation;

@@ -191,5 +191,13 @@ indents = indents || '';

if(match) {
next = path.join(path.dirname(p), match[2]);
line = recurse(next, opts, included, indents + match[1]);
fileLocation = match[2];
indent = match[1];
if (!fileLocation) {
fileLocation = indent;
indent = '';
}
next = path.join(path.dirname(p), fileLocation);
line = recurse(next, opts, included, indents + indent);
/**

@@ -196,0 +204,0 @@ * Include debug comments if `opts.debug`

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