Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typings should be fixed #71

Closed
vsimko opened this issue Jan 8, 2021 · 1 comment
Closed

Typings should be fixed #71

vsimko opened this issue Jan 8, 2021 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@vsimko
Copy link

vsimko commented Jan 8, 2021

Problem

I tried this:

import {table} from "arquero";

const myTable = table({
  x: [1610109901000, 1610109902000, 1610109903000, 1610109904000],
  y: [600, 610, 590, 602]
});

I got a warning from IntelliJ (both in javascript and in typescript): Invalid number of arguments, expected 2

This is because the names parameter of the table function is not marked as optional.

/**
* Create a new table for a set of named columns.
* @param {object} columns
* The set of named column arrays.
* Object keys are the column names.
* The enumeration order of the keys determines the column indices.
* Object values must be arrays (or array-like values) of identical length.
* @return {ColumnTable} the instantiated table
* @example table({ colA: ['a', 'b', 'c'], colB: [3, 4, 5] })
*/
export function table(columns, names) {
return new ColumnTable(mapObject(columns, x => x), names);
}

How to fix

Add the following code to your jsdoc: @param {string[]?} names

I would also suggest to review the typings of all functions in your code 😄

@jheer jheer added the documentation Improvements or additions to documentation label Jan 8, 2021
@jheer
Copy link
Member

jheer commented Jan 8, 2021

Thanks. I updated the JSDoc and released v2.1.1.

@jheer jheer closed this as completed Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants