yini-parser
Version:
Readable configuration without YAML foot-guns or JSON noise. The official Node.js parser for YINI config format — An INI-inspired configuration format with clear nesting, explicit types, and predictable parsing.
38 lines (37 loc) • 2.52 kB
TypeScript
/**
* Development-only YINI samples with intentional defects.
*
* These inputs are used for quick manual testing during development
* via src/dev/.
*
* Each sample contains ONE clearly documented defect.
* They are NOT part of the automated test suite.
*
* All real testing belongs in /tests/.
*/
/**
* Invalid assignment operator (`:=` instead of `=`).
*/
export declare const defectInvalidAssignmentOperator = "\n^ App\nname = 'Hello'\ntxt := 'World' // INVALID: assignment operator must be \"=\"\n";
/**
* Invalid section name (starts with a number and contains hyphen).
*/
export declare const defectInvalidSectionName = "\n^ App\nname = \"My Application\"\n\n^ 20-Database // INVALID: section name must start with a letter or underscore\nhost = \"localhost\"\nport = 5432\n";
/**
* Invalid numeric literal (double underscore).
*/
export declare const defectInvalidNumericLiteral = "\n^ App\nname = \"Demo\"\n\n^ Database\nhost = \"localhost\"\nport = 5432\n\nsomeKey = 33__33 // INVALID: malformed numeric literal\n";
/**
* Duplicate key in the same section.
*/
export declare const defectDuplicateKey = "\n^ App\nname = \"Demo\"\nname = \"Override\" // INVALID: duplicate key in same section\n";
/**
* Section level jump (^^ without parent ^).
*/
export declare const defectSectionLevelJump = "\n^^ Logging // INVALID: section level jumps without parent\nenabled = true\n";
/**
* Unterminated string literal.
*/
export declare const defectUnterminatedString = "\n^ App\nname = \"Demo\nversion = \"1.0.0\"\n";
export declare const defectConfigCombo3 = "\n^ App\nname = \"Combo defects sample\"\n\nmode := \"dev\" // INVALID #1: ':=' is not a valid assignment operator (must be '=')\n\n^ 2Database // INVALID #2: section name starts with a digit (must start with A-Z/_ or be backticked)\nhost = \"localhost\"\n\nports = [80, 443, 8080 // INVALID #3: missing closing ']' in array literal\n";
export declare const defectConfig2Combo3 = "\n^ App\nname = \"ComboTest\"\nversion = 1.0\n\n ^^ Database\n host = \"localhost\"\n port = 54_32 // INVALID number format: underscores not allowed inside numbers\n\n auth = { user: \"admin\", pass: \"secret\" }\n\n ^^^ Logging\n enabled = maybe // INVALID boolean: only true/false/on/off/yes/no allowed\n\n ^ Network\n timeout = 30\n\n^ Server\n host = \"0.0.0.0\"\n port := 8080 // INVALID assignment operator: must use \"=\" not \":=\"\n\n ^^ Security\n useTLS = true\n";