
Security News
OpenClaw Advisory Surge Highlights Gaps Between GHSA and CVE Tracking
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.
@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 848 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 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A recent burst of security disclosures in the OpenClaw project is drawing attention to how vulnerability information flows across advisory and CVE systems.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.