@hkdigital/lib-core 0.4.12 → 0.4.13

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 (133) hide show
  1. package/README.md +4 -1
  2. package/dist/auth/errors.d.ts +1 -1
  3. package/dist/auth/errors.js +1 -1
  4. package/dist/auth/jwt/constants.d.ts +6 -0
  5. package/dist/auth/jwt/constants.js +13 -0
  6. package/dist/auth/jwt/core.d.ts +38 -0
  7. package/dist/auth/jwt/core.js +114 -0
  8. package/dist/auth/jwt/errors.d.ts +39 -0
  9. package/dist/auth/jwt/errors.js +74 -0
  10. package/dist/auth/jwt/generators.d.ts +29 -0
  11. package/dist/auth/jwt/generators.js +53 -0
  12. package/dist/auth/jwt/typedef.d.ts +159 -0
  13. package/dist/auth/jwt/typedef.js +72 -0
  14. package/dist/auth/jwt/util.d.ts +6 -0
  15. package/dist/auth/jwt/util.js +43 -0
  16. package/dist/auth/jwt.d.ts +4 -0
  17. package/dist/auth/jwt.js +12 -0
  18. package/dist/generic/data/classes/IterableTree.js +1 -1
  19. package/dist/generic/data/classes/Selector.js +1 -1
  20. package/dist/generic/promises/classes/HkPromise.js +1 -1
  21. package/dist/generic/streaming/classes/ServerEventsStore.js +1 -1
  22. package/dist/generic/typedef.d.ts +2 -0
  23. package/dist/generic/typedef.js +2 -0
  24. package/dist/logging/internal/adapters/console.js +3 -3
  25. package/dist/logging/internal/adapters/pino.js +17 -3
  26. package/dist/logging/internal/adapters/pino.js__ +260 -0
  27. package/dist/logging/internal/test-errors.js +3 -2
  28. package/dist/network/http/errors.js +10 -4
  29. package/dist/network/http/headers.js +1 -1
  30. package/dist/network/http/http-request.js +1 -1
  31. package/dist/network/http/json-request.js +1 -1
  32. package/dist/network/http/response.js +1 -1
  33. package/dist/network/loaders/audio/AudioScene.svelte.js +1 -1
  34. package/dist/network/loaders/image/ImageScene.svelte.js +1 -1
  35. package/dist/network/loaders/image/utils/index.js +1 -1
  36. package/dist/network/states/NetworkLoader.svelte.js +1 -1
  37. package/dist/network/typedef.d.ts +2 -0
  38. package/dist/network/typedef.js +3 -1
  39. package/dist/services/service-base/ServiceBase.js +1 -3
  40. package/dist/services/typedef.d.ts +2 -0
  41. package/dist/services/typedef.js +2 -0
  42. package/dist/state/typedef.d.ts +3 -0
  43. package/dist/state/typedef.js +3 -0
  44. package/dist/ui/components/drag-drop/drag-state.svelte.d.ts +3 -3
  45. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.d.ts +3 -3
  46. package/dist/ui/components/presenter/util.js +1 -1
  47. package/dist/ui/components/tab-bar/HkTabBar.state.svelte.d.ts +3 -3
  48. package/dist/ui/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +3 -3
  49. package/dist/util/array/index.d.ts +0 -4
  50. package/dist/util/array/index.js +1 -5
  51. package/dist/util/array.d.ts +1 -0
  52. package/dist/util/array.js +9 -0
  53. package/dist/util/bases/base64.d.ts +8 -0
  54. package/dist/util/bases/base64.js +23 -0
  55. package/dist/util/bases/index.d.ts +0 -1
  56. package/dist/util/bases/index.js +0 -1
  57. package/dist/util/bases.d.ts +2 -0
  58. package/dist/util/bases.js +10 -0
  59. package/dist/util/compare.d.ts +1 -0
  60. package/dist/util/compare.js +9 -0
  61. package/dist/util/css/index.d.ts +0 -1
  62. package/dist/util/css/index.js +0 -1
  63. package/dist/util/css.d.ts +1 -0
  64. package/dist/util/css.js +8 -0
  65. package/dist/util/env.d.ts +1 -0
  66. package/dist/util/env.js +8 -0
  67. package/dist/util/exceptions.d.ts +1 -0
  68. package/dist/util/exceptions.js +8 -0
  69. package/dist/util/expect/arrays.js +2 -0
  70. package/dist/util/expect/compounds.d.ts +20 -0
  71. package/dist/util/expect/compounds.js +48 -0
  72. package/dist/util/expect/objects.d.ts +28 -0
  73. package/dist/util/expect/objects.js +70 -0
  74. package/dist/util/expect/primitives.d.ts +31 -1
  75. package/dist/util/expect/primitives.js +56 -0
  76. package/dist/util/expect/values.d.ts +26 -0
  77. package/dist/util/expect/values.js +48 -0
  78. package/dist/util/expect.d.ts +6 -0
  79. package/dist/util/expect.js +31 -0
  80. package/dist/util/function/index.js +1 -1
  81. package/dist/util/function.d.ts +1 -0
  82. package/dist/util/function.js +8 -0
  83. package/dist/util/geometry.d.ts +1 -0
  84. package/dist/util/geometry.js +9 -0
  85. package/dist/util/is.d.ts +1 -0
  86. package/dist/util/is.js +8 -0
  87. package/dist/util/iterate/index.js +1 -1
  88. package/dist/util/iterate.d.ts +1 -0
  89. package/dist/util/iterate.js +8 -0
  90. package/dist/util/object/index.js +2 -2
  91. package/dist/util/object.d.ts +1 -0
  92. package/dist/util/object.js +8 -0
  93. package/dist/util/random/bytes.d.ts +28 -0
  94. package/dist/util/random/bytes.js +72 -0
  95. package/dist/util/random.d.ts +1 -0
  96. package/dist/util/random.js +9 -0
  97. package/dist/util/singleton/index.js +1 -1
  98. package/dist/util/singleton.d.ts +1 -0
  99. package/dist/util/singleton.js +8 -0
  100. package/dist/util/ssr.d.ts +1 -0
  101. package/dist/util/ssr.js +8 -0
  102. package/dist/util/string/convert.js +1 -1
  103. package/dist/util/string/index.d.ts +0 -5
  104. package/dist/util/string/index.js +0 -5
  105. package/dist/util/string/interpolate.js +1 -1
  106. package/dist/util/string.d.ts +5 -0
  107. package/dist/util/string.js +12 -0
  108. package/dist/util/svelte/index.d.ts +0 -3
  109. package/dist/util/svelte/index.js +0 -4
  110. package/dist/util/svelte.d.ts +3 -0
  111. package/dist/util/svelte.js +11 -0
  112. package/dist/util/sveltekit/index.d.ts +0 -1
  113. package/dist/util/sveltekit/index.js +0 -1
  114. package/dist/util/sveltekit/route-folders/index.js +1 -1
  115. package/dist/util/sveltekit.d.ts +1 -0
  116. package/dist/util/sveltekit.js +8 -0
  117. package/dist/util/time/index.d.ts +7 -0
  118. package/dist/util/time/index.js +12 -1
  119. package/dist/util/time.d.ts +1 -0
  120. package/dist/util/time.js +1 -0
  121. package/dist/util/unique.d.ts +1 -0
  122. package/dist/util/unique.js +8 -0
  123. package/dist/valibot/{index.d.ts → valibot.d.ts} +1 -2
  124. package/dist/valibot/{index.js → valibot.js} +1 -6
  125. package/package.json +3 -1
  126. package/dist/auth/errors/jwt.d.ts +0 -8
  127. package/dist/auth/errors/jwt.js +0 -5
  128. package/dist/util/expect/index.d.ts +0 -103
  129. package/dist/util/expect/index.js +0 -259
  130. package/dist/util/index.d.ts +0 -10
  131. /package/dist/util/{geo → geometry}/index.d.ts +0 -0
  132. /package/dist/util/{geo → geometry}/index.js +0 -0
  133. /package/dist/util/{index.js → index.js__} +0 -0
