fix(types): improve TypeScript strictness compatibility and modernize test exports
This commit is contained in:
@@ -5,13 +5,15 @@ import * as plugins from './smartstring.plugins.js';
|
||||
* @param envArrayArg
|
||||
* @returns {}
|
||||
*/
|
||||
export const makeEnvObject = function (envArrayArg: string[]) {
|
||||
let returnObject = {};
|
||||
let regexString = /(.*)=(.*)/;
|
||||
export const makeEnvObject = function (envArrayArg: string[]): Record<string, string> {
|
||||
const returnObject: Record<string, string> = {};
|
||||
const regexString = /(.*)=(.*)/;
|
||||
if (typeof envArrayArg !== 'undefined') {
|
||||
for (let envKey in envArrayArg) {
|
||||
let regexMatches = regexString.exec(envArrayArg[envKey]);
|
||||
returnObject[regexMatches[1]] = regexMatches[2];
|
||||
for (const envString of envArrayArg) {
|
||||
const regexMatches = regexString.exec(envString);
|
||||
if (regexMatches) {
|
||||
returnObject[regexMatches[1]] = regexMatches[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnObject;
|
||||
|
||||
Reference in New Issue
Block a user