const buildProperty = Effect.fnUntraced(function* (propertySignature) {
// ...
return Match.value<SupportedSyntaxKind>(kind).pipe(
Match.withReturnType<TypePropertyShape>(),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.STRING_KEYWORD), (kind) => ({
kind,
optional,
})),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.NUMBER_KEYWORD), (kind) => ({
kind,
optional,
})),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.BOOLEAN_KEYWORD), (kind) => ({
kind,
optional,
})),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.TYPE_REFERENCE), (kind) => ({
kind,
refName: typeNode.getText(),
optional,
})),
Match.exhaustive,
);
});
const buildProperty = Effect.fnUntraced(function* (propertySignature) {
// ...
return Match.value<SupportedSyntaxKind>(kind).pipe(
Match.withReturnType<TypePropertyShape>(),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.STRING_KEYWORD), (kind) => ({
kind,
optional,
})),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.NUMBER_KEYWORD), (kind) => ({
kind,
optional,
})),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.BOOLEAN_KEYWORD), (kind) => ({
kind,
optional,
})),
Match.when(Match.is(SUPPORTED_SYNTAX_KIND.TYPE_REFERENCE), (kind) => ({
kind,
refName: typeNode.getText(),
optional,
})),
Match.exhaustive,
);
});