@certik/skynet 0.10.20 → 0.10.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.21
4
+
5
+ - Enabled more customizations for indexer selector support, check https://github.com/sindresorhus/meow for available config options, an example
6
+
7
+ ```
8
+ selectors: {
9
+ "onlyProject": {
10
+ type: "string",
11
+ alias: "only-project",
12
+ default: null,
13
+ isRequired: false
14
+ },
15
+
16
+ "protocol": {
17
+ type: "string",
18
+ isRequired: true
19
+ }
20
+ }
21
+ ```
22
+
3
23
  ## 0.10.20
4
24
 
5
25
  - Used shorter lock ttl for api and producer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.10.20",
3
+ "version": "0.10.21",
4
4
  "description": "Skynet Shared JS library",
5
5
  "main": "index.js",
6
6
  "author": "CertiK Engineering",
package/selector.js CHANGED
@@ -17,18 +17,16 @@ function getSelectorDesc(selector) {
17
17
  .join("\n");
18
18
  }
19
19
 
20
+ // check https://github.com/sindresorhus/meow for selector config options
20
21
  function getSelectorFlags(selector) {
21
22
  return Object.keys(selector).reduce((acc, name) => {
22
23
  const flag = {
23
24
  type: selector[name].type || "string",
24
- isRequired: true,
25
+ ...selector[name]
25
26
  };
26
27
 
27
- if (selector[name].default) {
28
- flag.default = selector[name].default;
29
- }
30
-
31
- if (!selector[name].optional) {
28
+ // by default to be required
29
+ if (!selector[name].optional && selector[name].isRequired !== false) {
32
30
  flag.isRequired = true;
33
31
  }
34
32