summaryrefslogtreecommitdiff
path: root/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2023-12-21 22:46:53 +0800
committerlittleblack111 <littleblack11111@gmail.com>2023-12-21 22:46:53 +0800
commitf06956efd2dc4bf77244a9fcce2b883a00b925af (patch)
tree0123cb73ce67f1f4b17e1d6cbabff076ee44e31b /node_modules/@babel/runtime/helpers/esm/toPrimitive.js
parent8d980c13970c15b6d2312b6fc4ac51698dd0d220 (diff)
updated node modules
Diffstat (limited to 'node_modules/@babel/runtime/helpers/esm/toPrimitive.js')
-rw-r--r--node_modules/@babel/runtime/helpers/esm/toPrimitive.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/node_modules/@babel/runtime/helpers/esm/toPrimitive.js b/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
index cbfabb7f..56b19f5a 100644
--- a/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
+++ b/node_modules/@babel/runtime/helpers/esm/toPrimitive.js
@@ -1,11 +1,11 @@
import _typeof from "./typeof.js";
-export default function _toPrimitive(input, hint) {
- if (_typeof(input) !== "object" || input === null) return input;
- var prim = input[Symbol.toPrimitive];
- if (prim !== undefined) {
- var res = prim.call(input, hint || "default");
- if (_typeof(res) !== "object") return res;
+export default function toPrimitive(t, r) {
+ if ("object" != _typeof(t) || !t) return t;
+ var e = t[Symbol.toPrimitive];
+ if (void 0 !== e) {
+ var i = e.call(t, r || "default");
+ if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
- return (hint === "string" ? String : Number)(input);
+ return ("string" === r ? String : Number)(t);
} \ No newline at end of file