Skip to content

Commit

Permalink
Fix TypeScript errors (#6061)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmatown committed Jul 7, 2021
1 parent 5f4ecfc commit 5f3d407
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .changeset/chatty-bulldogs-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@keystone-ui/core': patch
'@keystone-next/types': patch
---

Fixed TypeScript errors in declarations
2 changes: 1 addition & 1 deletion design-system/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"main": "dist/core.cjs.js",
"module": "dist/core.esm.js",
"devDependencies": {
"@types/facepaint": "^1.2.1",
"@types/react": "^17.0.11",
"react": "^17.0.2",
"react-dom": "^17.0.2"
Expand All @@ -17,6 +16,7 @@
"dependencies": {
"@babel/runtime": "^7.14.6",
"@emotion/react": "^11.4.0",
"@types/facepaint": "^1.2.1",
"facepaint": "^1.2.1"
},
"engines": {
Expand Down
14 changes: 7 additions & 7 deletions packages-next/types/src/legacy-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { schema } from '.';
const identity = (x: any) => x;

export const impls = {
equalityConditions<T>(fieldKey: string, f: (a: any) => any = identity) {
equalityConditions<T>(fieldKey: string, f: (a: any) => any = identity): any {
return {
[fieldKey]: (value: T) => ({ [fieldKey]: { equals: f(value) } }),
[`${fieldKey}_not`]: (value: T | null) =>
Expand All @@ -14,7 +14,7 @@ export const impls = {
},
};
},
equalityConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity) {
equalityConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity): any {
return {
[`${fieldKey}_i`]: (value: string) => ({
[fieldKey]: { equals: f(value), mode: 'insensitive' },
Expand All @@ -31,7 +31,7 @@ export const impls = {
};
},

inConditions<T>(fieldKey: string, f: (a: any) => any = identity) {
inConditions<T>(fieldKey: string, f: (a: any) => any = identity): any {
return {
[`${fieldKey}_in`]: (value: (T | null)[]) =>
(value.includes(null)
Expand All @@ -56,7 +56,7 @@ export const impls = {
};
},

orderingConditions<T>(fieldKey: string, f: (a: any) => any = identity) {
orderingConditions<T>(fieldKey: string, f: (a: any) => any = identity): any {
return {
[`${fieldKey}_lt`]: (value: T) => ({ [fieldKey]: { lt: f(value) } }),
[`${fieldKey}_lte`]: (value: T) => ({ [fieldKey]: { lte: f(value) } }),
Expand All @@ -65,7 +65,7 @@ export const impls = {
};
},

containsConditions(fieldKey: string, f: (a: any) => any = identity) {
containsConditions(fieldKey: string, f: (a: any) => any = identity): any {
return {
[`${fieldKey}_contains`]: (value: string) => ({ [fieldKey]: { contains: f(value) } }),
[`${fieldKey}_not_contains`]: (value: string) => ({
Expand All @@ -74,7 +74,7 @@ export const impls = {
};
},

stringConditions(fieldKey: string, f: (a: any) => any = identity) {
stringConditions(fieldKey: string, f: (a: any) => any = identity): any {
return {
...impls.containsConditions(fieldKey, f),
[`${fieldKey}_starts_with`]: (value: string) => ({ [fieldKey]: { startsWith: f(value) } }),
Expand All @@ -88,7 +88,7 @@ export const impls = {
};
},

stringConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity) {
stringConditionsInsensitive(fieldKey: string, f: (a: any) => any = identity): any {
return {
[`${fieldKey}_contains_i`]: (value: string) => ({
[fieldKey]: { contains: f(value), mode: 'insensitive' },
Expand Down

1 comment on commit 5f3d407

@vercel
Copy link

@vercel vercel bot commented on 5f3d407 Jul 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.