(
lines: string[],
structVar: string,
fieldNames: Map<string, string>,
term: GoJSONMatchTerm,
indent: string,
varPrefix: string
)
| 1625 | } |
| 1626 | |
| 1627 | function pushGoJSONPositiveTermLines( |
| 1628 | lines: string[], |
| 1629 | structVar: string, |
| 1630 | fieldNames: Map<string, string>, |
| 1631 | term: GoJSONMatchTerm, |
| 1632 | indent: string, |
| 1633 | varPrefix: string |
| 1634 | ): void { |
| 1635 | const propName = goJSONMatchPathProperty(term.path); |
| 1636 | const fieldExpr = `${structVar}.${fieldNames.get(propName)!}`; |
| 1637 | if (term.kind === "propertyExists") { |
| 1638 | lines.push(`${indent}if ${fieldExpr} == nil {`); |
| 1639 | lines.push(`${indent}\treturn false`); |
| 1640 | lines.push(`${indent}}`); |
| 1641 | return; |
| 1642 | } |
| 1643 | |
| 1644 | lines.push(`${indent}if ${fieldExpr} == nil {`); |
| 1645 | lines.push(`${indent}\treturn false`); |
| 1646 | lines.push(`${indent}}`); |
| 1647 | pushGoJSONStringMatchLines(lines, fieldExpr, term.values, indent, varPrefix); |
| 1648 | } |
| 1649 | |
| 1650 | function pushGoJSONNegativePropertyLines( |
| 1651 | lines: string[], |
no test coverage detected
searching dependent graphs…