@app-config/node
Advanced tools
Comparing version
@@ -17,3 +17,3 @@ "use strict"; | ||
} | ||
const inferredFileType = await core_1.guessFileType(value); | ||
const inferredFileType = await (0, core_1.guessFileType)(value); | ||
logging_1.logger.verbose(`EnvironmentSource guessed that ${this.variableName} is ${inferredFileType} FileType`); | ||
@@ -20,0 +20,0 @@ return [value, inferredFileType]; |
@@ -13,8 +13,8 @@ "use strict"; | ||
super(); | ||
this.filePath = path_1.resolve(filePath); | ||
this.fileType = fileType !== null && fileType !== void 0 ? fileType : core_1.filePathAssumedType(this.filePath); | ||
this.filePath = (0, path_1.resolve)(filePath); | ||
this.fileType = fileType !== null && fileType !== void 0 ? fileType : (0, core_1.filePathAssumedType)(this.filePath); | ||
} | ||
async readContents() { | ||
try { | ||
const content = await fs_extra_1.readFile(this.filePath); | ||
const content = await (0, fs_extra_1.readFile)(this.filePath); | ||
logging_1.logger.verbose(`FileSource read ${this.filePath}`); | ||
@@ -54,3 +54,3 @@ return [content.toString('utf-8'), this.fileType]; | ||
this.fileExtensions = fileExtensions !== null && fileExtensions !== void 0 ? fileExtensions : defaultFileExtensions; | ||
this.environmentOptions = environment_1.asEnvOptions(environmentOverrideOrFileExtensions, environmentAliasesOrEnvironmentOptions, environmentSourceNames); | ||
this.environmentOptions = (0, environment_1.asEnvOptions)(environmentOverrideOrFileExtensions, environmentAliasesOrEnvironmentOptions, environmentSourceNames); | ||
} | ||
@@ -60,5 +60,5 @@ } | ||
async resolveSource(context) { | ||
const environment = environment_1.currentEnvFromContext(context !== null && context !== void 0 ? context : {}, this.environmentOptions); | ||
const environment = (0, environment_1.currentEnvFromContext)(context !== null && context !== void 0 ? context : {}, this.environmentOptions); | ||
const aliasesForCurrentEnv = environment | ||
? environment_1.aliasesFor(environment, this.environmentOptions.aliases) | ||
? (0, environment_1.aliasesFor)(environment, this.environmentOptions.aliases) | ||
: []; | ||
@@ -79,3 +79,3 @@ const filesToTry = []; | ||
for (const filepath of filesToTry) { | ||
if (await fs_extra_1.pathExists(filepath)) { | ||
if (await (0, fs_extra_1.pathExists)(filepath)) { | ||
logging_1.logger.verbose(`FlexibleFileSource found successful match at ${filepath}`); | ||
@@ -99,5 +99,5 @@ return new FileSource(filepath); | ||
// resolve filepaths that are relative to the current FileSource | ||
if (!path_1.isAbsolute(filepath) && source instanceof FileSource) { | ||
resolvedPath = path_1.join(path_1.dirname(source.filePath), filepath); | ||
if (path_1.resolve(source.filePath) === resolvedPath) { | ||
if (!(0, path_1.isAbsolute)(filepath) && source instanceof FileSource) { | ||
resolvedPath = (0, path_1.join)((0, path_1.dirname)(source.filePath), filepath); | ||
if ((0, path_1.resolve)(source.filePath) === resolvedPath) { | ||
throw new core_1.AppConfigError(`An extension tried to resolve to it's own file (${resolvedPath}).`); | ||
@@ -104,0 +104,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
async function promptUser(options) { | ||
const { named } = await prompts_1.default(Object.assign(Object.assign({}, options), { name: 'named' })); | ||
const { named } = await (0, prompts_1.default)(Object.assign(Object.assign({}, options), { name: 'named' })); | ||
return named; | ||
@@ -14,0 +14,0 @@ } |
{ | ||
"name": "@app-config/node", | ||
"description": "Node.js API for @app-config", | ||
"version": "2.7.1", | ||
"version": "2.7.2", | ||
"license": "MPL-2.0", | ||
@@ -33,4 +33,4 @@ "author": { | ||
"dependencies": { | ||
"@app-config/core": "^2.7.1", | ||
"@app-config/logging": "^2.7.1", | ||
"@app-config/core": "^2.7.2", | ||
"@app-config/logging": "^2.7.2", | ||
"@types/prompts": "2", | ||
@@ -41,3 +41,3 @@ "fs-extra": "9", | ||
"devDependencies": { | ||
"@app-config/test-utils": "^2.7.1", | ||
"@app-config/test-utils": "^2.7.2", | ||
"@types/fs-extra": "9" | ||
@@ -44,0 +44,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53609
0.24%Updated
Updated