Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
victory-sokolov committed Jan 7, 2025
1 parent 5ea6378 commit b347482
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default antfu({
'style/arrow-parens': 'off',
'curly': 'off',
'style/brace-style': 'off',
'style/semi': 'off',
'antfu/if-newline': 'off',
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export type AnyFunc = <Input, Output>(...args: Input[]) => Output;

export type AnyAsyncFunc<Input extends any[] = any[], Output = any> = (
...args: Input
...args: Input
) => Promise<Output>;

// Helper type to get the return type of a function
Expand Down
8 changes: 4 additions & 4 deletions src/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ export const nFormatter = (amount: string): number => {

/**
* Generate number seequence with specific length
* @param length
* @param length
* @returns Generate number with provided length
*/
export const generateNumberWithLength = (length: number): number => {
if (length <= 0) {
throw new Error("Length must be greater than zero");
throw new Error('Length must be greater than zero');
}

const min = Math.pow(10, length - 1);
const max = Math.pow(10, length) - 1;
const min = 10 ** (length - 1);
const max = 10 ** length - 1;

return Math.floor(Math.random() * (max - min + 1)) + min;
}

0 comments on commit b347482

Please sign in to comment.