element-vir 26.12.1 → 26.12.2
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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +8 -8
- package/dist/util/map-async-value.d.ts +0 -7
- package/dist/util/map-async-value.js +0 -31
package/dist/index.d.ts
CHANGED
|
@@ -39,5 +39,4 @@ export * from './template-transforms/vir-html/vir-html.js';
|
|
|
39
39
|
export * from './typed-event/typed-event.js';
|
|
40
40
|
export * from './util/increment.js';
|
|
41
41
|
export * from './util/lit-template.js';
|
|
42
|
-
export * from './util/map-async-value.js';
|
|
43
42
|
export * from './util/type.js';
|
package/dist/index.js
CHANGED
|
@@ -39,5 +39,4 @@ export * from './template-transforms/vir-html/vir-html.js';
|
|
|
39
39
|
export * from './typed-event/typed-event.js';
|
|
40
40
|
export * from './util/increment.js';
|
|
41
41
|
export * from './util/lit-template.js';
|
|
42
|
-
export * from './util/map-async-value.js';
|
|
43
42
|
export * from './util/type.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "element-vir",
|
|
3
|
-
"version": "26.12.
|
|
3
|
+
"version": "26.12.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"custom",
|
|
6
6
|
"web",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"test:docs": "virmator docs check"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@augment-vir/assert": "^31.54.
|
|
43
|
-
"@augment-vir/common": "^31.54.
|
|
44
|
-
"date-vir": "^8.
|
|
42
|
+
"@augment-vir/assert": "^31.54.4",
|
|
43
|
+
"@augment-vir/common": "^31.54.4",
|
|
44
|
+
"date-vir": "^8.1.0",
|
|
45
45
|
"lit": "^3.3.1",
|
|
46
46
|
"lit-css-vars": "^3.0.11",
|
|
47
47
|
"lit-html": "^3.3.1",
|
|
48
48
|
"object-shape-tester": "^6.10.0",
|
|
49
|
-
"observavir": "^2.
|
|
49
|
+
"observavir": "^2.3.0",
|
|
50
50
|
"typed-event-target": "^4.1.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@augment-vir/test": "^31.54.
|
|
54
|
-
"@augment-vir/web": "^31.54.
|
|
53
|
+
"@augment-vir/test": "^31.54.4",
|
|
54
|
+
"@augment-vir/web": "^31.54.4",
|
|
55
55
|
"@web/dev-server-esbuild": "^1.0.4",
|
|
56
56
|
"@web/test-runner": "^0.20.2",
|
|
57
57
|
"@web/test-runner-commands": "^0.9.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"type-fest": "^5.3.1",
|
|
64
64
|
"typedoc": "^0.28.15",
|
|
65
65
|
"typescript": "5.9.3",
|
|
66
|
-
"vite": "^7.
|
|
66
|
+
"vite": "^7.3.0",
|
|
67
67
|
"vite-tsconfig-paths": "^5.1.4"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type AsyncValue } from 'observavir';
|
|
2
|
-
/**
|
|
3
|
-
* Maps an async value to a new async value.
|
|
4
|
-
*
|
|
5
|
-
* @category Util
|
|
6
|
-
*/
|
|
7
|
-
export declare function mapAsyncValue<const OriginalValue, const MappedValue>(asyncValue: AsyncValue<OriginalValue>, mapper: (value: NoInfer<OriginalValue>) => MappedValue): AsyncValue<MappedValue>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { isNotNoUpdate } from 'observavir';
|
|
2
|
-
/**
|
|
3
|
-
* Maps an async value to a new async value.
|
|
4
|
-
*
|
|
5
|
-
* @category Util
|
|
6
|
-
*/
|
|
7
|
-
export function mapAsyncValue(asyncValue, mapper) {
|
|
8
|
-
if (asyncValue instanceof Error) {
|
|
9
|
-
return asyncValue;
|
|
10
|
-
}
|
|
11
|
-
else if (asyncValue instanceof Promise) {
|
|
12
|
-
return asyncValue.then((value) => {
|
|
13
|
-
const mapped = mapper(value);
|
|
14
|
-
if (isNotNoUpdate(mapped)) {
|
|
15
|
-
return mapped;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
throw new Error('Cannot map to no update.');
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const mapped = mapper(asyncValue);
|
|
24
|
-
if (isNotNoUpdate(mapped)) {
|
|
25
|
-
return mapped;
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
throw new Error('Cannot map to no update.');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|