1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.createUnaryPlus = void 0;
|
7 |
|
8 | var _factory = require("../../utils/factory");
|
9 |
|
10 | var _collection = require("../../utils/collection");
|
11 |
|
12 | var _number = require("../../plain/number");
|
13 |
|
14 | var name = 'unaryPlus';
|
15 | var dependencies = ['typed', 'config', 'BigNumber'];
|
16 | var createUnaryPlus = (0, _factory.factory)(name, dependencies, function (_ref) {
|
17 | var typed = _ref.typed,
|
18 | config = _ref.config,
|
19 | BigNumber = _ref.BigNumber;
|
20 |
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | var unaryPlus = typed(name, {
|
46 | number: _number.unaryPlusNumber,
|
47 | Complex: function Complex(x) {
|
48 | return x;
|
49 | },
|
50 | BigNumber: function BigNumber(x) {
|
51 | return x;
|
52 | },
|
53 | Fraction: function Fraction(x) {
|
54 | return x;
|
55 | },
|
56 | Unit: function Unit(x) {
|
57 | return x.clone();
|
58 | },
|
59 | 'Array | Matrix': function ArrayMatrix(x) {
|
60 |
|
61 | return (0, _collection.deepMap)(x, unaryPlus, true);
|
62 | },
|
63 | 'boolean | string': function booleanString(x) {
|
64 |
|
65 | return config.number === 'BigNumber' ? new BigNumber(+x) : +x;
|
66 | }
|
67 | });
|
68 | return unaryPlus;
|
69 | });
|
70 | exports.createUnaryPlus = createUnaryPlus; |
\ | No newline at end of file |