Files
NapCatQQ/.pnpm-store/v3/files/6a/f3cd1e5a9fbe31aa96eaae51ed7c2d5b01757064ca06c97a59698d2a56bc25f088d69bf243823cc0e9671c7a6339b8502eb99e5dc513eaeebb69dc5d1c7443
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

20 lines
671 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSortedImportSpecifiers = void 0;
var natural_sort_1 = require("../natural-sort");
/**
* This function returns import nodes with alphabetically sorted module
* specifiers
* @param node Import declaration node
*/
var getSortedImportSpecifiers = function (node) {
node.specifiers.sort(function (a, b) {
if (a.type !== b.type) {
return a.type === 'ImportDefaultSpecifier' ? -1 : 1;
}
return (0, natural_sort_1.naturalSort)(a.local.name, b.local.name);
});
return node;
};
exports.getSortedImportSpecifiers = getSortedImportSpecifiers;