@dereekb/rxjs 13.6.17 → 13.7.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/index.cjs.js +20 -3
- package/index.esm.js +20 -3
- package/package.json +2 -2
- package/src/lib/asset/asset.builder.d.ts +4 -0
- package/src/lib/asset/asset.loader.d.ts +2 -0
- package/src/lib/asset/asset.loader.delegated.d.ts +1 -0
- package/src/lib/asset/asset.loader.fetch.d.ts +1 -0
- package/src/lib/asset/asset.loader.memory.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -42,6 +42,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
42
42
|
* ```
|
|
43
43
|
*
|
|
44
44
|
* @param path - Relative path from the environment's base asset directory.
|
|
45
|
+
* @returns A local asset reference with the given path.
|
|
45
46
|
*/ function localAsset(path) {
|
|
46
47
|
return {
|
|
47
48
|
sourceType: 'local',
|
|
@@ -61,6 +62,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
61
62
|
* ```
|
|
62
63
|
*
|
|
63
64
|
* @param url - Absolute URL with http/https prefix to fetch the asset from.
|
|
65
|
+
* @returns A remote asset reference with the given URL.
|
|
64
66
|
* @throws Error if the URL does not have a valid http/https prefix.
|
|
65
67
|
*/ function remoteAsset(url) {
|
|
66
68
|
if (!util.isWebsiteUrlWithPrefix(url)) {
|
|
@@ -90,6 +92,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
90
92
|
* ```
|
|
91
93
|
*
|
|
92
94
|
* @param folder - Base folder path for the assets.
|
|
95
|
+
* @returns A fluent builder for creating local asset refs within the specified folder.
|
|
93
96
|
*/ function assetFolder(folder) {
|
|
94
97
|
var normalizedFolder = folder.endsWith('/') ? folder : folder + '/';
|
|
95
98
|
var builder = {
|
|
@@ -126,6 +129,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
126
129
|
* ```
|
|
127
130
|
*
|
|
128
131
|
* @param baseUrl - Base URL with http/https prefix.
|
|
132
|
+
* @returns A fluent builder for creating remote asset refs under the specified base URL.
|
|
129
133
|
* @throws Error if the base URL does not have a valid http/https prefix.
|
|
130
134
|
*/ function remoteAssetBaseUrl(baseUrl) {
|
|
131
135
|
if (!util.isWebsiteUrlWithPrefix(baseUrl)) {
|
|
@@ -162,6 +166,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
162
166
|
*
|
|
163
167
|
* @param ref - The asset path reference this instance represents.
|
|
164
168
|
* @param getFn - Promise-based function that loads the asset bytes.
|
|
169
|
+
* @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
|
|
165
170
|
*/ function assetLoaderAssetInstance(ref, getFn) {
|
|
166
171
|
return {
|
|
167
172
|
ref: function ref1() {
|
|
@@ -189,6 +194,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
189
194
|
* ```
|
|
190
195
|
*
|
|
191
196
|
* @param getFn - Promise-based function that loads any asset's bytes.
|
|
197
|
+
* @returns An {@link AssetLoader} that creates instances using the provided get function.
|
|
192
198
|
*/ function assetLoaderFromGetFn(getFn) {
|
|
193
199
|
var loader = {
|
|
194
200
|
get: function get(ref) {
|
|
@@ -217,6 +223,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
217
223
|
* ```
|
|
218
224
|
*
|
|
219
225
|
* @param config - Specifies the local and remote delegate loaders.
|
|
226
|
+
* @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
|
|
220
227
|
*/ function delegatedAssetLoader(config) {
|
|
221
228
|
var local = config.local, remote = config.remote;
|
|
222
229
|
var loader = {
|
|
@@ -374,6 +381,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
374
381
|
* ```
|
|
375
382
|
*
|
|
376
383
|
* @param config - Optional fetch configuration with custom fetch function.
|
|
384
|
+
* @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
|
|
377
385
|
*/ function fetchAssetLoader() {
|
|
378
386
|
var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
379
387
|
var _config_fetch;
|
|
@@ -552,6 +560,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
552
560
|
* ```
|
|
553
561
|
*
|
|
554
562
|
* @param assets - Map of asset refs to their raw byte data.
|
|
563
|
+
* @returns An {@link AssetLoader} backed by the provided in-memory map.
|
|
555
564
|
*/ function memoryAssetLoader(assets) {
|
|
556
565
|
var getFn = function getFn(ref) {
|
|
557
566
|
return _async_to_generator$2(function() {
|
|
@@ -5797,9 +5806,17 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
5797
5806
|
var state;
|
|
5798
5807
|
if (inputState != null) {
|
|
5799
5808
|
var end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5809
|
+
var hasNextPage = util.invertMaybeBoolean(end);
|
|
5810
|
+
// Reuse the same reference when hasNextPage hasn't changed to avoid
|
|
5811
|
+
// tricking downstream distinctUntilChanged/scan into treating a
|
|
5812
|
+
// re-emitted result as a new page (which causes duplicate accumulation).
|
|
5813
|
+
if (inputState.hasNextPage === hasNextPage) {
|
|
5814
|
+
state = inputState;
|
|
5815
|
+
} else {
|
|
5816
|
+
state = _object_spread_props$1(_object_spread$1({}, inputState), {
|
|
5817
|
+
hasNextPage: hasNextPage
|
|
5818
|
+
});
|
|
5819
|
+
}
|
|
5803
5820
|
}
|
|
5804
5821
|
return {
|
|
5805
5822
|
n: request.n,
|
package/index.esm.js
CHANGED
|
@@ -40,6 +40,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
40
40
|
* ```
|
|
41
41
|
*
|
|
42
42
|
* @param path - Relative path from the environment's base asset directory.
|
|
43
|
+
* @returns A local asset reference with the given path.
|
|
43
44
|
*/ function localAsset(path) {
|
|
44
45
|
return {
|
|
45
46
|
sourceType: 'local',
|
|
@@ -59,6 +60,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
59
60
|
* ```
|
|
60
61
|
*
|
|
61
62
|
* @param url - Absolute URL with http/https prefix to fetch the asset from.
|
|
63
|
+
* @returns A remote asset reference with the given URL.
|
|
62
64
|
* @throws Error if the URL does not have a valid http/https prefix.
|
|
63
65
|
*/ function remoteAsset(url) {
|
|
64
66
|
if (!isWebsiteUrlWithPrefix(url)) {
|
|
@@ -88,6 +90,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
88
90
|
* ```
|
|
89
91
|
*
|
|
90
92
|
* @param folder - Base folder path for the assets.
|
|
93
|
+
* @returns A fluent builder for creating local asset refs within the specified folder.
|
|
91
94
|
*/ function assetFolder(folder) {
|
|
92
95
|
var normalizedFolder = folder.endsWith('/') ? folder : folder + '/';
|
|
93
96
|
var builder = {
|
|
@@ -124,6 +127,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
124
127
|
* ```
|
|
125
128
|
*
|
|
126
129
|
* @param baseUrl - Base URL with http/https prefix.
|
|
130
|
+
* @returns A fluent builder for creating remote asset refs under the specified base URL.
|
|
127
131
|
* @throws Error if the base URL does not have a valid http/https prefix.
|
|
128
132
|
*/ function remoteAssetBaseUrl(baseUrl) {
|
|
129
133
|
if (!isWebsiteUrlWithPrefix(baseUrl)) {
|
|
@@ -160,6 +164,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
160
164
|
*
|
|
161
165
|
* @param ref - The asset path reference this instance represents.
|
|
162
166
|
* @param getFn - Promise-based function that loads the asset bytes.
|
|
167
|
+
* @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
|
|
163
168
|
*/ function assetLoaderAssetInstance(ref, getFn) {
|
|
164
169
|
return {
|
|
165
170
|
ref: function ref1() {
|
|
@@ -187,6 +192,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
187
192
|
* ```
|
|
188
193
|
*
|
|
189
194
|
* @param getFn - Promise-based function that loads any asset's bytes.
|
|
195
|
+
* @returns An {@link AssetLoader} that creates instances using the provided get function.
|
|
190
196
|
*/ function assetLoaderFromGetFn(getFn) {
|
|
191
197
|
var loader = {
|
|
192
198
|
get: function get(ref) {
|
|
@@ -215,6 +221,7 @@ function _class_call_check$9(instance, Constructor) {
|
|
|
215
221
|
* ```
|
|
216
222
|
*
|
|
217
223
|
* @param config - Specifies the local and remote delegate loaders.
|
|
224
|
+
* @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
|
|
218
225
|
*/ function delegatedAssetLoader(config) {
|
|
219
226
|
var local = config.local, remote = config.remote;
|
|
220
227
|
var loader = {
|
|
@@ -372,6 +379,7 @@ function _ts_generator$3(thisArg, body) {
|
|
|
372
379
|
* ```
|
|
373
380
|
*
|
|
374
381
|
* @param config - Optional fetch configuration with custom fetch function.
|
|
382
|
+
* @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
|
|
375
383
|
*/ function fetchAssetLoader() {
|
|
376
384
|
var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
377
385
|
var _config_fetch;
|
|
@@ -550,6 +558,7 @@ function _ts_generator$2(thisArg, body) {
|
|
|
550
558
|
* ```
|
|
551
559
|
*
|
|
552
560
|
* @param assets - Map of asset refs to their raw byte data.
|
|
561
|
+
* @returns An {@link AssetLoader} backed by the provided in-memory map.
|
|
553
562
|
*/ function memoryAssetLoader(assets) {
|
|
554
563
|
var getFn = function getFn(ref) {
|
|
555
564
|
return _async_to_generator$2(function() {
|
|
@@ -5795,9 +5804,17 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
5795
5804
|
var state;
|
|
5796
5805
|
if (inputState != null) {
|
|
5797
5806
|
var end = inputState.value != null ? isItemPageIteratorResultEndResult(inputState.value) : undefined;
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5807
|
+
var hasNextPage = invertMaybeBoolean(end);
|
|
5808
|
+
// Reuse the same reference when hasNextPage hasn't changed to avoid
|
|
5809
|
+
// tricking downstream distinctUntilChanged/scan into treating a
|
|
5810
|
+
// re-emitted result as a new page (which causes duplicate accumulation).
|
|
5811
|
+
if (inputState.hasNextPage === hasNextPage) {
|
|
5812
|
+
state = inputState;
|
|
5813
|
+
} else {
|
|
5814
|
+
state = _object_spread_props$1(_object_spread$1({}, inputState), {
|
|
5815
|
+
hasNextPage: hasNextPage
|
|
5816
|
+
});
|
|
5817
|
+
}
|
|
5801
5818
|
}
|
|
5802
5819
|
return {
|
|
5803
5820
|
n: request.n,
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import { type AssetLocalPathRef, type AssetRemotePathRef } from './asset';
|
|
|
10
10
|
* ```
|
|
11
11
|
*
|
|
12
12
|
* @param path - Relative path from the environment's base asset directory.
|
|
13
|
+
* @returns A local asset reference with the given path.
|
|
13
14
|
*/
|
|
14
15
|
export declare function localAsset(path: SlashPath): AssetLocalPathRef;
|
|
15
16
|
/**
|
|
@@ -25,6 +26,7 @@ export declare function localAsset(path: SlashPath): AssetLocalPathRef;
|
|
|
25
26
|
* ```
|
|
26
27
|
*
|
|
27
28
|
* @param url - Absolute URL with http/https prefix to fetch the asset from.
|
|
29
|
+
* @returns A remote asset reference with the given URL.
|
|
28
30
|
* @throws Error if the URL does not have a valid http/https prefix.
|
|
29
31
|
*/
|
|
30
32
|
export declare function remoteAsset(url: WebsiteUrlWithPrefix): AssetRemotePathRef;
|
|
@@ -65,6 +67,7 @@ export interface AssetFolderBuilder {
|
|
|
65
67
|
* ```
|
|
66
68
|
*
|
|
67
69
|
* @param folder - Base folder path for the assets.
|
|
70
|
+
* @returns A fluent builder for creating local asset refs within the specified folder.
|
|
68
71
|
*/
|
|
69
72
|
export declare function assetFolder(folder: SlashPath): AssetFolderBuilder;
|
|
70
73
|
/**
|
|
@@ -107,6 +110,7 @@ export interface RemoteAssetBuilder {
|
|
|
107
110
|
* ```
|
|
108
111
|
*
|
|
109
112
|
* @param baseUrl - Base URL with http/https prefix.
|
|
113
|
+
* @returns A fluent builder for creating remote asset refs under the specified base URL.
|
|
110
114
|
* @throws Error if the base URL does not have a valid http/https prefix.
|
|
111
115
|
*/
|
|
112
116
|
export declare function remoteAssetBaseUrl(baseUrl: WebsiteUrlWithPrefix): RemoteAssetBuilder;
|
|
@@ -13,6 +13,7 @@ import { type AssetPathRef, type AssetLoaderAssetInstance, type AssetLoaderGetFn
|
|
|
13
13
|
*
|
|
14
14
|
* @param ref - The asset path reference this instance represents.
|
|
15
15
|
* @param getFn - Promise-based function that loads the asset bytes.
|
|
16
|
+
* @returns An {@link AssetLoaderAssetInstance} with a cold observable that invokes getFn on each subscription.
|
|
16
17
|
*/
|
|
17
18
|
export declare function assetLoaderAssetInstance(ref: AssetPathRef, getFn: AssetLoaderGetFn): AssetLoaderAssetInstance;
|
|
18
19
|
/**
|
|
@@ -30,5 +31,6 @@ export declare function assetLoaderAssetInstance(ref: AssetPathRef, getFn: Asset
|
|
|
30
31
|
* ```
|
|
31
32
|
*
|
|
32
33
|
* @param getFn - Promise-based function that loads any asset's bytes.
|
|
34
|
+
* @returns An {@link AssetLoader} that creates instances using the provided get function.
|
|
33
35
|
*/
|
|
34
36
|
export declare function assetLoaderFromGetFn(getFn: AssetLoaderGetFn): AssetLoader;
|
|
@@ -32,5 +32,6 @@ export interface DelegatedAssetLoaderConfig {
|
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
34
|
* @param config - Specifies the local and remote delegate loaders.
|
|
35
|
+
* @returns An {@link AssetLoader} that routes requests to the appropriate delegate based on source type.
|
|
35
36
|
*/
|
|
36
37
|
export declare function delegatedAssetLoader(config: DelegatedAssetLoaderConfig): AssetLoader;
|
|
@@ -29,5 +29,6 @@ export interface FetchAssetLoaderConfig {
|
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* @param config - Optional fetch configuration with custom fetch function.
|
|
32
|
+
* @returns An {@link AssetLoader} that loads remote assets via HTTP fetch.
|
|
32
33
|
*/
|
|
33
34
|
export declare function fetchAssetLoader(config?: FetchAssetLoaderConfig): AssetLoader;
|
|
@@ -17,5 +17,6 @@ import { type AssetPathRef, type AssetLoader } from './asset';
|
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
19
|
* @param assets - Map of asset refs to their raw byte data.
|
|
20
|
+
* @returns An {@link AssetLoader} backed by the provided in-memory map.
|
|
20
21
|
*/
|
|
21
22
|
export declare function memoryAssetLoader(assets: Map<AssetPathRef, ArrayBuffer>): AssetLoader;
|