@modern-js/utils 2.59.0 → 2.60.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ import { _ as _type_of } from "@swc/helpers/_/_type_of";
1
2
  function isString(str) {
2
3
  return typeof str === "string";
3
4
  }
@@ -11,13 +12,13 @@ function isFunction(func) {
11
12
  return typeof func === "function";
12
13
  }
13
14
  function isObject(obj) {
14
- return obj !== null && typeof obj === "object";
15
+ return obj !== null && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object";
15
16
  }
16
17
  function isPlainObject(obj) {
17
18
  return isObject(obj) && Object.prototype.toString.call(obj) === "[object Object]";
18
19
  }
19
20
  function isPromise(obj) {
20
- return Boolean(obj) && (typeof obj === "object" || typeof obj === "function") && typeof obj.then === "function";
21
+ return Boolean(obj) && ((typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object" || typeof obj === "function") && typeof obj.then === "function";
21
22
  }
22
23
  function isRegExp(obj) {
23
24
  return Object.prototype.toString.call(obj) === "[object RegExp]";
@@ -1,4 +1,5 @@
1
1
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
2
+ import { _ as _type_of } from "@swc/helpers/_/_type_of";
2
3
  var friendlySyntaxErrorLabel = "SyntaxError:";
3
4
  function isLikelyASyntaxError(message) {
4
5
  return message.includes(friendlySyntaxErrorLabel);
@@ -6,7 +7,7 @@ function isLikelyASyntaxError(message) {
6
7
  function formatMessage(stats) {
7
8
  var lines = [];
8
9
  var message;
9
- if (typeof stats === "object") {
10
+ if ((typeof stats === "undefined" ? "undefined" : _type_of(stats)) === "object") {
10
11
  var fileName = stats.moduleName ? "File: ".concat(stats.moduleName, "\n") : "";
11
12
  var mainMessage = typeof stats.formatted === "string" ? stats.formatted : stats.message;
12
13
  var details = stats.details ? "\nDetails: ".concat(stats.details, "\n") : "";
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.59.0",
18
+ "version": "2.60.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -151,7 +151,7 @@
151
151
  }
152
152
  },
153
153
  "dependencies": {
154
- "@swc/helpers": "0.5.3",
154
+ "@swc/helpers": "0.5.13",
155
155
  "caniuse-lite": "^1.0.30001520",
156
156
  "lodash": "^4.17.21",
157
157
  "rslog": "^1.1.0"
@@ -162,9 +162,9 @@
162
162
  "jest": "^29",
163
163
  "typescript": "^5",
164
164
  "webpack": "^5.94.0",
165
- "@modern-js/types": "2.59.0",
166
- "@scripts/build": "2.59.0",
167
- "@scripts/jest-config": "2.59.0"
165
+ "@modern-js/types": "2.60.0",
166
+ "@scripts/build": "2.60.0",
167
+ "@scripts/jest-config": "2.60.0"
168
168
  },
169
169
  "sideEffects": false,
170
170
  "scripts": {