Socket
Socket
Sign inDemoInstall

mongodb-memory-server-core

Package Overview
Dependencies
Maintainers
2
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-memory-server-core - npm Package Compare versions

Comparing version 8.11.3 to 8.11.4

8

lib/util/getos/index.d.ts

@@ -0,1 +1,3 @@

/** Helper Static so that a consistent UNKNOWN value is used */
export declare const UNKNOWN = "unknown";
export interface OtherOS {

@@ -20,2 +22,8 @@ os: 'aix' | 'android' | 'darwin' | 'freebsd' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | string;

/**
* Helper function to check if the input os is valid
* @param os The OS information to check
* @returns `true` if not undefined AND not UNKNOWN
*/
export declare function isValidOs(os: LinuxOS | undefined): os is LinuxOS;
/**
* Parse LSB-like output (either command or file)

@@ -22,0 +30,0 @@ */

33

lib/util/getos/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseOS = exports.parseLSB = exports.getOS = exports.isLinuxOS = void 0;
exports.parseOS = exports.parseLSB = exports.isValidOs = exports.getOS = exports.isLinuxOS = exports.UNKNOWN = void 0;
const tslib_1 = require("tslib");

@@ -23,2 +23,4 @@ const os_1 = require("os");

};
/** Helper Static so that a consistent UNKNOWN value is used */
exports.UNKNOWN = 'unknown';
/**

@@ -63,3 +65,3 @@ * Check if the OS is a LinuxOS Typeguard

const upstreamLSB = yield (0, utils_1.tryReleaseFile)('/etc/upstream-release/lsb-release', parseLSB);
if (!(0, utils_1.isNullOrUndefined)(upstreamLSB)) {
if (isValidOs(upstreamLSB)) {
log('getLinuxInformation: Using UpstreamLSB');

@@ -69,3 +71,3 @@ return upstreamLSB;

const etcOsRelease = yield (0, utils_1.tryReleaseFile)('/etc/os-release', parseOS);
if (!(0, utils_1.isNullOrUndefined)(etcOsRelease)) {
if (isValidOs(etcOsRelease)) {
log('getLinuxInformation: Using etcOsRelease');

@@ -75,3 +77,3 @@ return etcOsRelease;

const usrOsRelease = yield (0, utils_1.tryReleaseFile)('/usr/lib/os-release', parseOS);
if (!(0, utils_1.isNullOrUndefined)(usrOsRelease)) {
if (isValidOs(usrOsRelease)) {
log('getLinuxInformation: Using usrOsRelease');

@@ -81,11 +83,11 @@ return usrOsRelease;

const etcLSBRelease = yield (0, utils_1.tryReleaseFile)('/etc/lsb-release', parseLSB);
if (!(0, utils_1.isNullOrUndefined)(etcLSBRelease)) {
if (isValidOs(etcLSBRelease)) {
log('getLinuxInformation: Using etcLSBRelease');
return etcLSBRelease;
}
console.warn('Could not find any Release File, using fallback binary');
console.warn('Could not find any valid Release File, using fallback information');
// if none has worked, return unknown
return {
os: 'linux',
dist: 'unknown',
dist: exports.UNKNOWN,
release: '',

@@ -96,2 +98,15 @@ };

/**
* Helper function to check if the input os is valid
* @param os The OS information to check
* @returns `true` if not undefined AND not UNKNOWN
*/
function isValidOs(os) {
// helper for debugging
if (os && os.dist === exports.UNKNOWN) {
log('isValidOS: found defined os, but was unknown:', os);
}
return !(0, utils_1.isNullOrUndefined)(os) && os.dist !== exports.UNKNOWN;
}
exports.isValidOs = isValidOs;
/**
* Parse LSB-like output (either command or file)

@@ -103,3 +118,3 @@ */

os: 'linux',
dist: (_b = (_a = input.match(LSBRegex.name)) === null || _a === void 0 ? void 0 : _a[1].toLocaleLowerCase()) !== null && _b !== void 0 ? _b : 'unknown',
dist: (_b = (_a = input.match(LSBRegex.name)) === null || _a === void 0 ? void 0 : _a[1].toLocaleLowerCase()) !== null && _b !== void 0 ? _b : exports.UNKNOWN,
codename: (_c = input.match(LSBRegex.codename)) === null || _c === void 0 ? void 0 : _c[1].toLocaleLowerCase(),

@@ -117,3 +132,3 @@ release: (_e = (_d = input.match(LSBRegex.release)) === null || _d === void 0 ? void 0 : _d[1].toLocaleLowerCase()) !== null && _e !== void 0 ? _e : '',

os: 'linux',
dist: (_b = (_a = input.match(OSRegex.name)) === null || _a === void 0 ? void 0 : _a[1].toLocaleLowerCase()) !== null && _b !== void 0 ? _b : 'unknown',
dist: (_b = (_a = input.match(OSRegex.name)) === null || _a === void 0 ? void 0 : _a[1].toLocaleLowerCase()) !== null && _b !== void 0 ? _b : exports.UNKNOWN,
codename: (_c = input.match(OSRegex.codename)) === null || _c === void 0 ? void 0 : _c[1].toLocaleLowerCase(),

@@ -120,0 +135,0 @@ release: (_e = (_d = input.match(OSRegex.release)) === null || _d === void 0 ? void 0 : _d[1].toLocaleLowerCase()) !== null && _e !== void 0 ? _e : '',

@@ -371,3 +371,3 @@ "use strict";

}
if (/^elementary\s?os\s*$/i.test(os.dist)) {
if (/^elementary(?:\s?os)?\s*$/i.test(os.dist)) {
const elementaryToUbuntuRelease = {

@@ -374,0 +374,0 @@ 3: '14.04',

{
"name": "mongodb-memory-server-core",
"version": "8.11.3",
"version": "8.11.4",
"description": "MongoDB Server for testing (core package, without autodownload). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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