socket-function 0.13.0 → 0.14.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/misc.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
package/src/misc.ts CHANGED
@@ -324,6 +324,8 @@ export function compare(lhs: unknown, rhs: unknown): number {
324
324
  return compare(typeof lhs, typeof rhs);
325
325
  }
326
326
  if (lhs === rhs) return 0;
327
+ if (lhs === null && rhs !== null) return -1;
328
+ if (lhs !== null && rhs === null) return 1;
327
329
  if (typeof lhs === "number") {
328
330
  if (Number.isNaN(lhs)) {
329
331
  if (Number.isNaN(rhs)) return 0;