Skip to content

Commit

Permalink
Remove unneeded @param jsdoc annotations for tuple and property (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz committed Dec 11, 2019
1 parent 636bb39 commit 3ad3318
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
14 changes: 6 additions & 8 deletions prebuild/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const iota = (num: number) => [...Array(num)].map((v, idx) => idx);
const joiner = (num: number, fn: (v: number) => string, ch: string) =>
export const iota = (num: number) => [...Array(num)].map((v, idx) => idx);
export const joiner = (num: number, fn: (v: number) => string, ch: string) =>
iota(num)
.map(fn)
.join(ch);
const commas = (num: number, fn: (v: number) => string) => joiner(num, fn, ',');
export const commas = (num: number, fn: (v: number) => string) => joiner(num, fn, ',');

const arbCommas = (num: number) => commas(num, v => `arb${v}`); // arb0,arb1,...
const txCommas = (num: number) => commas(num, v => `T${v}`); // T0,T1,...
const txXor = (num: number) => joiner(num, v => `T${v}`, '|'); // T0|T1|...

export { iota, joiner, commas, arbCommas, txCommas, txXor };
export const arbCommas = (num: number) => commas(num, v => `arb${v}`); // arb0,arb1,...
export const txCommas = (num: number) => commas(num, v => `T${v}`); // T0,T1,...
export const txXor = (num: number) => joiner(num, v => `T${v}`, '|'); // T0|T1|...
3 changes: 1 addition & 2 deletions prebuild/property.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { commas, iota, joiner, txCommas } from './helpers';
import { commas, iota, txCommas } from './helpers';

const predicateFor = (num: number, isAsync: boolean): string =>
isAsync
Expand All @@ -11,7 +11,6 @@ const signatureFor = (num: number, isAsync: boolean): string => {
return `
/**
* Instantiate a new {@link ${className}}
* ${joiner(num, v => `@param arb${v} Generate the parameter at position #${v + 1} of predicate`, '\n* ')}
* @param predicate Assess the success of the property. Would be considered falsy if its throws or if its output evaluates to false
*/
function ${functionName}<${txCommas(num)}>(
Expand Down
3 changes: 1 addition & 2 deletions prebuild/tuple.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { commas, iota, joiner, txCommas } from './helpers';
import { commas, iota, txCommas } from './helpers';

const signatureFor = (num: number, opt?: boolean): string =>
`
/**
* For tuples of [${txCommas(num)}]
* ${joiner(num, v => `@param arb${v} Arbitrary responsible for T${v}`, '\n* ')}
*/
function tuple<${txCommas(num)}>(
${commas(num, v => `arb${v}${opt === true ? '?' : ''}: Arbitrary<T${v}>`)}
Expand Down

0 comments on commit 3ad3318

Please sign in to comment.