New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mock-async-storage

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mock-async-storage - npm Package Compare versions

Comparing version 2.0.4 to 2.0.5

5

lib/mockAsyncStorage.js

@@ -91,5 +91,4 @@ 'use strict';

return _asyncToGenerator(function* () {
const entries = Array.from(_this6.store.entries());
const requested = entries.filter(function ([k]) {
return keys.includes(k);
const requested = keys.map(function (k) {
return [k, _this6.store.get(k) || null];
});

@@ -96,0 +95,0 @@ if (cb) cb(null, requested);

2

package.json
{
"name": "mock-async-storage",
"title": "Jest Mock AsyncStorage for react-native",
"version": "2.0.4",
"version": "2.0.5",
"description": "Its a mock of react-native AsyncStorage for jest tests",

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

@@ -124,6 +124,6 @@ /* eslint-env jest */

const cb = jest.fn()
const values = await storage.multiGet(['foo', 'bar'], cb)
const values = await storage.multiGet(['foo', 'bar', 'baz'], cb)
expect(values).toEqual([['foo', 'foo'], ['bar', 'bar']])
expect(cb).toBeCalledWith(null, [['foo', 'foo'], ['bar', 'bar']])
expect(values).toEqual([['foo', 'foo'], ['bar', 'bar'], ['baz', null]])
expect(cb).toBeCalledWith(null, [['foo', 'foo'], ['bar', 'bar'], ['baz', null]])
})

@@ -130,0 +130,0 @@

@@ -67,4 +67,3 @@ // @flow

async multiGet (keys: Array<K>, cb: ?ErrBack<Entries<K, V>>): Promise<Entries<K, V>> {
const entries = Array.from(this.store.entries())
const requested = entries.filter(([k]) => keys.includes(k))
const requested = keys.map(k => [k, this.store.get(k) || null])
if (cb) cb(null, requested)

@@ -71,0 +70,0 @@ return requested

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