(state, dts, kind)
| 370 | } |
| 371 | |
| 372 | function getNodes(state, dts, kind) { |
| 373 | const compatibles = state.compatible.get(kind); |
| 374 | if (!compatibles) |
| 375 | return []; |
| 376 | |
| 377 | return DTSParser.filter(dts, node => { |
| 378 | const compatible = node.properties?.compatible; |
| 379 | if (!compatible) |
| 380 | return; |
| 381 | |
| 382 | const status = node.properties.status?.value?.value ?? "okay" |
| 383 | if ("okay" !== status) |
| 384 | return; |
| 385 | |
| 386 | if ("string" === compatible.value.type) |
| 387 | return compatibles.includes(compatible.value.value); |
| 388 | |
| 389 | if ("string-array" === compatible.value.type) |
| 390 | return compatible.value.value.some(value => compatibles.includes(value)); |
| 391 | }); |
| 392 | } |
| 393 | |
| 394 | function doAliases(state, dts) { |
| 395 | const root = dts.nodes['/']; |
no test coverage detected