ant-design/components/theme/util/calc/index.ts
叶枫 502dac12aa
docs: format code (#48309)
* docs: fix code

* feat: lint

* feat: prettier

* feat: test

* feat: review

* feat: format html

* feat: format html
2024-04-08 14:04:08 +08:00

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;