@prozilla-os/shared 1.1.1 → 1.2.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.
- package/README.md +7 -30
- package/dist/main.d.ts +62 -7
- package/dist/main.js +131 -35
- package/dist/main.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -11,39 +11,16 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
## About
|
|
14
|
+
## About
|
|
15
15
|
|
|
16
|
-
`@prozilla-os/shared` is a library of shared utility functions for ProzillaOS packages.
|
|
16
|
+
`@prozilla-os/shared` is a library of shared utility functions and variables for ProzillaOS packages.
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
### `appViteConfig(basePath, entryPath)`
|
|
29
|
-
|
|
30
|
-
Helper function for creating Vite configurations for ProzillaOS apps.
|
|
31
|
-
|
|
32
|
-
#### Params
|
|
33
|
-
|
|
34
|
-
- `basePath` (string) - Path of base directory
|
|
35
|
-
- `entryPath` (string) - Path of library entry
|
|
36
|
-
|
|
37
|
-
#### Example
|
|
38
|
-
```tsx
|
|
39
|
-
// vite.config.ts
|
|
40
|
-
|
|
41
|
-
import { defineConfig } from "vite";
|
|
42
|
-
import { appViteConfig } from "@prozilla-os/shared";
|
|
43
|
-
|
|
44
|
-
export default defineConfig({
|
|
45
|
-
...appViteConfig(__dirname, "src/main.ts")
|
|
46
|
-
});
|
|
21
|
+
npm install @prozilla-os/shared
|
|
22
|
+
yarn add @prozilla-os/shared
|
|
23
|
+
pnpm add @prozilla-os/shared
|
|
47
24
|
```
|
|
48
25
|
|
|
49
26
|
## Links
|
|
@@ -56,8 +33,8 @@ export default defineConfig({
|
|
|
56
33
|
- [Ko-fi][ko-fi]
|
|
57
34
|
|
|
58
35
|
[demo]: https://os.prozilla.dev/
|
|
59
|
-
[docs]:
|
|
36
|
+
[docs]: https://os.prozilla.dev/docs/reference/shared
|
|
60
37
|
[github]: https://github.com/prozilla-os/ProzillaOS/tree/main/packages/shared
|
|
61
38
|
[npm]: https://www.npmjs.com/package/@prozilla-os/shared
|
|
62
39
|
[discord]: https://discord.gg/JwbyQP4tdz
|
|
63
|
-
[ko-fi]: https://ko-fi.com/prozilla
|
|
40
|
+
[ko-fi]: https://ko-fi.com/prozilla
|
package/dist/main.d.ts
CHANGED
|
@@ -1,12 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const ANSI: {
|
|
2
|
+
fg: {
|
|
3
|
+
black: string;
|
|
4
|
+
red: string;
|
|
5
|
+
green: string;
|
|
6
|
+
yellow: string;
|
|
7
|
+
blue: string;
|
|
8
|
+
magenta: string;
|
|
9
|
+
cyan: string;
|
|
10
|
+
white: string;
|
|
11
|
+
};
|
|
12
|
+
bg: {};
|
|
13
|
+
decoration: {
|
|
14
|
+
dim: string;
|
|
15
|
+
bold: string;
|
|
16
|
+
};
|
|
17
|
+
reset: string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
21
|
+
|
|
22
|
+
export declare class EventEmitter<EventMap extends EventNamesMap> {
|
|
23
|
+
#private;
|
|
24
|
+
static EVENT_NAMES: EventNamesMap;
|
|
25
|
+
/**
|
|
26
|
+
* Add event listener for an event
|
|
27
|
+
*/
|
|
28
|
+
on<Key extends keyof EventMap>(eventName: Key, callback: (data: unknown) => void): void;
|
|
29
|
+
/**
|
|
30
|
+
* Remove event listener for an event
|
|
31
|
+
*/
|
|
32
|
+
off<Key extends keyof EventMap>(eventName: Key, callback: (data: unknown) => void): void;
|
|
33
|
+
/**
|
|
34
|
+
* Dispatch event
|
|
35
|
+
*/
|
|
36
|
+
emit<Key extends keyof EventMap>(eventName: Key, data?: unknown): void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare type EventNamesMap = Record<string, string>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Format a time relative to now
|
|
43
|
+
* @param date - The date
|
|
44
|
+
* @param maxLength - The maximum amount of units, e.g.: 3 => years, months, days
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatRelativeTime(date: Date, maxLength: number | undefined, allowAffixes: boolean): string;
|
|
2
47
|
|
|
3
48
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
7
|
-
* @returns Vite configuration
|
|
8
|
-
* @see https://vitejs.dev/config/
|
|
49
|
+
* Format a time
|
|
50
|
+
* @param time - Time in milliseconds
|
|
51
|
+
* @param maxLength - The maximum amount of units, e.g.: 3 => years, months, days
|
|
9
52
|
*/
|
|
10
|
-
export declare
|
|
53
|
+
export declare function formatTime(time: number, maxLength: number | undefined, allowAffixes: boolean): string;
|
|
54
|
+
|
|
55
|
+
export declare function isValidInteger(number: number | string): number | boolean;
|
|
56
|
+
|
|
57
|
+
export declare function randomFromArray<Type>(array: Type[]): Type;
|
|
58
|
+
|
|
59
|
+
export declare function randomRange(min: number, max: number): number;
|
|
60
|
+
|
|
61
|
+
export declare function removeDuplicatesFromArray<Type>(array: Type[]): Type[];
|
|
62
|
+
|
|
63
|
+
export declare function removeFromArray<Type>(item: Type, array: Type[]): void;
|
|
64
|
+
|
|
65
|
+
export declare function round(value: number, precision: number): number;
|
|
11
66
|
|
|
12
67
|
export { }
|
package/dist/main.js
CHANGED
|
@@ -1,39 +1,135 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var m = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
4
|
+
};
|
|
5
|
+
var M = (t, n, e) => n in t ? g(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
6
|
+
var d = (t, n, e) => M(t, typeof n != "symbol" ? n + "" : n, e), b = (t, n, e) => n.has(t) || m("Cannot " + e);
|
|
7
|
+
var i = (t, n, e) => (b(t, n, "read from private field"), e ? e.call(t) : n.get(t)), x = (t, n, e) => n.has(t) ? m("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(t) : n.set(t, e);
|
|
8
|
+
const A = {
|
|
9
|
+
fg: {
|
|
10
|
+
black: "\x1B[30m",
|
|
11
|
+
red: "\x1B[31m",
|
|
12
|
+
green: "\x1B[32m",
|
|
13
|
+
yellow: "\x1B[33m",
|
|
14
|
+
blue: "\x1B[34m",
|
|
15
|
+
magenta: "\x1B[35m",
|
|
16
|
+
cyan: "\x1B[36m",
|
|
17
|
+
white: "\x1B[37m"
|
|
18
|
+
},
|
|
19
|
+
bg: {},
|
|
20
|
+
decoration: {
|
|
21
|
+
dim: "\x1B[2m",
|
|
22
|
+
bold: "\x1B[1m"
|
|
23
|
+
},
|
|
24
|
+
reset: "\x1B[0m"
|
|
25
|
+
};
|
|
26
|
+
function E(t, n) {
|
|
27
|
+
const e = n.indexOf(t);
|
|
28
|
+
e !== -1 && n.splice(e, 1);
|
|
29
|
+
}
|
|
30
|
+
function O(t) {
|
|
31
|
+
return t[Math.floor(Math.random() * t.length)];
|
|
32
|
+
}
|
|
33
|
+
function T(t) {
|
|
34
|
+
return t.filter((n, e) => t.indexOf(n) === e);
|
|
35
|
+
}
|
|
36
|
+
const p = {
|
|
37
|
+
s: 1e3,
|
|
38
|
+
m: 1e3 * 60,
|
|
39
|
+
h: 1e3 * 60 * 60,
|
|
40
|
+
d: 1e3 * 60 * 60 * 24,
|
|
41
|
+
w: 1e3 * 60 * 60 * 24 * 7,
|
|
42
|
+
n: 1e3 * 60 * 60 * 24 * 31,
|
|
43
|
+
y: 1e3 * 60 * 60 * 24 * 365,
|
|
44
|
+
c: 1e3 * 60 * 60 * 24 * 365 * 100
|
|
35
45
|
};
|
|
46
|
+
function y(t, n = 3, e) {
|
|
47
|
+
const s = [], a = (o, f) => {
|
|
48
|
+
if (!e)
|
|
49
|
+
return o.join(", ");
|
|
50
|
+
let u = "", h = "";
|
|
51
|
+
return f ? h = "ago" : u = "in", [u, o.join(", "), h].join(" ").trim();
|
|
52
|
+
};
|
|
53
|
+
let c = !1;
|
|
54
|
+
if (t < 0 && (t = -t, c = !0), Math.abs(t) < p.s)
|
|
55
|
+
return a(["less than a second"], c);
|
|
56
|
+
const l = [], B = {
|
|
57
|
+
s: "seconds",
|
|
58
|
+
m: "minutes",
|
|
59
|
+
h: "hours",
|
|
60
|
+
d: "days",
|
|
61
|
+
n: "months",
|
|
62
|
+
y: "years"
|
|
63
|
+
};
|
|
64
|
+
for (const [o, f] of Object.entries(p).reverse()) {
|
|
65
|
+
if (o === "w" || o === "c")
|
|
66
|
+
continue;
|
|
67
|
+
const u = Math.floor(t / f);
|
|
68
|
+
t -= u * f, u > 0 && l.push({ amount: u, label: B[o] });
|
|
69
|
+
}
|
|
70
|
+
for (let o = 0; o < n; o++) {
|
|
71
|
+
const f = l[o];
|
|
72
|
+
f && s.push(`${f.amount} ${f.label}`);
|
|
73
|
+
}
|
|
74
|
+
return s.length === 0 ? a(["less than a second"], c) : a(s, c);
|
|
75
|
+
}
|
|
76
|
+
function j(t, n = 3, e) {
|
|
77
|
+
const s = t.valueOf() - Date.now();
|
|
78
|
+
return y(s, n, e);
|
|
79
|
+
}
|
|
80
|
+
var r;
|
|
81
|
+
class I {
|
|
82
|
+
constructor() {
|
|
83
|
+
x(this, r, {});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Add event listener for an event
|
|
87
|
+
*/
|
|
88
|
+
on(n, e) {
|
|
89
|
+
i(this, r)[n] || (i(this, r)[n] = []), i(this, r)[n].push(e);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Remove event listener for an event
|
|
93
|
+
*/
|
|
94
|
+
off(n, e) {
|
|
95
|
+
i(this, r)[n] && (i(this, r)[n] = i(this, r)[n].filter(
|
|
96
|
+
(s) => s !== e
|
|
97
|
+
));
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Dispatch event
|
|
101
|
+
*/
|
|
102
|
+
emit(n, e) {
|
|
103
|
+
i(this, r)[n] && i(this, r)[n].forEach((s) => {
|
|
104
|
+
s(e);
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
r = new WeakMap(), d(I, "EVENT_NAMES", {});
|
|
109
|
+
function R(t, n, e) {
|
|
110
|
+
return t < n ? n : t > e ? e : t;
|
|
111
|
+
}
|
|
112
|
+
function D(t, n) {
|
|
113
|
+
return Math.random() * (n - t) + t;
|
|
114
|
+
}
|
|
115
|
+
function F(t, n) {
|
|
116
|
+
const e = Math.pow(10, n || 0);
|
|
117
|
+
return Math.round(t * e) / e;
|
|
118
|
+
}
|
|
119
|
+
function S(t) {
|
|
120
|
+
return typeof t == "number" || parseInt(t) || parseInt(t) === 0;
|
|
121
|
+
}
|
|
36
122
|
export {
|
|
37
|
-
|
|
123
|
+
A as ANSI,
|
|
124
|
+
I as EventEmitter,
|
|
125
|
+
R as clamp,
|
|
126
|
+
j as formatRelativeTime,
|
|
127
|
+
y as formatTime,
|
|
128
|
+
S as isValidInteger,
|
|
129
|
+
O as randomFromArray,
|
|
130
|
+
D as randomRange,
|
|
131
|
+
T as removeDuplicatesFromArray,
|
|
132
|
+
E as removeFromArray,
|
|
133
|
+
F as round
|
|
38
134
|
};
|
|
39
135
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/constants/ansi.const.ts","../src/features/_utils/array.utils.ts","../src/features/_utils/date.utils.ts","../src/features/_utils/event.utils.ts","../src/features/_utils/math.utils.ts","../src/features/_utils/number.utils.ts"],"sourcesContent":["export const ANSI = {\r\n\tfg: {\r\n\t\tblack: \"\\u001b[30m\",\r\n\t\tred: \"\\u001b[31m\",\r\n\t\tgreen: \"\\u001b[32m\",\r\n\t\tyellow: \"\\u001b[33m\",\r\n\t\tblue: \"\\u001b[34m\",\r\n\t\tmagenta: \"\\u001b[35m\",\r\n\t\tcyan: \"\\u001b[36m\",\r\n\t\twhite: \"\\u001b[37m\",\r\n\t},\r\n\tbg: {\r\n\r\n\t},\r\n\tdecoration: {\r\n\t\tdim: \"\\u001b[2m\",\r\n\t\tbold: \"\\u001b[1m\"\r\n\t},\r\n\treset: \"\\u001b[0m\",\r\n};","export function removeFromArray<Type>(item: Type, array: Type[]) {\r\n\tconst index = array.indexOf(item);\r\n\tif (index !== -1) {\r\n\t\tarray.splice(index, 1);\r\n\t}\r\n}\r\n\r\nexport function randomFromArray<Type>(array: Type[]): Type {\r\n\treturn array[Math.floor(Math.random() * array.length)];\r\n}\r\n\r\nexport function removeDuplicatesFromArray<Type>(array: Type[]): Type[] {\r\n\treturn array.filter((item, index) => array.indexOf(item) === index);\r\n}","const TIME_INDICATORS = {\r\n\t\"s\": 1000,\r\n\t\"m\": 1000 * 60,\r\n\t\"h\": 1000 * 60 * 60,\r\n\t\"d\": 1000 * 60 * 60 * 24,\r\n\t\"w\": 1000 * 60 * 60 * 24 * 7,\r\n\t\"n\": 1000 * 60 * 60 * 24 * 31,\r\n\t\"y\": 1000 * 60 * 60 * 24 * 365,\r\n\t\"c\": 1000 * 60 * 60 * 24 * 365 * 100\r\n};\r\n\r\n/**\r\n * Format a time\r\n * @param time - Time in milliseconds\r\n * @param maxLength - The maximum amount of units, e.g.: 3 => years, months, days\r\n */\r\nexport function formatTime(time: number, maxLength: number = 3, allowAffixes: boolean): string {\r\n\tconst result: string[] = [];\r\n\r\n\tconst formatResult = (result: string[], inPast: boolean): string => {\r\n\t\tif (!allowAffixes)\r\n\t\t\treturn result.join(\", \");\r\n\r\n\t\tlet prefix = \"\";\r\n\t\tlet suffix = \"\";\r\n\r\n\t\tif (inPast) {\r\n\t\t\tsuffix = \"ago\";\r\n\t\t} else {\r\n\t\t\tprefix = \"in\";\r\n\t\t}\r\n\r\n\t\treturn [prefix, result.join(\", \"), suffix].join(\" \").trim();\r\n\t};\r\n\r\n\tlet inPast = false;\r\n\r\n\tif (time < 0) {\r\n\t\ttime = -time;\r\n\t\tinPast = true;\r\n\t}\r\n\r\n\tif (Math.abs(time) < TIME_INDICATORS.s) {\r\n\t\treturn formatResult([\"less than a second\"], inPast);\r\n\t}\r\n\r\n\tconst units: { amount: number, label: string }[] = [];\r\n\tconst unitLabels: Record<string, string> = {\r\n\t\t\"s\": \"seconds\",\r\n\t\t\"m\": \"minutes\",\r\n\t\t\"h\": \"hours\",\r\n\t\t\"d\": \"days\",\r\n\t\t\"n\": \"months\",\r\n\t\t\"y\": \"years\",\r\n\t};\r\n\r\n\tfor (const [key, value] of Object.entries(TIME_INDICATORS).reverse()) {\r\n\t\tif (key === \"w\" || key === \"c\")\r\n\t\t\tcontinue;\r\n\r\n\t\tconst amount = Math.floor(time / value);\r\n\t\ttime -= amount * value;\r\n\r\n\t\tif (amount > 0)\r\n\t\t\tunits.push({ amount, label: unitLabels[key] });\r\n\t}\r\n\r\n\tfor (let i = 0; i < maxLength; i++) {\r\n\t\tconst unit = units[i];\r\n\r\n\t\tif (unit)\r\n\t\t\tresult.push(`${unit.amount} ${unit.label}`);\r\n\t}\r\n\r\n\tif (result.length === 0) {\r\n\t\treturn formatResult([\"less than a second\"], inPast);\r\n\t} else {\r\n\t\treturn formatResult(result, inPast);\r\n\t}\r\n};\r\n\r\n/**\r\n * Format a time relative to now\r\n * @param date - The date\r\n * @param maxLength - The maximum amount of units, e.g.: 3 => years, months, days\r\n */\r\nexport function formatRelativeTime(date: Date, maxLength: number = 3, allowAffixes: boolean): string {\r\n\tconst difference = date.valueOf() - Date.now();\r\n\treturn formatTime(difference, maxLength, allowAffixes);\r\n};","export type EventNamesMap = Record<string, string>;\r\n\r\nexport class EventEmitter<EventMap extends EventNamesMap> {\r\n\tstatic EVENT_NAMES: EventNamesMap = {};\r\n\r\n\t#events: Record<string, Array<Function>> = {};\r\n\r\n\t/**\r\n\t * Add event listener for an event\r\n\t */\r\n\ton<Key extends keyof EventMap>(eventName: Key, callback: (data: unknown) => void) {\r\n\t\tif (!this.#events[eventName as string]) {\r\n\t\t\tthis.#events[eventName as string] = [];\r\n\t\t}\r\n\t\tthis.#events[eventName as string].push(callback);\r\n\t}\r\n\t\r\n\t/**\r\n\t * Remove event listener for an event\r\n\t */\r\n\toff<Key extends keyof EventMap>(eventName: Key, callback: (data: unknown) => void) {\r\n\t\tif (this.#events[eventName as string]) {\r\n\t\t\tthis.#events[eventName as string] = this.#events[eventName as string].filter(\r\n\t\t\t\t(listener) => listener !== callback\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Dispatch event\r\n\t */\r\n\temit<Key extends keyof EventMap>(eventName: Key, data?: unknown) {\r\n\t\tif (this.#events[eventName as string]) {\r\n\t\t\tthis.#events[eventName as string].forEach((listener) => {\r\n\t\t\t\tlistener(data);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n}","export function clamp(value: number, min: number, max: number): number {\r\n\tif (value < min) {\r\n\t\treturn min;\r\n\t} else if (value > max) {\r\n\t\treturn max;\r\n\t} else {\r\n\t\treturn value;\r\n\t}\r\n}\r\n\r\nexport function randomRange(min: number, max: number): number {\r\n\treturn Math.random() * (max - min) + min;\r\n}\r\n\r\nexport function round(value: number, precision: number): number {\r\n\tconst multiplier = Math.pow(10, precision || 0);\r\n\treturn Math.round(value * multiplier) / multiplier;\r\n}","export function isValidInteger(number: number | string): number | boolean {\r\n\treturn (typeof number === \"number\" || parseInt(number) || parseInt(number) === 0);\r\n}"],"names":["ANSI","removeFromArray","item","array","index","randomFromArray","removeDuplicatesFromArray","TIME_INDICATORS","formatTime","time","maxLength","allowAffixes","result","formatResult","inPast","prefix","suffix","units","unitLabels","key","value","amount","i","unit","formatRelativeTime","date","difference","_events","EventEmitter","__privateAdd","eventName","callback","__privateGet","listener","data","__publicField","clamp","min","max","randomRange","round","precision","multiplier","isValidInteger","number"],"mappings":";;;;;;;AAAO,MAAMA,IAAO;AAAA,EACnB,IAAI;AAAA,IACH,OAAO;AAAA,IACP,KAAK;AAAA,IACL,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,EACR;AAAA,EACA,IAAI,CAEJ;AAAA,EACA,YAAY;AAAA,IACX,KAAK;AAAA,IACL,MAAM;AAAA,EACP;AAAA,EACA,OAAO;AACR;ACnBgB,SAAAC,EAAsBC,GAAYC,GAAe;AAC1D,QAAAC,IAAQD,EAAM,QAAQD,CAAI;AAChC,EAAIE,MAAU,MACPD,EAAA,OAAOC,GAAO,CAAC;AAEvB;AAEO,SAASC,EAAsBF,GAAqB;AACnD,SAAAA,EAAM,KAAK,MAAM,KAAK,WAAWA,EAAM,MAAM,CAAC;AACtD;AAEO,SAASG,EAAgCH,GAAuB;AAC/D,SAAAA,EAAM,OAAO,CAACD,GAAME,MAAUD,EAAM,QAAQD,CAAI,MAAME,CAAK;AACnE;ACbA,MAAMG,IAAkB;AAAA,EACvB,GAAK;AAAA,EACL,GAAK,MAAO;AAAA,EACZ,GAAK,MAAO,KAAK;AAAA,EACjB,GAAK,MAAO,KAAK,KAAK;AAAA,EACtB,GAAK,MAAO,KAAK,KAAK,KAAK;AAAA,EAC3B,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SAAAG,EAAMpB,GAAeqB,GAA2B;AAC/D,QAAMC,IAAa,KAAK,IAAI,IAAID,KAAa,CAAC;AAC9C,SAAO,KAAK,MAAMrB,IAAQsB,CAAU,IAAIA;AACzC;ACjBO,SAASC,EAAeC,GAA2C;AACjE,SAAA,OAAOA,KAAW,YAAY,SAASA,CAAM,KAAK,SAASA,CAAM,MAAM;AAChF;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prozilla-os/shared",
|
|
3
3
|
"description": "A library of shared utility functions for ProzillaOS packages.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"homepage": "https://os.prozilla.dev",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Prozilla",
|
|
8
8
|
"email": "business@prozilla.dev",
|
|
9
9
|
"url": "https://prozilla.dev/"
|
|
10
10
|
},
|
|
11
|
+
"funding": "https://ko-fi.com/prozilla",
|
|
11
12
|
"type": "module",
|
|
12
13
|
"main": "dist/main.js",
|
|
13
14
|
"types": "dist/main.d.ts",
|
|
@@ -17,13 +18,12 @@
|
|
|
17
18
|
"directory": "packages/shared"
|
|
18
19
|
},
|
|
19
20
|
"license": "MIT",
|
|
20
|
-
"dependencies": {},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "^20.14.5",
|
|
23
23
|
"@types/react": "^18.3.3",
|
|
24
24
|
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
25
25
|
"typescript": "^5.4.5",
|
|
26
|
-
"vite": "^5.
|
|
26
|
+
"vite": "^5.4.8",
|
|
27
27
|
"vite-plugin-dts": "^3.9.1",
|
|
28
28
|
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
29
29
|
},
|