Skip to content

Commit 871d0f9

Browse files
authored
Merge pull request #17 from TrySound/drop-object-path
Drop object-path
2 parents 401b707 + 95a5b84 commit 871d0f9

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict';
22

3-
var path = require('path'),
4-
objectPath = require('object-path');
3+
var path = require('path');
54

65
/**
76
* Infer the compilation context directory from options.
@@ -11,8 +10,8 @@ var path = require('path'),
1110
*/
1211
function getContextDirectory() {
1312
/* jshint validthis:true */
14-
var context = objectPath.get(this, 'options.context');
13+
var context = this.options ? this.options.context : null;
1514
return !!context && path.resolve(context) || process.cwd();
1615
}
1716

18-
module.exports = getContextDirectory;
17+
module.exports = getContextDirectory;

codec/utility/get-output-directory.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict';
22

33
var path = require('path'),
4-
fs = require('fs'),
5-
objectPath = require('object-path');
4+
fs = require('fs');
65

76
var getContextDirectory = require('./get-context-directory');
87

@@ -14,10 +13,10 @@ var getContextDirectory = require('./get-context-directory');
1413
*/
1514
function getOutputDirectory() {
1615
/* jshint validthis:true */
17-
var base = objectPath.get(this, 'options.output.directory'),
16+
var base = this.options && this.options.output ? this.options.output.directory : null,
1817
absBase = !!base && path.resolve(getContextDirectory.call(this), base),
1918
isValid = !!absBase && fs.existsSync(absBase) && fs.statSync(absBase).isDirectory();
2019
return isValid ? absBase : undefined;
2120
}
2221

23-
module.exports = getOutputDirectory;
22+
module.exports = getOutputDirectory;

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
"homepage": "https://github.com/bholloway/adjust-sourcemap-loader",
2828
"dependencies": {
2929
"loader-utils": "^2.0.0",
30-
"object-path": "0.11.4",
3130
"regex-parser": "2.2.10"
3231
},
3332
"devDependencies": {

0 commit comments

Comments
 (0)