This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/postcss-calc/dist/lib/convert.js

46 lines
995 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _cssUnitConverter = _interopRequireDefault(require("css-unit-converter"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function convertNodes(left, right, precision) {
switch (left.type) {
case 'LengthValue':
case 'AngleValue':
case 'TimeValue':
case 'FrequencyValue':
case 'ResolutionValue':
return convertAbsoluteLength(left, right, precision);
default:
return {
left,
right
};
}
}
function convertAbsoluteLength(left, right, precision) {
if (right.type === left.type) {
right = {
type: left.type,
value: (0, _cssUnitConverter.default)(right.value, right.unit, left.unit, precision),
unit: left.unit
};
}
return {
left,
right
};
}
var _default = convertNodes;
exports.default = _default;
module.exports = exports.default;