-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use named exports insteadof default exports for utils
- Loading branch information
Showing
12 changed files
with
14 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import _chatError from '@/utils/chat-error'; | ||
import { ChatError as _chatError } from '@/utils/chat-error'; | ||
export as namespace ChatError; | ||
export = _chatError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import _fsPath from '@/utils/fs-path'; | ||
import { fsPath as _fsPath } from '@/utils/fs-path'; | ||
export as namespace fsPath; | ||
export = _fsPath; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
class ChatError extends Error { | ||
export class ChatError extends Error { | ||
constructor(args) { | ||
super(args); | ||
this.name = this.constructor.name; | ||
} | ||
} | ||
|
||
export default ChatError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- TODO get this working with 'unknown' | ||
export default function emptyObject<T extends Record<string, any>>(obj: T): Record<string, never> { | ||
export function emptyObject<T extends Record<string, any>>(obj: T): Record<string, never> { | ||
Object.keys(obj).forEach(key => delete obj[key]); | ||
return obj as Record<string, never>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
// eslint-disable-next-line no-restricted-imports -- eval is at src-level | ||
export * from '../eval'; | ||
export * from '@/eval'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import path from 'path'; | ||
|
||
export default function fsPath(...paths: string[]): string { | ||
export function fsPath(...paths: string[]): string { | ||
return path.join(__dirname, '..', ...paths); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export function escapeRegEx(input: string): string { | ||
return input.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); | ||
return input.replace(/\W/g, '\\$&'); | ||
} |