UNPKG

fp-units

Version:

An FP-oriented library to easily convert CSS units.

42 lines (33 loc) 1.95 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var throwUnspecifiedProp = exports.throwUnspecifiedProp = function throwUnspecifiedProp(prop) { return function () { throw new Error("Unspecified property: no `" + prop + "` property found in the provided node config."); }; }; var throwUnknownUnit = exports.throwUnknownUnit = function throwUnknownUnit(unit) { throw new Error("Unknown unit: `" + unit + "` is not handled."); }; var throwIncompatibleUnits = exports.throwIncompatibleUnits = function throwIncompatibleUnits(from, to) { throw new Error("Incompatible units: `" + from + "` cannot be converted to `" + to + "`."); }; var throwInvalidCalcMult = exports.throwInvalidCalcMult = function throwInvalidCalcMult() { throw new Error("Invalid calc expression: at least one side of a multiplication should be a number."); }; var throwInvalidCalcDivLeft = exports.throwInvalidCalcDivLeft = function throwInvalidCalcDivLeft() { throw new Error("Invalid calc expression: the left side of a division should be a dimension or a number."); }; var throwInvalidCalcDivRight = exports.throwInvalidCalcDivRight = function throwInvalidCalcDivRight() { throw new Error("Invalid calc expression: the right side of a division should be a number."); }; var throwInvalidCalcDiv0 = exports.throwInvalidCalcDiv0 = function throwInvalidCalcDiv0() { throw new Error("Invalid calc expression: division by 0."); }; var throwInvalidCalcUnknownUnit = exports.throwInvalidCalcUnknownUnit = function throwInvalidCalcUnknownUnit(unit) { throw new Error("Invalid calc expression: Unknown unit: `" + unit + "` is not handled."); }; var throwInvalidCalcIncompatibleUnits = exports.throwInvalidCalcIncompatibleUnits = function throwInvalidCalcIncompatibleUnits(prev, next) { throw new Error("Invalid calc expression: Incompatible units: calc operation between `" + prev + "` and `" + next + "` cannot be performed."); };