@nxtedition/shared 2.0.0 → 2.0.1

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.
Files changed (2) hide show
  1. package/index.js +4 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,6 +27,7 @@ async function* _reader({ sharedState, sharedBuffer }, cb) {
27
27
 
28
28
  while (readPos !== writePos) {
29
29
  const len = buffer.readInt32LE(readPos)
30
+ assert(len > 0)
30
31
 
31
32
  if (len === END_OF_PACKET) {
32
33
  readPos = 0
@@ -128,6 +129,9 @@ export function writer({ sharedState, sharedBuffer }) {
128
129
  len = args[0]
129
130
  fn = args[1]
130
131
  opaque = args[2]
132
+
133
+ assert(len > 0)
134
+ assert(typeof fn === 'function')
131
135
  } else {
132
136
  if (Array.isArray(args[0])) {
133
137
  args = args[0]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/shared",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Ring Buffer for NodeJS cross Worker communication",
5
5
  "main": "index.js",
6
6
  "repository": {