Skip to content

Commit 1584b95

Browse files
committed
Move functions related to order to its folder
1 parent f2e1a98 commit 1584b95

10 files changed

+11
-15
lines changed
File renamed without changes.

lib/createExpectedOrder.js renamed to lib/order/createExpectedOrder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const isString = require('./isString');
1+
const isString = require('../isString');
22

33
module.exports = function createExpectedOrder(input) {
44
const order = {};

lib/getOrderData.js renamed to lib/order/getOrderData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const isStandardSyntaxProperty = require('./isStandardSyntaxProperty');
2-
const isCustomProperty = require('./isCustomProperty');
1+
const isStandardSyntaxProperty = require('../isStandardSyntaxProperty');
2+
const isCustomProperty = require('../isCustomProperty');
33
const isDollarVariable = require('./isDollarVariable');
44
const isAtVariable = require('./isAtVariable');
55
const calcAtRulePatternPriority = require('./calcAtRulePatternPriority');
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/processMostNodes.js renamed to lib/order/processMostNodes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const getOrderData = require('./getOrderData');
2-
const getComments = require('./getComments');
2+
const getComments = require('../getComments');
33

44
// eslint-disable-next-line max-params
55
module.exports = function processMostNodes(node, index, order, processedNodes) {
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
module.exports = {
2-
sortByIndexes,
3-
};
4-
5-
function sortByIndexes(a, b) {
1+
module.exports = function sortByIndexes(a, b) {
62
// If a and b have the same group index, and a's property index is
73
// higher than b's property index, in a sorted list a appears after
84
// b:
@@ -14,4 +10,4 @@ function sortByIndexes(a, b) {
1410
// in a sorted list they appear in the same order they were in
1511
// original array:
1612
return a.initialIndex - b.initialIndex;
17-
}
13+
};

lib/order/sortNode.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const createExpectedOrder = require('../createExpectedOrder');
1+
const createExpectedOrder = require('./createExpectedOrder');
22
const isRuleWithNodes = require('../isRuleWithNodes');
3-
const processLastComments = require('../processLastComments');
4-
const processMostNodes = require('../processMostNodes');
5-
const sorting = require('../sorting');
3+
const processLastComments = require('./processLastComments');
4+
const processMostNodes = require('./processMostNodes');
5+
const sortByIndexes = require('./sortByIndexes');
66

77
module.exports = function sortNode(node, optsOrder) {
88
if (!isRuleWithNodes(node)) {
@@ -25,7 +25,7 @@ module.exports = function sortNode(node, optsOrder) {
2525
});
2626

2727
// Sort declarations saved for sorting
28-
processed.sort(sorting.sortByIndexes);
28+
processed.sort(sortByIndexes);
2929

3030
// Enforce semicolon for the last node
3131
node.raws.semicolon = true;

0 commit comments

Comments
 (0)