Uname: Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 54.36.31.145
Your Ip: 216.73.216.182
User: homesquasz (91404) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : sorting.js
const postcss = require('postcss');
const _ = require('lodash');
const shorthandData = require('./shorthandData');

module.exports = {
	sortDeclarations,
	sortDeclarationsAlphabetically,
	sortByIndexes,
};

function sortDeclarations(a, b) {
	// If unprefixed prop names are the same, compare the prefixed versions
	if (a.node.type === 'decl' && b.node.type === 'decl' && a.unprefixedName === b.unprefixedName) {
		// If first property has no prefix and second property has prefix
		if (!postcss.vendor.prefix(a.name).length && postcss.vendor.prefix(b.name).length) {
			return 1;
		}

		if (postcss.vendor.prefix(a.name).length && !postcss.vendor.prefix(b.name).length) {
			return -1;
		}
	}

	if (!_.isUndefined(a.orderData) && !_.isUndefined(b.orderData)) {
		// If a and b have the same group index, and a's property index is
		// higher than b's property index, in a sorted list a appears after
		// b:
		if (a.orderData.propertyIndex !== b.orderData.propertyIndex) {
			return a.orderData.propertyIndex - b.orderData.propertyIndex;
		}
	}

	if (
		a.unspecifiedPropertiesPosition === 'bottom' ||
		a.unspecifiedPropertiesPosition === 'bottomAlphabetical' ||
		b.unspecifiedPropertiesPosition === 'bottomAlphabetical'
	) {
		if (!_.isUndefined(a.orderData) && _.isUndefined(b.orderData)) {
			return -1;
		}

		if (_.isUndefined(a.orderData) && !_.isUndefined(b.orderData)) {
			return 1;
		}
	}

	if (a.unspecifiedPropertiesPosition === 'top') {
		if (!_.isUndefined(a.orderData) && _.isUndefined(b.orderData)) {
			return 1;
		}

		if (_.isUndefined(a.orderData) && !_.isUndefined(b.orderData)) {
			return -1;
		}
	}

	if (a.unspecifiedPropertiesPosition === 'bottomAlphabetical') {
		if (_.isUndefined(a.orderData) && _.isUndefined(b.orderData)) {
			return sortDeclarationsAlphabetically(a, b);
		}
	}

	// If a and b have the same group index and the same property index,
	// in a sorted list they appear in the same order they were in
	// original array:
	return a.initialIndex - b.initialIndex;
}

function isShorthand(a, b) {
	const longhands = shorthandData[a] || [];

	return longhands.includes(b);
}

function sortDeclarationsAlphabetically(a, b) {
	if (isShorthand(a.unprefixedName, b.unprefixedName)) {
		return -1;
	}

	if (isShorthand(b.unprefixedName, a.unprefixedName)) {
		return 1;
	}

	if (a.unprefixedName === b.unprefixedName) {
		if (a.node.type === 'decl' && b.node.type === 'decl') {
			// If first property has no prefix and second property has prefix
			if (!postcss.vendor.prefix(a.name).length && postcss.vendor.prefix(b.name).length) {
				return 1;
			}

			if (postcss.vendor.prefix(a.name).length && !postcss.vendor.prefix(b.name).length) {
				return -1;
			}
		}

		return a.initialIndex - b.initialIndex;
	}

	return a.unprefixedName <= b.unprefixedName ? -1 : 1;
}

function sortByIndexes(a, b) {
	// If a and b have the same group index, and a's property index is
	// higher than b's property index, in a sorted list a appears after
	// b:
	if (a.position !== b.position) {
		return a.position - b.position;
	}

	// If a and b have the same group index and the same property index,
	// in a sorted list they appear in the same order they were in
	// original array:
	return a.initialIndex - b.initialIndex;
}
© 2026 GrazzMean
Page non trouvée – APK Comptoir Hammami
Jannah Theme License is not validated, Go to the theme options page to validate the license, You need a single license for each domain name.

404 :(

Oups ! Cette page est introuvable.

Il semble que nous ne puissions pas trouver ce que vous cherchez. Peut-être qu'une recherche pourrait vous aider.

Bouton retour en haut de la page