ts-dynamic-query
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -19,5 +19,5 @@ import { FilterDescriptor, FilterDescriptorBase, FilterGroupDescriptor, SortDescriptorBase } from "../models"; | ||
private static getFilterValues; | ||
static getRealFilters(filters: FilterDescriptorBase[]): FilterDescriptorBase[]; | ||
static getRealSorts(sorts: SortDescriptorBase[]): SortDescriptorBase[]; | ||
static getRealFilters<T>(filters: FilterDescriptorBase[]): FilterDescriptorBase[]; | ||
static getRealSorts<T>(sorts: SortDescriptorBase[]): SortDescriptorBase[]; | ||
private static getValue; | ||
} |
@@ -19,5 +19,5 @@ import { FilterDescriptor, FilterDescriptorBase, FilterGroupDescriptor, SortDescriptorBase } from "../models"; | ||
private static getFilterValues; | ||
static getRealFilters(filters: FilterDescriptorBase[]): FilterDescriptorBase[]; | ||
static getRealSorts(sorts: SortDescriptorBase[]): SortDescriptorBase[]; | ||
static getRealFilters<T>(filters: FilterDescriptorBase[]): FilterDescriptorBase[]; | ||
static getRealSorts<T>(sorts: SortDescriptorBase[]): SortDescriptorBase[]; | ||
private static getValue; | ||
} |
{ | ||
"name": "ts-dynamic-query", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -302,3 +302,3 @@ import { | ||
public static getRealFilters( | ||
public static getRealFilters<T>( | ||
filters: FilterDescriptorBase[] | ||
@@ -315,3 +315,3 @@ ): FilterDescriptorBase[] { | ||
case "FilterDescriptor": | ||
result.push(new FilterDescriptor().fromJSON(filterJson)); | ||
result.push(new FilterDescriptor<T>().fromJSON(filterJson)); | ||
break; | ||
@@ -326,3 +326,3 @@ case "FilterGroupDescriptor": | ||
public static getRealSorts( | ||
public static getRealSorts<T>( | ||
sorts: SortDescriptorBase[] | ||
@@ -339,3 +339,3 @@ ): SortDescriptorBase[] { | ||
case "SortDescriptor": | ||
result.push(new SortDescriptor().fromJSON(filterJson)); | ||
result.push(new SortDescriptor<T>().fromJSON(filterJson)); | ||
break; | ||
@@ -342,0 +342,0 @@ } |
@@ -46,6 +46,6 @@ import { SortDescriptorBase } from "./sortDescriptorBase"; | ||
const obj = deserialize<DynamicQuery<T>>(DynamicQuery, json); | ||
this.filters = FilterHelper.getRealFilters(obj.filters); | ||
this.sorts = FilterHelper.getRealSorts(obj.sorts); | ||
this.filters = FilterHelper.getRealFilters<T>(obj.filters); | ||
this.sorts = FilterHelper.getRealSorts<T>(obj.sorts); | ||
return this; | ||
} | ||
} |
@@ -19,3 +19,3 @@ import { expect } from "chai"; | ||
const query = new DynamicQuery(); | ||
const query = new DynamicQuery<Student>(); | ||
query.addFilters(nameFilter); | ||
@@ -31,7 +31,6 @@ const result = query.toJSON(); | ||
it("should to json", () => { | ||
const json = `{"filters":[{"condition":0,"type":"FilterDescriptor","operator":2,"propertyPath":"name","value":"Frank"}],"sorts":[]}` | ||
const result = new DynamicQuery().fromJSON(json); | ||
const json = `{"filters":[{"condition":0,"type":"FilterDescriptor","operator":2,"propertyPath":"name","value":"Frank"}],"sorts":[]}`; | ||
const result = new DynamicQuery<Student>().fromJSON(json); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
148617