@@ -0,0 +1,12 @@
1
+ /**
2
+ * JWT utilities main export
3
+ *
4
+ * @description
5
+ * This module provides a clean API for JWT operations including signing,
6
+ * verifying tokens, and generating secret keys.
7
+ */
8
+
9
+ export * from './jwt/core.js';
10
+ export * from './jwt/generators.js';
11
+ export * from './jwt/errors.js';
12
+ export * from './jwt/constants.js';
@@ -1,6 +1,6 @@
1
1
  /* ------------------------------------------------------------------ Imports */
2
2
 
3
- import * as expect from '../../../util/expect/index.js';
3
+ import * as expect from '../../../util/expect.js';
4
4
 
5
5
  import { PATH_SEPARATOR } from '../../../util/object/index.js';
6
6
 
@@ -28,7 +28,7 @@
28
28
 
29
29
  /* ------------------------------------------------------------------ Imports */
30
30
 
31
- import * as expect from '../../../util/expect/index.js';
31
+ import * as expect from '../../../util/expect.js';
32
32
 
33
33
  /* ------------------------------------------------------------------- Export */
34
34
 
@@ -34,7 +34,7 @@
34
34
 
35
35
  /* ------------------------------------------------------------------ Imports */
36
36
 
37
- import * as expect from '../../../util/expect/index.js';
37
+ import * as expect from '../../../util/expect.js';
38
38
 
