@headless-tree/core 0.0.0-20250716232056 → 0.0.0-20250716233347

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @headless-tree/core
2
2
 
3
- ## 0.0.0-20250716232056
3
+ ## 0.0.0-20250716233347
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -12,9 +12,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.syncDataLoaderFeature = void 0;
13
13
  const utils_1 = require("../../utils");
14
14
  const errors_1 = require("../../utilities/errors");
15
+ const undefErrorMessage = "sync dataLoader returned undefined";
15
16
  const promiseErrorMessage = "sync dataLoader returned promise";
16
17
  const unpromise = (data) => {
17
- if (!data || (typeof data === "object" && "then" in data)) {
18
+ if (!data) {
19
+ throw (0, errors_1.throwError)(undefErrorMessage);
20
+ }
21
+ if (typeof data === "object" && "then" in data) {
18
22
  throw (0, errors_1.throwError)(promiseErrorMessage);
19
23
  }
20
24
  return data;
@@ -9,9 +9,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { makeStateUpdater } from "../../utils";
11
11
  import { throwError } from "../../utilities/errors";
12
+ const undefErrorMessage = "sync dataLoader returned undefined";
12
13
  const promiseErrorMessage = "sync dataLoader returned promise";
13
14
  const unpromise = (data) => {
14
- if (!data || (typeof data === "object" && "then" in data)) {
15
+ if (!data) {
16
+ throw throwError(undefErrorMessage);
17
+ }
18
+ if (typeof data === "object" && "then" in data) {
15
19
  throw throwError(promiseErrorMessage);
16
20
  }
17
21
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-tree/core",
3
- "version": "0.0.0-20250716232056",
3
+ "version": "0.0.0-20250716233347",
4
4
  "main": "lib/cjs/index.js",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/esm/index.d.ts",
@@ -2,9 +2,13 @@ import { FeatureImplementation } from "../../types/core";
2
2
  import { makeStateUpdater } from "../../utils";
3
3
  import { throwError } from "../../utilities/errors";
4
4
 
5
+ const undefErrorMessage = "sync dataLoader returned undefined";
5
6
  const promiseErrorMessage = "sync dataLoader returned promise";
6
7
  const unpromise = <T>(data: T | Promise<T>): T => {
7
- if (!data || (typeof data === "object" && "then" in data)) {
8
+ if (!data) {
9
+ throw throwError(undefErrorMessage);
10
+ }
11
+ if (typeof data === "object" && "then" in data) {
8
12
  throw throwError(promiseErrorMessage);
9
13
  }
10
14
  return data;