grunt-jscrambler
Advanced tools
Comparing version 5.2.6 to 5.2.7
{ | ||
"name": "grunt-jscrambler", | ||
"description": "Obfuscate your source files using the JScrambler API.", | ||
"version": "5.2.6", | ||
"version": "5.2.7", | ||
"homepage": "https://github.com/jscrambler/jscrambler", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -28,3 +28,3 @@ # ![jscrambler](https://rawgithub.com/jscrambler/grunt-jscrambler/master/media/jscrambler-logo.png) | ||
In your project's Gruntfile, add a section named `jscrambler` to the data object passed into `grunt.initConfig()`. | ||
#### Relative path | ||
```js | ||
@@ -56,3 +56,40 @@ grunt.initConfig({ | ||
``` | ||
#### Absolute path | ||
```js | ||
grunt.initConfig({ | ||
jscrambler: { | ||
main: { | ||
options: { | ||
keys: { | ||
accessKey: '', | ||
secretKey: '' | ||
}, | ||
applicationId: '', | ||
params: [ | ||
{ | ||
name: 'whitespaceRemoval' | ||
}, | ||
{ | ||
name: 'charToTernaryOperator' | ||
} | ||
] | ||
}, | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: '/example/src/' | ||
src: ['foo.js', 'bar.js'], | ||
dest: '/destination/' | ||
}, | ||
{ | ||
expand: true, | ||
cwd: '/otherexample/' | ||
src: ['foo.js', 'bar.js'], | ||
dest: '/otherdestination/' | ||
} | ||
] | ||
} | ||
}, | ||
}); | ||
``` | ||
You will need your credentials and Application ID in order to protect your application. | ||
@@ -59,0 +96,0 @@ Navigate to your [profile](https://app.jscrambler.com/profile) page and grab your `accessKey` and `secretKey` at the _API Credentials_ section. |
@@ -26,15 +26,9 @@ /** | ||
elem.src.forEach(function (src) { | ||
if (grunt.file.arePathsEquivalent(src, file)) { | ||
var dest = elem.dest; | ||
var lastDestChar = dest[dest.length - 1]; | ||
var destPath; | ||
if (elem.src.length === 1 && lastDestChar !== '/' && lastDestChar !== '\\') { | ||
destPath = dest; | ||
} else { | ||
destPath = path.join(dest, file); | ||
} | ||
grunt.file.write(destPath, buffer); | ||
} else if (elem.dest) { | ||
grunt.file.write(path.join(elem.dest, file), buffer); | ||
if(process.platform !== 'win32' && grunt.file.isPathAbsolute(src)) { | ||
var parsedPath = path.parse(src); | ||
src = src.replace(parsedPath.root, ''); | ||
} | ||
if(grunt.file.arePathsEquivalent(src, file)) { | ||
grunt.file.write(elem.dest, buffer); | ||
} | ||
}); | ||
@@ -41,0 +35,0 @@ }); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
65837
109
210
1