Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wildcard for type checking #45

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
run: deno lint

- name: Type check
run: deno check **/**/*.ts
run: deno check **/*.ts
3 changes: 2 additions & 1 deletion examples/delete_movie.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LogicalFilterOperator } from '../types/mod.ts'
import type { DeleteAction } from '../types/persistence_schema/mod.ts'
import moviesSchema from './schemas/movies.ts'

Expand All @@ -10,7 +11,7 @@ const deleteMovieAction: DeleteAction = {
},
},
filter: {
operator: 'eq',
operator: LogicalFilterOperator.EQ,
operands: [
{ type: 'schema', value: '/id' },
{ type: 'data', value: '/id' },
Expand Down
10 changes: 7 additions & 3 deletions examples/delete_movies.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
ConditionalFilterOperator,
LogicalFilterOperator,
} from '../types/mod.ts'
import type { BulkDeleteAction } from '../types/persistence_schema/mod.ts'
import moviesSchema from './schemas/movies.ts'

Expand All @@ -10,17 +14,17 @@ const deleteMovieAction: BulkDeleteAction = {
},
},
filter: {
operator: 'and',
operator: ConditionalFilterOperator.AND,
operands: [
{
operator: 'lt',
operator: LogicalFilterOperator.LT,
operands: [
{ type: 'schema', value: '/release_date' },
{ type: 'data', value: '/release_date' },
],
},
{
operator: 'is_null',
operator: LogicalFilterOperator.IS_NULL,
operands: [{ type: 'schema', value: '/likes' }],
},
],
Expand Down
3 changes: 2 additions & 1 deletion examples/update_movie.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LogicalFilterOperator } from '../types/mod.ts'
import type { UpdateAction } from '../types/persistence_schema/mod.ts'
import moviesSchema from './schemas/movies.ts'

Expand All @@ -13,7 +14,7 @@ const updateMovieAction: UpdateAction = {
required: ['id'],
},
filter: {
operator: 'eq',
operator: LogicalFilterOperator.EQ,
operands: [
{ type: 'schema', value: '/id' },
{ type: 'data', value: '/id' },
Expand Down
3 changes: 2 additions & 1 deletion examples/update_movie_with_characters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LogicalFilterOperator } from '../types/mod.ts'
import type { UpdateAction } from '../types/persistence_schema/mod.ts'
import moviesSchema from './schemas/movies.ts'

Expand Down Expand Up @@ -26,7 +27,7 @@ const updateMovieWithCharactersAction: UpdateAction = {
required: ['id'],
},
filter: {
operator: 'eq',
operator: LogicalFilterOperator.EQ,
operands: [
{ type: 'schema', value: '/id' },
{ type: 'data', value: '/id' },
Expand Down
14 changes: 9 additions & 5 deletions examples/update_movies.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
ConditionalFilterOperator,
LogicalFilterOperator,
} from '../types/mod.ts'
import type { BulkUpdateAction } from '../types/persistence_schema/mod.ts'
import moviesSchema from './schemas/movies.ts'

Expand All @@ -10,24 +14,24 @@ const updateMoviesAction: BulkUpdateAction = {
},
},
filter: {
operator: 'and',
operator: ConditionalFilterOperator.AND,
operands: [
{
operator: 'eq',
operator: LogicalFilterOperator.EQ,
operands: [
{ type: 'schema', value: '/created_at' },
{ type: 'schema', value: '/updated_at' },
],
},
{
operator: 'or',
operator: ConditionalFilterOperator.OR,
operands: [
{
operator: 'is_null',
operator: LogicalFilterOperator.IS_NULL,
operands: [{ type: 'schema', value: '/likes' }],
},
{
operator: 'is_null',
operator: LogicalFilterOperator.IS_NULL,
operands: [{ type: 'schema', value: '/release_date' }],
},
],
Expand Down
4 changes: 2 additions & 2 deletions types/ui_schema/form/example/association.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UISchema } from '../mod.ts'
import type { FormUISchema } from '../mod.ts'

const MovieFormUISchema: UISchema<
const MovieFormUISchema: FormUISchema<
{
name: string
director?: {
Expand Down
4 changes: 2 additions & 2 deletions types/ui_schema/form/example/field_layout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UISchema } from '../mod.ts'
import type { FormUISchema } from '../mod.ts'

const RegisterFormUISchema: UISchema<{
const RegisterFormUISchema: FormUISchema<{
name: string
password: string
profile: {
Expand Down
6 changes: 3 additions & 3 deletions types/ui_schema/form/example/layout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UISchema } from '../mod.ts'
import type { FormUISchema } from '../mod.ts'

const LayoutedFormUISchema: UISchema<{
const LayoutedFormFormUISchema: FormUISchema<{
name: string
signature: string
birthday: string
Expand Down Expand Up @@ -167,4 +167,4 @@ const LayoutedFormUISchema: UISchema<{
},
}

export default LayoutedFormUISchema
export default LayoutedFormFormUISchema
4 changes: 2 additions & 2 deletions types/ui_schema/form/example/simple.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UISchema } from '../mod.ts'
import type { FormUISchema } from '../mod.ts'

const PersonFormUISchema: UISchema<{
const PersonFormUISchema: FormUISchema<{
name: string
gender: string
birthday: string
Expand Down
1 change: 0 additions & 1 deletion types/ui_schema/table/example/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const moviesTableSchema: TableSchema<
}
}
> = {
id: 'movie_list_schema',
columns: {
releaseYear: {
fieldType: 'NumericField',
Expand Down