fix(AppData, dev dependencies, settings): Improve boolean conversion in AppData, update @types/node dependency, and add local settings file.

This commit is contained in:
2025-08-15 12:26:50 +00:00
parent c74ded8d5d
commit 33a5b6b11c
5 changed files with 71 additions and 176 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/npmextra',
version: '5.1.3',
version: '5.1.4',
description: 'A utility to enhance npm with additional configuration, tool management capabilities, and a key-value store for project setups.'
}

View File

@@ -135,9 +135,19 @@ export class AppData<T = any> {
}
// lets format the env value
if (envValue) {
if (typeof envValue === 'string' && convert === 'boolean') {
envValue = envValue === 'true';
if (envValue !== undefined && envValue !== null) {
if (convert === 'boolean') {
// Handle both string and boolean inputs
if (typeof envValue === 'boolean') {
// Already boolean, keep as-is
envValue = envValue;
} else if (typeof envValue === 'string') {
// Convert string to boolean
envValue = envValue === 'true';
} else {
// Any other type, convert to boolean
envValue = Boolean(envValue);
}
}
if (
typeof envValue === 'string' &&