mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-07-12 19:26:13 +09:00
Clean up the oopsie. Rebuild the blank exercises.
This commit is contained in:
+12
-9
@@ -1,14 +1,17 @@
|
||||
'use strict';
|
||||
var path = require('path');
|
||||
var findUp = require('find-up');
|
||||
const path = require('path');
|
||||
const findUp = require('find-up');
|
||||
|
||||
module.exports = function (cwd) {
|
||||
return findUp('package.json', {cwd: cwd}).then(function (fp) {
|
||||
return fp ? path.dirname(fp) : null;
|
||||
});
|
||||
const pkgDir = async cwd => {
|
||||
const filePath = await findUp('package.json', {cwd});
|
||||
return filePath && path.dirname(filePath);
|
||||
};
|
||||
|
||||
module.exports.sync = function (cwd) {
|
||||
var fp = findUp.sync('package.json', {cwd: cwd});
|
||||
return fp ? path.dirname(fp) : null;
|
||||
module.exports = pkgDir;
|
||||
// TODO: Remove this for the next major release
|
||||
module.exports.default = pkgDir;
|
||||
|
||||
module.exports.sync = cwd => {
|
||||
const filePath = findUp.sync('package.json', {cwd});
|
||||
return filePath && path.dirname(filePath);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user