@lowentry/utils 1.5.1 → 1.6.1

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/LeUtils.js +15 -0
  2. package/package.json +1 -1
package/LeUtils.js CHANGED
@@ -811,6 +811,21 @@ export const LeUtils = {
811
811
  return (a.length < b.length) ? -1 : 1;
812
812
  },
813
813
 
814
+ /**
815
+ * Compares two strings generated by LeUtils.timestamp(). Primarily used for sorting.
816
+ *
817
+ * @param {string} a
818
+ * @param {string} b
819
+ * @returns {number}
820
+ */
821
+ compareTimestampStrings:
822
+ (a, b) =>
823
+ {
824
+ a = LeUtils.base64ToHex(STRING(a));
825
+ b = LeUtils.base64ToHex(STRING(b));
826
+ return LeUtils.compare(a, b);
827
+ },
828
+
814
829
  /**
815
830
  * Returns true if the given object is empty, false otherwise.
816
831
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowentry/utils",
3
- "version": "1.5.1",
3
+ "version": "1.6.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Provides utilities for general JavaScript development.",