- HERENCIA-SIMCO.md actualizado con directivas v3.7 y v3.8 - Actualizaciones de configuracion Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
10 lines
317 B
JavaScript
10 lines
317 B
JavaScript
export const numberSelector = (obj, key, type) => {
|
|
if (!(key in obj))
|
|
return undefined;
|
|
const numberValue = parseInt(obj[key], 10);
|
|
if (Number.isNaN(numberValue)) {
|
|
throw new TypeError(`Cannot load ${type} '${key}'. Expected number, got '${obj[key]}'.`);
|
|
}
|
|
return numberValue;
|
|
};
|