mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-24 15:46:10 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
12 lines
360 B
TypeScript
12 lines
360 B
TypeScript
import type AbstractCalculator from './calculator';
|
|
import CSSCalculator from './CSSCalculator';
|
|
import NumCalculator from './NumCalculator';
|
|
|
|
const genCalc = (type: 'css' | 'js') => {
|
|
const Calculator = type === 'css' ? CSSCalculator : NumCalculator;
|
|
|
|
return (num: number | string | AbstractCalculator) => new Calculator(num);
|
|
};
|
|
|
|
export default genCalc;
|