Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-atomic-store

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-atomic-store - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

23

lib/index.js

@@ -1,2 +0,7 @@

import AwaitLock from 'await-lock';
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const await_lock_1 = __importDefault(require("await-lock"));
/**

@@ -6,4 +11,4 @@ * Do a datastore-wide lock when calling any methods.

*/
export const AsyncAtomicStore = (creationOptions) => {
const lock = new AwaitLock();
exports.AsyncAtomicStore = (creationOptions) => {
const lock = new await_lock_1.default();
const { read, write, data } = creationOptions;

@@ -63,5 +68,5 @@ return {

*/
export const AsyncArray = (array) => {
exports.AsyncArray = (array) => {
const innerArray = array || [];
return AsyncAtomicStore({
return exports.AsyncAtomicStore({
data: async () => innerArray,

@@ -77,5 +82,5 @@ read: async (index) => innerArray[index],

*/
export const AsyncObject = (obj) => {
exports.AsyncObject = (obj) => {
const innerObj = obj || Object.create(null);
return AsyncAtomicStore({
return exports.AsyncAtomicStore({
data: async () => innerObj,

@@ -91,5 +96,5 @@ read: async (index) => innerObj[index],

*/
export const AsyncMap = (map) => {
exports.AsyncMap = (map) => {
const innerMap = map || new Map();
return AsyncAtomicStore({
return exports.AsyncAtomicStore({
data: async () => innerMap,

@@ -96,0 +101,0 @@ read: async (key) => innerMap.get(key),

{
"name": "async-atomic-store",
"version": "1.2.0",
"version": "1.2.1",
"description": "An agnostic little store abstraction for reading, writing and appending on the same data from multiple sources in a locking manner, that allows concurrent/parallel (like from many async sources) write, append and read",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc