@tstdl/base 0.91.11 → 0.91.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.
@@ -50,10 +50,10 @@ export class Collection {
50
50
  return this.size > 0;
51
51
  }
52
52
  constructor() {
53
- lazyProperty(this, '$size', () => untracked(() => toLazySignal(this.size$, { requireSync: true })));
54
- lazyProperty(this, '$observe', () => untracked(() => toLazySignal(this.observe$, { requireSync: true, equal: () => false })));
55
- lazyProperty(this, '$isEmpty', () => untracked(() => toLazySignal(this.isEmpty$, { requireSync: true })));
56
- lazyProperty(this, '$hasItems', () => untracked(() => toLazySignal(this.hasItems$, { requireSync: true })));
53
+ lazyProperty(this, '$size', () => untracked(() => toLazySignal(this.size$, { requireSync: true, manualCleanup: true })));
54
+ lazyProperty(this, '$observe', () => untracked(() => toLazySignal(this.observe$, { requireSync: true, manualCleanup: true, equal: () => false })));
55
+ lazyProperty(this, '$isEmpty', () => untracked(() => toLazySignal(this.isEmpty$, { requireSync: true, manualCleanup: true })));
56
+ lazyProperty(this, '$hasItems', () => untracked(() => toLazySignal(this.hasItems$, { requireSync: true, manualCleanup: true })));
57
57
  }
58
58
  [Symbol.iterator]() {
59
59
  return this.items();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.91.11",
3
+ "version": "0.91.13",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -134,7 +134,7 @@
134
134
  "typescript": "5.5"
135
135
  },
136
136
  "peerDependencies": {
137
- "@elastic/elasticsearch": "^8.14",
137
+ "@elastic/elasticsearch": "^8.15",
138
138
  "@koa/router": "^12.0",
139
139
  "@tstdl/angular": "^0.91",
140
140
  "@zxcvbn-ts/core": "^3.0",
@@ -5,8 +5,10 @@ import { boolean } from './schemas/boolean.js';
5
5
  import { func } from './schemas/function.js';
6
6
  import { number } from './schemas/number.js';
7
7
  import { getSchemaFromReflection } from './schemas/object.js';
8
+ import { readableStream } from './schemas/readable-stream.js';
8
9
  import { string } from './schemas/string.js';
9
10
  import { symbol } from './schemas/symbol.js';
11
+ import { uint8Array } from './schemas/uint8-array.js';
10
12
  export function schemaTestableToSchema(testable) {
11
13
  if (testable instanceof Schema) {
12
14
  return testable;
@@ -24,6 +26,10 @@ export function schemaTestableToSchema(testable) {
24
26
  return symbol();
25
27
  case Function:
26
28
  return func();
29
+ case Uint8Array:
30
+ return uint8Array();
31
+ case ReadableStream:
32
+ return readableStream();
27
33
  default:
28
34
  return getSchemaFromReflection(testable);
29
35
  }
package/signals/api.d.ts CHANGED
@@ -10,6 +10,7 @@ export type SignalsConfiguration<TInjector = SignalsInjector> = {
10
10
  isSignal: typeof Types.isSignal;
11
11
  toSignal: typeof Types.toSignal;
12
12
  toObservable: typeof Types.toObservable;
13
+ isInSignalsInjectionContext: () => boolean;
13
14
  getCurrentSignalsInjector: () => TInjector;
14
15
  runInSignalsInjectionContext: <ReturnT>(injector: TInjector, fn: () => ReturnT) => ReturnT;
15
16
  };
@@ -20,6 +21,7 @@ export declare let untracked: typeof Types.untracked;
20
21
  export declare let isSignal: typeof Types.isSignal;
21
22
  export declare let toSignal: typeof Types.toSignal;
22
23
  export declare let toObservable: typeof Types.toObservable;
24
+ export declare let isInSignalsInjectionContext: SignalsConfiguration['isInSignalsInjectionContext'];
23
25
  export declare let getCurrentSignalsInjector: SignalsConfiguration['getCurrentSignalsInjector'];
24
26
  export declare let runInSignalsInjectionContext: SignalsConfiguration['runInSignalsInjectionContext'];
25
27
  export declare function configureSignals<TInjector>(configuration: SignalsConfiguration<TInjector>): void;
package/signals/api.js CHANGED
@@ -6,11 +6,12 @@ export let untracked = throwSignalsNotConfigured;
6
6
  export let isSignal = throwSignalsNotConfigured;
7
7
  export let toSignal = throwSignalsNotConfigured;
8
8
  export let toObservable = throwSignalsNotConfigured;
9
+ export let isInSignalsInjectionContext = throwSignalsNotConfigured;
9
10
  export let getCurrentSignalsInjector = throwSignalsNotConfigured;
10
11
  export let runInSignalsInjectionContext = throwSignalsNotConfigured;
11
12
  /* eslint-enable import/no-mutable-exports */
12
13
  export function configureSignals(configuration) {
13
- ({ signal, computed, effect, untracked, isSignal, toSignal, toObservable, runInSignalsInjectionContext, getCurrentSignalsInjector } = configuration);
14
+ ({ signal, computed, effect, untracked, isSignal, toSignal, toObservable, isInSignalsInjectionContext, runInSignalsInjectionContext, getCurrentSignalsInjector } = configuration);
14
15
  }
15
16
  function throwSignalsNotConfigured() {
16
17
  throw new Error('Signals are not configured. Use configureDefaultSignalsImplementation() for default implementation or configureSignals() for custom implementation.');
@@ -15,6 +15,7 @@ export function configureDefaultSignalsImplementation() {
15
15
  isSignal,
16
16
  toSignal,
17
17
  toObservable,
18
+ isInSignalsInjectionContext: () => true,
18
19
  getCurrentSignalsInjector: () => null,
19
20
  runInSignalsInjectionContext: (_, fn) => fn()
20
21
  });