@elaraai/east-web-std 1.0.85
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/CLA.md +26 -0
- package/CONTRIBUTING.md +28 -0
- package/LICENSE.md +31 -0
- package/README.md +191 -0
- package/THIRD_PARTY_NOTICES.md +123 -0
- package/dist/src/compliance.spec.d.ts +6 -0
- package/dist/src/compliance.spec.d.ts.map +1 -0
- package/dist/src/compliance.spec.js +89 -0
- package/dist/src/compliance.spec.js.map +1 -0
- package/dist/src/console.d.ts +237 -0
- package/dist/src/console.d.ts.map +1 -0
- package/dist/src/console.js +260 -0
- package/dist/src/console.js.map +1 -0
- package/dist/src/crypto.d.ts +224 -0
- package/dist/src/crypto.d.ts.map +1 -0
- package/dist/src/crypto.js +295 -0
- package/dist/src/crypto.js.map +1 -0
- package/dist/src/fetch.d.ts +383 -0
- package/dist/src/fetch.d.ts.map +1 -0
- package/dist/src/fetch.js +412 -0
- package/dist/src/fetch.js.map +1 -0
- package/dist/src/index.d.ts +106 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +93 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/path.d.ts +243 -0
- package/dist/src/path.d.ts.map +1 -0
- package/dist/src/path.js +562 -0
- package/dist/src/path.js.map +1 -0
- package/dist/src/random/crypto-rng.d.ts +38 -0
- package/dist/src/random/crypto-rng.d.ts.map +1 -0
- package/dist/src/random/crypto-rng.js +55 -0
- package/dist/src/random/crypto-rng.js.map +1 -0
- package/dist/src/random/distributions/bates.d.ts +17 -0
- package/dist/src/random/distributions/bates.d.ts.map +1 -0
- package/dist/src/random/distributions/bates.js +15 -0
- package/dist/src/random/distributions/bates.js.map +1 -0
- package/dist/src/random/distributions/bernoulli.d.ts +17 -0
- package/dist/src/random/distributions/bernoulli.d.ts.map +1 -0
- package/dist/src/random/distributions/bernoulli.js +13 -0
- package/dist/src/random/distributions/bernoulli.js.map +1 -0
- package/dist/src/random/distributions/binomial.d.ts +17 -0
- package/dist/src/random/distributions/binomial.d.ts.map +1 -0
- package/dist/src/random/distributions/binomial.js +24 -0
- package/dist/src/random/distributions/binomial.js.map +1 -0
- package/dist/src/random/distributions/exponential.d.ts +17 -0
- package/dist/src/random/distributions/exponential.d.ts.map +1 -0
- package/dist/src/random/distributions/exponential.js +13 -0
- package/dist/src/random/distributions/exponential.js.map +1 -0
- package/dist/src/random/distributions/geometric.d.ts +17 -0
- package/dist/src/random/distributions/geometric.d.ts.map +1 -0
- package/dist/src/random/distributions/geometric.js +14 -0
- package/dist/src/random/distributions/geometric.js.map +1 -0
- package/dist/src/random/distributions/irwin-hall.d.ts +17 -0
- package/dist/src/random/distributions/irwin-hall.d.ts.map +1 -0
- package/dist/src/random/distributions/irwin-hall.js +18 -0
- package/dist/src/random/distributions/irwin-hall.js.map +1 -0
- package/dist/src/random/distributions/log-normal.d.ts +17 -0
- package/dist/src/random/distributions/log-normal.d.ts.map +1 -0
- package/dist/src/random/distributions/log-normal.js +12 -0
- package/dist/src/random/distributions/log-normal.js.map +1 -0
- package/dist/src/random/distributions/normal.d.ts +18 -0
- package/dist/src/random/distributions/normal.d.ts.map +1 -0
- package/dist/src/random/distributions/normal.js +16 -0
- package/dist/src/random/distributions/normal.js.map +1 -0
- package/dist/src/random/distributions/pareto.d.ts +17 -0
- package/dist/src/random/distributions/pareto.d.ts.map +1 -0
- package/dist/src/random/distributions/pareto.js +14 -0
- package/dist/src/random/distributions/pareto.js.map +1 -0
- package/dist/src/random/distributions/poisson.d.ts +17 -0
- package/dist/src/random/distributions/poisson.d.ts.map +1 -0
- package/dist/src/random/distributions/poisson.js +81 -0
- package/dist/src/random/distributions/poisson.js.map +1 -0
- package/dist/src/random/distributions/uniform-int.d.ts +17 -0
- package/dist/src/random/distributions/uniform-int.d.ts.map +1 -0
- package/dist/src/random/distributions/uniform-int.js +16 -0
- package/dist/src/random/distributions/uniform-int.js.map +1 -0
- package/dist/src/random/distributions/uniform.d.ts +17 -0
- package/dist/src/random/distributions/uniform.d.ts.map +1 -0
- package/dist/src/random/distributions/uniform.js +10 -0
- package/dist/src/random/distributions/uniform.js.map +1 -0
- package/dist/src/random/rng.d.ts +21 -0
- package/dist/src/random/rng.d.ts.map +1 -0
- package/dist/src/random/rng.js +7 -0
- package/dist/src/random/rng.js.map +1 -0
- package/dist/src/random/xorshift128.d.ts +42 -0
- package/dist/src/random/xorshift128.d.ts.map +1 -0
- package/dist/src/random/xorshift128.js +119 -0
- package/dist/src/random/xorshift128.js.map +1 -0
- package/dist/src/random.d.ts +822 -0
- package/dist/src/random.d.ts.map +1 -0
- package/dist/src/random.js +992 -0
- package/dist/src/random.js.map +1 -0
- package/dist/src/test.d.ts +86 -0
- package/dist/src/test.d.ts.map +1 -0
- package/dist/src/test.js +160 -0
- package/dist/src/test.js.map +1 -0
- package/dist/src/time.d.ts +201 -0
- package/dist/src/time.d.ts.map +1 -0
- package/dist/src/time.js +300 -0
- package/dist/src/time.js.map +1 -0
- package/package.json +64 -0
package/dist/src/time.js
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
import { East, IntegerType, NullType, DateTimeType, StringType } from "@elaraai/east";
|
|
6
|
+
import { EastError } from "@elaraai/east/internal";
|
|
7
|
+
/**
|
|
8
|
+
* Computes the UTC offset in minutes for an IANA timezone at a given instant.
|
|
9
|
+
*
|
|
10
|
+
* Uses Intl.DateTimeFormat to format the datetime in both UTC and the target
|
|
11
|
+
* timezone, then computes the difference. It only depends on the date
|
|
12
|
+
* component formatting, not abbreviations, so it gives east-node-std's answer
|
|
13
|
+
* wherever `Intl` carries the IANA zones, as every current browser does.
|
|
14
|
+
*/
|
|
15
|
+
function computeUtcOffsetMinutes(datetime, zone) {
|
|
16
|
+
const formatParts = (tz) => {
|
|
17
|
+
const fmt = new Intl.DateTimeFormat("en-US", {
|
|
18
|
+
timeZone: tz,
|
|
19
|
+
year: "numeric",
|
|
20
|
+
month: "2-digit",
|
|
21
|
+
day: "2-digit",
|
|
22
|
+
hour: "2-digit",
|
|
23
|
+
minute: "2-digit",
|
|
24
|
+
second: "2-digit",
|
|
25
|
+
hour12: false,
|
|
26
|
+
});
|
|
27
|
+
const parts = fmt.formatToParts(datetime);
|
|
28
|
+
const get = (type) => parseInt(parts.find(p => p.type === type).value);
|
|
29
|
+
return { year: get("year"), month: get("month"), day: get("day"), hour: get("hour"), minute: get("minute"), second: get("second") };
|
|
30
|
+
};
|
|
31
|
+
const utc = formatParts("UTC");
|
|
32
|
+
const local = formatParts(zone);
|
|
33
|
+
const utcMs = Date.UTC(utc.year, utc.month - 1, utc.day, utc.hour, utc.minute, utc.second);
|
|
34
|
+
const localMs = Date.UTC(local.year, local.month - 1, local.day, local.hour, local.minute, local.second);
|
|
35
|
+
return (localMs - utcMs) / 60000;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets the current Unix timestamp in milliseconds.
|
|
39
|
+
*
|
|
40
|
+
* Returns the number of milliseconds elapsed since the Unix epoch
|
|
41
|
+
* (January 1, 1970 00:00:00 UTC). This is useful for timestamping events,
|
|
42
|
+
* measuring durations, and working with date/time data.
|
|
43
|
+
*
|
|
44
|
+
* This is a platform function for the East language, enabling time access
|
|
45
|
+
* in East programs running in a browser.
|
|
46
|
+
*
|
|
47
|
+
* @returns The current time as milliseconds since epoch (January 1, 1970 UTC)
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const getTimestamp = East.function([], IntegerType, $ => {
|
|
52
|
+
* return Time.now();
|
|
53
|
+
* // Returns: 1735689600000n (example)
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export const time_now = East.platform("time_now", [], IntegerType);
|
|
58
|
+
/**
|
|
59
|
+
* Sleeps for the specified number of milliseconds.
|
|
60
|
+
*
|
|
61
|
+
* Pauses execution asynchronously for the given duration. This is a non-blocking
|
|
62
|
+
* sleep that allows other operations to run during the wait period. Useful for
|
|
63
|
+
* rate limiting, delays, and timing control.
|
|
64
|
+
*
|
|
65
|
+
* This is a platform function for the East language, enabling timed delays
|
|
66
|
+
* in East programs running in a browser.
|
|
67
|
+
*
|
|
68
|
+
* @param ms - The number of milliseconds to sleep (must be non-negative)
|
|
69
|
+
* @returns Null after sleeping completes
|
|
70
|
+
*
|
|
71
|
+
* @throws {EastError} When sleep fails
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const delayedTask = East.function([], NullType, $ => {
|
|
76
|
+
* $(Console.log("Starting..."));
|
|
77
|
+
* $(Time.sleep(1000n)); // Wait 1 second
|
|
78
|
+
* $(Console.log("Done!"));
|
|
79
|
+
* });
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* A browser may slow the timers of a page in a background tab, so a sleep
|
|
84
|
+
* there can last longer than asked.
|
|
85
|
+
*/
|
|
86
|
+
export const time_sleep = East.asyncPlatform("time_sleep", [IntegerType], NullType);
|
|
87
|
+
/**
|
|
88
|
+
* Gets the UTC offset in minutes for an IANA timezone at a given UTC datetime.
|
|
89
|
+
*
|
|
90
|
+
* Returns the number of minutes that the given timezone is ahead of (positive)
|
|
91
|
+
* or behind (negative) UTC at the specified instant. This accounts for DST
|
|
92
|
+
* transitions — the same timezone can return different offsets depending on
|
|
93
|
+
* the datetime.
|
|
94
|
+
*
|
|
95
|
+
* The timezone must be a valid IANA timezone name (e.g., "Australia/Sydney",
|
|
96
|
+
* "America/New_York", "Europe/London", "Asia/Tokyo"). See the IANA Time Zone
|
|
97
|
+
* Database for the full list of valid names.
|
|
98
|
+
*
|
|
99
|
+
* @param datetime - A UTC datetime to compute the offset for
|
|
100
|
+
* @param zone - An IANA timezone name (e.g., "Australia/Sydney")
|
|
101
|
+
* @returns UTC offset in minutes (e.g., 660 for Sydney in summer, 600 in winter)
|
|
102
|
+
*
|
|
103
|
+
* @throws {EastError} When the timezone name is not a valid IANA timezone
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* const toSydneyTime = East.function([DateTimeType], DateTimeType, ($, dt) => {
|
|
108
|
+
* const offset = $.let(Time.getTimezoneOffset(dt, "Australia/Sydney"));
|
|
109
|
+
* $.return(dt.addMinutes(offset));
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export const time_get_timezone_offset = East.platform("time_get_timezone_offset", [DateTimeType, StringType], IntegerType);
|
|
114
|
+
/** What a sleep a host stopped fails with. */
|
|
115
|
+
const STOPPED = "the program was stopped";
|
|
116
|
+
/**
|
|
117
|
+
* Waits a number of milliseconds, unless a signal stops the wait first: then
|
|
118
|
+
* its timer is cleared, and it fails.
|
|
119
|
+
*/
|
|
120
|
+
function sleepFor(ms, signal) {
|
|
121
|
+
return new Promise((resolve, reject) => {
|
|
122
|
+
if (signal?.aborted === true) {
|
|
123
|
+
reject(new Error(STOPPED));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
let timer;
|
|
127
|
+
const stop = () => {
|
|
128
|
+
clearTimeout(timer);
|
|
129
|
+
reject(new Error(STOPPED));
|
|
130
|
+
};
|
|
131
|
+
timer = setTimeout(() => {
|
|
132
|
+
signal?.removeEventListener("abort", stop);
|
|
133
|
+
resolve();
|
|
134
|
+
}, ms);
|
|
135
|
+
signal?.addEventListener("abort", stop, { once: true });
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Browser implementation of time platform functions, whose sleeps a host may
|
|
140
|
+
* stop.
|
|
141
|
+
*
|
|
142
|
+
* @param signal - Stops the program's sleeps, for a host that stops a program
|
|
143
|
+
* without ending its thread: once it aborts, a sleep under way fails at
|
|
144
|
+
* once, its timer cleared, and a later one fails as it starts. Unset, a
|
|
145
|
+
* sleep ends once its time has passed
|
|
146
|
+
* @returns The platform functions, to pass to {@link East.compileAsync}
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const stop = new AbortController();
|
|
151
|
+
* const compiled = await East.compileAsync(delayedTask.toIR(), createTimeImpl(stop.signal));
|
|
152
|
+
* const running = compiled();
|
|
153
|
+
* stop.abort(); // the sleep under way fails at once: "Failed to sleep: the program was stopped"
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export function createTimeImpl(signal) {
|
|
157
|
+
return [
|
|
158
|
+
time_now.implement(() => {
|
|
159
|
+
try {
|
|
160
|
+
return BigInt(Date.now());
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
throw new EastError(`Failed to get current time: ${err.message}`, {
|
|
164
|
+
location: [{ filename: "time_now", line: 0n, column: 0n }],
|
|
165
|
+
cause: err
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}),
|
|
169
|
+
time_sleep.implement(async (ms) => {
|
|
170
|
+
try {
|
|
171
|
+
await sleepFor(Number(ms), signal);
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
throw new EastError(`Failed to sleep: ${err.message}`, {
|
|
175
|
+
location: [{ filename: "time_sleep", line: 0n, column: 0n }],
|
|
176
|
+
cause: err
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}),
|
|
180
|
+
time_get_timezone_offset.implement((datetime, zone) => {
|
|
181
|
+
try {
|
|
182
|
+
const offset = computeUtcOffsetMinutes(datetime, zone);
|
|
183
|
+
return BigInt(offset);
|
|
184
|
+
}
|
|
185
|
+
catch (err) {
|
|
186
|
+
if (err instanceof RangeError) {
|
|
187
|
+
throw new EastError(`Invalid IANA timezone: "${zone}". ` +
|
|
188
|
+
`Use a valid IANA timezone name such as "Australia/Sydney", "America/New_York", or "Europe/London". ` +
|
|
189
|
+
`See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the full list.`, { location: [{ filename: "time_get_timezone_offset", line: 0n, column: 0n }], cause: err });
|
|
190
|
+
}
|
|
191
|
+
if (err instanceof EastError)
|
|
192
|
+
throw err;
|
|
193
|
+
throw new EastError(`Failed to get timezone offset for "${zone}": ${err.message}`, {
|
|
194
|
+
location: [{ filename: "time_get_timezone_offset", line: 0n, column: 0n }],
|
|
195
|
+
cause: err
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}),
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Browser implementation of time platform functions.
|
|
203
|
+
*
|
|
204
|
+
* Pass this array to {@link East.compileAsync} to enable time operations.
|
|
205
|
+
*/
|
|
206
|
+
const TimeImpl = createTimeImpl();
|
|
207
|
+
/**
|
|
208
|
+
* Grouped time platform functions.
|
|
209
|
+
*
|
|
210
|
+
* Provides time, sleep, and timezone operations for East programs.
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```ts
|
|
214
|
+
* import { East, NullType } from "@elaraai/east";
|
|
215
|
+
* import { Time } from "@elaraai/east-web-std";
|
|
216
|
+
*
|
|
217
|
+
* const timedTask = East.function([], NullType, $ => {
|
|
218
|
+
* const start = $.let(Time.now());
|
|
219
|
+
* $(Time.sleep(1000n)); // Sleep for 1 second
|
|
220
|
+
* const end = $.let(Time.now());
|
|
221
|
+
* });
|
|
222
|
+
*
|
|
223
|
+
* const compiled = await East.compileAsync(timedTask.toIR(), Time.Implementation);
|
|
224
|
+
* await compiled();
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
export const Time = {
|
|
228
|
+
/**
|
|
229
|
+
* Gets the current Unix timestamp in milliseconds.
|
|
230
|
+
*
|
|
231
|
+
* Returns the number of milliseconds elapsed since the Unix epoch
|
|
232
|
+
* (January 1, 1970 00:00:00 UTC). Useful for timestamping and measuring durations.
|
|
233
|
+
*
|
|
234
|
+
* @returns The current time as milliseconds since epoch
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const getTimestamp = East.function([], IntegerType, $ => {
|
|
239
|
+
* return Time.now();
|
|
240
|
+
* });
|
|
241
|
+
*
|
|
242
|
+
* const compiled = await East.compileAsync(getTimestamp.toIR(), Time.Implementation);
|
|
243
|
+
* await compiled(); // Returns: 1735689600000n (example timestamp)
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
now: time_now,
|
|
247
|
+
/**
|
|
248
|
+
* Sleeps for the specified number of milliseconds.
|
|
249
|
+
*
|
|
250
|
+
* Pauses execution asynchronously for the given duration. Non-blocking sleep
|
|
251
|
+
* that allows other operations to run during the wait period.
|
|
252
|
+
*
|
|
253
|
+
* @param ms - The number of milliseconds to sleep (must be non-negative)
|
|
254
|
+
* @returns Null after sleeping completes
|
|
255
|
+
* @throws {EastError} When sleep fails
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```ts
|
|
259
|
+
* const delayedTask = East.function([], NullType, $ => {
|
|
260
|
+
* $(Console.log("Starting..."));
|
|
261
|
+
* $(Time.sleep(1000n));
|
|
262
|
+
* $(Console.log("Done!"));
|
|
263
|
+
* });
|
|
264
|
+
*
|
|
265
|
+
* const compiled = await East.compileAsync(delayedTask.toIR(), Time.Implementation);
|
|
266
|
+
* await compiled(); // Waits 1 second between log messages
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
sleep: time_sleep,
|
|
270
|
+
/**
|
|
271
|
+
* Gets the UTC offset in minutes for an IANA timezone at a given UTC datetime.
|
|
272
|
+
*
|
|
273
|
+
* Accounts for DST — the same timezone returns different offsets depending
|
|
274
|
+
* on the datetime. Use the result with `addMinutes` to convert a UTC datetime
|
|
275
|
+
* to local time.
|
|
276
|
+
*
|
|
277
|
+
* @param datetime - A UTC datetime
|
|
278
|
+
* @param zone - An IANA timezone name (e.g., "Australia/Sydney")
|
|
279
|
+
* @returns UTC offset in minutes
|
|
280
|
+
* @throws {EastError} When the timezone name is invalid
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```ts
|
|
284
|
+
* const toSydneyTime = East.function([DateTimeType], DateTimeType, ($, dt) => {
|
|
285
|
+
* const offset = $.let(Time.getTimezoneOffset(dt, "Australia/Sydney"));
|
|
286
|
+
* $.return(dt.addMinutes(offset));
|
|
287
|
+
* });
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
getTimezoneOffset: time_get_timezone_offset,
|
|
291
|
+
/**
|
|
292
|
+
* Browser implementation of time platform functions.
|
|
293
|
+
*
|
|
294
|
+
* Pass this to {@link East.compileAsync} to enable time operations.
|
|
295
|
+
*/
|
|
296
|
+
Implementation: TimeImpl,
|
|
297
|
+
};
|
|
298
|
+
// Exported beside `Time.Implementation`, as east-node-std exports it
|
|
299
|
+
export { TimeImpl };
|
|
300
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/time.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAAC,QAAc,EAAE,IAAY;IACzD,MAAM,WAAW,GAAG,CAAC,EAAU,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;YACzC,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,KAAK;SAChB,CAAC,CAAC;QACH,MAAM,KAAK,GAAG,GAAG,CAAC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ACrF,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,0BAA0B,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAC7F,CAAC;gBACN,CAAC;gBACD,IAAI,GAAG,YAAY,SAAS;oBAAE,MAAM,GAAG,CAAC;gBACxC,MAAM,IAAI,SAAS,CAAC,sCAAsC,IAAI,MAAM,GAAG,CAAC,OAAO,EAAE,EAAE;oBAC/E,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,0BAA0B,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;oBAC1E,KAAK,EAAE,GAAG;iBACb,CAAC,CAAC;YACP,CAAC;QACL,CAAC,CAAC;KACD,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,MAAM,QAAQ,GAAuB,cAAc,EAAE,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB;;;;;;;;;;;;;;;;;OAiBG;IACH,GAAG,EAAE,QAAQ;IAEb;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,EAAE,UAAU;IAEjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,iBAAiB,EAAE,wBAAwB;IAE3C;;;;OAIG;IACH,cAAc,EAAE,QAAQ;CAClB,CAAC;AAEX,qEAAqE;AACrE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elaraai/east-web-std",
|
|
3
|
+
"version": "1.0.85",
|
|
4
|
+
"description": "East Web - the standard platform functions for East programs in a browser",
|
|
5
|
+
"main": "dist/src/index.js",
|
|
6
|
+
"types": "dist/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/src/index.d.ts",
|
|
10
|
+
"default": "./dist/src/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/src",
|
|
16
|
+
"!dist/**/*.spec.*",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE.md",
|
|
19
|
+
"CONTRIBUTING.md",
|
|
20
|
+
"CLA.md",
|
|
21
|
+
"THIRD_PARTY_NOTICES.md"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/elaraai/east-workspace.git",
|
|
26
|
+
"directory": "libs/east-web/packages/east-web-std"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"east",
|
|
30
|
+
"elara",
|
|
31
|
+
"browser",
|
|
32
|
+
"web",
|
|
33
|
+
"platform",
|
|
34
|
+
"runtime"
|
|
35
|
+
],
|
|
36
|
+
"author": "Elara AI Pty Ltd",
|
|
37
|
+
"license": "AGPL-3.0-or-later",
|
|
38
|
+
"type": "module",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=22.0.0"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^22.18.1",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
|
45
|
+
"@typescript-eslint/parser": "^8.42.0",
|
|
46
|
+
"eslint": "^9.34.0",
|
|
47
|
+
"eslint-plugin-headers": "^1.3.3",
|
|
48
|
+
"typescript": "~5.9.2",
|
|
49
|
+
"@elaraai/east-node-std": "1.0.85"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@elaraai/east": "1.0.85"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "rm -rf dist && tsc",
|
|
56
|
+
"package": "npm run build && mkdir -p .package && npm pack --pack-destination .package",
|
|
57
|
+
"test": "npm run build && node --enable-source-maps --test-reporter=spec --test 'dist/test/**/*.spec.js'",
|
|
58
|
+
"test:check": "tsc -p tsconfig.test.json",
|
|
59
|
+
"test:coverage": "npm run build && node --enable-source-maps --test-reporter=spec --test --experimental-test-coverage 'dist/test/**/*.spec.js'",
|
|
60
|
+
"test:compliance": "npm run build && node --enable-source-maps --test-reporter=spec --test dist/src/compliance.spec.js",
|
|
61
|
+
"lint": "eslint .",
|
|
62
|
+
"lint:fix": "eslint . --fix"
|
|
63
|
+
}
|
|
64
|
+
}
|