Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "worker_map", | ||
"description": "Tread-safe map structure for worker_threads.", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"main": "./src/worker_map.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -9,3 +9,2 @@ const decoder = new TextDecoder("utf8"); | ||
const MAP_SIZE = Symbol("MAP_SIZE"); | ||
const PLAIN_OBJECT = Symbol("PLAIN_OBJECT"); | ||
@@ -95,3 +94,2 @@ const VALUE_BUFFER = Symbol("VALUE_BUFFER"); | ||
this[VALUE_BUFFER] = valueBuffer; | ||
this[MAP_SIZE] = this.keys().length; | ||
@@ -124,3 +122,2 @@ return this; | ||
this[VALUE_BUFFER] = valueBuffer; | ||
this[MAP_SIZE] = 0; | ||
@@ -152,4 +149,2 @@ return this; | ||
this[MAP_SIZE] = Object.keys(sharedObject).length; | ||
unlock(valueBuffer); | ||
@@ -190,4 +185,2 @@ | ||
this[MAP_SIZE] = Object.keys(sharedObject).length; | ||
return true; | ||
@@ -197,3 +190,6 @@ }; | ||
WorkerMap.prototype.size = function () { | ||
return this[MAP_SIZE]; | ||
const valueBuffer = this[VALUE_BUFFER]; | ||
const sharedObject = safeLoadSharedObject(valueBuffer); | ||
return Object.keys(sharedObject).length; | ||
}; | ||
@@ -200,0 +196,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18751
284