Skip to content

Commit

Permalink
Merge branch 'main' into feat/flow
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon authored Sep 26, 2024
2 parents 3c64753 + 7016baf commit c49ee8e
Show file tree
Hide file tree
Showing 46 changed files with 589 additions and 45 deletions.
2 changes: 1 addition & 1 deletion docs/ja/reference/array/forEachRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function forEachRight<T>(arr: T[], callback: (value: T, index: number, arr: T[])
##

```ts
import { forEachRight } from 'es-toolkit/forEachRight';
import { forEachRight } from 'es-toolkit/array';

const array = [1, 2, 3];
const result: number[] = [];
Expand Down
33 changes: 33 additions & 0 deletions docs/ja/reference/compat/function/defer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# defer

::: info
この関数は互換性のために `es-toolkit/compat` からのみインポートできます。代替可能なネイティブ JavaScript API があるか、まだ十分に最適化されていないためです。

`es-toolkit/compat` からこの関数をインポートすると、[lodash と完全に同じように動作](../../../compatibility.md)します。
:::

`func`を呼び出しを、現在のコールスタックがクリアされるまで遅延します。追加の引数は、呼び出されたときに`func`に提供されます。

## インターフェース

```typescript
function defer<F extends (...args: any[]) => any>(func: F, ...args: Parameters<F>): number;
```

### パラメータ

- `func` (`F`): 遅延する関数。
- `args` (`Parameters<F>`): `func`を呼び出すための引数。

### 戻り値

(`number`): タイマーID。

##

```typescript
defer((text) => {
console.log(text);
}, 'deferred');
// => Logs 'deferred' after the current call stack has cleared.
```
2 changes: 1 addition & 1 deletion docs/ja/reference/compat/predicate/isArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function isArguments(value?: unknown): value is IArguments;
##

```typescript
import { isArguments } from 'es-toolkit/predicate';
import { isArguments } from 'es-toolkit/compat';

const args = (function () {
return arguments;
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/reference/compat/predicate/isArrayLike.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function isArrayLike(value: unknown): value is ArrayLike<unknown>;
##

```typescript
import { isArrayLike } from 'es-toolkit/predicate';
import { isArrayLike } from 'es-toolkit/compat';

console.log(isArrayLike([1, 2, 3])); // true
console.log(isArrayLike('abc')); // true
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/reference/compat/predicate/isArrayLikeObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function isArrayLikeObject(value: unknown): value is ArrayLike<unknown> & object
##

```typescript
import { isArrayLikeObject } from 'es-toolkit/predicate';
import { isArrayLikeObject } from 'es-toolkit/compat';

console.log(isArrayLikeObject([1, 2, 3])); // true
console.log(isArrayLikeObject({ 0: 'a', length: 1 })); // true
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/reference/compat/predicate/isObjectLike.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function isObjectLike(value: unknown): value is object;
##

```typescript
import { isObjectLike } from 'es-toolkit/predicate';
import { isObjectLike } from 'es-toolkit/compat';

const value1 = { a: 1 };
const value2 = [1, 2, 3];
Expand Down
34 changes: 34 additions & 0 deletions docs/ja/reference/compat/util/toFinite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# toFinite

::: info
この関数は互換性のために `es-toolkit/compat` からのみインポートできます。代替可能なネイティブ JavaScript API があるか、まだ十分に最適化されていないためです。

`es-toolkit/compat` からこの関数をインポートすると、[lodash と完全に同じように動作](../../../compatibility.md)します。
:::

`value` を有限の数値に変換します。

## インターフェース

```typescript
function toFinite(value?: unknown): number;
```

### パラメータ

- `value` (`unknown`): 変換する値。

### 戻り値

(`number`): 有限の数値。

##

```typescript
toNumber(3.2); // => 3.2
toNumber(Number.MIN_VALUE); // => 5e-324
toNumber(Infinity); // => 1.7976931348623157e+308
toNumber('3.2'); // => 3.2
toNumber(Symbol.iterator); // => 0
toNumber(NaN); // => 0
```
34 changes: 34 additions & 0 deletions docs/ja/reference/compat/util/toInteger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# toInteger

::: info
この関数は互換性のために `es-toolkit/compat` からのみインポートできます。代替可能なネイティブ JavaScript API があるか、まだ十分に最適化されていないためです。

`es-toolkit/compat` からこの関数をインポートすると、[lodash と完全に同じように動作](../../../compatibility.md)します。
:::

`value`を整数に変換します。無限大の値の場合は、有限の値に変換されます。小数点以下の数字は切り捨てられます。

## インターフェース

```typescript
function toInteger(value?: unknown): number;
```

### パラメータ

- `value` (`unknown`): 変換する値。

### 戻り値

(`number`): 整数。

##

```typescript
toInteger(3.2); // => 3
toInteger(Number.MIN_VALUE); // => 0
toInteger(Infinity); // => 1.7976931348623157e+308
toInteger('3.2'); // => 3
toInteger(Symbol.iterator); // => 0
toInteger(NaN); // => 0
```
36 changes: 36 additions & 0 deletions docs/ja/reference/compat/util/toNumber.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# toNumber

::: info
この関数は互換性のために `es-toolkit/compat` からのみインポートできます。代替可能なネイティブ JavaScript API があるか、まだ十分に最適化されていないためです。

`es-toolkit/compat` からこの関数をインポートすると、[lodash と完全に同じように動作](../../../compatibility.md)します。
:::

`value`を数値に変換します。

`Number()`とは異なり、この関数はシンボルに対して`NaN`を返します。

## インターフェース

```typescript
function toNumber(value?: unknown): number;
```

### パラメータ

- `value` (`unknown`): 変換する値。

### 戻り値

(`number`): 変換された数値。

##

```typescript
toNumber(3.2); // => 3.2
toNumber(Number.MIN_VALUE); // => 5e-324
toNumber(Infinity); // => Infinity
toNumber('3.2'); // => 3.2
toNumber(Symbol.iterator); // => NaN
toNumber(NaN); // => NaN
```
28 changes: 28 additions & 0 deletions docs/ja/reference/string/constantCase.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# constantCase

文字列を定数ケースに変換します。

定数ケースは、各単語が大文字で書かれ、アンダースコア(`_`)で区切られる命名規則です。たとえば、`CONSTANT_CASE`

## インターフェース

```typescript
function constantCase(str: string): string;
```

### パラメータ

- `str` (`string`): 定数ケースに変更される文字列。

### 戻り値

(`string`): 定数ケースに変換された文字列。

##

```typescript
const convertedStr1 = constantCase('camelCase') // returns 'CAMEL_CASE'
const convertedStr2 = constantCase('some whitespace') // returns 'SOME_WHITESPACE'
const convertedStr3 = constantCase('hyphen-text') // returns 'HYPHEN_TEXT'
const convertedStr4 = constantCase('HTTPRequest') // returns 'HTTP_REQUEST'
```
2 changes: 1 addition & 1 deletion docs/ko/reference/array/forEachRight.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function forEachRight<T>(arr: T[], callback: (value: T, index: number, arr: T[])
## 예시

```ts
import { forEachRight } from 'es-toolkit/forEachRight';
import { forEachRight } from 'es-toolkit/array';

const array = [1, 2, 3];
const result: number[] = [];
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/reference/compat/array/castArray.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function castArray<T>(value?: T | readonly T[]): T[];
## 예시

```typescript
import { castArray } from 'es-toolkit/array';
import { castArray } from 'es-toolkit/compat';

const arr1 = castArray(1);
// [1]을 반환해요.
Expand Down
33 changes: 33 additions & 0 deletions docs/ko/reference/compat/function/defer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# defer

::: info
이 함수는 호환성을 위한 `es-toolkit/compat` 에서만 가져올 수 있어요. 대체할 수 있는 네이티브 JavaScript API가 있거나, 아직 충분히 최적화되지 않았기 때문이에요.

`es-toolkit/compat`에서 이 함수를 가져오면, [lodash와 완전히 똑같이 동작](../../../compatibility.md)해요.
:::

함수 `func`를 현재 호출 스택이 끝날 때까지 지연시켜요.

## 인터페이스

```typescript
function defer<F extends (...args: any[]) => any>(func: F, ...args: Parameters<F>): number;
```

### 파라미터

- `func` (`F`): 지연시킬 함수.
- `args` (`Parameters<F>`): `func`를 호출할 인수.

### 반환 값

(`number`): 타이머 ID.

## 예시

```typescript
defer((text) => {
console.log(text);
}, 'deferred');
// => Logs 'deferred' after the current call stack has cleared.
```
2 changes: 1 addition & 1 deletion docs/ko/reference/compat/predicate/isArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function isArguments(value?: unknown): value is IArguments;
## 예시

```typescript
import { isArguments } from 'es-toolkit/predicate';
import { isArguments } from 'es-toolkit/compat';

const args = (function () {
return arguments;
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/reference/compat/predicate/isArrayLike.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function isArrayLike(value: unknown): value is ArrayLike<unknown>;
## 예시

```typescript
import { isArrayLike } from 'es-toolkit/predicate';
import { isArrayLike } from 'es-toolkit/compat';

console.log(isArrayLike([1, 2, 3])); // true
console.log(isArrayLike('abc')); // true
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/reference/compat/predicate/isArrayLikeObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function isArrayLikeObject(value: unknown): value is ArrayLike<unknown> & object
## 예시

```typescript
import { isArrayLikeObject } from 'es-toolkit/predicate';
import { isArrayLikeObject } from 'es-toolkit/compat';

console.log(isArrayLikeObject([1, 2, 3])); // true
console.log(isArrayLikeObject({ 0: 'a', length: 1 })); // true
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/reference/compat/predicate/isObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function isObject(value: unknown): value is object;
## 예시

```typescript
import { isObject } from 'es-toolkit/predicate';
import { isObject } from 'es-toolkit/compat';

const value1 = {};
const value2 = [1, 2, 3];
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/reference/compat/predicate/isObjectLike.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function isObjectLike(value: unknown): value is object;
## 예시

```typescript
import { isObjectLike } from 'es-toolkit/predicate';
import { isObjectLike } from 'es-toolkit/compat';

const value1 = { a: 1 };
const value2 = [1, 2, 3];
Expand Down
34 changes: 34 additions & 0 deletions docs/ko/reference/compat/util/toFinite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# toFinite

::: info
이 함수는 호환성을 위한 `es-toolkit/compat` 에서만 가져올 수 있어요. 대체할 수 있는 네이티브 JavaScript API가 있거나, 아직 충분히 최적화되지 않았기 때문이에요.

`es-toolkit/compat`에서 이 함수를 가져오면, [lodash와 완전히 똑같이 동작](../../../compatibility.md)해요.
:::

`value`를 유한한 숫자로 변환해요.

## 인터페이스

```typescript
function toFinite(value?: unknown): number;
```

### 파라미터

- `value` (`unknown`): 변환할 값.

### 반환 값

(`number`): 유한한 숫자.

## 예시

```typescript
toNumber(3.2); // => 3.2
toNumber(Number.MIN_VALUE); // => 5e-324
toNumber(Infinity); // => 1.7976931348623157e+308
toNumber('3.2'); // => 3.2
toNumber(Symbol.iterator); // => 0
toNumber(NaN); // => 0
```
34 changes: 34 additions & 0 deletions docs/ko/reference/compat/util/toInteger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# toInteger

::: info
이 함수는 호환성을 위한 `es-toolkit/compat` 에서만 가져올 수 있어요. 대체할 수 있는 네이티브 JavaScript API가 있거나, 아직 충분히 최적화되지 않았기 때문이에요.

`es-toolkit/compat`에서 이 함수를 가져오면, [lodash와 완전히 똑같이 동작](../../../compatibility.md)해요.
:::

`value`를 정수로 변환해요. 무한한 값인 경우, 유한한 값으로 변환돼요. 소숫점 아래 숫자는 버려요.

## 인터페이스

```typescript
function toInteger(value?: unknown): number;
```

### 파라미터

- `value` (`unknown`): 변환할 값.

### 반환 값

(`number`): 변환된 정수.

## 예시

```typescript
toInteger(3.2); // => 3
toInteger(Number.MIN_VALUE); // => 0
toInteger(Infinity); // => 1.7976931348623157e+308
toInteger('3.2'); // => 3
toInteger(Symbol.iterator); // => 0
toInteger(NaN); // => 0
```
Loading

0 comments on commit c49ee8e

Please sign in to comment.