multer-flydrive-engine
Advanced tools
Comparing version 1.0.1 to 1.0.2
import { StorageEngine } from 'multer'; | ||
import { Storage } from '@slynova/flydrive'; | ||
import { MulterFlydriveOptions } from './types'; | ||
import { MulterFlydriveOptions, Storage } from './types'; | ||
export declare class FlydriveStorageEngine implements StorageEngine { | ||
@@ -5,0 +4,0 @@ private readonly opts; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const flydrive_1 = require("@slynova/flydrive"); | ||
const path_1 = require("path"); | ||
@@ -11,3 +10,3 @@ const crypto_1 = require("crypto"); | ||
async disk(req, file) { | ||
return this.opts.disk instanceof flydrive_1.Storage ? this.opts.disk : this.opts.disk(req, file); | ||
return typeof this.opts.disk === 'function' ? this.opts.disk(req, file) : this.opts.disk; | ||
} | ||
@@ -14,0 +13,0 @@ async destination(req, file) { |
/// <reference types="multer" /> | ||
import { Request } from "express"; | ||
import { Storage } from '@slynova/flydrive'; | ||
export interface Storage { | ||
put: (path: string, ...args: any[]) => Promise<void>; | ||
getProperties: (path: string) => Promise<{ | ||
contentLength: number; | ||
}>; | ||
delete: (path: string) => Promise<void>; | ||
} | ||
export declare type MulterFlydriveOptionsFunction = ((req?: Request, file?: Express.Multer.File) => string | Promise<string>); | ||
export interface MulterFlydriveOptions { | ||
disk: Storage; | ||
disk: object | ((...args: any[]) => Promise<object>); | ||
destination?: string | MulterFlydriveOptionsFunction; | ||
filename?: MulterFlydriveOptionsFunction; | ||
} |
{ | ||
"name": "multer-flydrive-engine", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A multer storage engine for flydrive's fluent storage interface", | ||
@@ -48,5 +48,3 @@ "main": "build/index.js", | ||
}, | ||
"dependencies": { | ||
"@slynova/flydrive": "^0.3.1" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
@@ -53,0 +51,0 @@ "multer": "^1.4.2" |
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
8072
1
86
- Removed@slynova/flydrive@^0.3.1
- Removed@slynova/flydrive@0.3.1(transitive)
- Removedclone@2.1.2(transitive)
- Removedcreate-output-stream@0.0.1(transitive)
- Removedfs-extra@6.0.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedjsonfile@4.0.0(transitive)
- Removednode-exceptions@3.0.0(transitive)
- Removedresetable@1.0.3(transitive)
- Removeduniversalify@0.1.2(transitive)