@umijs/utils 4.0.0-beta.16 → 4.0.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/tryPaths.d.ts +1 -0
- package/dist/tryPaths.js +11 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -29,5 +29,6 @@ export * from './importLazy';
|
|
|
29
29
|
export * from './npmClient';
|
|
30
30
|
export * from './randomColor/randomColor';
|
|
31
31
|
export * as register from './register';
|
|
32
|
+
export * from './tryPaths';
|
|
32
33
|
export * from './winPath';
|
|
33
34
|
export { address, axios, chalk, cheerio, chokidar, clipboardy, crossSpawn, debug, deepmerge, fsExtra, glob, Generator, BaseGenerator, generateFile, installDeps, lodash, logger, Mustache, pkgUp, portfinder, prompts, resolve, rimraf, semver, stripAnsi, updatePackageJSON, yParser, };
|
package/dist/index.js
CHANGED
|
@@ -85,4 +85,5 @@ __exportStar(require("./importLazy"), exports);
|
|
|
85
85
|
__exportStar(require("./npmClient"), exports);
|
|
86
86
|
__exportStar(require("./randomColor/randomColor"), exports);
|
|
87
87
|
exports.register = __importStar(require("./register"));
|
|
88
|
+
__exportStar(require("./tryPaths"), exports);
|
|
88
89
|
__exportStar(require("./winPath"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tryPaths(paths: string[]): string | undefined;
|
package/dist/tryPaths.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tryPaths = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
function tryPaths(paths) {
|
|
6
|
+
for (const path of paths) {
|
|
7
|
+
if ((0, fs_1.existsSync)(path))
|
|
8
|
+
return path;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.tryPaths = tryPaths;
|
package/package.json
CHANGED