Skip to content

Commit

Permalink
fix(formula): type error
Browse files Browse the repository at this point in the history
  • Loading branch information
DR-Univer committed Oct 17, 2024
1 parent 2d772d1 commit 2431567
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions packages/core/src/services/log/log.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ export class DesktopLogService extends Disposable implements ILogService {
method: typeof console.log | typeof console.error | typeof console.warn | typeof console.debug,
...args: ArgsType
): void {
// const firstArg = args[0];
// const withTag = /^\[(.*?)\]/g.test(firstArg);
// if (withTag) {
// method(`\x1B[97;104m${firstArg}\x1B[0m`, ...args.slice(1));
// } else {
// method(...args);
// }
const firstArg = args[0];
const withTag = /^\[(.*?)\]/g.test(firstArg);
if (withTag) {
method(`\x1B[97;104m${firstArg}\x1B[0m`, ...args.slice(1));
} else {
method(...args);
}
}
}
12 changes: 6 additions & 6 deletions packages/engine-formula/src/basics/__tests__/regex.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { describe, expect, it } from 'vitest';
import { isReferenceString, REFERENCE_TABLE_MULTIPLE_COLUMN_REGEX, REFERENCE_TABLE_SINGLE_COLUMN_REGEX, regexTestColumn, regexTestRow, regexTestSingeRange } from '../regex';
import { isReferenceString, REFERENCE_TABLE_MULTIPLE_COLUMN_REGEX, REFERENCE_TABLE_SINGLE_COLUMN_REGEX, regexTestColumn, regexTestMultipleRange, regexTestRow, regexTestSingeRange } from '../regex';

describe('Test ref regex', () => {
it('Single range', () => {
Expand All @@ -27,11 +27,11 @@ describe('Test ref regex', () => {
});

it('Multiple range', () => {
expect(regexTestSingeRange('A1:B10')).toBe(true);
expect(regexTestSingeRange('Sheet1!A1:B10')).toBe(true);
expect(regexTestSingeRange('[workbook]Sheet1!A1:B10')).toBe(true);
expect(regexTestSingeRange('[workbook]\'Sheet-1\'!A1:B10')).toBe(true);
expect(regexTestSingeRange('\'[workbook]Sheet1\'!A1:B10')).toBe(true);
expect(regexTestMultipleRange('A1:B10')).toBe(true);
expect(regexTestMultipleRange('Sheet1!A1:B10')).toBe(true);
expect(regexTestMultipleRange('[workbook]Sheet1!A1:B10')).toBe(true);
expect(regexTestMultipleRange('[workbook]\'Sheet-1\'!A1:B10')).toBe(true);
expect(regexTestMultipleRange('\'[workbook]Sheet1\'!A1:B10')).toBe(true);
});

it('Row range', () => {
Expand Down

0 comments on commit 2431567

Please sign in to comment.