Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit f02f1ec

Browse files
committed
Consistency of undefined fallback
1 parent 4c43e2c commit f02f1ec

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/convert.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ module.exports = function convert(config) {
808808
value: convertChild(node.initializer),
809809
computed: nodeUtils.isComputedProperty(node.name),
810810
static: nodeUtils.hasStaticModifierFlag(node),
811-
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) ? true : undefined
811+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined
812812
});
813813

814814
if (node.type) {
@@ -1291,9 +1291,9 @@ module.exports = function convert(config) {
12911291
range: [node.getStart(), node.end],
12921292
loc: nodeUtils.getLoc(node, ast),
12931293
accessibility: nodeUtils.getTSNodeAccessibility(node),
1294-
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) ? true : undefined,
1294+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
12951295
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node),
1296-
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) ? true : undefined,
1296+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined,
12971297
parameter: result
12981298
};
12991299
}
@@ -1946,9 +1946,9 @@ module.exports = function convert(config) {
19461946
key: convertChild(node.name),
19471947
params: convertParameters(node.parameters),
19481948
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null,
1949-
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) ? true : undefined,
1949+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
19501950
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node),
1951-
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) ? true : undefined
1951+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined
19521952
});
19531953

19541954
const accessibility = nodeUtils.getTSNodeAccessibility(node);
@@ -1971,9 +1971,9 @@ module.exports = function convert(config) {
19711971
key: convertChild(node.name),
19721972
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : undefined,
19731973
initializer: convertChild(node.initializer) || undefined,
1974-
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) ? true : undefined,
1975-
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) ? true : undefined,
1976-
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) ? true : undefined
1974+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
1975+
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node) || undefined,
1976+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined
19771977
});
19781978

19791979
const accessibility = nodeUtils.getTSNodeAccessibility(node);
@@ -1989,9 +1989,9 @@ module.exports = function convert(config) {
19891989
type: AST_NODE_TYPES.TSIndexSignature,
19901990
index: convertChild(node.parameters[0]),
19911991
typeAnnotation: (node.type) ? convertTypeAnnotation(node.type) : null,
1992-
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) ? true : undefined,
1992+
readonly: nodeUtils.hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined,
19931993
static: nodeUtils.hasModifier(SyntaxKind.StaticKeyword, node),
1994-
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) ? true : undefined
1994+
export: nodeUtils.hasModifier(SyntaxKind.ExportKeyword, node) || undefined
19951995
});
19961996

19971997
const accessibility = nodeUtils.getTSNodeAccessibility(node);

0 commit comments

Comments
 (0)