39
39
  import { noop } from '../../../util/function/index.js';
40
40
 
@@ -2,7 +2,7 @@ import { writable } from 'svelte/store';
2
2
 
3
3
  // eslint-disable-next-line no-unused-vars
4
4
  import * as v from 'valibot';
5
- import { AbsOrRelUrl } from '../../../valibot/index.js';
5
+ import { AbsOrRelUrl } from '../../../valibot/parsers.js';
6
6
 
7
7
  import { SubscribersCount } from '../../../state/classes.js';
8
8
 
@@ -1 +1,3 @@
1
1
  export * from "./data/typedef.js";
2
+ declare const _default: {};
3
+ export default _default;
@@ -1 +1,3 @@
1
1
  export * from './data/typedef.js';
2
+
3
+ export default {};
@@ -3,9 +3,7 @@ import { LEVELS } from '../../constants.js';
3
3
  import {
4
4
  findRelevantFrameIndex,
5
5
  detectErrorMeta,
6
- formatErrorDisplay,
7
- isMeaningfulFunctionName,
8
- parseFunctionName
6
+ formatErrorDisplay
9
7
  } from './formatting.js';
10
8
 
11
9
  /**
@@ -362,6 +360,8 @@ export class ConsoleAdapter {
362
360
 
363
361
  let cleaned = trimmed;
364
362
 
363
+ console.log(123, cleaned);
364
+
365
365
  // Convert Chrome format to Firefox format for consistency
366
366
  if (isChromeFormat) {
367
367
  // "at functionName (url:line:col)" -> "functionName@url:line:col"
@@ -27,6 +27,14 @@ export class PinoAdapter {
27
27
  this.#projectRoot = import.meta.env.VITE_PROJECT_ROOT || process.cwd();
28
28
  const baseOptions = {
29
29
  serializers: {
30
+
31
+ //
32
+ // Use 'errors' property to trigger Pino's error serializer
33
+ // The serializer traverses the error.cause chain and outputs an array
34
+ // of serialized error objects, which is why we use 'errors' (plural)
35
+ // instead of Pino's standard 'err' property (which expects a single
36
+ // error)
37
+ //
30
38
  errors: (err) => {
31
39
 
32
40
  /** @type {import('./typedef').ErrorSummary[]} */
@@ -194,13 +202,18 @@ export class PinoAdapter {
194
202
  // Simplify pnpm paths: node_modules/.pnpm/package@version_deps/node_modules/package
195
203
  // becomes: node_modules/package
196
204
  const pnpmRegex =
197
- /node_modules\/\.pnpm\/([^@\/]+)@[^\/]+\/node_modules\/\1/g;
205
+ /node_modules\/\.pnpm\/([^@/]+)@[^/]+\/node_modules\/\1/g;
198
206
  cleaned = cleaned.replace(pnpmRegex, 'node_modules/$1');
199
207
 
200
208
  // Also handle cases where the package name might be different in the final path
201
- const pnpmRegex2 = /node_modules\/\.pnpm\/[^\/]+\/node_modules\/([^\/]+)/g;
209
+ const pnpmRegex2 = /node_modules\/\.pnpm\/[^/]+\/node_modules\/([^/]+)/g;
202
210
  cleaned = cleaned.replace(pnpmRegex2, 'node_modules/$1');
203
211
 
212
+ // Filter out Node.js internal modules
213
+ const lines = cleaned.split('\n');
214
+ const filteredLines = lines.filter(line => !line.includes('node:internal'));
215
+ cleaned = filteredLines.join('\n');
216
+
204
217
  return cleaned;
205
218
  }
