@digipair/skill-basic 0.113.1 → 0.114.2

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # skill-test
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build skill-basic` to build the library.
@@ -1,20 +1,7 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var engine = require('@digipair/engine');
6
4
 
7
- function _extends() {
8
- _extends = Object.assign || function assign(target) {
9
- for(var i = 1; i < arguments.length; i++){
10
- var source = arguments[i];
11
- for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
12
- }
13
- return target;
14
- };
15
- return _extends.apply(this, arguments);
16
- }
17
-
18
5
  /**
19
6
  * Convert array of 16 byte values to UUID string format of the form:
20
7
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
@@ -29,7 +16,7 @@ function unsafeStringify(arr) {
29
16
  //
30
17
  // Note to future-self: No, you can't remove the `toLowerCase()` call.
31
18
  // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
32
- return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
19
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
33
20
  }
34
21
 
35
22
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
@@ -41,21 +28,21 @@ function rng() {
41
28
  // lazy load so that environments that need to polyfill have a chance to do so
42
29
  if (!getRandomValues) {
43
30
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
44
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
31
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
45
32
  if (!getRandomValues) {
46
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
33
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
47
34
  }
48
35
  }
49
36
  return getRandomValues(rnds8);
50
37
  }
51
38
 
52
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
39
+ var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
53
40
  var native = {
54
41
  randomUUID: randomUUID
55
42
  };
56
43
 
57
44
  function v4(options, buf, offset) {
58
- if (native.randomUUID && !buf && !options) {
45
+ if (native.randomUUID && true && !options) {
59
46
  return native.randomUUID();
60
47
  }
61
48
  options = options || {};
@@ -63,14 +50,6 @@ function v4(options, buf, offset) {
63
50
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
64
51
  rnds[6] = rnds[6] & 0x0f | 0x40;
65
52
  rnds[8] = rnds[8] & 0x3f | 0x80;
66
- // Copy bytes to buffer, if provided
67
- if (buf) {
68
- offset = offset || 0;
69
- for(var i = 0; i < 16; ++i){
70
- buf[offset + i] = rnds[i];
71
- }
72
- return buf;
73
- }
74
53
  return unsafeStringify(rnds);
75
54
  }
76
55
 
@@ -94,23 +73,21 @@ let BasicService = class BasicService {
94
73
  return result;
95
74
  }
96
75
  async interval(params, _pinsSettingsList, context) {
97
- var _context_protected;
98
76
  const { time, execute } = params;
99
- const signal = (_context_protected = context.protected) == null ? void 0 : _context_protected.signal;
77
+ const signal = context.protected?.signal;
100
78
  const result = setInterval(()=>{
101
79
  engine.executePinsList(execute, context, `${context.__PATH__}.execute`);
102
80
  }, time);
103
- signal == null ? void 0 : signal.addEventListener('abort', ()=>clearInterval(result));
81
+ signal?.addEventListener('abort', ()=>clearInterval(result));
104
82
  return result;
105
83
  }
106
84
  async defer(params, _pinsSettingsList, context) {
107
- var _context_protected;
108
85
  const { time, execute } = params;
109
- const signal = (_context_protected = context.protected) == null ? void 0 : _context_protected.signal;
86
+ const signal = context.protected?.signal;
110
87
  const result = setTimeout(()=>{
111
88
  engine.executePinsList(execute, context, `${context.__PATH__}.execute`);
112
89
  }, time);
113
- signal == null ? void 0 : signal.addEventListener('abort', ()=>clearTimeout(result));
90
+ signal?.addEventListener('abort', ()=>clearTimeout(result));
114
91
  return result;
115
92
  }
116
93
  async stopInterval(params, _pinsSettingsList, _context) {
@@ -132,9 +109,10 @@ let BasicService = class BasicService {
132
109
  try {
133
110
  return await engine.executePinsList(executeTry, context, `${context.__PATH__}.executeTry`);
134
111
  } catch (error) {
135
- return await engine.executePinsList(executeCatch, _extends({}, context, {
112
+ return await engine.executePinsList(executeCatch, {
113
+ ...context,
136
114
  error
137
- }), `${context.__PATH__}.executeCatch`);
115
+ }, `${context.__PATH__}.executeCatch`);
138
116
  }
139
117
  }
140
118
  async uuid(_params, _pinsSettingsList, _context) {