
Product
Socket Threat Intel Now Shows Which Malware Campaigns Were Blocked or Detected
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.
@eggjs/tegg-common-util
Advanced tools
Common utility functions for tegg framework.
A utility method for deduplicating module references to avoid adding duplicate modules.
public static deduplicateModules(
moduleReferences: readonly ModuleReference[]
): readonly ModuleReference[]
Note: This method does not accept options parameters. The behavior is fixed and optimized for common use cases.
import { ModuleConfigUtil } from '@eggjs/tegg-common-util';
const modules = [
{ name: 'module1', path: '/path/to/module1' },
{ name: 'module2', path: '/path/to/module2' },
{ name: 'module1', path: '/different/path/to/module1' }, // Will throw error
];
const result = ModuleConfigUtil.deduplicateModules(modules);
// Throws Error: Duplicate module name "module1" found
const modules = [
{ name: 'module1', path: '/path/to/module1', optional: true },
{ name: 'module1', path: '/path/to/module1' }, // Non-optional version
];
const result = ModuleConfigUtil.deduplicateModules(modules);
// Result: 1 module, non-optional version kept
const modules = [
{ name: 'module1', path: '/path/to/module1' },
{ name: 'module2', path: '/path/to/module1' }, // Same path, different name
];
const result = ModuleConfigUtil.deduplicateModules(modules);
// Result: 1 module, first occurrence kept
// In ModuleScanner.loadModuleReferences()
return ModuleConfigUtil.deduplicateModules(allModuleReferences);
// Automatically handles deduplication with optimal defaults
// In Runner.getModuleReferences()
return ModuleConfigUtil.deduplicateModules(allModuleReferences);
// Simple and reliable deduplication
try {
const result = ModuleConfigUtil.deduplicateModules(modules);
} catch (error) {
if (error.message.includes('Duplicate module name')) {
// Handle duplicate module name error
console.error('Configuration error:', error.message);
}
throw error;
}
// This API never existed in the actual implementation
const result = ModuleConfigUtil.deduplicateModules(modules, {
prioritizeNonOptional: true,
allowNameDuplicates: false,
logPrefix: '[tegg/config]',
logger: customLogger,
});
// Current implementation - simple and direct
const result = ModuleConfigUtil.deduplicateModules(modules);
// Automatically handles all deduplication logic
FAQs
common util for tegg
The npm package @eggjs/tegg-common-util receives a total of 298 weekly downloads. As such, @eggjs/tegg-common-util popularity was classified as not popular.
We found that @eggjs/tegg-common-util demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.

Product
Socket Threat Intel now shows which malware campaigns were blocked or detected in your organization, with links to scans and Firewall events.

Security News
Fixes for eMudhra and Brotli are out. Getting them everywhere they’re needed means tracking down bundled libraries, runtimes, and certificate stores.

Threat Research
/Security News
Socket uncovered secret-stealing workflows that ran in LiteLLM’s GitHub repository 11 days before the supply chain attack on PyPI and Docker.