Skip to content
This repository was archived by the owner on Feb 8, 2025. It is now read-only.

Commit 56c6f18

Browse files
authored
feat(contented): add boolean PipelineField (#630)
#### What this PR does / why we need it: Support boolean validation.
1 parent 465e0e4 commit 56c6f18

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/contented-pipeline-md/src/plugins/RemarkFrontmatter.ts

+2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ export function remarkFrontmatterValidate(): Transformer<Parent> {
9292

9393
function isTypeValid(type: string, value: any) {
9494
switch (type.replaceAll(' ', '')) {
95+
case 'boolean':
96+
return typeof value === 'boolean';
9597
case 'string':
9698
return typeof value === 'string';
9799
case 'number':

packages/contented-pipeline/src/PipelineField.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export type PipelineField =
2+
| AbstractField<'boolean', boolean>
23
| AbstractField<'string', string>
34
| AbstractField<'number', number>
45
| AbstractField<'string[]', string[]>

0 commit comments

Comments
 (0)