"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.children = void 0;
var gluegun_1 = require("gluegun");
var pathlib = require("path");
/**
 * A lot like gluegun's filesystem.subdirectories(), but gets files too.
 *
 * This should probably go in Gluegun.
 *
 * Right about right here: https://github.com/infinitered/gluegun/blob/master/src/toolbox/filesystem-tools.ts#L52
 */
function children(path, isRelative, matching) {
    if (isRelative === void 0) { isRelative = false; }
    if (matching === void 0) { matching = "*"; }
    var dirs = gluegun_1.filesystem.cwd(path).find({
        matching: matching,
        directories: true,
        recursive: false,
        files: true,
    });
    if (isRelative) {
        return dirs;
    }
    else {
        return dirs.map(function (dir) { return pathlib.join(path, dir); });
    }
}
exports.children = children;
//# sourceMappingURL=filesystem-ext.js.map