Skip to content
This repository has been archived by the owner on Oct 31, 2018. It is now read-only.

Commit

Permalink
Update: Remove options merging and lodash.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkemperman authored and phated committed May 5, 2017
1 parent 89c5465 commit 3b2c641
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
18 changes: 5 additions & 13 deletions index.js
Expand Up @@ -2,7 +2,6 @@

var path = require('path');

var assign = require('lodash.assign');
var fs = require('graceful-fs');
var through = require('through2');
var koalas = require('koalas');
Expand Down Expand Up @@ -56,16 +55,9 @@ function dest(outFolder, opt) {

function normalize(file, enc, cb) {
var defaultMode = file.stat ? file.stat.mode : null;

var options = assign({}, opt, {
cwd: koalas(string(opt.cwd, file), process.cwd()),
mode: koalas(number(opt.mode, file), defaultMode),
overwrite: koalas(boolean(opt.overwrite, file), true),
});

options.flag = (options.overwrite ? 'w' : 'wx');

var cwd = path.resolve(options.cwd);
var mode = koalas(number(opt.mode, file), defaultMode);
var flag = koalas(boolean(opt.overwrite, file), true) ? 'w' : 'wx';
var cwd = path.resolve(koalas(string(opt.cwd, file), process.cwd()));

var outFolderPath = string(outFolder, file);
if (!outFolderPath) {
Expand All @@ -76,8 +68,8 @@ function dest(outFolder, opt) {

// Wire up new properties
file.stat = (file.stat || new fs.Stats());
file.stat.mode = options.mode;
file.flag = options.flag;
file.stat.mode = mode;
file.flag = flag;
file.cwd = cwd;
file.base = basePath;
file.path = writePath;
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -26,7 +26,6 @@
"dependencies": {
"graceful-fs": "^4.1.4",
"koalas": "^1.0.1",
"lodash.assign": "^4.1.0",
"through2": "^2.0.1",
"value-or-function": "^2.0.0",
"vinyl": "^2.0.2"
Expand Down

0 comments on commit 3b2c641

Please sign in to comment.