Last change
on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
583 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var _typeof = require("@babel/runtime/helpers/typeof")["default"];
|
---|
| 2 |
|
---|
| 3 | function _toPrimitive(input, hint) {
|
---|
| 4 | if (_typeof(input) !== "object" || input === null) return input;
|
---|
| 5 | var prim = input[Symbol.toPrimitive];
|
---|
| 6 |
|
---|
| 7 | if (prim !== undefined) {
|
---|
| 8 | var res = prim.call(input, hint || "default");
|
---|
| 9 | if (_typeof(res) !== "object") return res;
|
---|
| 10 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | return (hint === "string" ? String : Number)(input);
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | module.exports = _toPrimitive;
|
---|
| 17 | module.exports["default"] = module.exports, module.exports.__esModule = true; |
---|
Note:
See
TracBrowser
for help on using the repository browser.