Skip to content

Commit 482cd6b

Browse files
committed
feat: add configuration object
Changes: - Add a global configuration object `config` that can be used to set the number of digits after the floating point: `fractionDigits` - Update docs
1 parent 5b4e6d6 commit 482cd6b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262

6363
# Tests
6464
- name: Run tests
65-
run: pnpm test
65+
run: pnpm lint:fix && pnpm test
6666

6767
# Setup NPM
6868
- name: Create .npmrc

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ function generateSolution(raw: string[]) {
5656
let tmp = str;
5757
if (str) {
5858
tmp = str.replaceAll(/#\d/g, (m) => map[m]?.result || '');
59-
str = str.replaceAll(/#\d/g, (m) => map[m]?.expr || map[m]?.result || '');
59+
str = str.replaceAll(
60+
/#\d/g,
61+
(m) => map[m]?.expr || map[m]?.result || ''
62+
);
6063
if (tmp !== str) {
6164
box.unshift(tmp);
6265
}
@@ -133,4 +136,4 @@ export function evaluate(code: string): Result {
133136
};
134137
}
135138

136-
export { config } from './global';
139+
export { config } from './global';

0 commit comments

Comments
 (0)