Skip to content

Commit 2382a89

Browse files
committed
feat(utils): better return type
1 parent 6469a3a commit 2382a89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/utils/src/array.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,11 @@ export function getArrayChildrenByParentId<T extends object>(
216216
* @param parentId 父级节点id
217217
* @param key 标识字段,默认 id | Identifier field, default id
218218
*/
219-
export function getArrayChildrenIdByParentId(
219+
export function getArrayChildrenIdByParentId<T = any>(
220220
data: Record<string, any>[] | undefined,
221221
parentId: string,
222222
key = 'id',
223-
): any[] | undefined {
223+
): T[] | undefined {
224224
const children = getArrayChildrenByParentId(data, parentId, key);
225225
if (!Array.isArray(children)) {
226226
return;

0 commit comments

Comments
 (0)