From e39fb46e5a365a6f4407b97a6fd307aaf555437f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Louren=C3=A7o?= Date: Wed, 10 Apr 2024 08:22:33 -0300 Subject: [PATCH] fix(perf): only import what is needed for type-defs --- workspaces/config/lib/type-defs.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/workspaces/config/lib/type-defs.js b/workspaces/config/lib/type-defs.js index 20a827c3d164e..23ff884f5655f 100644 --- a/workspaces/config/lib/type-defs.js +++ b/workspaces/config/lib/type-defs.js @@ -2,9 +2,10 @@ const nopt = require('nopt') const { Umask, validate: validateUmask } = require('./umask.js') -const semver = require('semver') +const semverValid = require('semver/functions/valid.js') +const Semver = require('semver/classes/semver.js') const validateSemver = (data, k, val) => { - const valid = semver.valid(val) + const valid = semverValid(val) if (!valid) { return false } @@ -23,7 +24,7 @@ const validatePath = (data, k, val) => { module.exports = { ...nopt.typeDefs, semver: { - type: semver, + type: Semver, validate: validateSemver, description: 'full valid SemVer string', },