@digipair/skill-process 0.94.0-8 → 0.95.0

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.
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  /**
4
6
  * Convert array of 16 byte values to UUID string format of the form:
5
7
  * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
@@ -14,7 +16,7 @@ function unsafeStringify(arr) {
14
16
  //
15
17
  // Note to future-self: No, you can't remove the `toLowerCase()` call.
16
18
  // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
17
- 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();
18
20
  }
19
21
 
20
22
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
@@ -26,21 +28,21 @@ function rng() {
26
28
  // lazy load so that environments that need to polyfill have a chance to do so
27
29
  if (!getRandomValues) {
28
30
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
29
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
31
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
30
32
  if (!getRandomValues) {
31
- 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");
32
34
  }
33
35
  }
34
36
  return getRandomValues(rnds8);
35
37
  }
36
38
 
37
- var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
39
+ var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
38
40
  var native = {
39
41
  randomUUID: randomUUID
40
42
  };
41
43
 
42
44
  function v4(options, buf, offset) {
43
- if (native.randomUUID && true && !options) {
45
+ if (native.randomUUID && !buf && !options) {
44
46
  return native.randomUUID();
45
47
  }
46
48
  options = options || {};
@@ -48,6 +50,14 @@ function v4(options, buf, offset) {
48
50
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
49
51
  rnds[6] = rnds[6] & 0x0f | 0x40;
50
52
  rnds[8] = rnds[8] & 0x3f | 0x80;
53
+ // Copy bytes to buffer, if provided
54
+ if (buf) {
55
+ offset = offset || 0;
56
+ for(var i = 0; i < 16; ++i){
57
+ buf[offset + i] = rnds[i];
58
+ }
59
+ return buf;
60
+ }
51
61
  return unsafeStringify(rnds);
52
62
  }
53
63
 
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './libs/skill-process/src/index';
@@ -12,7 +12,7 @@ function unsafeStringify(arr) {
12
12
  //
13
13
  // Note to future-self: No, you can't remove the `toLowerCase()` call.
14
14
  // REF: https://github.com/uuidjs/uuid/pull/677#issuecomment-1757351351
15
- 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();
15
+ 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();
16
16
  }
17
17
 
18
18
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
@@ -24,21 +24,21 @@ function rng() {
24
24
  // lazy load so that environments that need to polyfill have a chance to do so
25
25
  if (!getRandomValues) {
26
26
  // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
27
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
27
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
28
28
  if (!getRandomValues) {
29
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
29
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
30
30
  }
31
31
  }
32
32
  return getRandomValues(rnds8);
33
33
  }
34
34
 
35
- var randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
35
+ var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
36
36
  var native = {
37
37
  randomUUID: randomUUID
38
38
  };
39
39
 
40
40
  function v4(options, buf, offset) {
41
- if (native.randomUUID && true && !options) {
41
+ if (native.randomUUID && !buf && !options) {
42
42
  return native.randomUUID();
43
43
  }
44
44
  options = options || {};
@@ -46,6 +46,14 @@ function v4(options, buf, offset) {
46
46
  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
47
47
  rnds[6] = rnds[6] & 0x0f | 0x40;
48
48
  rnds[8] = rnds[8] & 0x3f | 0x80;
49
+ // Copy bytes to buffer, if provided
50
+ if (buf) {
51
+ offset = offset || 0;
52
+ for(var i = 0; i < 16; ++i){
53
+ buf[offset + i] = rnds[i];
54
+ }
55
+ return buf;
56
+ }
49
57
  return unsafeStringify(rnds);
50
58
  }
51
59
 
@@ -1,2 +1 @@
1
1
  export * from './lib/skill-process';
2
- //# sourceMappingURL=index.d.ts.map
@@ -12,4 +12,3 @@ export declare const list: (params: any, pinsSettingsList: PinsSettings[], conte
12
12
  reasoning: string;
13
13
  time: number;
14
14
  }[]>;
15
- //# sourceMappingURL=skill-process.d.ts.map
package/package.json CHANGED
@@ -1,28 +1,12 @@
1
1
  {
2
2
  "name": "@digipair/skill-process",
3
- "version": "0.94.0-8",
4
- "main": "./dist/index.cjs.js",
5
- "module": "./dist/index.esm.js",
6
- "types": "./dist/index.d.ts",
3
+ "version": "0.95.0",
7
4
  "keywords": [
8
5
  "digipair",
9
6
  "service",
10
7
  "util"
11
8
  ],
12
- "exports": {
13
- "./package.json": "./package.json",
14
- ".": {
15
- "types": "./dist/index.d.ts",
16
- "import": "./dist/index.esm.js",
17
- "default": "./dist/index.cjs.js"
18
- }
19
- },
20
- "files": [
21
- "dist",
22
- "!**/*.tsbuildinfo"
23
- ],
24
- "nx": {
25
- "name": "skill-process"
26
- },
27
- "dependencies": {}
28
- }
9
+ "dependencies": {},
10
+ "main": "./index.cjs.js",
11
+ "module": "./index.esm.js"
12
+ }
package/README.md DELETED
@@ -1,7 +0,0 @@
1
- # skill-test
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build skill-process` to build the library.
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill-process.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwDnC,eAAO,MAAM,GAAG,GAAI,UAAU,MAAM,EAAE,WAAW,MAAM,EAAE,KAAK,QAAQ;;;CAC9B,CAAC;AAEzC,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,SAAwB,CAAC;AAE1D,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,qBAC9B,CAAC;AAEnD,eAAO,MAAM,IAAI,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG;;;;;IAC9B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=skill-process.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill-process.spec.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-process.spec.ts"],"names":[],"mappings":""}
File without changes
File without changes
File without changes