
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@tc-libs/constant
Advanced tools
Raccoglie costanti condivise usate dagli altri package del monorepo. Al momento espone enum per:
Raccoglie costanti condivise usate dagli altri package del monorepo. Al momento espone enum per:
Questo package non registra moduli NestJS e non ha configurazione runtime: si importa direttamente dove serve.
import {
ENUM_APP_ENVIRONMENT,
ENUM_FILE_IMAGE_MIME,
ENUM_FILE_EXCEL_MIME,
ENUM_FILE_AUDIO_MIME,
ENUM_FILE_TEXT_MIME,
ENUM_FILE_VIDEO_MIME,
ENUM_FILE_TYPE,
ENUM_TABLE_FILE_TYPE,
} from '@tc-libs/constant';
ENUM_APP_ENVIRONMENTValori standard per distinguere il contesto applicativo:
ENUM_APP_ENVIRONMENT.PRODUCTION;
ENUM_APP_ENVIRONMENT.STAGING;
ENUM_APP_ENVIRONMENT.DEVELOPMENT;
Utile per confronti espliciti in config, bootstrap e logica condizionale.
Gli enum MIME vengono usati soprattutto dai package file, doc, request e response per validazione upload ed export.
ENUM_FILE_IMAGE_MIME.PNG;
ENUM_FILE_EXCEL_MIME.XLSX;
ENUM_FILE_AUDIO_MIME.MP3;
ENUM_FILE_VIDEO_MIME.MP4;
ENUM_FILE_TEXT_MIME.PDF;
ENUM_FILE_TEXT_MIME e un oggetto aggregato che unisce plain text, ODT, PDF, DOCX e PowerPoint.
ENUM_FILE_TYPECategoria logica del file, indipendente dal MIME specifico:
ENUM_FILE_TYPE.IMAGE;
ENUM_FILE_TYPE.AUDIO;
ENUM_FILE_TYPE.EXCEL;
ENUM_FILE_TYPE.VIDEO;
Viene usato, ad esempio, per applicare limiti diversi ai file binari o per persistere il tipo in entita database.
ENUM_TABLE_FILE_TYPEFormati tabellari supportati nelle esportazioni:
ENUM_TABLE_FILE_TYPE.CSV;
ENUM_TABLE_FILE_TYPE.XLS;
ENUM_TABLE_FILE_TYPE.XLSX;
import { ENUM_FILE_IMAGE_MIME } from '@tc-libs/constant';
const allowed = Object.values(ENUM_FILE_IMAGE_MIME);
if (!allowed.includes(file.mimetype as ENUM_FILE_IMAGE_MIME)) {
throw new Error('Unsupported image format');
}
import { ENUM_APP_ENVIRONMENT } from '@tc-libs/constant';
const isProd =
process.env.NODE_ENV === ENUM_APP_ENVIRONMENT.PRODUCTION;
import { ENUM_TABLE_FILE_TYPE } from '@tc-libs/constant';
type ExportOptions = {
fileType: ENUM_TABLE_FILE_TYPE;
};
Usa questo package quando vuoi:
nx build constant
nx test constant
FAQs
Raccoglie costanti condivise usate dagli altri package del monorepo. Al momento espone enum per:
We found that @tc-libs/constant demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.