From 5597afd69114baf283808fdb30552a89ba5ef6d6 Mon Sep 17 00:00:00 2001 From: Aybrea Date: Wed, 30 Oct 2024 20:39:38 +0800 Subject: [PATCH] chore: format docs --- docs/array/find.md | 12 ++++++------ docs/array/remove-array-blank.md | 2 +- docs/zh/array/find.md | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/array/find.md b/docs/array/find.md index 6d45f78..d66c9fb 100644 --- a/docs/array/find.md +++ b/docs/array/find.md @@ -7,19 +7,19 @@ Finds the `first` or `last` element in an array that meets a specified condition ```ts import { find } from 'rattail' -find(['a', 'b', 'c'], (item) => item === 'a') +find(['a', 'b', 'c'], (item) => item === 'a') // return ['a', 0] -find(['a', 'b', 'a'], (item) => item === 'a', 'end') +find(['a', 'b', 'a'], (item) => item === 'a', 'end') // return ['a', 2] ``` ### Arguments -| Arg | Type | Defaults | -| ------ | ------------------------------------------------- | --------- | -| `arr` | `Array` | | +| Arg | Type | Defaults | +| ------ | ----------------------------------------------------- | --------- | +| `arr` | `Array` | | | `fn` | `(item: any, index: number, array: Array) => boolean` | | -| `from` | `'start' \| 'end'` | `'start'` | +| `from` | `'start' \| 'end'` | `'start'` | ### Return diff --git a/docs/array/remove-array-blank.md b/docs/array/remove-array-blank.md index 9d7ced6..ca0e42d 100644 --- a/docs/array/remove-array-blank.md +++ b/docs/array/remove-array-blank.md @@ -14,7 +14,7 @@ removeArrayBlank([1, null, 2, undefined, 3]) // return [1, 2, 3] | Arg | Type | Defaults | | ----- | ------- | -------- | -| `arr` | `Array` | | +| `arr` | `Array` | | ### Return diff --git a/docs/zh/array/find.md b/docs/zh/array/find.md index 54af298..b3ce9e9 100644 --- a/docs/zh/array/find.md +++ b/docs/zh/array/find.md @@ -15,11 +15,11 @@ find(['a', 'b', 'a'], (item) => item === 'a', 'end') ### 参数 -| 参数 | 类型 | 默认值 | -| ------ | ------------------------------------------------- | --------- | -| `arr` | `Array` | | +| 参数 | 类型 | 默认值 | +| ------ | ----------------------------------------------------- | --------- | +| `arr` | `Array` | | | `fn` | `(item: any, index: number, array: Array) => boolean` | | -| `from` | `'start' \| 'end'` | `'start'` | +| `from` | `'start' \| 'end'` | `'start'` | ### 返回值