Skip to content

Commit

Permalink
docs(castArray): Update docs (#590)
Browse files Browse the repository at this point in the history
* test(castArray): Add lodash test permalink

* docs(castArray): Update docs
  • Loading branch information
mass2527 committed Sep 24, 2024
1 parent 7192cd7 commit 7623503
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/compat/array/castArray.spec.ts
Original file line number Diff line number Diff line change
@@ -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, ''];
Expand Down
4 changes: 2 additions & 2 deletions src/compat/array/castArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 7623503

Please sign in to comment.