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

mobiletto-base

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobiletto-base - npm Package Compare versions

Comparing version 2.0.29 to 2.0.30

4

lib/cjs/mobiletto.d.ts
import { MobilettoOptions } from "mobiletto-common";
import { MobilettoConnection, MobilettoQueue } from "./types.js";
import { MobilettoConnection, MobilettoQueue, MobilettoDriverParameter } from "./types.js";
import { MobilettoEncryptionSettings } from "./crypt.js";
export declare const ALL_MQ: Record<string, MobilettoQueue>;
export declare function mobiletto(driverPath: string, key: string, secret?: string | null, opts?: MobilettoOptions | null, encryption?: MobilettoEncryptionSettings): Promise<MobilettoConnection>;
export declare function mobiletto(driverPath: string | MobilettoDriverParameter, key: string, secret?: string | null, opts?: MobilettoOptions | null, encryption?: MobilettoEncryptionSettings): Promise<MobilettoConnection>;
export declare function connect(driverPath: string, key: string, secret?: string | null, opts?: MobilettoOptions | null, encryption?: MobilettoEncryptionSettings): Promise<MobilettoConnection>;

@@ -35,14 +35,25 @@ "use strict";

let driver;
if (register_js_1.ALL_DRIVERS[driverPath]) {
driver = register_js_1.ALL_DRIVERS[driverPath];
if (typeof driverPath === "string") {
if (register_js_1.ALL_DRIVERS[driverPath]) {
driver = register_js_1.ALL_DRIVERS[driverPath];
}
else if (require) {
driver = require(driverPath.includes("/") ? driverPath : `./drivers/${driverPath}/index.js`);
}
else {
throw new mobiletto_common_1.MobilettoError(`mobiletto: error resolving driver (require not supported): ${driverPath} (try an ES import of the driver package)`);
}
}
else if (require) {
driver = require(driverPath.includes("/") ? driverPath : `./drivers/${driverPath}/index.js`);
else if (typeof driverPath === "function") {
driver = { storageClient: driverPath };
}
else if (typeof driverPath === "object" && typeof driverPath.storageClient === "function") {
driver = driverPath;
}
else {
throw new mobiletto_common_1.MobilettoError(`mobiletto: error resolving driver (require not supported): ${driverPath} (try an ES import of the driver package)`);
throw new mobiletto_common_1.MobilettoError(`mobiletto: expected registered driver name or a MobilettoDriverParameter, received a ${typeof driverPath} with value ${driverPath}`);
}
let client;
try {
client = driver.storageClient(key, secret, opts);
client = driver.storageClient(key, secret || undefined, opts || undefined);
}

@@ -49,0 +60,0 @@ catch (e) {

import { MobilettoOptions } from "mobiletto-common";
import { MobilettoConnection, MobilettoQueue } from "./types.js";
import { MobilettoConnection, MobilettoQueue, MobilettoDriverParameter } from "./types.js";
import { MobilettoEncryptionSettings } from "./crypt.js";
export declare const ALL_MQ: Record<string, MobilettoQueue>;
export declare function mobiletto(driverPath: string, key: string, secret?: string | null, opts?: MobilettoOptions | null, encryption?: MobilettoEncryptionSettings): Promise<MobilettoConnection>;
export declare function mobiletto(driverPath: string | MobilettoDriverParameter, key: string, secret?: string | null, opts?: MobilettoOptions | null, encryption?: MobilettoEncryptionSettings): Promise<MobilettoConnection>;
export declare function connect(driverPath: string, key: string, secret?: string | null, opts?: MobilettoOptions | null, encryption?: MobilettoEncryptionSettings): Promise<MobilettoConnection>;

@@ -29,14 +29,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

let driver;
if (ALL_DRIVERS[driverPath]) {
driver = ALL_DRIVERS[driverPath];
if (typeof driverPath === "string") {
if (ALL_DRIVERS[driverPath]) {
driver = ALL_DRIVERS[driverPath];
}
else if (require) {
driver = require(driverPath.includes("/") ? driverPath : `./drivers/${driverPath}/index.js`);
}
else {
throw new MobilettoError(`mobiletto: error resolving driver (require not supported): ${driverPath} (try an ES import of the driver package)`);
}
}
else if (require) {
driver = require(driverPath.includes("/") ? driverPath : `./drivers/${driverPath}/index.js`);
else if (typeof driverPath === "function") {
driver = { storageClient: driverPath };
}
else if (typeof driverPath === "object" && typeof driverPath.storageClient === "function") {
driver = driverPath;
}
else {
throw new MobilettoError(`mobiletto: error resolving driver (require not supported): ${driverPath} (try an ES import of the driver package)`);
throw new MobilettoError(`mobiletto: expected registered driver name or a MobilettoDriverParameter, received a ${typeof driverPath} with value ${driverPath}`);
}
let client;
try {
client = driver.storageClient(key, secret, opts);
client = driver.storageClient(key, secret || undefined, opts || undefined);
}

@@ -43,0 +54,0 @@ catch (e) {

{
"name": "mobiletto-base",
"version": "2.0.29",
"version": "2.0.30",
"type": "module",

@@ -5,0 +5,0 @@ "description": "A storage layer that presents a uniform interface to Amazon S3, Backblaze B2, local and other storage systems.",

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