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

grunt-contrib-compress

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-compress - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

.travis.yml

8

package.json
{
"name": "grunt-contrib-compress",
"description": "Compress files and folders.",
"version": "0.2.2",
"version": "0.3.0",
"homepage": "https://github.com/gruntjs/grunt-contrib-compress",

@@ -35,7 +35,7 @@ "author": {

"rimraf": "~2.0.2",
"grunt-contrib-lib": "~0.2.0"
"grunt-contrib-lib": "~0.3.0"
},
"devDependencies": {
"grunt": "~0.3.15",
"grunt-contrib-clean": "~0.2.0"
"grunt-contrib-clean": "~0.3.0"
},

@@ -45,2 +45,2 @@ "keywords": [

]
}
}

@@ -1,2 +0,2 @@

# grunt-contrib-compress
# grunt-contrib-compress [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-compress.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-compress)
> Compress files and folders (part of the [grunt-contrib](https://github.com/gruntjs/grunt-contrib) collection). Submitted by [Chris Talkington](https://github.com/ctalkington).

@@ -38,3 +38,3 @@

As of v0.2.2, this is now automatically detected per dest:src pair but can be overridden per target if desired.
As of v0.3.0, this is now automatically detected per dest:src pair but can be overridden per target if desired.

@@ -79,3 +79,4 @@ ##### basePath ```string```

* 2012/09/24 - v0.3.0 - general cleanup and consolidation. global options depreciated.
* 2012/09/18 - v0.2.2 - test refactoring. no valid source check. automatic mode detection.
* 2012/09/10 - v0.2.0 - refactored from grunt-contrib into individual repo.

@@ -23,5 +23,2 @@ /*

var _ = grunt.util._;
var async = grunt.util.async;
var kindOf = grunt.util.kindOf;
var helpers = require('grunt-contrib-lib').init(grunt);

@@ -47,10 +44,3 @@

if (options.basePath && kindOf(options.basePath) === 'string') {
options.basePath = path.normalize(options.basePath);
options.basePath = _(options.basePath).trim(path.sep);
} else {
options.basePath = false;
}
if (options.rootDir && kindOf(options.rootDir) === 'string') {
if (grunt.util.kindOf(options.rootDir) === 'string' && options.rootDir.length >= 1) {
options.rootDir = path.normalize(options.rootDir).split(path.sep)[0];

@@ -67,3 +57,3 @@ } else {

async.forEachSeries(this.files, function(file, next) {
grunt.util.async.forEachSeries(this.files, function(file, next) {
srcFiles = grunt.file.expandFiles(file.src);

@@ -78,3 +68,3 @@ destDir = path.dirname(file.dest);

if (_.include(supportedModes, mode) === false) {
if (grunt.util._.include(supportedModes, mode) === false) {
grunt.fail.warn('Mode ' + mode.cyan + ' not supported.');

@@ -110,20 +100,4 @@ }

var findBasePath = function(srcFiles) {
var basePaths = [];
var dirName;
srcFiles.forEach(function(srcFile) {
dirName = path.dirname(srcFile);
dirName = path.normalize(dirName);
basePaths.push(dirName.split(path.sep));
});
basePaths = _.intersection.apply([], basePaths);
return path.join.apply(path, basePaths);
};
var autoDetectMode = function(dest) {
if (_.endsWith(dest, '.tar.gz')) {
if (grunt.util._.endsWith(dest, '.tar.gz')) {
return 'tgz';

@@ -149,3 +123,3 @@ }

var basePath = options.basePath || findBasePath(srcFiles);
var basePath = helpers.findBasePath(srcFiles, options.basePath);
var rootDir = options.rootDir;

@@ -160,7 +134,7 @@

relative = '';
} else if (basePath && basePath.length > 1) {
relative = _(relative).chain().strRight(basePath).trim(path.sep).value();
} else if (basePath && basePath.length >= 1) {
relative = grunt.util._(relative).strRight(basePath).trim(path.sep);
}
if (rootDir && rootDir.length > 1) {
if (rootDir && rootDir.length >= 1) {
relative = path.join(options.rootDir, relative);

@@ -193,3 +167,3 @@ }

var zipFiles = _.uniq(copyResult[0]);
var zipFiles = grunt.util._.uniq(copyResult[0]);
var zipMeta = copyResult[1];

@@ -234,7 +208,7 @@

if (options.rootDir && options.rootDir.length > 1) {
if (options.rootDir && options.rootDir.length >= 1) {
tarDir = options.rootDir;
options.rootDir = false;
} else {
tarDir = _(destFile).strLeftBack(destFileExt);
tarDir = grunt.util._(destFile).strLeftBack(destFileExt);
}

@@ -241,0 +215,0 @@

Sorry, the diff of this file is not supported yet

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