1 |
|
2 |
|
3 |
|
4 | import { createDeprecatedEval } from '../expression/function/eval'
|
5 | import { createDeprecatedImport } from '../core/function/deprecatedImport'
|
6 | import { createDeprecatedVar } from '../function/statistics/variance'
|
7 | import { createDeprecatedTypeof } from '../function/utils/typeOf'
|
8 | import {
|
9 | isAccessorNode,
|
10 | isArray,
|
11 | isArrayNode,
|
12 | isAssignmentNode,
|
13 | isBigNumber,
|
14 | isBlockNode,
|
15 | isBoolean, isChain, isCollection,
|
16 | isComplex,
|
17 | isConditionalNode,
|
18 | isConstantNode,
|
19 | isDate,
|
20 | isDenseMatrix,
|
21 | isFraction,
|
22 | isFunction,
|
23 | isFunctionAssignmentNode,
|
24 | isFunctionNode,
|
25 | isHelp,
|
26 | isIndex,
|
27 | isIndexNode,
|
28 | isMatrix,
|
29 | isNode,
|
30 | isNull,
|
31 | isNumber,
|
32 | isObject,
|
33 | isObjectNode,
|
34 | isOperatorNode,
|
35 | isParenthesisNode,
|
36 | isRange,
|
37 | isRangeNode,
|
38 | isRegExp,
|
39 | isResultSet,
|
40 | isSparseMatrix,
|
41 | isString, isSymbolNode,
|
42 | isUndefined,
|
43 | isUnit
|
44 | } from '../utils/is'
|
45 | import { ArgumentsError } from '../error/ArgumentsError'
|
46 | import { DimensionError } from '../error/DimensionError'
|
47 | import { IndexError } from '../error/IndexError'
|
48 | import { lazy } from '../utils/object'
|
49 | import { warnOnce } from '../utils/log'
|
50 | import {
|
51 | BigNumber,
|
52 | Complex,
|
53 | DenseMatrix,
|
54 | FibonacciHeap,
|
55 | Fraction,
|
56 | ImmutableDenseMatrix,
|
57 | Index,
|
58 | Matrix,
|
59 | ResultSet,
|
60 | Range,
|
61 | Spa,
|
62 | SparseMatrix,
|
63 | typeOf,
|
64 | Unit,
|
65 | variance
|
66 | } from './pureFunctionsAny.generated'
|
67 | import {
|
68 | AccessorNode,
|
69 | ArrayNode,
|
70 | AssignmentNode,
|
71 | BlockNode,
|
72 | Chain,
|
73 | ConditionalNode,
|
74 | ConstantNode,
|
75 | evaluate,
|
76 | FunctionAssignmentNode,
|
77 | FunctionNode,
|
78 | Help,
|
79 | IndexNode,
|
80 | Node,
|
81 | ObjectNode,
|
82 | OperatorNode,
|
83 | ParenthesisNode,
|
84 | parse,
|
85 | Parser,
|
86 | RangeNode,
|
87 | RelationalNode,
|
88 | reviver,
|
89 | SymbolNode
|
90 | } from './impureFunctionsAny.generated'
|
91 |
|
92 | export const deprecatedEval = createDeprecatedEval({ evaluate })
|
93 |
|
94 |
|
95 | export const deprecatedImport = createDeprecatedImport({})
|
96 |
|
97 |
|
98 | export const deprecatedVar = createDeprecatedVar({ variance })
|
99 |
|
100 |
|
101 | export const deprecatedTypeof = createDeprecatedTypeof({ typeOf })
|
102 |
|
103 | export const type = createDeprecatedProperties('type', {
|
104 | isNumber,
|
105 | isComplex,
|
106 | isBigNumber,
|
107 | isFraction,
|
108 | isUnit,
|
109 | isString,
|
110 | isArray,
|
111 | isMatrix,
|
112 | isCollection,
|
113 | isDenseMatrix,
|
114 | isSparseMatrix,
|
115 | isRange,
|
116 | isIndex,
|
117 | isBoolean,
|
118 | isResultSet,
|
119 | isHelp,
|
120 | isFunction,
|
121 | isDate,
|
122 | isRegExp,
|
123 | isObject,
|
124 | isNull,
|
125 | isUndefined,
|
126 | isAccessorNode,
|
127 | isArrayNode,
|
128 | isAssignmentNode,
|
129 | isBlockNode,
|
130 | isConditionalNode,
|
131 | isConstantNode,
|
132 | isFunctionAssignmentNode,
|
133 | isFunctionNode,
|
134 | isIndexNode,
|
135 | isNode,
|
136 | isObjectNode,
|
137 | isOperatorNode,
|
138 | isParenthesisNode,
|
139 | isRangeNode,
|
140 | isSymbolNode,
|
141 | isChain,
|
142 | BigNumber,
|
143 | Chain,
|
144 | Complex,
|
145 | Fraction,
|
146 | Matrix,
|
147 | DenseMatrix,
|
148 | SparseMatrix,
|
149 | Spa,
|
150 | FibonacciHeap,
|
151 | ImmutableDenseMatrix,
|
152 | Index,
|
153 | Range,
|
154 | ResultSet,
|
155 | Unit,
|
156 | Help,
|
157 | Parser
|
158 | })
|
159 |
|
160 | export const expression = createDeprecatedProperties('expression', {
|
161 | parse,
|
162 | Parser,
|
163 | node: createDeprecatedProperties('expression.node', {
|
164 | AccessorNode,
|
165 | ArrayNode,
|
166 | AssignmentNode,
|
167 | BlockNode,
|
168 | ConditionalNode,
|
169 | ConstantNode,
|
170 | IndexNode,
|
171 | FunctionAssignmentNode,
|
172 | FunctionNode,
|
173 | Node,
|
174 | ObjectNode,
|
175 | OperatorNode,
|
176 | ParenthesisNode,
|
177 | RangeNode,
|
178 | RelationalNode,
|
179 | SymbolNode
|
180 | })
|
181 | })
|
182 |
|
183 | export const json = createDeprecatedProperties('json', {
|
184 | reviver
|
185 | })
|
186 |
|
187 | export const error = createDeprecatedProperties('error', {
|
188 | ArgumentsError,
|
189 | DimensionError,
|
190 | IndexError
|
191 | })
|
192 |
|
193 | function createDeprecatedProperties (path, props) {
|
194 | const obj = {}
|
195 |
|
196 | Object.keys(props).forEach(name => {
|
197 | lazy(obj, name, () => {
|
198 | warnOnce(`math.${path}.${name} is moved to math.${name} in v6.0.0. ` +
|
199 | 'Please use the new location instead.')
|
200 | return props[name]
|
201 | })
|
202 | })
|
203 |
|
204 | return obj
|
205 | }
|