206
219
 
@@ -217,7 +230,8 @@ export class PinoAdapter {
217
230
  timestamp
218
231
  };
219
232
 
220
- // Check if details contains an error and promote it to err property for pino serializer
233
+ // Check if details contains an error and promote it to error property for
234
+ // pino serializer
221
235
  if (details) {
222
236
  if (details instanceof Error) {
223
237
  // details is directly an error
@@ -0,0 +1,260 @@
1
+ /**
2
+ * Pino adapter for server-side logging
3
+ */
4
+ import pino from 'pino';
5
+ import { dev } from '$app/environment';
6
+
7
+ import {
8
+ detectErrorMeta,
9
+ findRelevantFrameIndex,
10
+ formatErrorDisplay
11
+ } from './formatting.js';
12
+
13
+ /**
14
+ * Pino adapter that bridges Logger events to pino
15
+ */
16
+ export class PinoAdapter {
17
+ #projectRoot = null;
18
+
19
+ /**
20
+ * Create a new PinoAdapter
21
+ *
22
+ * @param {Object} [options] - Pino configuration options
23
+ */
24
+ constructor(options = {}) {
25
+ // Determine project root once for stack trace cleaning
26
+ this.#projectRoot = import.meta.env.VITE_PROJECT_ROOT || process.cwd();
27
+ const baseOptions = {
28
+ serializers: {
29
+ errors: (err) => {
30
+
31
+ /** @type {import('./typedef').ErrorSummary[]} */
32
+ const chain = [];
33
+ let loggedAt = null;
34
+
35
+ let current = err;
36
+ let isFirst = true;
37
+
38
+ while (current && current instanceof Error) {
39
+ // Check if this is the first error and it's a LoggerError - extract logging context
40
+ if (isFirst && current.name === 'LoggerError') {
41
+ if (current.stack) {
42
+ const cleanedStackString = this.#cleanStackTrace(current.stack);
43
+ const cleanedStackArray = cleanedStackString
44
+ .split('\n')
45
+ .map((line) => line.trim())
46
+ .filter(
47
+ (line) =>
48
+ line && line !== current.name + ': ' + current.message
49
+ );
50
+
51
+ // For LoggerError, we know it's a logger.error call, so find the relevant frame
52
+ const loggerErrorIndex = cleanedStackArray.findIndex(frame =>
53
+ (frame.includes('Logger.error') && frame.includes('logger/Logger.js')) ||
54
+ (frame.includes('error@') && frame.includes('logger/Logger.js'))
55
+ );
56
+
57
+ if (loggerErrorIndex >= 0 && loggerErrorIndex + 1 < cleanedStackArray.length) {
58
+ const relevantFrame = cleanedStackArray[loggerErrorIndex + 1];
59
+
60
+ // Extract function name from the relevant frame
61
+ // const functionName = parseFunctionName(relevantFrame);
62
+
63
+ // const errorType = functionName ? `logger.error in ${functionName}` : 'logger.error';
64
+ loggedAt = relevantFrame.slice(3); // remove "at "
65
+ }
66
+ }
67
+
68
+ // Skip the LoggerError and move to the actual error
69
+ current = current.cause;
70
+ isFirst = false;
71
+ continue;
72
+ }
73
+ /** @type {import('./typedef').ErrorSummary} */
74
+ const serialized = {
75
+ name: current.name,
76
+ message: current.message
77
+ };
78
+
79
+ // Add error metadata for structured logging and terminal display
80
+ if (current.stack) {
81
+ // Convert cleaned stack string to array format expected by formatting functions
82
+ const cleanedStackString = this.#cleanStackTrace(current.stack);
83
+ const cleanedStackArray = cleanedStackString
84
+ .split('\n')
85
+ .map((line) => line.trim())
86
+ .filter(
87
+ (line) =>
88
+ line && line !== current.name + ': ' + current.message
89
+ );
90
+
91
+ const errorMeta = detectErrorMeta(current, cleanedStackArray);
92
+ const relevantFrameIndex = findRelevantFrameIndex(
93
+ current,
94
+ cleanedStackArray
95
+ );
96
+
97
+ serialized.meta = errorMeta;
98
+ serialized.errorType = formatErrorDisplay(errorMeta);
99
+
100
+ // Include stack frames for terminal display
101
+ serialized.stackFrames = cleanedStackArray
102
+ .slice(0, 9)
103
+ .map((frame, index) => {
104
+ const marker = index === relevantFrameIndex ? '→' : ' ';
105
+
106
+ return `${marker} ${frame}`;
107
+ });
108
+ }
109
+
110
+ // Include HttpError-specific properties
111
+ const httpError = /** @type {import('$lib/network/errors.js').HttpError} */ (current);
112
+ if (httpError.status !== undefined) {
113
+ serialized.status = httpError.status;
114
+ }
115
+ if (httpError.details !== undefined) {
116
+ serialized.details = httpError.details;
117
+ }
118
+
119
+ chain.push(serialized);
120
+ current = current.cause;
121
+ isFirst = false;
122
+ }
123
+
124
+ return loggedAt ? { chain, loggedAt } : chain;
125
+ }
126
+ }
127
+ };
128
+
129
+ // Add error handling for missing pino-pretty in dev
130
+ if ( dev) {
131
+ const devOptions = {
132
+ level: 'debug',
133
+ transport: {
134
+ target: 'pino-pretty',
135
+ options: {
136
+ colorize: true,
137
+ ignore: 'hostname,pid'
138
+ }
139
+ }
140
+ };
141
+
142
+ try {
143
+ this.pino = pino({ ...baseOptions, ...devOptions, ...options });
144
+ } catch (error) {
145
+ if (
146
+ error.message.includes('Cannot find module') &&
147
+ error.message.includes('pino-pretty')
148
+ ) {
149
+ const errorMessage = `
150
+ ╭─────────────────────────────────────────────────────────────╮
151
+ │ Missing Dependency │
152
+ ├─────────────────────────────────────────────────────────────┤
153
+ │ 'pino-pretty' is required for development logging │
154
+ │ Install it with: pnpm add -D pino-pretty │
155
+ ╰─────────────────────────────────────────────────────────────╯`;
156
+ console.error(errorMessage);
157
+ throw new Error('pino-pretty is required for development mode');
158
+ }
159
+ throw error;
160
+ }
161
+ } else {
162
+ this.pino = pino({ ...baseOptions, ...options });
163
+ }
164
+ }
165
+
166
+ /**
167
+ * Clean stack trace by removing project root path and simplifying node_modules
168
+ *
169
+ * @param {string} stack - Original stack trace
170
+ * @returns {string} Cleaned stack trace
171
+ */
172
+ #cleanStackTrace(stack) {
173
+ if (!stack || !this.#projectRoot) {
174
+ return stack;
175
+ }
176
+
177
+ let cleaned = stack;
178
+
179
+ // Escape special regex characters in the project root path
180
+ const escapedRoot = this.#projectRoot.replace(
181
+ /[.*+?^${}()|[\]\\]/g,
182
+ '\\$&'
183
+ );
184
+
185
+ // Replace project root path with relative path, handling file:// protocol
186
+ // Match both regular paths and file:// URLs
187
+ const rootRegex = new RegExp(
188
+ `(\\s+at\\s+.*\\()(file://)?${escapedRoot}[\\/\\\\]`,
189
+ 'g'
190
+ );
191
+ cleaned = cleaned.replace(rootRegex, '$1');
192
+
193
+ // Simplify pnpm paths: node_modules/.pnpm/package@version_deps/node_modules/package
194
+ // becomes: node_modules/package
195
+ const pnpmRegex =
196
+ /node_modules\/\.pnpm\/([^@\/]+)@[^\/]+\/node_modules\/\1/g;
197
+ cleaned = cleaned.replace(pnpmRegex, 'node_modules/$1');
198
+
199
+ // Also handle cases where the package name might be different in the final path
200
+ const pnpmRegex2 = /node_modules\/\.pnpm\/[^\/]+\/node_modules\/([^\/]+)/g;
201
+ cleaned = cleaned.replace(pnpmRegex2, 'node_modules/$1');
202
+
203
+ return cleaned;
204
+ }
205
+
206
+ /**
207
+ * Handle log events from Logger
208
+ *
209
+ * @param {Object} logEvent - Log event from Logger
210
+ */
211
+ handleLog(logEvent) {
212
+ const { level, message, details, source, timestamp } = logEvent;
213
+
214
+ const logData = {
215
+ source,
216
+ timestamp
217
+ };
218
+
219
+ // Check if details contains an error and promote it to err property for pino serializer
220
+ if (details) {
221
+ if (details instanceof Error) {
222
+ // details is directly an error
223
+ logData.err = details;
224
+ } else if (details.error instanceof Error) {
225
+ // details has an error property
226
+ logData.err = details.error;
227
+ // Include other details except the error
228
+ // eslint-disable-next-line no-unused-vars
229
+ const { error, ...otherDetails } = details;
230
+ if (Object.keys(otherDetails).length > 0) {
231
+ logData.details = otherDetails;
232
+ }
233
+ } else {
234
+ // No error found in details, include all details
235
+ logData.details = details;
236
+ }
237
+ }
238
+
239
+ // Check if we have loggedAt info from the serializer
240
+ if (logData.err && typeof logData.err === 'object' && logData.err.loggedAt) {
241
+ logData.loggedAt = logData.err.loggedAt;
242
+ logData.err = logData.err.chain;
243
+ }
244
+
245
+ this.pino[level](logData, message);
246
+ }
247
+
248
+ /**
249
+ * Create a child logger with additional context
250
+ *
251
+ * @param {Object} context - Additional context data
252
+ * @returns {PinoAdapter} New adapter instance with context
253
+ */
254
+ child(context) {
255
+ const childPino = this.pino.child(context);
256
+ const adapter = new PinoAdapter();
257
+ adapter.pino = childPino;
258
+ return adapter;
259
+ }
260
+ }
@@ -1,7 +1,8 @@
1
- import { expect, rethrow } from '../../util/index.js';
1
+ import * as expect from '../../util/expect.js';
2
+ import { rethrow } from '../../util/exceptions.js';
2
3
  import { HkPromise } from '../../generic/promises.js';
