Elysia Tools
Navegación
Formatos de datos
Ejemplos de variables de entorno
Los ejemplos de variables de entorno cubren comillas, valores vacíos y nombres en dotenv de Node.js.
Ejemplos
Entradas de esta colección
Almohadilla entre comillas y valores de texto
La almohadilla citada es dato, no el comentario externo. El indicador sigue siendo texto.
Etiquetas
synthetic, offline, text-operations
{
"fixture_kind": "synthetic-invalid-placeholders",
"input": "APP_LABEL=\"demo # blue\" # outside comment\nFEATURE_FLAG=false\n",
"operation": "Read using the Node.js dotenv specification; do not load into the process environment.",
"expected": {
"APP_LABEL": "demo # blue",
"FEATURE_FLAG": "false"
}
}Vacío frente a ausente
Una declaración vacía conserva su clave; ausencia no es cadena vacía. Se excluyen variables heredadas.
Etiquetas
synthetic, offline, text-operations
{
"fixture_kind": "synthetic-invalid-placeholders",
"input": "EMPTY=\"\"\nMODE=demo\n",
"operation": "Inspect only this fixture: compare EMPTY with undeclared MISSING.",
"expected": {
"EMPTY": {
"declared": true,
"value": ""
},
"MISSING": {
"declared": false
}
}
}Diagnóstico de nombres de variables
Se permite el guion bajo, no el guion ni el espacio; solo esta regla de Node.js.
Etiquetas
synthetic, offline, text-operations
{
"fixture_kind": "synthetic-invalid-placeholders",
"input": [
"APP_MODE",
"_DEMO",
"DEMO-MODE",
"DEMO MODE"
],
"operation": "Classify names using ^[a-zA-Z_]+[a-zA-Z0-9_]*$; this is a diagnostic list, not a dotenv file.",
"expected": [
true,
true,
false,
false
]
}Herramientas
Herramientas que suelen usarse con este ejemplo
Relacionado
Colecciones de ejemplos relacionadas
Relacionado