mirror of
https://github.com/toss/es-toolkit.git
synced 2024-11-27 14:57:44 +03:00
docs(negate): Fix docs for negate
This commit is contained in:
parent
cdc3282060
commit
9b6bf6dfb4
@ -23,6 +23,4 @@ import { negate } from 'es-toolkit/function';
|
||||
|
||||
negate(() => true)(); // returns 'false'
|
||||
negate(() => false)(); // returns 'false'
|
||||
negate(() => 1); // returns 'false'
|
||||
negate(() => 0); // returns 'true'
|
||||
```
|
||||
|
@ -23,6 +23,4 @@ import { negate } from 'es-toolkit/function';
|
||||
|
||||
negate(() => true)(); // returns 'false'
|
||||
negate(() => false)(); // returns 'false'
|
||||
negate(() => 1); // returns 'false'
|
||||
negate(() => 0); // returns 'true'
|
||||
```
|
||||
|
26
docs/zh_hans/reference/function/negate.md
Normal file
26
docs/zh_hans/reference/function/negate.md
Normal file
@ -0,0 +1,26 @@
|
||||
# negate
|
||||
|
||||
创建一个函数,它会否定给定谓词函数的结果。
|
||||
|
||||
## 签名
|
||||
|
||||
```typescript
|
||||
function negate<F extends (...args: unknown[]) => boolean>(func: F): F;
|
||||
```
|
||||
|
||||
### 参数
|
||||
|
||||
- `func` (`F extends (args: ...Parameters) => unknown`): 要否定的函数。
|
||||
|
||||
### 返回值
|
||||
|
||||
- (`F`): 返回新的否定函数。
|
||||
|
||||
## 示例
|
||||
|
||||
```typescript
|
||||
import { negate } from 'es-toolkit/function';
|
||||
|
||||
negate(() => true)(); // 返回 'false'
|
||||
negate(() => false)(); // 返回 'false'
|
||||
```
|
Loading…
Reference in New Issue
Block a user