printer-notifications/node_modules/svelte-eslint-parser/lib/parser/sort.js
2023-11-13 16:10:04 -05:00

19 lines
412 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sortNodes = void 0;
/**
* Sort tokens
*/
function sortNodes(tokens) {
if (!tokens) {
return [];
}
return tokens.sort((a, b) => {
if (a.range[0] !== b.range[0]) {
return a.range[0] - b.range[0];
}
return a.range[1] - b.range[1];
});
}
exports.sortNodes = sortNodes;