mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
lib: remove startsWith/endsWith primordials for char checks
PR-URL: https://github.com/nodejs/node/pull/55407 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mattias Buelens <mattias@buelens.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
This commit is contained in:
parent
6e3e99c81e
commit
753cbede2a
11 changed files with 17 additions and 22 deletions
|
@ -391,8 +391,9 @@ function resolvePackageTargetString(
|
|||
}
|
||||
|
||||
if (!StringPrototypeStartsWith(target, './')) {
|
||||
if (internal && !StringPrototypeStartsWith(target, '../') &&
|
||||
!StringPrototypeStartsWith(target, '/')) {
|
||||
if (internal &&
|
||||
target[0] !== '/' &&
|
||||
!StringPrototypeStartsWith(target, '../')) {
|
||||
// No need to convert target to string, since it's already presumed to be
|
||||
if (!URLCanParse(target)) {
|
||||
const exportTarget = pattern ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue