Skip to content

Commit

Permalink
feat(contented): add boolean PipelineField (#630)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

Support boolean validation.
  • Loading branch information
fuxingloh authored Oct 3, 2023
1 parent 465e0e4 commit 56c6f18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function remarkFrontmatterValidate(): Transformer<Parent> {

function isTypeValid(type: string, value: any) {
switch (type.replaceAll(' ', '')) {
case 'boolean':
return typeof value === 'boolean';
case 'string':
return typeof value === 'string';
case 'number':
Expand Down
1 change: 1 addition & 0 deletions packages/contented-pipeline/src/PipelineField.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export type PipelineField =
| AbstractField<'boolean', boolean>
| AbstractField<'string', string>
| AbstractField<'number', number>
| AbstractField<'string[]', string[]>
Expand Down

0 comments on commit 56c6f18

Please sign in to comment.