@ztimson/utils 0.26.26 → 0.27.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.
package/dist/math.d.ts CHANGED
@@ -23,3 +23,13 @@ export declare function dec2Frac(num: number, maxDen?: number): string;
23
23
  * @return {number} Faction as a decimal
24
24
  */
25
25
  export declare function fracToDec(frac: string): number;
26
+ /**
27
+ * Add a suffix to a number:
28
+ * 1 = 1st
29
+ * 2 = 2nd
30
+ * 3 = 3rd
31
+ * N = Nth
32
+ * @param {number} n
33
+ * @returns {string}
34
+ */
35
+ export declare function numSuffix(n: number): string;
package/dist/objects.d.ts CHANGED
@@ -3,18 +3,18 @@ export type Delta = {
3
3
  };
4
4
  /**
5
5
  * Applies deltas in order to modify `target`.
6
- * @param target - Object to mutate
6
+ * @param base - Original
7
7
  * @param deltas - List of deltas to apply
8
8
  * @returns Mutated target
9
9
  */
10
- export declare function applyDeltas(target: any, deltas: Delta[]): any;
10
+ export declare function applyDelta(base: any, deltas: any): any;
11
11
  /**
12
12
  * Creates a nested delta that reverts `target` back to `old`.
13
13
  * @param old - Original object
14
- * @param target - Modified object
15
- * @returns Delta to revert changes
14
+ * @param updated - Modified object
15
+ * @returns New changes
16
16
  */
17
- export declare function calcDelta(old: any, target: any): Delta;
17
+ export declare function calcDelta(old: any, updated: any): any;
18
18
  /**
19
19
  * Removes any null values from an object in-place
20
20
  *
package/dist/time.d.ts CHANGED
@@ -5,6 +5,8 @@
5
5
  * @return {() => void}
6
6
  */
7
7
  export declare function adjustedInterval(cb: Function, ms: number): () => void;
8
+ export declare function dayOfWeek(d: number): string;
9
+ export declare function dayOfYear(date: Date): number;
8
10
  /**
9
11
  * Format date
10
12
  *
@@ -22,6 +24,7 @@ export declare function formatDate(format?: string, date?: Date | number | strin
22
24
  * @return {number} Clear Interval ID
23
25
  */
24
26
  export declare function instantInterval(fn: () => any, interval: number): NodeJS.Timeout;
27
+ export declare function month(m: number): string;
25
28
  /**
26
29
  * Use in conjunction with `await` to pause an async script
27
30
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztimson/utils",
3
- "version": "0.26.26",
3
+ "version": "0.27.1",
4
4
  "description": "Utility library",
5
5
  "author": "Zak Timson",
6
6
  "license": "MIT",