c2-mongoose 2.1.218 → 2.1.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,5 +24,6 @@ declare class SearcherFlow<D> {
|
|
|
24
24
|
search(model: mongoose.Model<any>, options: SearchOptions): Promise<SearchResponse<D>>;
|
|
25
25
|
transformObject(originalObject: any): any;
|
|
26
26
|
buildDefaultFilters(objectSearch: any): any;
|
|
27
|
+
isValidObjectId(value: string): boolean;
|
|
27
28
|
}
|
|
28
29
|
export default SearcherFlow;
|
|
@@ -276,6 +276,10 @@ var SearcherFlow = /** @class */ (function () {
|
|
|
276
276
|
delete filters['$and'];
|
|
277
277
|
return filters;
|
|
278
278
|
};
|
|
279
|
+
SearcherFlow.prototype.isValidObjectId = function (value) {
|
|
280
|
+
var objectIdPattern = /^[0-9a-fA-F]{24}$/;
|
|
281
|
+
return objectIdPattern.test(value);
|
|
282
|
+
};
|
|
279
283
|
return SearcherFlow;
|
|
280
284
|
}());
|
|
281
285
|
exports.default = SearcherFlow;
|
package/package.json
CHANGED
package/src/flow/SearcherFlow.ts
CHANGED