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.2.2 to 0.2.3

2

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

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

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

## Release History
- 0.2.3 - Fix bug when building source files from a different platform. Thanks [wGEric](https://github.com/wGEric)!
- 0.2.0 - Support for expandable paths and debugging. Thanks [@ktmud](https://github.com/ktmud)!

@@ -110,0 +111,0 @@ - 0.1.0 - Updated for grunt 0.4

@@ -24,2 +24,8 @@ /*

/**
* Regex for matching new lines
*/
var newlineRegexp = /\r?\n/g;
/**
* Core `grunt-includes` task

@@ -97,2 +103,15 @@ * Iterates over all source files and calls `recurse(path)` on each

/**
* Returns the new line style for file `p`
*
* @param {String} p
* @return {String}
*/
function newlineStyle(p) {
var matches = grunt.file.read(p).match(newlineRegexp);
return matches[0] || grunt.util.linefeed;
}
/**
* Helper for `includes` builds all includes for `p`

@@ -105,5 +124,6 @@ *

function recurse(p, opts, included) {
var src, next, match, error, comment, compiled;
var src, next, match, error, comment, newline, compiled;
comment = commentStyle(p);
newline = newlineStyle(p);
included = included || [];

@@ -142,3 +162,3 @@

src = grunt.file.read(p).split(grunt.util.linefeed);
src = grunt.file.read(p).split(newline);

@@ -166,3 +186,3 @@ /**

line = comment.replace(/%s/g, 'Begin: ' + next) +
'\n' + line + '\n' + comment.replace(/%s/g, 'End: ' + next);
newline + line + newline + comment.replace(/%s/g, 'End: ' + next);
}

@@ -174,5 +194,5 @@ }

return compiled.join(grunt.util.linefeed);
return compiled.join(newline);
}
};
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