@thi.ng/csp 2.1.6 → 2.1.9

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,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-04-07T14:17:30Z
3
+ - **Last updated**: 2022-06-09T16:14:01Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -78,7 +78,7 @@ node --experimental-repl-await
78
78
  > const csp = await import("@thi.ng/csp");
79
79
  ```
80
80
 
81
- Package sizes (gzipped, pre-treeshake): ESM: 2.65 KB
81
+ Package sizes (gzipped, pre-treeshake): ESM: 2.64 KB
82
82
 
83
83
  ## Dependencies
84
84
 
package/channel.js CHANGED
@@ -61,7 +61,7 @@ export class Channel {
61
61
  this.txbuf = new DCons();
62
62
  this.tx = tx ? tx(Channel.RFN) : null;
63
63
  this.onerror = tx && (err || defaultErrorHandler);
64
- this.state = 0 /* OPEN */;
64
+ this.state = 0 /* State.OPEN */;
65
65
  this.isBusy = false;
66
66
  }
67
67
  static constantly(x, delay) {
@@ -268,7 +268,7 @@ export class Channel {
268
268
  }
269
269
  write(value) {
270
270
  return new Promise((resolve) => {
271
- if (this.state !== 0 /* OPEN */) {
271
+ if (this.state !== 0 /* State.OPEN */) {
272
272
  resolve(false);
273
273
  }
274
274
  if (this.writes.length < Channel.MAX_WRITES) {
@@ -277,7 +277,7 @@ export class Channel {
277
277
  ? async () => {
278
278
  try {
279
279
  if (isReduced(this.tx[2](this.txbuf, value))) {
280
- this.state = 1 /* CLOSED */;
280
+ this.state = 1 /* State.CLOSED */;
281
281
  }
282
282
  }
283
283
  catch (e) {
@@ -296,7 +296,7 @@ export class Channel {
296
296
  }
297
297
  read() {
298
298
  return new Promise((resolve) => {
299
- if (this.state === 2 /* DONE */) {
299
+ if (this.state === 2 /* State.DONE */) {
300
300
  resolve(undefined);
301
301
  }
302
302
  this.reads.push(resolve);
@@ -309,17 +309,17 @@ export class Channel {
309
309
  });
310
310
  }
311
311
  close(flush = false) {
312
- if (this.state === 0 /* OPEN */) {
313
- this.state = 1 /* CLOSED */;
312
+ if (this.state === 0 /* State.OPEN */) {
313
+ this.state = 1 /* State.CLOSED */;
314
314
  flush && this.flush();
315
315
  return this.process();
316
316
  }
317
317
  }
318
318
  isClosed() {
319
- return this.state !== 0 /* OPEN */;
319
+ return this.state !== 0 /* State.OPEN */;
320
320
  }
321
321
  isReadable() {
322
- return ((this.state !== 2 /* DONE */ && this.buf && this.buf.length > 0) ||
322
+ return ((this.state !== 2 /* State.DONE */ && this.buf && this.buf.length > 0) ||
323
323
  (this.writes && this.writes.length > 0) ||
324
324
  (this.txbuf && this.txbuf.length > 0));
325
325
  }
@@ -419,8 +419,8 @@ export class Channel {
419
419
  })();
420
420
  }
421
421
  release() {
422
- if (this.state === 1 /* CLOSED */) {
423
- this.state = 2 /* DONE */;
422
+ if (this.state === 1 /* State.CLOSED */) {
423
+ this.state = 2 /* State.DONE */;
424
424
  this.flush();
425
425
  this.buf.release();
426
426
  delete this.reads;
@@ -457,7 +457,7 @@ export class Channel {
457
457
  buf.push(put);
458
458
  put.resolve(true);
459
459
  }
460
- if (this.state === 1 /* CLOSED */) {
460
+ if (this.state === 1 /* State.CLOSED */) {
461
461
  if (this.tx && !writes.length) {
462
462
  try {
463
463
  // finalize/complete transducer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/csp",
3
- "version": "2.1.6",
3
+ "version": "2.1.9",
4
4
  "description": "ES6 promise based CSP primitives & operations",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -38,20 +38,20 @@
38
38
  "testnode": "tsc -p test && node build/test/node.js"
39
39
  },
40
40
  "dependencies": {
41
- "@thi.ng/api": "^8.3.5",
42
- "@thi.ng/arrays": "^2.2.1",
43
- "@thi.ng/checks": "^3.1.5",
44
- "@thi.ng/dcons": "^3.2.1",
45
- "@thi.ng/errors": "^2.1.5",
46
- "@thi.ng/transducers": "^8.3.1"
41
+ "@thi.ng/api": "^8.3.7",
42
+ "@thi.ng/arrays": "^2.2.4",
43
+ "@thi.ng/checks": "^3.2.0",
44
+ "@thi.ng/dcons": "^3.2.4",
45
+ "@thi.ng/errors": "^2.1.7",
46
+ "@thi.ng/transducers": "^8.3.4"
47
47
  },
48
48
  "devDependencies": {
49
- "@microsoft/api-extractor": "^7.19.4",
50
- "@thi.ng/testament": "^0.2.5",
49
+ "@microsoft/api-extractor": "^7.25.0",
50
+ "@thi.ng/testament": "^0.2.8",
51
51
  "rimraf": "^3.0.2",
52
52
  "tools": "^0.0.1",
53
- "typedoc": "^0.22.13",
54
- "typescript": "^4.6.2"
53
+ "typedoc": "^0.22.17",
54
+ "typescript": "^4.7.3"
55
55
  },
56
56
  "keywords": [
57
57
  "async",
@@ -102,5 +102,5 @@
102
102
  "status": "deprecated",
103
103
  "year": 2016
104
104
  },
105
- "gitHead": "5ee1feb590dd935593b1dd4e7f38a3ed3ba64765\n"
105
+ "gitHead": "9e516d30a1a537e027a6b3d78bf9121bc5831d31\n"
106
106
  }