@nocobase/utils 1.9.0-alpha.14 → 1.9.0-alpha.15

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/lib/index.d.ts CHANGED
@@ -39,4 +39,5 @@ export * from './wrap-middleware';
39
39
  export * from './object-to-cli-args';
40
40
  export * from './parsedValue';
41
41
  export * from './dateRangeUtils';
42
+ export * from './parse-bigint';
42
43
  export { Schema } from '@formily/json-schema';
package/lib/index.js CHANGED
@@ -74,6 +74,7 @@ __reExport(src_exports, require("./wrap-middleware"), module.exports);
74
74
  __reExport(src_exports, require("./object-to-cli-args"), module.exports);
75
75
  __reExport(src_exports, require("./parsedValue"), module.exports);
76
76
  __reExport(src_exports, require("./dateRangeUtils"), module.exports);
77
+ __reExport(src_exports, require("./parse-bigint"), module.exports);
77
78
  var import_json_schema = require("@formily/json-schema");
78
79
  // Annotate the CommonJS export names for ESM import in node:
79
80
  0 && (module.exports = {
@@ -109,5 +110,6 @@ var import_json_schema = require("@formily/json-schema");
109
110
  ...require("./wrap-middleware"),
110
111
  ...require("./object-to-cli-args"),
111
112
  ...require("./parsedValue"),
112
- ...require("./dateRangeUtils")
113
+ ...require("./dateRangeUtils"),
114
+ ...require("./parse-bigint")
113
115
  });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const parseBigIntValue: (val: string | number) => string | number;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
15
+ var __export = (target, all) => {
16
+ for (var name in all)
17
+ __defProp(target, name, { get: all[name], enumerable: true });
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var parse_bigint_exports = {};
29
+ __export(parse_bigint_exports, {
30
+ parseBigIntValue: () => parseBigIntValue
31
+ });
32
+ module.exports = __toCommonJS(parse_bigint_exports);
33
+ const parseBigIntValue = /* @__PURE__ */ __name((val) => {
34
+ if (val === null || val === void 0) {
35
+ return val;
36
+ }
37
+ try {
38
+ const big = BigInt(val);
39
+ return big <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(big) : val;
40
+ } catch {
41
+ return val;
42
+ }
43
+ }, "parseBigIntValue");
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ parseBigIntValue
47
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/utils",
3
- "version": "1.9.0-alpha.14",
3
+ "version": "1.9.0-alpha.15",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "AGPL-3.0",
@@ -16,5 +16,5 @@
16
16
  "multer": "^1.4.5-lts.2",
17
17
  "object-path": "^0.11.8"
18
18
  },
19
- "gitHead": "0e2ad0f673bff626b4d59aaa9657ce5d5efb54c6"
19
+ "gitHead": "620cda051dd97134add40055d83039e3d9b6891e"
20
20
  }