reactronic 0.22.503 → 0.22.504

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.
@@ -45,7 +45,7 @@ export declare class Collection<T> implements CollectionReader<T> {
45
45
  lookup(key: string | undefined): Item<T> | undefined;
46
46
  claim(key: string, resolution?: {
47
47
  isDuplicate: boolean;
48
- }): Item<T> | undefined;
48
+ }, error?: string): Item<T> | undefined;
49
49
  add(instance: T): Item<T>;
50
50
  remove(item: Item<T>): void;
51
51
  move(item: Item<T>, after: Item<T>): void;
@@ -37,10 +37,10 @@ export class Collection {
37
37
  }
38
38
  return result;
39
39
  }
40
- claim(key, resolution) {
40
+ claim(key, resolution, error) {
41
41
  const tag = this.tag;
42
42
  if (tag < 0)
43
- throw new Error('merge is not in progress');
43
+ throw new Error(error !== null && error !== void 0 ? error : 'merge is not in progress');
44
44
  let item = this.strictNextItem;
45
45
  if (key !== (item ? this.getKey(item.instance) : undefined))
46
46
  item = this.lookup(key);
@@ -58,7 +58,7 @@ export class Collection {
58
58
  else if (resolution)
59
59
  resolution.isDuplicate = true;
60
60
  else
61
- throw new Error(`duplicate item: ${key}`);
61
+ throw new Error(`duplicate collection item: ${key}`);
62
62
  }
63
63
  else if (resolution)
64
64
  resolution.isDuplicate = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactronic",
3
- "version": "0.22.503",
3
+ "version": "0.22.504",
4
4
  "description": "Reactronic - Transactional Reactive State Management",
5
5
  "publisher": "Nezaboodka Software",
6
6
  "license": "Apache-2.0",
@@ -33,8 +33,8 @@
33
33
  "devDependencies": {
34
34
  "@types/node": "18.11.9",
35
35
  "@types/react": "18.0.25",
36
- "@typescript-eslint/eslint-plugin": "5.42.0",
37
- "@typescript-eslint/parser": "5.42.0",
36
+ "@typescript-eslint/eslint-plugin": "5.42.1",
37
+ "@typescript-eslint/parser": "5.42.1",
38
38
  "ava": "4.3.3",
39
39
  "c8": "7.12.0",
40
40
  "eslint": "8.27.0",