From 7623503572beab1dfc839c6c954a44a093ff6460 Mon Sep 17 00:00:00 2001 From: Dongho Kim <70563791+mass2527@users.noreply.github.com> Date: Tue, 24 Sep 2024 10:37:45 +0900 Subject: [PATCH] docs(castArray): Update docs (#590) * test(castArray): Add lodash test permalink * docs(castArray): Update docs --- src/compat/array/castArray.spec.ts | 3 +++ src/compat/array/castArray.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compat/array/castArray.spec.ts b/src/compat/array/castArray.spec.ts index 6be550392..3cdd930ec 100644 --- a/src/compat/array/castArray.spec.ts +++ b/src/compat/array/castArray.spec.ts @@ -1,6 +1,9 @@ import { describe, expect, it } from 'vitest'; import { castArray } from './castArray'; +/** + * @see https://github.com/lodash/lodash/blob/6a2cc1dfcf7634fea70d1bc5bd22db453df67b42/test/castArray.spec.js#L1 + */ describe('castArray', () => { it('should wrap non-array items in an array', () => { const falsey = [false, null, undefined, 0, NaN, '']; diff --git a/src/compat/array/castArray.ts b/src/compat/array/castArray.ts index 43a9c6b5d..e62fdd64c 100644 --- a/src/compat/array/castArray.ts +++ b/src/compat/array/castArray.ts @@ -2,7 +2,7 @@ * Casts value as an array if it's not one. * * @template T The type of elements in the array. - * @param {T | readonly T[]} value The value to be cast to an array. + * @param {T | T[]} value The value to be cast to an array. * @returns {T[]} An array containing the input value if it wasn't an array, or the original array if it was. * * @example @@ -15,7 +15,7 @@ * const arr3 = castArray({'a': 1}); * // Returns: [{'a': 1}] * - * const arr4 = castArray(null); + * const arr4 = castArray(null); * // Returns: [null] * * const arr5 = castArray(undefined);