Comparing version 5.4.1 to 5.4.2
@@ -5,3 +5,2 @@ "use strict"; | ||
const tslib_1 = require("tslib"); | ||
const lodash_1 = require("lodash"); | ||
const util_1 = require("util"); | ||
@@ -19,3 +18,3 @@ const utils_1 = require("../utils"); | ||
}; | ||
const optsEncodeMap = (0, lodash_1.invert)(optsDecodeMap); | ||
const optsEncodeMap = (0, utils_1.invertObject)(optsDecodeMap); | ||
exports.PRIORITY_LIMIT = 2 ** 21; | ||
@@ -22,0 +21,0 @@ /** |
@@ -5,4 +5,2 @@ "use strict"; | ||
const crypto_1 = require("crypto"); | ||
const minimatch_1 = require("minimatch"); | ||
const fg = require("fast-glob"); | ||
const path = require("path"); | ||
@@ -28,15 +26,3 @@ const fs = require("fs"); | ||
exports.ScriptLoaderError = ScriptLoaderError; | ||
const hasMagic = (pattern) => { | ||
if (!Array.isArray(pattern)) { | ||
pattern = [pattern]; | ||
} | ||
for (const p of pattern) { | ||
if (new minimatch_1.Minimatch(p, GlobOptions).hasMagic()) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
const isPossiblyMappedPath = (path) => path && ['~', '<'].includes(path[0]); | ||
const hasFilenamePattern = (path) => hasMagic(path); | ||
/** | ||
@@ -132,2 +118,31 @@ * Lua script loader with include support | ||
} | ||
const minimatch = await import('minimatch'); | ||
if (!minimatch) { | ||
console.warn('Install minimatch as dev-dependency'); | ||
} | ||
const Minimatch = minimatch.Minimatch || class Empty { | ||
}; | ||
const fg = await import('fast-glob'); | ||
if (!fg) { | ||
console.warn('Install fast-glob as dev-dependency'); | ||
} | ||
const nonOp = () => { | ||
return ['']; | ||
}; | ||
const glob = (fg === null || fg === void 0 ? void 0 : fg.default.glob) || nonOp; | ||
const hasMagic = (pattern) => { | ||
if (!Array.isArray(pattern)) { | ||
pattern = [pattern]; | ||
} | ||
for (const p of pattern) { | ||
if (new Minimatch(p, GlobOptions).hasMagic()) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
const hasFilenamePattern = (path) => hasMagic(path); | ||
async function getFilenamesByPattern(pattern) { | ||
return glob(pattern, { dot: true }); | ||
} | ||
let res; | ||
@@ -362,5 +377,2 @@ let content = file.content; | ||
} | ||
async function getFilenamesByPattern(pattern) { | ||
return fg.glob(pattern, { dot: true }); | ||
} | ||
// Determine the project root | ||
@@ -367,0 +379,0 @@ // https://stackoverflow.com/a/18721515 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.QUEUE_EVENT_SUFFIX = exports.errorToJSON = exports.parseObjectValues = exports.isRedisVersionLowerThan = exports.childSend = exports.asyncSend = exports.isNotConnectionError = exports.DELAY_TIME_1 = exports.DELAY_TIME_5 = exports.clientCommandMessageReg = exports.getParentKey = exports.removeAllQueueData = exports.decreaseMaxListeners = exports.increaseMaxListeners = exports.isRedisCluster = exports.isRedisInstance = exports.delay = exports.array2obj = exports.isEmpty = exports.lengthInUtf8Bytes = exports.tryCatch = exports.errorObject = void 0; | ||
exports.QUEUE_EVENT_SUFFIX = exports.errorToJSON = exports.parseObjectValues = exports.isRedisVersionLowerThan = exports.childSend = exports.asyncSend = exports.isNotConnectionError = exports.DELAY_TIME_1 = exports.DELAY_TIME_5 = exports.clientCommandMessageReg = exports.getParentKey = exports.removeAllQueueData = exports.decreaseMaxListeners = exports.isRedisCluster = exports.isRedisInstance = exports.invertObject = exports.increaseMaxListeners = exports.delay = exports.array2obj = exports.isEmpty = exports.lengthInUtf8Bytes = exports.tryCatch = exports.errorObject = void 0; | ||
const ioredis_1 = require("ioredis"); | ||
@@ -59,2 +59,14 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
exports.delay = delay; | ||
function increaseMaxListeners(emitter, count) { | ||
const maxListeners = emitter.getMaxListeners(); | ||
emitter.setMaxListeners(maxListeners + count); | ||
} | ||
exports.increaseMaxListeners = increaseMaxListeners; | ||
const invertObject = (obj) => { | ||
return Object.entries(obj).reduce((encodeMap, [key, value]) => { | ||
encodeMap[value] = key; | ||
return encodeMap; | ||
}, {}); | ||
}; | ||
exports.invertObject = invertObject; | ||
function isRedisInstance(obj) { | ||
@@ -72,7 +84,2 @@ if (!obj) { | ||
exports.isRedisCluster = isRedisCluster; | ||
function increaseMaxListeners(emitter, count) { | ||
const maxListeners = emitter.getMaxListeners(); | ||
emitter.setMaxListeners(maxListeners + count); | ||
} | ||
exports.increaseMaxListeners = increaseMaxListeners; | ||
function decreaseMaxListeners(emitter, count) { | ||
@@ -79,0 +86,0 @@ increaseMaxListeners(emitter, -count); |
import { __rest } from "tslib"; | ||
import { invert } from 'lodash'; | ||
import { debuglog } from 'util'; | ||
import { errorObject, isEmpty, getParentKey, lengthInUtf8Bytes, parseObjectValues, tryCatch, } from '../utils'; | ||
import { errorObject, invertObject, isEmpty, getParentKey, lengthInUtf8Bytes, parseObjectValues, tryCatch, } from '../utils'; | ||
import { Backoffs } from './backoffs'; | ||
@@ -15,3 +14,3 @@ import { Scripts } from './scripts'; | ||
}; | ||
const optsEncodeMap = invert(optsDecodeMap); | ||
const optsEncodeMap = invertObject(optsDecodeMap); | ||
export const PRIORITY_LIMIT = 2 ** 21; | ||
@@ -18,0 +17,0 @@ /** |
import { createHash } from 'crypto'; | ||
import { Minimatch } from 'minimatch'; | ||
import * as fg from 'fast-glob'; | ||
import * as path from 'path'; | ||
@@ -23,15 +21,3 @@ import * as fs from 'fs'; | ||
} | ||
const hasMagic = (pattern) => { | ||
if (!Array.isArray(pattern)) { | ||
pattern = [pattern]; | ||
} | ||
for (const p of pattern) { | ||
if (new Minimatch(p, GlobOptions).hasMagic()) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
const isPossiblyMappedPath = (path) => path && ['~', '<'].includes(path[0]); | ||
const hasFilenamePattern = (path) => hasMagic(path); | ||
/** | ||
@@ -127,2 +113,31 @@ * Lua script loader with include support | ||
} | ||
const minimatch = await import('minimatch'); | ||
if (!minimatch) { | ||
console.warn('Install minimatch as dev-dependency'); | ||
} | ||
const Minimatch = minimatch.Minimatch || class Empty { | ||
}; | ||
const fg = await import('fast-glob'); | ||
if (!fg) { | ||
console.warn('Install fast-glob as dev-dependency'); | ||
} | ||
const nonOp = () => { | ||
return ['']; | ||
}; | ||
const glob = (fg === null || fg === void 0 ? void 0 : fg.default.glob) || nonOp; | ||
const hasMagic = (pattern) => { | ||
if (!Array.isArray(pattern)) { | ||
pattern = [pattern]; | ||
} | ||
for (const p of pattern) { | ||
if (new Minimatch(p, GlobOptions).hasMagic()) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
const hasFilenamePattern = (path) => hasMagic(path); | ||
async function getFilenamesByPattern(pattern) { | ||
return glob(pattern, { dot: true }); | ||
} | ||
let res; | ||
@@ -356,5 +371,2 @@ let content = file.content; | ||
} | ||
async function getFilenamesByPattern(pattern) { | ||
return fg.glob(pattern, { dot: true }); | ||
} | ||
// Determine the project root | ||
@@ -361,0 +373,0 @@ // https://stackoverflow.com/a/18721515 |
@@ -21,5 +21,6 @@ /// <reference types="node" /> | ||
export declare function delay(ms: number, abortController?: AbortController): Promise<void>; | ||
export declare function increaseMaxListeners(emitter: EventEmitter, count: number): void; | ||
export declare const invertObject: (obj: Record<string, string>) => Record<string, string>; | ||
export declare function isRedisInstance(obj: any): obj is Redis | Cluster; | ||
export declare function isRedisCluster(obj: unknown): obj is Cluster; | ||
export declare function increaseMaxListeners(emitter: EventEmitter, count: number): void; | ||
export declare function decreaseMaxListeners(emitter: EventEmitter, count: number): void; | ||
@@ -26,0 +27,0 @@ export declare function removeAllQueueData(client: RedisClient, queueName: string, prefix?: string): Promise<void | boolean>; |
@@ -51,2 +51,12 @@ import { Cluster } from 'ioredis'; | ||
} | ||
export function increaseMaxListeners(emitter, count) { | ||
const maxListeners = emitter.getMaxListeners(); | ||
emitter.setMaxListeners(maxListeners + count); | ||
} | ||
export const invertObject = (obj) => { | ||
return Object.entries(obj).reduce((encodeMap, [key, value]) => { | ||
encodeMap[value] = key; | ||
return encodeMap; | ||
}, {}); | ||
}; | ||
export function isRedisInstance(obj) { | ||
@@ -62,6 +72,2 @@ if (!obj) { | ||
} | ||
export function increaseMaxListeners(emitter, count) { | ||
const maxListeners = emitter.getMaxListeners(); | ||
emitter.setMaxListeners(maxListeners + count); | ||
} | ||
export function decreaseMaxListeners(emitter, count) { | ||
@@ -68,0 +74,0 @@ increaseMaxListeners(emitter, -count); |
{ | ||
"name": "bullmq", | ||
"version": "5.4.1", | ||
"version": "5.4.2", | ||
"description": "Queue for messages and jobs based on Redis", | ||
@@ -57,6 +57,4 @@ "homepage": "https://bullmq.io/", | ||
"cron-parser": "^4.6.0", | ||
"fast-glob": "^3.3.2", | ||
"ioredis": "^5.3.2", | ||
"lodash": "^4.17.21", | ||
"minimatch": "^9.0.3", | ||
"msgpackr": "^1.10.1", | ||
@@ -80,3 +78,2 @@ "node-abort-controller": "^3.1.1", | ||
"@types/chai-as-promised": "^7.1.5", | ||
"@types/glob": "^7.2.0", | ||
"@types/lodash.defaults": "^4.2.7", | ||
@@ -103,2 +100,3 @@ "@types/lodash.isarguments": "^3.1.7", | ||
"eslint-plugin-tsdoc": "^0.2.16", | ||
"fast-glob": "^3.3.2", | ||
"husky": "^8.0.1", | ||
@@ -108,2 +106,3 @@ "istanbul": "^0.4.5", | ||
"madge": "^5.0.1", | ||
"minimatch": "^9.0.3", | ||
"mocha": "^10.0.0", | ||
@@ -110,0 +109,0 @@ "mocha-lcov-reporter": "^1.3.0", |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1542865
8
24565
54
- Removedfast-glob@^3.3.2
- Removedminimatch@^9.0.3
- Removed@nodelib/fs.scandir@2.1.5(transitive)
- Removed@nodelib/fs.stat@2.0.5(transitive)
- Removed@nodelib/fs.walk@1.2.8(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@2.0.1(transitive)
- Removedbraces@3.0.3(transitive)
- Removedfast-glob@3.3.2(transitive)
- Removedfastq@1.17.1(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedmerge2@1.4.1(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminimatch@9.0.5(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedqueue-microtask@1.2.3(transitive)
- Removedreusify@1.0.4(transitive)
- Removedrun-parallel@1.2.0(transitive)
- Removedto-regex-range@5.0.1(transitive)