Remove lodash Dependency (#457)

NodeJS 24 contains RegExp.escape, no need for lodash.
This commit is contained in:
Jonatan Männchen
2026-06-28 18:35:21 +02:00
committed by GitHub
parent b4b8d851b6
commit ea45c8043f
4 changed files with 7 additions and 17291 deletions
+5 -17278
View File
File diff suppressed because it is too large Load Diff
-7
View File
@@ -11,7 +11,6 @@
"@actions/exec": "3.0.0",
"@actions/tool-cache": "4.0.0",
"csv-parse": "6.2.1",
"lodash": "4.17.23",
"semver": "7.7.4",
"smol-toml": "1.6.1"
},
@@ -2183,12 +2182,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/lodash": {
"version": "4.17.23",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
"license": "MIT"
},
"node_modules/make-dir": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
-1
View File
@@ -21,7 +21,6 @@
"@actions/exec": "3.0.0",
"@actions/tool-cache": "4.0.0",
"csv-parse": "6.2.1",
"lodash": "4.17.23",
"semver": "7.7.4",
"smol-toml": "1.6.1"
},
+2 -5
View File
@@ -7,7 +7,6 @@ import { exec } from '@actions/exec'
import * as tc from '@actions/tool-cache'
import * as semver from 'semver'
import * as csv from 'csv-parse/sync'
import _ from 'lodash'
import toml from 'smol-toml'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -378,9 +377,7 @@ async function getOTPVersions(osVersion) {
})
} else if (process.platform === 'win32') {
const otpArch = otpArchitecture()
const file_regex = new RegExp(
`^otp_win${_.escapeRegExp(otpArch)}_(.*).exe$`,
)
const file_regex = new RegExp(`^otp_win${RegExp.escape(otpArch)}_(.*).exe$`)
otpVersionsListings.forEach((otpVersionsListing) => {
otpVersionsListing
.map((x) => x.assets)
@@ -982,7 +979,7 @@ async function install(toolName, opts) {
const otpArch = otpArchitecture()
return (
'https://github.com/erlang/otp/releases/download/' +
`OTP-${toolVersion}/otp_win${_.escapeRegExp(otpArch)}_${toolVersion}.exe`
`OTP-${toolVersion}/otp_win${otpArch}_${toolVersion}.exe`
)
},
extract: async () => ['file', 'otp.exe'],