Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/internal/readline/utils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
'use strict';

const {
ArrayPrototypeSlice,
ArrayPrototypeSort,
ArrayPrototypeToSorted,
RegExpPrototypeExec,
StringFromCharCode,
StringPrototypeCharCodeAt,
Expand Down Expand Up @@ -385,7 +384,7 @@ function commonPrefix(strings) {
if (strings.length === 1) {
return strings[0];
}
const sorted = ArrayPrototypeSort(ArrayPrototypeSlice(strings));
const sorted = ArrayPrototypeToSorted(strings);
const min = sorted[0];
const max = sorted[sorted.length - 1];
for (let i = 0; i < min.length; i++) {
Expand Down
1 change: 1 addition & 0 deletions typings/primordials.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ declare namespace primordials {
export const ArrayPrototypeSlice: UncurryThis<typeof Array.prototype.slice>
export const ArrayPrototypeSort: UncurryThis<typeof Array.prototype.sort>
export const ArrayPrototypeSplice: UncurryThis<typeof Array.prototype.splice>
export const ArrayPrototypeToSorted: UncurryThis<typeof Array.prototype.toSorted>
export const ArrayPrototypeIncludes: UncurryThis<typeof Array.prototype.includes>
export const ArrayPrototypeIndexOf: UncurryThis<typeof Array.prototype.indexOf>
export const ArrayPrototypeJoin: UncurryThis<typeof Array.prototype.join>
Expand Down