Skip to content

Commit

Permalink
docs: remove jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed Sep 28, 2024
1 parent c0ead8b commit 0e6c4cd
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -1299,27 +1299,17 @@ function generateDefaultIndexer() {
* + `map`, `record`
*/
class UnwrappedUnionType extends UnionType {
/**
*
* @param {*} schema
* @param {*} opts
* @param {Function|undefined} projectionFn The projection function used
* to determine the bucket for the
* Union. Falls back to generate
* from `wrapUnions` parameter
* if given.
*/
constructor (schema, opts, projectionFn) {
constructor (schema, opts, /* @private parameter */ _projectionFn) {
super(schema, opts);

if (!projectionFn && opts && typeof opts.wrapUnions === 'function') {
if (!_projectionFn && opts && typeof opts.wrapUnions === 'function') {
try {
projectionFn = opts.wrapUnions(this.types);
_projectionFn = opts.wrapUnions(this.types);
} catch(e) {
throw new Error(`Error generating projection function: ${e}`);
}
}
this._getIndex = projectionFn
this._getIndex = _projectionFn
? generateProjectionIndexer(projectionFn)
: generateDefaultIndexer.bind(this)(this.types);

Expand Down

0 comments on commit 0e6c4cd

Please sign in to comment.