mirror of
https://github.com/hanzoai/prettier.git
synced 2026-09-24 17:02:04 +00:00
16 lines
332 B
JavaScript
16 lines
332 B
JavaScript
import { createMethodShim } from "./shared.js";
|
|
|
|
const arrayToReversed =
|
|
Array.prototype.toReversed ??
|
|
function () {
|
|
return [...this].reverse();
|
|
};
|
|
|
|
const toReversed = /* @__PURE__ */ createMethodShim("toReversed", function () {
|
|
if (Array.isArray(this)) {
|
|
return arrayToReversed;
|
|
}
|
|
});
|
|
|
|
export default toReversed;
|