-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/combat-take
- Loading branch information
Showing
26 changed files
with
705 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# flattenObject | ||
|
||
중첩된 객체를 단순한 객체로 평탄화해요. | ||
|
||
- `Array`는 평탄화돼요. | ||
- 순수 객체가 아닌 `Buffer`나 `TypedArray`는 평탄화되지 않아요. | ||
|
||
## 인터페이스 | ||
|
||
```typescript | ||
function flattenObject(object: object): Record<string, any>; | ||
``` | ||
|
||
### 파라미터 | ||
|
||
- `object` (`object`): 평탄화할 객체. | ||
|
||
### 반환 값 | ||
|
||
(`T`): 평탄화된 객체. | ||
|
||
## 예시 | ||
|
||
```typescript | ||
const nestedObject = { | ||
a: { | ||
b: { | ||
c: 1 | ||
} | ||
}, | ||
d: [2, 3] | ||
}; | ||
|
||
const flattened = flattenObject(nestedObject); | ||
console.log(flattened); | ||
// Output: | ||
// { | ||
// 'a.b.c': 1, | ||
// 'd.0': 2, | ||
// 'd.1': 3 | ||
// } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# isPlainObject | ||
|
||
주어진 값이 순수 객체(Plain object)인지 확인해요. | ||
|
||
## 인터페이스 | ||
|
||
```typescript | ||
function isPlainObject(object: object): boolean; | ||
``` | ||
|
||
### 파라미터 | ||
|
||
- `object` (`object`): 검사할 값. | ||
|
||
### Returns | ||
|
||
(`boolean`): 값이 순수 객체이면 true. | ||
|
||
## Examples | ||
|
||
```typescript | ||
console.log(isPlainObject({})); // true | ||
console.log(isPlainObject([])); // false | ||
console.log(isPlainObject(null)); // false | ||
console.log(isPlainObject(Object.create(null))); // true | ||
console.log(Buffer.from('hello, world')); // false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# flattenObject | ||
|
||
Flattens a nested object into a single-level object with dot-separated keys. | ||
|
||
- `Array`s are flattened. | ||
- Non-plain objects, like `Buffer`s or `TypedArray`s, are not flattened. | ||
|
||
## Signature | ||
|
||
```typescript | ||
function flattenObject(object: object): Record<string, any>; | ||
``` | ||
|
||
### Parameters | ||
|
||
- `object` (`object`): The object to flatten. | ||
|
||
### Returns | ||
|
||
(`T`): The flattened object. | ||
|
||
## Examples | ||
|
||
```typescript | ||
const nestedObject = { | ||
a: { | ||
b: { | ||
c: 1 | ||
} | ||
}, | ||
d: [2, 3] | ||
}; | ||
|
||
const flattened = flattenObject(nestedObject); | ||
console.log(flattened); | ||
// Output: | ||
// { | ||
// 'a.b.c': 1, | ||
// 'd.0': 2, | ||
// 'd.1': 3 | ||
// } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# isPlainObject | ||
|
||
Checks if a given value is a plain object. | ||
|
||
## Signature | ||
|
||
```typescript | ||
function isPlainObject(object: object): boolean; | ||
``` | ||
|
||
### Parameters | ||
|
||
- `object` (`object`): The value to check. | ||
|
||
### Returns | ||
|
||
(`boolean`): True if the value is a plain object, otherwise false. | ||
|
||
## Examples | ||
|
||
```typescript | ||
console.log(isPlainObject({})); // true | ||
console.log(isPlainObject([])); // false | ||
console.log(isPlainObject(null)); // false | ||
console.log(isPlainObject(Object.create(null))); // true | ||
console.log(Buffer.from('hello, world')); // false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# flattenObject | ||
|
||
将嵌套对象扁平化为具有点分隔键的单级对象。 | ||
|
||
- `Array` 会被扁平化。 | ||
- 非普通对象,如 `Buffer` 或 `TypedArray`,不会被扁平化。 | ||
|
||
## 签名 | ||
|
||
```typescript | ||
function flattenObject(object: object): Record<string, any>; | ||
``` | ||
|
||
### 参数 | ||
|
||
- `object` (`object`): 要扁平化的对象。 | ||
|
||
### 返回值 | ||
|
||
(`T`): 扁平化后的对象。 | ||
|
||
## 示例 | ||
|
||
```typescript | ||
const nestedObject = { | ||
a: { | ||
b: { | ||
c: 1 | ||
} | ||
}, | ||
d: [2, 3] | ||
}; | ||
|
||
const flattened = flattenObject(nestedObject); | ||
console.log(flattened); | ||
// 输出: | ||
// { | ||
// 'a.b.c': 1, | ||
// 'd.0': 2, | ||
// 'd.1': 3 | ||
// } | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# isPlainObject | ||
|
||
检查给定值是否是一个普通对象。 | ||
|
||
## 签名 | ||
|
||
```typescript | ||
function isPlainObject(object: object): boolean; | ||
``` | ||
|
||
### 参数 | ||
|
||
- `object` (`object`): 要检查的值。 | ||
|
||
### 返回值 | ||
|
||
(`boolean`): 如果该值是普通对象,则返回 `true`,否则返回 `false`。 | ||
|
||
## 示例 | ||
|
||
```typescript | ||
console.log(isPlainObject({})); // true | ||
console.log(isPlainObject([])); // false | ||
console.log(isPlainObject(null)); // false | ||
console.log(isPlainObject(Object.create(null))); // true | ||
console.log(Buffer.from('hello, world')); // false | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.