Clean up the oopsie. Rebuild the blank exercises.

This commit is contained in:
Michael Frank
2021-05-09 00:39:21 +12:00
parent b984cb4c6f
commit d28d80c46f
1565 changed files with 27186 additions and 199003 deletions
+12 -9
View File
@@ -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);
};