From 43cbdd5b662bafe41f4eb6c59c5a8a778e3e0385 Mon Sep 17 00:00:00 2001 From: Jake Lacey Date: Fri, 25 Aug 2023 16:16:32 +0100 Subject: [PATCH] refactor: use specific lodash packages This is to reduce the size of the bundle users have to install. --- sign.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sign.js b/sign.js index 1aeeabc..82bf526 100644 --- a/sign.js +++ b/sign.js @@ -2,7 +2,13 @@ const timespan = require('./lib/timespan'); const PS_SUPPORTED = require('./lib/psSupported'); const validateAsymmetricKey = require('./lib/validateAsymmetricKey'); const jws = require('jws'); -const {includes, isBoolean, isInteger, isNumber, isPlainObject, isString, once} = require('lodash') +const includes = require('lodash.includes'); +const isBoolean = require('lodash.isboolean'); +const isInteger = require('lodash.isinteger'); +const isNumber = require('lodash.isnumber'); +const isPlainObject = require('lodash.isplainobject'); +const isString = require('lodash.isstring'); +const once = require('lodash.once'); const { KeyObject, createSecretKey, createPrivateKey } = require('crypto') const SUPPORTED_ALGS = ['RS256', 'RS384', 'RS512', 'ES256', 'ES384', 'ES512', 'HS256', 'HS384', 'HS512', 'none'];