fix(types): improve TypeScript strictness compatibility and modernize test exports

This commit is contained in:
2026-05-01 11:28:39 +00:00
parent 0e0bd5cd6c
commit 94f994ee6c
21 changed files with 2582 additions and 2257 deletions
+8 -6
View File
@@ -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;