(oid1?: ObjectId | null, oid2?: ObjectId | null)
| 1117 | * - `+0 = oid1 is equal oid2` |
| 1118 | */ |
| 1119 | export function compareObjectId(oid1?: ObjectId | null, oid2?: ObjectId | null): 0 | 1 | -1 { |
| 1120 | if (oid1 == null && oid2 == null) { |
| 1121 | return 0; |
| 1122 | } |
| 1123 | |
| 1124 | if (oid1 == null) { |
| 1125 | return -1; |
| 1126 | } |
| 1127 | |
| 1128 | if (oid2 == null) { |
| 1129 | return 1; |
| 1130 | } |
| 1131 | |
| 1132 | return ByteUtils.compare(oid1.id, oid2.id); |
| 1133 | } |
| 1134 | |
| 1135 | export function parseInteger(value: unknown): number | null { |
| 1136 | if (typeof value === class="st">'number') return Math.trunc(value); |
no outgoing calls
no test coverage detected