26import fastifyRateLimit from "@fastify/rate-limit";
27import logger from "./lib/logger";
28import routes from './routes';
29import * as fastify from "fastify";30
31/**
32 * Initializes and configures the Fastify application instance.
10 * @license Apache-2.0 OR MIT
11 */
12
13import * as fastify from 'fastify';14import verify from '@sebastienrousseau/crypto-lib/dist/lib/verify';
15import fastifyRateLimit from "@fastify/rate-limit";
16import { IHeadersVerify } from '../../@types/types';
10 * @license Apache-2.0 OR MIT
11 */
12
13import * as fastify from 'fastify';14import revoke from '@sebastienrousseau/crypto-lib/dist/lib/revoke';
15import { IHeadersRevoke } from '../../@types/types';
16
10 * @license Apache-2.0 OR MIT
11 */
12
13import * as fastify from 'fastify';14import { v4 as uuidv4 } from "uuid";
15import { LIB_VERSION } from '../../config/constants';
16
10 * @license Apache-2.0 OR MIT
11 */
12
13import * as fastify from 'fastify';14import generate from '@sebastienrousseau/crypto-lib/dist/lib/generate';
15import { IHeadersGenerate } from '../../@types/types';
16
Wildcard imports are easier to write, but make it harder to pick out the specific functions or objects from a dependency that are used in a file.
import * from 'module';
// there is no clear way to tell if
// `someFunction` has been imported
// from 'module'.
someFunction();
Therefore, it is recommended to explicit imports wherever possible.
NOTE: Some libraries do not expose themselves as ESModules. In cases like these, it is recommended to use a skipcq comment to suppress this issue.
import * as axios from 'axios'
import * as Sentry from '@sentry/node'
try {
const result = await axios.get();
// ...
} catch (err) {
Sentry.captureException(err);
}
import axios from 'axios'
// skipcq: JS-C1003 - sentry does not expose itself as an ES Module.
import * as Sentry from '@sentry/node'
try {
const result = await axios.get();
// ...
} catch (err) {
Sentry.captureException(err);
}