3
4
  import { httpGet } from '../../network/http/index.js';
4
- import { v } from '../../valibot/index.js';
5
+ import { v } from '../../valibot/valibot.js';
5
6
 
6
7
  /**
7
8
  * Test functions for generating various types of errors for logging demonstration
@@ -1,9 +1,9 @@
1
- import * as expect from '../../util/expect/index.js';
1
+ import * as expect from '../../util/expect.js';
2
2
  import { DetailedError } from '../../generic/errors.js';
3
3
 
4
4
  import { CONTENT_TYPE } from '../../constants/http/index.js';
5
5
 
6
- import { APPLICATION_JSON } from '../../constants/mime/index.js';
6
+ import { APPLICATION_JSON, TEXT_PLAIN } from '../../constants/mime/index.js';
7
7
 
8
8
  /**
9
9
  * Try to get error information from the server error response
@@ -77,8 +77,14 @@ export async function getErrorFromResponse(response) {
77
77
  }
78
78
  }
79
79
  }
80
- } else {
81
- // For non-JSON responses, always use status text (avoid HTML pages)
80
+ }
81
+
82
+ if (!message && contentType === TEXT_PLAIN ) {
83
+ message = await response.text();
84
+ }
85
+
86
+ if (!message) {
87
+ // Final fallback to status text (avoid HTML pages)
82
88
  message = response.statusText || `HTTP ${response.status}`;
83
89
  }
84
90
  // console.log( "message", message );
@@ -1,4 +1,4 @@
1
- import * as expect from '../../util/expect/index.js';
1
+ import * as expect from '../../util/expect.js';
2
2
 
3
3
  /**
4
4
  * Set headers in an existing `Headers` object
@@ -13,7 +13,7 @@ import { CONTENT_TYPE } from '../../constants/http/headers.js';
13
13
 
14
14
  import { AbortError, TimeoutError } from '../errors/api.js';
15
15
 
16
- import * as expect from '../../util/expect/index.js';
16
+ import * as expect from '../../util/expect.js';
17
17
 
18
18
  import { toURL } from './url.js';
19
19
  import { setRequestHeaders } from './headers.js';
@@ -4,7 +4,7 @@ import { APPLICATION_JSON } from '../../constants/mime/application.js';
4
4
  import { CONTENT_TYPE } from '../../constants/http/headers.js';
5
5
  import { ResponseError } from '../errors.js';
6
6
 
7
- import * as expect from '../../util/expect/index.js';
7
+ import * as expect from '../../util/expect.js';
8
8
 
9
9
  import { toURL } from './url.js';
10
10
  import { httpRequest } from './http-request.js';
@@ -1,5 +1,5 @@
1
1
  import { ResponseError, HttpError } from '../errors.js';
2
- import * as expect from '../../util/expect/index.js';
2
+ import * as expect from '../../util/expect.js';
3
3
  import { toURL } from './url.js';
4
4
 
5
5
  import {
@@ -1,4 +1,4 @@
1
- import * as expect from '../../../util/expect/index.js';
1
+ import * as expect from '../../../util/expect.js';
2
2
 
3
3
  import { LoadingStateMachine } from '../../../state/classes.js';
4
4
 
@@ -1,6 +1,6 @@
1
1
  /** @typedef {import('./typedef.js').ImageMeta} ImageMeta */
