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

FixedSet is not a constructor #1

Open
trasherdk opened this issue Aug 29, 2019 · 1 comment
Open

FixedSet is not a constructor #1

trasherdk opened this issue Aug 29, 2019 · 1 comment

Comments

@trasherdk
Copy link

var FixedSet = require("@magic8bot/fixedset") ;

var data = [
  { "o": 10.0, "h":15.0, "l":9.5, "c":11.0 },
  { "o": 11.0, "h":12.5, "l":9.8, "c":12.0 },
  { "o": 12.0, "h":15.5, "l":10.5, "c":13.0 },
  { "o": 13.0, "h":16.0, "l":10.5, "c":14.0 }
];

var fixedset = new FixedSet(5, data);

console.log(fixedset);

Results in:

var fixedset = new FixedSet(5, data);
                 ^

TypeError: FixedSet is not a constructor
@trasherdk
Copy link
Author

This version is working:

var fixedset_1 = require('@magic8bot/fixedset');
var data = [
    { "o": 10.0, "h": 15.0, "l": 9.5, "c": 11.0 },
    { "o": 11.0, "h": 12.5, "l": 9.8, "c": 12.0 },
    { "o": 12.0, "h": 15.5, "l": 10.5, "c": 13.0 },
    { "o": 13.0, "h": 16.0, "l": 10.5, "c": 14.0 }
];
var fixedset = new fixedset_1.FixedSet(5, data);
console.log(fixedset);

Result:

$ node fixedset-1.js           
FixedSet {
  setSize: 5,
  [Symbol(set)]: Set {
    { o: 10, h: 15, l: 9.5, c: 11 },
    { o: 11, h: 12.5, l: 9.8, c: 12 },
    { o: 12, h: 15.5, l: 10.5, c: 13 },
    { o: 13, h: 16, l: 10.5, c: 14 }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant