Skip to content

Commit

Permalink
remove duplicated filters
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Jan 15, 2024
1 parent a4b1b1d commit a2d7148
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/filters/liquid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,40 +182,6 @@ export default function(editor: DataSourceEditor): Filter[] {
<label slot="label">Value to match</label>
</state-editor>
`,
}, {
type: 'filter',
id: 'first',
label: 'first',
validate: (field: Field | null) => !!field && field.kind === 'list',
output: (field: Field | null) => convertKind(field, 'list', 'object'),
apply: (arr) => (arr as unknown[])[0],
options: {},
quotedOptions: [],
}, {
type: 'filter',
id: 'last',
label: 'last',
validate: (field: Field | null) => !!field && field.kind === 'list',
output: (field: Field | null) => convertKind(field, 'list', 'object'),
apply: (arr) => (arr as unknown[])[(arr as unknown[]).length - 1],
options: {},
quotedOptions: [],
}, {
type: 'filter',
id: 'join',
label: 'join',
validate: (field: Field | null) => !!field && field.typeIds.includes('String') && field.kind === 'list',
output: (field: Field | null) => convertKind(field, 'list', 'scalar'),
apply: (arr, options) => (arr as string[]).join(options.separator as string ?? ','),
options: {
separator: ',',
},
quotedOptions: [],
optionsForm: (field: Field | null, options: Options) => html`
<label>Separator
<input type="text" name="separator" placeholder="Separator" value=${options.separator}/>
</label>
`,
}, {
type: 'filter',
id: 'split',
Expand Down

0 comments on commit a2d7148

Please sign in to comment.