2
2
 
3
- import * as expect from '../../../util/expect/index.js';
3
+ import * as expect from '../../../util/expect.js';
4
4
 
5
5
  import { LoadingStateMachine } from '../../../state/classes.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { expect } from '../../../../util/index.js';
1
+ import * as expect from '../../../../util/expect.js';
2
2
 
3
3
  /**
4
4
  * Returns the unchanged image meta object or the last item of
@@ -16,7 +16,7 @@ import {
16
16
  INITIAL
17
17
  } from '../../state/classes/loading-state-machine/constants.js';
18
18
 
19
- import * as expect from '../../util/expect/index.js';
19
+ import * as expect from '../../util/expect.js';
20
20
 
21
21
  import { httpGet, loadResponseBuffer } from '../http.js';
22
22
 
@@ -2,3 +2,5 @@ export * from "./http/typedef.js";
2
2
  export * from "./cache/typedef.js";
3
3
  export * from "./states/typedef.js";
4
4
  export * from "./loaders/typedef.js";
5
+ declare const _default: {};
6
+ export default _default;
@@ -7,4 +7,6 @@
7
7
  export * from './http/typedef.js';
8
8
  export * from './cache/typedef.js';
9
9
  export * from './states/typedef.js';
10
- export * from './loaders/typedef.js';
10
+ export * from './loaders/typedef.js';
11
+
12
+ export default {};
@@ -446,9 +446,7 @@ export class ServiceBase extends EventEmitter {
446
446
  * @param {Error} error - Error that occurred
447
447
  */
