Skip to content

Commit 3a934ad

Browse files
committed
fix: declare that of returns arrays of length 1
1 parent 01b8661 commit 3a934ad

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

dtslint/ts3.5/Array.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ declare const ns: Array<number>
99
declare const ss: Array<string>
1010
declare const tns: Array<[number, string]>
1111

12+
pipe(_.of('b'), ([value]: [string]) => value)
13+
1214
// prepend
1315

1416
pipe(ss, _.prepend('a')) // $ExpectType NonEmptyArray<string>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Array.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@ const _chainRecBreadthFirst: ChainRec1<URI>['chainRec'] = RA._chainRecBreadthFir
15081508
* @category constructors
15091509
* @since 2.0.0
15101510
*/
1511-
export const of: <A>(a: A) => Array<A> = NEA.of
1511+
export const of: <A>(a: A) => [A] = NEA.of
15121512

15131513
/**
15141514
* Makes an empty `Array`, useful for building a [`Monoid`](#Monoid)

0 commit comments

Comments
 (0)