Skip to content

Commit

Permalink
JNG-3980 filter empty values (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
noherczeg authored Aug 22, 2024
1 parent 6336669 commit a64625a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export interface SerializerUtil {
serializeDate: (date: Date) => string;
serializeTime: (time: Date) => string;
serializeTimestamp: (timestamp: Date) => string;
deserializeDate: (date: string) => Date;
deserializeTime: (time: string) => Date;
deserializeTimestamp: (timestamp: Date) => Date;
serializeDate: (date?: Date | null) => string | null | undefined;
serializeTime: (time?: Date | null) => string | null | undefined;
serializeTimestamp: (timestamp?: Date | null) => string | null | undefined;
deserializeDate: (date?: string | null) => Date | null | undefined;
deserializeTime: (time?: string | null) => Date | null | undefined;
deserializeTimestamp: (timestamp?: Date | null) => Date | null | undefined;
}

export interface Serializer<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
export enum _BooleanOperation {
equals = 'equals',
notEquals = 'notEquals',
isDefined = 'isDefined',
isUndefined = 'isUndefined',
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export enum _EnumerationOperation {
equals = 'equals',
notEquals = 'notEquals',
isDefined = 'isDefined',
isUndefined = 'isUndefined',
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ export enum _NumericOperation {
greaterOrEqual = 'greaterOrEqual',
equal = 'equal',
notEqual = 'notEqual',
isDefined = 'isDefined',
isUndefined = 'isUndefined',
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ export enum _StringOperation {
notEqual = 'notEqual',
matches = 'matches',
like = 'like',
isDefined = 'isDefined',
isUndefined = 'isUndefined',
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const serviceTimeToUiTime = (timeStr?: any) => {
};

export const serializerUtil: SerializerUtil = {
serializeDate: (date) => uiDateToServiceDate(date)!,
serializeTime: (time) => uiTimeToServiceTime(time)!,
serializeTimestamp: (timestamp) => timestamp.toISOString(),
serializeDate: (date) => uiDateToServiceDate(date),
serializeTime: (time) => uiTimeToServiceTime(time),
serializeTimestamp: (timestamp) => timestamp?.toISOString(),
deserializeDate: (date) => serviceDateToUiDate(date),
deserializeTime: (time) => serviceTimeToUiTime(time),
deserializeTimestamp: (timestamp) => serviceDateToUiDate(timestamp),
Expand Down

0 comments on commit a64625a

Please sign in to comment.