From 1e0f149176877f906968a01087cf63290652ccbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kh=E1=BA=A3i?= Date: Thu, 16 May 2024 15:38:14 +0700 Subject: [PATCH] refactor: replace deprecated method (#45) --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2ef255d..bd24e09 100644 --- a/index.js +++ b/index.js @@ -425,10 +425,10 @@ function makeEnv (data, opts, prefix, env) { i = i.replace(/^_+/, '') let k if (i.indexOf(namePref) === 0) { - k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, '_') + k = i.substring(namePref.length).replace(/[^a-zA-Z0-9_]/g, '_') pkgConfig[k] = value } else if (i.indexOf(verPref) === 0) { - k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, '_') + k = i.substring(verPref.length).replace(/[^a-zA-Z0-9_]/g, '_') pkgVerConfig[k] = value } const envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_')