( rule: PackedLDMLRule, visited: Set<string> )
| 255 | } |
| 256 | |
| 257 | function importedTailorings( |
| 258 | rule: PackedLDMLRule, |
| 259 | visited: Set<string> |
| 260 | ): readonly TailoringEntry[] { |
| 261 | if ( |
| 262 | rule[0] !== 'setting' || |
| 263 | rule[1] !== 'import' || |
| 264 | typeof rule[2] !== 'string' |
| 265 | ) { |
| 266 | return [] |
| 267 | } |
| 268 | // LDML [import] pulls rules from another language tag / collation type. |
| 269 | // The visited set prevents recursive imports from looping. |
| 270 | // https://www.unicode.org/reports/tr35/tr35-collation.html#Special_Purpose_Commands |
| 271 | const imported = IMPORT_COLLATION_RE.exec(rule[2]) |
| 272 | return imported ? tailoringEntries(imported[1], imported[2], visited) : [] |
| 273 | } |
| 274 | |
| 275 | function addTailoredRelation( |
| 276 | entries: TailoringEntry[], |
no test coverage detected