Elysia Tools
导航
数据格式
环境变量示例
环境变量案例展示 Node.js dotenv 解析中的引号、空值和变量名诊断。
案例
这个案例集合中的条目
引号中的井号与字符串值
引号内井号属于数据,外部注释不属于值;开关仍为字符串而非布尔值。
标签
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"
}
}空值与未声明
空声明仍有键;未声明不等于空字符串,本练习不考虑进程继承的变量。
标签
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
}
}
}变量名诊断
下划线允许,连字符和空格不符合此 Node.js 名称规则;不能据此验证其他 dotenv 实现。
标签
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
]
}工具
经常与该案例搭配使用的工具
相关内容
相关案例集合
相关内容