Skip to content

Commit

Permalink
refactor(transducers): update swizzler() arg types
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 2, 2018
1 parent 488462e commit 2f5abce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/transducers/src/func/swizzler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
* swizzler([1, 1, 3, 3])([1, 2, 3, 4]) // [ 2, 2, 4, 4 ]
* swizzler([2, 0])([1, 2, 3]) // [ 3, 1 ]
* ```
* Even though, any object can be used as input, the returned
* values will always be in array form.
* Even though, any object can be used as input to the generated
* function, the returned values will always be in array form.
*
* ```
* swizzler(["a", "c", "b"])({a: 1, b: 2, c: 3}) // [ 1, 3, 2 ]
* ```
*
* @param order indices
*/
export function swizzler<T>(order: PropertyKey[]): (x: T) => any[] {
export function swizzler<T>(order: string | PropertyKey[]): (x: T) => any[] {
const [a, b, c, d, e, f, g, h] = order;
switch (order.length) {
case 0:
Expand Down

0 comments on commit 2f5abce

Please sign in to comment.