diff --git a/docs/.vitepress/items/index.ts b/docs/.vitepress/items/index.ts index 0cbd1b6..513a636 100644 --- a/docs/.vitepress/items/index.ts +++ b/docs/.vitepress/items/index.ts @@ -1,3 +1,3 @@ export * from './general' export * from './string' -export * from './number' \ No newline at end of file +export * from './number' diff --git a/docs/general/get-global-this.md b/docs/general/get-global-this.md index 928efd1..273175b 100644 --- a/docs/general/get-global-this.md +++ b/docs/general/get-global-this.md @@ -7,8 +7,8 @@ Retrieve the global object based on the current environment ```ts import { getGlobalThis } from 'rattail' -getGlobalThis() -// returns `window` in browser, `global` in Node.js, +getGlobalThis() +// returns `window` in browser, `global` in Node.js, // or `self` in web worker ``` diff --git a/docs/string/camelize.md b/docs/string/camelize.md index bb5818b..9c6cc09 100644 --- a/docs/string/camelize.md +++ b/docs/string/camelize.md @@ -13,8 +13,8 @@ camelize('FooBar') // return 'fooBar' ### Arguments -| Arg | Type | Defaults | -| --- | :----: | -------: | +| Arg | Type | Defaults | +| ------- | :------: | -------: | | `value` | `string` | | ### Return diff --git a/docs/string/kebab-case.md b/docs/string/kebab-case.md index f70bd86..ada4d60 100644 --- a/docs/string/kebab-case.md +++ b/docs/string/kebab-case.md @@ -13,8 +13,8 @@ kebabCase('fooBar') // return 'foo-bar' ### Arguments -| Arg | Type | Defaults | -| --- | :----: | -------: | +| Arg | Type | Defaults | +| ------- | :------: | -------: | | `value` | `string` | | ### Return diff --git a/docs/zh/general/is-symbol.md b/docs/zh/general/is-symbol.md index 4305d05..5066d4f 100644 --- a/docs/zh/general/is-symbol.md +++ b/docs/zh/general/is-symbol.md @@ -13,12 +13,12 @@ isSymbol('rattail') // return false ### 参数列表 -| 参数 | 类型 | 默认值 | -| ------- | :------: | -----: | -| `value` | `any` | | +| 参数 | 类型 | 默认值 | +| ------- | :---: | -----: | +| `value` | `any` | | ### 返回值 | 类型 | | :-------: | -| `boolean` | \ No newline at end of file +| `boolean` | diff --git a/tests/function.spec.ts b/tests/function.spec.ts index 643f4d2..e7fec4d 100644 --- a/tests/function.spec.ts +++ b/tests/function.spec.ts @@ -11,7 +11,9 @@ describe('Utility Functions', () => { debouncedFn() debouncedFn() - await new Promise((resolve) => setTimeout(resolve, 150)) + await new Promise((resolve) => { + setTimeout(resolve, 150) + }) expect(fn).toHaveBeenCalledTimes(1) }) @@ -23,7 +25,9 @@ describe('Utility Functions', () => { debouncedFn() debouncedFn() - await new Promise((resolve) => setTimeout(resolve, 150)) + await new Promise((resolve) => { + setTimeout(resolve, 150) + }) expect(fn).toHaveBeenCalledTimes(1) }) @@ -36,9 +40,13 @@ describe('Utility Functions', () => { throttledFn() throttledFn() - await new Promise((resolve) => setTimeout(resolve, 50)) + await new Promise((resolve) => { + setTimeout(resolve, 50) + }) throttledFn() - await new Promise((resolve) => setTimeout(resolve, 100)) + await new Promise((resolve) => { + setTimeout(resolve, 100) + }) throttledFn() expect(fn).toHaveBeenCalledTimes(2) diff --git a/tests/general.spec.ts b/tests/general.spec.ts index f86e819..d9b5f43 100644 --- a/tests/general.spec.ts +++ b/tests/general.spec.ts @@ -1,4 +1,4 @@ -import { it, expect, beforeEach } from 'vitest' +import { it, expect } from 'vitest' import { isNonEmptyArray, isString, diff --git a/tests/json.spec.ts b/tests/json.spec.ts index 4949671..8c1a4eb 100644 --- a/tests/json.spec.ts +++ b/tests/json.spec.ts @@ -20,4 +20,3 @@ describe('JSON utility functions', () => { expect(prettyString).toBe('{\n "key": "value",\n "number": 42\n}') }) }) - \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts index efcb100..d061be5 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -5,7 +5,7 @@ export default defineConfig({ environment: 'jsdom', coverage: { provider: 'istanbul', - include: ['src/*.ts'] + include: ['src/*.ts'], }, }, })