Skip to content

Commit 04c01d0

Browse files
committed
try parse string orderby
1 parent 989b395 commit 04c01d0

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

OpenFlow/src/DatabaseConnection.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,13 @@ export class DatabaseConnection {
289289
var mysort: Object = {};
290290
if (orderby) {
291291
if (typeof orderby === "string" || orderby instanceof String) {
292-
mysort[(orderby as string)] = 1;
292+
var neworderby = null;
293+
try {
294+
neworderby = JSON.parse((orderby as string));
295+
mysort = neworderby;
296+
} catch (error) {
297+
}
298+
if (neworderby == null) mysort[(orderby as string)] = 1;
293299
} else {
294300
mysort = orderby;
295301
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.537
1+
0.0.538

0 commit comments

Comments
 (0)