We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e51813 commit 03e7b9aCopy full SHA for 03e7b9a
example.js
@@ -0,0 +1,14 @@
1
+/**
2
+ * js-bit-list working example
3
+ * @author Mikhail Kormanowsky
4
+ */
5
+
6
+const BitList = require("./index");
7
8
+const MyBitList = BitList.useKeys(["myKey", "otherKey"]);
9
10
+let myBitListInstance = new MyBitList({myKey: true});
11
12
+console.log("It works!");
13
+console.log("Number", myBitListInstance.toNumber());
14
+console.log("myKey value", myBitListInstance.toObject().myKey);
index.js
@@ -195,6 +195,7 @@ class BitList {
195
super(initialValue);
196
} catch (error) {
197
if (typeof initialValue === "object" && initialValue !== null) {
198
+ super(0);
199
this.setObject(initialValue);
200
} else {
201
throw error;
0 commit comments