@hkdigital/lib-core 0.3.1 → 0.3.3

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 (40) hide show
  1. package/README.md +1 -1
  2. package/dist/components/drag-drop/Draggable.svelte +1 -1
  3. package/dist/components/drag-drop/DropZone.svelte +1 -1
  4. package/dist/components/inputs/text-input/TextInput.svelte +2 -2
  5. package/dist/constants/index.d.ts +5 -1
  6. package/dist/constants/index.js +5 -2
  7. package/dist/constants/states/index.d.ts +4 -0
  8. package/dist/constants/states/index.js +4 -0
  9. package/dist/util/exceptions/index.d.ts +3 -3
  10. package/dist/util/exceptions/index.js +2 -2
  11. package/dist/util/http/http-request.js +1 -1
  12. package/dist/util/http/index.js +1 -1
  13. package/dist/util/http/json-request.js +1 -1
  14. package/dist/util/http/response.js +1 -1
  15. package/dist/util/http/url.js +1 -1
  16. package/dist/util/time/index.js +1 -1
  17. package/dist/util/unique/index.js +1 -1
  18. package/package.json +1 -1
  19. /package/dist/constants/{bases.d.ts → bases/index.d.ts} +0 -0
  20. /package/dist/constants/{bases.js → bases/index.js} +0 -0
  21. /package/dist/constants/{state-labels/drag-states.d.ts → states/drag.d.ts} +0 -0
  22. /package/dist/constants/{state-labels/drag-states.js → states/drag.js} +0 -0
  23. /package/dist/constants/{state-labels/drop-states.d.ts → states/drop.d.ts} +0 -0
  24. /package/dist/constants/{state-labels/drop-states.js → states/drop.js} +0 -0
  25. /package/dist/constants/{state-labels/input-states.d.ts → states/input.d.ts} +0 -0
  26. /package/dist/constants/{state-labels/input-states.js → states/input.js} +0 -0
  27. /package/dist/constants/{state-labels/submit-states.d.ts → states/submit.d.ts} +0 -0
  28. /package/dist/constants/{state-labels/submit-states.js → states/submit.js} +0 -0
  29. /package/dist/constants/{time.d.ts → time/index.d.ts} +0 -0
  30. /package/dist/constants/{time.js → time/index.js} +0 -0
  31. /package/dist/{constants/errors → errors}/api.d.ts +0 -0
  32. /package/dist/{constants/errors → errors}/api.js +0 -0
  33. /package/dist/{constants/errors → errors}/generic.d.ts +0 -0
  34. /package/dist/{constants/errors → errors}/generic.js +0 -0
  35. /package/dist/{constants/errors → errors}/http.d.ts +0 -0
  36. /package/dist/{constants/errors → errors}/http.js +0 -0
  37. /package/dist/{constants/errors → errors}/index.d.ts +0 -0
  38. /package/dist/{constants/errors → errors}/index.js +0 -0
  39. /package/dist/{constants/errors → errors}/jwt.d.ts +0 -0
  40. /package/dist/{constants/errors → errors}/jwt.js +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # HKdigital's lib-core
2
2
 
3
- Core library that we use to power up our Sveltekit projects
3
+ Core library that we use to power up our SvelteKit projects
4
4
 
5
5
  This is a library for [SvelteKit](https://svelte.dev/) projects.
6
6
  It contains common code and components that we use to create our projects.
@@ -10,7 +10,7 @@
10
10
  DRAGGING,
11
11
  DRAG_PREVIEW,
12
12
  DROPPING
13
- } from '../../constants/state-labels/drag-states.js';
13
+ } from '../../constants/states/drag.js';
14
14
 
15
15
  /** @typedef {import('../../typedef').SimulatedDragEvent} SimulatedDragEvent */
16
16
 
@@ -8,7 +8,7 @@
8
8
  DRAG_OVER,
9
9
  CAN_DROP,
10
10
  CANNOT_DROP
11
- } from '../../constants/state-labels/drop-states.js';
11
+ } from '../../constants/states/drop.js';
12
12
 
13
13
  /** @typedef {import('../../typedef').DragData} DragData */
14
14
  /** @typedef {import('../../typedef').DropData} DropData */
@@ -15,7 +15,7 @@
15
15
  INVALID,
16
16
  REQUIRED,
17
17
  DISABLED
18
- } from '../../../constants/state-labels/input-states.js';
18
+ } from '../../../constants/states/input.js';
19
19
 
20
20
  /**
21
21
  * @type {{
@@ -133,7 +133,7 @@
133
133
  //
134
134
  // Return CSS classes that indicate the component's state
135
135
  //
136
- // @see $lib/constants/state-labels
136
+ // @see $lib/constants/states
137
137
  //
138
138
  const outArr = [];
139
139
 
@@ -1,2 +1,6 @@
1
+ export * as bases from "./bases/index.js";
2
+ export * as http from "./http/index.js";
3
+ export * as mime from "./mime/index.js";
1
4
  export * as regexp from "./regexp/index.js";
2
- export * as time from "./time.js";
5
+ export * as states from "./states/index.js";
6
+ export * as time from "./time/index.js";
@@ -1,3 +1,6 @@
1
+ export * as bases from './bases/index.js';
2
+ export * as http from './http/index.js';
3
+ export * as mime from './mime/index.js';
1
4
  export * as regexp from './regexp/index.js';
2
- export * as time from './time.js';
3
- //export * as stateLabels from './state-labels/index.js';
5
+ export * as states from './states/index.js';
6
+ export * as time from './time/index.js';
@@ -0,0 +1,4 @@
1
+ export * as drag from "./drag.js";
2
+ export * as drop from "./drop.js";
3
+ export * as input from "./input.js";
4
+ export * as submit from "./submit.js";
@@ -0,0 +1,4 @@
1
+ export * as drag from './drag.js';
2
+ export * as drop from './drop.js';
3
+ export * as input from './input.js';
4
+ export * as submit from './submit.js';
@@ -5,11 +5,11 @@
5
5
  *
6
6
  * @param {string} message - Additional message to prepend
7
7
  * @param {Error|string} error - Original error
8
- * @param {string|Object.<string, any>} details
8
+ * @param {string|Object.<string, any>|null} [details]
9
9
  *
10
10
  * @throws {DetailedError}
11
11
  * @returns {never} This function never returns
12
12
  */
13
- export function rethrow(message: string, error: Error | string, details: string | {
13
+ export function rethrow(message: string, error: Error | string, details?: string | {
14
14
  [x: string]: any;
15
- }): never;
15
+ } | null): never;
@@ -1,5 +1,5 @@
1
1
 
2
- import { DetailedError } from "../../constants/errors/generic.js";
2
+ import { DetailedError } from "../../errors/generic.js";
3
3
 
4
4
  /**
5
5
  * Creates a new Error from the error message and throws it with a reference
@@ -8,7 +8,7 @@ import { DetailedError } from "../../constants/errors/generic.js";
8
8
  *
9
9
  * @param {string} message - Additional message to prepend
10
10
  * @param {Error|string} error - Original error
11
- * @param {string|Object.<string, any>} details
11
+ * @param {string|Object.<string, any>|null} [details]
12
12
  *
13
13
  * @throws {DetailedError}
14
14
  * @returns {never} This function never returns
@@ -11,7 +11,7 @@ import {
11
11
  import { APPLICATION_JSON } from '../../constants/mime/application.js';
12
12
  import { CONTENT_TYPE } from '../../constants/http/headers.js';
13
13
 
14
- import { AbortError, TimeoutError } from '../../constants/errors/api.js';
14
+ import { AbortError, TimeoutError } from '../../errors/api.js';
15
15
 
16
16
  import * as expect from '../expect/index.js';
17
17
 
@@ -5,7 +5,7 @@
5
5
  // AbortError,
6
6
  // TimeoutError,
7
7
  // TypeOrValueError
8
- // } from '$lib/constants/errors/index.js';
8
+ // } from '$lib/errors/index.js';
9
9
 
10
10
  // import { setRequestHeaders } from './headers.js';
11
11
  // import { getErrorFromResponse } from './errors.js';
@@ -2,7 +2,7 @@ import { METHOD_GET, METHOD_POST } from '../../constants/http/methods.js';
2
2
 
3
3
  import { APPLICATION_JSON } from '../../constants/mime/application.js';
4
4
  import { CONTENT_TYPE } from '../../constants/http/headers.js';
5
- import { ResponseError } from '../../constants/errors/index.js';
5
+ import { ResponseError } from '../../errors/index.js';
6
6
 
7
7
  import * as expect from '../expect/index.js';
8
8
 
@@ -1,4 +1,4 @@
1
- import { ResponseError } from '../../constants/errors/index.js';
1
+ import { ResponseError } from '../../errors/index.js';
2
2
  import * as expect from '../expect/index.js';
3
3
  import { toURL } from './url.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { TypeOrValueError } from '../../constants/errors/index.js';
1
+ import { TypeOrValueError } from '../../errors/index.js';
2
2
 
3
3
  /**
4
4
  * Returns an URL instance
@@ -33,7 +33,7 @@ import {
33
33
  MINUTE_MS,
34
34
  HOUR_MS,
35
35
  DAY_MS,
36
- TIME_2025_01_01 } from '../../constants/time.js';
36
+ TIME_2025_01_01 } from '../../constants/time/index.js';
37
37
 
38
38
  import * as expect from '../expect';
39
39
  import { HkPromise } from '../../classes/promise/index.js';
@@ -17,7 +17,7 @@
17
17
 
18
18
  /* ------------------------------------------------------------------ Imports */
19
19
 
20
- import { ALPHABET_BASE_HUMAN, ALPHABET_BASE_58 } from '../../constants/bases.js';
20
+ import { ALPHABET_BASE_HUMAN, ALPHABET_BASE_58 } from '../../constants/bases/index.js';
21
21
 
22
22
  import { base58fromNumber } from '../bases';
23
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes