return validator.isInt('' + id) ? { id } : { uuid: id }
}
+function parseAggregateResult (result: any) {
+ if (!result) return 0
+
+ const total = parseInt(result + '', 10)
+ if (isNaN(total)) return 0
+
+ return total
+}
+
// ---------------------------------------------------------------------------
export {
buildServerIdsFollowedBy,
buildTrigramSearchIndex,
buildWhereIdOrUUID,
- isOutdated
+ isOutdated,
+ parseAggregateResult
}
// ---------------------------------------------------------------------------