448
448
  _setError(operation, error) {
449
- const detailedError = new DetailedError(`${operation} failed`, {
450
- cause: error
451
- });
449
+ const detailedError = new DetailedError(`${operation} failed`, null, error);
452
450
 
453
451
  this.error = detailedError;
454
452
  this._setState(ERROR_STATE);
@@ -1,2 +1,4 @@
1
1
  export * from "./service-base/typedef.js";
2
2
  export * from "./service-manager/typedef.js";
3
+ declare const _default: {};
4
+ export default _default;
@@ -1,2 +1,4 @@
1
1
  export * from './service-base/typedef.js';
2
2
  export * from './service-manager/typedef.js';
3
+
4
+ export default {};
@@ -0,0 +1,3 @@
1
+ export * from "./context/typedef.js";
2
+ declare const _default: {};
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ export * from './context/typedef.js';
2
+
3
+ export default {};
@@ -1,6 +1,6 @@
1
- export const createOrGetDragState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => DragState;
2
- export const createDragState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => DragState;
3
- export const getDragState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => DragState;
1
+ export const createOrGetDragState: (contextKey?: import("../../../state/typedef.js").ContextKey) => DragState;
2
+ export const createDragState: (contextKey?: import("../../../state/typedef.js").ContextKey) => DragState;
3
+ export const getDragState: (contextKey?: import("../../../state/typedef.js").ContextKey) => DragState;
4
4
  export type SimulatedDragEvent = import("../../typedef.js").SimulatedDragEvent;
5
5
  /** @typedef {import('../../typedef.js').SimulatedDragEvent} SimulatedDragEvent */
6
6
  declare class DragState {
@@ -1,6 +1,6 @@
1
1
  export class AppLayoutState {
2
2
  landscapeOnSmallScreen: boolean;
3
3
  }
4
- export const createOrGetState: (contextKey?: import("../../../state/context/typedef").ContextKey) => AppLayoutState;
5
- export const createState: (contextKey?: import("../../../state/context/typedef").ContextKey) => AppLayoutState;
6
- export const getState: (contextKey?: import("../../../state/context/typedef").ContextKey) => AppLayoutState;
4
+ export const createOrGetState: (contextKey?: import("../../../state/typedef").ContextKey) => AppLayoutState;
5
+ export const createState: (contextKey?: import("../../../state/typedef").ContextKey) => AppLayoutState;
6
+ export const getState: (contextKey?: import("../../../state/typedef").ContextKey) => AppLayoutState;
@@ -1,6 +1,6 @@
1
1
  import { tick } from 'svelte';
2
2
 
3
- import * as expect from '../../../util/expect/index.js';
3
+ import * as expect from '../../../util/expect.js';
4
4
 
5
5
  import { pushNotEmpty } from '../../../util/array/index.js';
6
6
 
@@ -48,7 +48,7 @@ export class HkTabBarState {
48
48
  */
49
49
  linkTab(index: number, tabElement: HTMLElement): void;
50
50
  }
51
- export const createOrGetState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => HkTabBarState;
52
- export const createState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => HkTabBarState;
53
- export const getState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => HkTabBarState;
51
+ export const createOrGetState: (contextKey?: import("../../../state/typedef.js").ContextKey) => HkTabBarState;
52
+ export const createState: (contextKey?: import("../../../state/typedef.js").ContextKey) => HkTabBarState;
53
+ export const getState: (contextKey?: import("../../../state/typedef.js").ContextKey) => HkTabBarState;
54
54
  export type Tab = import("./typedef.js").Tab;
@@ -14,6 +14,6 @@ export class HkTabBarSelectorState {
14
14
  tabBarState: import("./HkTabBar.state.svelte.js").HkTabBarState;
15
15
  #private;
16
16
  }
17
- export const createOrGetState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => HkTabBarSelectorState;
18
- export const createState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => HkTabBarSelectorState;
19
- export const getState: (contextKey?: import("../../../state/context/typedef.js").ContextKey) => HkTabBarSelectorState;
17
+ export const createOrGetState: (contextKey?: import("../../../state/typedef.js").ContextKey) => HkTabBarSelectorState;
18
+ export const createState: (contextKey?: import("../../../state/typedef.js").ContextKey) => HkTabBarSelectorState;
19
+ export const getState: (contextKey?: import("../../../state/typedef.js").ContextKey) => HkTabBarSelectorState;
@@ -172,12 +172,8 @@ export function findAll<T extends unknown>(arr: T[], selector: object | null): T
172
172
  * @returns {object}
173
173
  */
174
174
  export function arrayToObject(arr: any[], keys: string[]): object;
175
- export { PATH_SEPARATOR } from "../object/index.js";
176
- import { smallestFirst } from '../compare/index.js';
177
- import { largestFirst } from '../compare/index.js';
178
175
  export const arraySlice: (start?: number, end?: number) => any[];
179
176
  export const arrayConcat: {
180
177
  (...items: ConcatArray<any>[]): any[];
181
178
  (...items: any[]): any[];
182
179
  };
183
- export { smallestFirst, largestFirst };
@@ -1,6 +1,6 @@
1
1
  /* ------------------------------------------------------------------ Imports */
2
2
 
3
- import * as expect from '../expect/index.js';
3
+ import * as expect from '../expect.js';
4
4
 
5
5
  import { smallestFirst, largestFirst } from '../compare/index.js';
6
6
 
@@ -15,10 +15,6 @@ const arrayConcat = Array.prototype.concat;
15
15
 
16
16
  /* ------------------------------------------------------------------ Exports */
17
17
 
18
- export { PATH_SEPARATOR } from '../object/index.js';
19
-
20
- export { smallestFirst, largestFirst };
21
-
22
18
  export { arraySlice, arrayConcat };
23
19
 
24
20
  /**
@@ -0,0 +1 @@
1
+ export * from "./array/index.js";