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

multer-gridfs-storage

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multer-gridfs-storage - npm Package Compare versions

Comparing version 4.0.3 to 4.1.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 4.1.0
* Breaking change: Removed Node 8 support
* Update: Updated dependencies
# 4.0.3

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

0

index.js

@@ -0,0 +0,0 @@ /**

2

lib/cache.js

@@ -221,3 +221,3 @@ /**

return new Promise((resolve, reject) => {
const _resolve = index => {
const _resolve = (index) => {
if (compare(cacheIndex, index)) {

@@ -224,0 +224,0 @@ this._emitter.removeListener('resolve', _resolve);

@@ -116,3 +116,3 @@ /**

})
.catch(error => this._fail(error));
.catch((error) => this._fail(error));
}

@@ -220,3 +220,3 @@

const errEvent = err => {
const errEvent = (err) => {
// Needs verification. Sometimes the event fires without an error object

@@ -311,3 +311,3 @@ // although the docs specify each of the events has a MongoError argument

const failedListener = err => {
const failedListener = (err) => {
this.removeListener('connection', connectionListener);

@@ -364,7 +364,12 @@ cb(err);

/* eslint-disable-next-line promise/prefer-await-to-then */
.then(fileSettings => {
.then((fileSettings) => {
let settings;
const setType = typeof fileSettings;
const allowedTypes = ['undefined', 'number', 'string', 'object'];
if (!allowedTypes.includes(setType)) {
const allowedTypes = new Set([
'undefined',
'number',
'string',
'object'
]);
if (!allowedTypes.has(setType)) {
throw new Error('Invalid type for file settings, got ' + setType);

@@ -391,6 +396,6 @@ }

/* eslint-disable-next-line promise/prefer-await-to-then */
.then(streamOptions => {
.then((streamOptions) => {
let store;
const emitError = streamError => {
const emitError = (streamError) => {
this.emit('streamError', streamError, streamOptions);

@@ -400,3 +405,3 @@ cb(streamError);

const emitFile = f => {
const emitFile = (f) => {
const storedFile = {

@@ -428,3 +433,3 @@ id: f._id,

// switched into flowing mode that causes the index not to be properly initialized so is better to open the store first
store.open(error => {
store.open((error) => {
if (error) {

@@ -498,3 +503,3 @@ return emitError(error);

return new Promise((resolve, reject) => {
const done = result => {
const done = (result) => {
this.removeListener('connectionFailed', fail);

@@ -504,3 +509,3 @@ resolve(result);

const fail = err => {
const fail = (err) => {
this.removeListener('connection', done);

@@ -507,0 +512,0 @@ reject(err);

@@ -173,3 +173,3 @@ /**

const stringProps = ['scheme', 'username', 'password', 'database'];
const diff = stringProps.find(prop => uri1[prop] !== uri2[prop]);
const diff = stringProps.find((prop) => uri1[prop] !== uri2[prop]);
if (diff) {

@@ -195,3 +195,3 @@ return false;

!hosts2.find(
h => h.host === hostObject.host && h.port === hostObject.port
(h) => h.host === hostObject.host && h.port === hostObject.port
)

@@ -198,0 +198,0 @@ ) {

{
"name": "multer-gridfs-storage",
"version": "4.0.3",
"version": "4.1.0",
"description": "Multer storage engine for GridFS",

@@ -35,3 +35,3 @@ "main": "index.js",

"is-generator": "^1.0.3",
"is-promise": "^2.1.0",
"is-promise": "^4.0.0",
"lodash.isplainobject": ">=0.8.0",

@@ -54,3 +54,3 @@ "mongodb": ">=2",

"jsdoc": "^3.6.3",
"md5-file": "^4.0.0",
"md5-file": "^5.0.0",
"mongoose": "^5.8.9",

@@ -61,6 +61,6 @@ "nyc": "^15.0.0",

"supertest": "^4.0.2",
"xo": "^0.28.0"
"xo": "^0.30.0"
},
"engines": {
"node": ">=8.3.0"
"node": ">=10"
},

@@ -67,0 +67,0 @@ "bugs": {

@@ -13,3 +13,3 @@ # Multer's GridFS storage engine

- Really simple api.
- Compatible with any Node.js version equal or greater than 8.
- Compatible with any Node.js version equal or greater than 10.
- Caching of url based connections.

@@ -16,0 +16,0 @@ - Compatible with Mongoose connection objects.

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