@eomm/convert-units
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -16,2 +16,9 @@ const metric = { | ||
}, | ||
dm: { | ||
name: { | ||
singular: 'Decimeter', | ||
plural: 'Decimeters' | ||
}, | ||
to_anchor: 1 / 10 | ||
}, | ||
m: { | ||
@@ -18,0 +25,0 @@ name: { |
declare module "convert-units" { | ||
type uDistance = "mm" | "cm" | "m" | "km" | "in" | "ft-us" | "ft" | "mi"; // Distance | ||
type uDistance = "mm" | "cm" | "dm" | "m" | "km" | "in" | "ft-us" | "ft" | "mi"; // Distance | ||
type uArea = "mm2" | "cm2" | "m2" | "ha" | "km2" | "in2" | "ft2" | "ac" | "mi2"; // Area | ||
type uMass = "mcg" | "mg" | "g" | "kg" | "oz" | "lb" | "mt" | "t" // Mass | ||
type uVolume = "mm3" | "cm3" | "ml" | "l" | "kl" | "m3" | "km3" | "tsp" | "Tbs" | "in3" | "fl-oz" | "cup" | "pnt" | "qt" | "gal" | "ft3" | "yd3" // Volume | ||
type uVolumeFlowRate = "mm3/s" | "cm3/s" | "ml/s" | "cl/s" | "dl/s" | "l/s" | "l/min" | "l/h" | "kl/s" | "kl/min" | "kl/h" | "m3/s" | "m3/min" | "m3/h" | "km3/s" | "tsp/s" | "Tbs/s" | "in3/s" | "in3/min" | "in3/h" | "fl-oz/s" | "fl-oz/min" | "fl-oz/h" | "cup/s" | "pnt/s" | "pnt/min" | "pnt/h" | "qt/s" | "gal/s" | "gal/min" | "gal/h" | "ft3/s" | "ft3/min" | "ft3/h" | "yd3/s" | "yd3/min" | "yd3/h"; // Volume Flow Rate | ||
type uVolumeFlowRate = "mm3/s" | "cm3/s" | "ml/s" | "cl/s" | "dl/s" | "l/s" | "l/min" | "l/h" | "kl/s" | "kl/min" | "kl/h" | "m3/s" | "m3/min" | "m3/h" | "km3/s" | "tsp/s" | "Tbs/s" | "in3/s" | "in3/min" | "in3/h" | "fl-oz/s" | "fl-oz/min" | "fl-oz/h" | "cup/s" | "pnt/s" | "pnt/min" | "pnt/h" | "qt/s" | "gal/s" | "gal/min" | "gal/h" | "ft3/s" | "ft3/min" | "ft3/h" | "yd3/s" | "yd3/min" | "yd3/h"; // Volume Flow Rate | ||
type uTemperature = "C" | "F" | "K" | "R"; // Temperature | ||
@@ -26,56 +26,56 @@ type uTime = "ns" | "mu" | "ms" | "s" | "min" | "h" | "d" | "week" | "month" | "year"; // Time | ||
type unit = uDistance | ||
| uArea | ||
| uMass | ||
| uVolume | ||
| uVolumeFlowRate | ||
| uTemperature | ||
| uTime | ||
| uFrequency | ||
| uSpeed | ||
| uPace | ||
| uPressure | ||
| uDitgital | ||
| uIlluminance | ||
| uPartsPer | ||
| uVoltage | ||
| uCurrent | ||
| uPower | ||
| uApparentPower | ||
| uReactivePower | ||
| uEnergy | ||
| uReactiveEnergy | ||
| uAngle; | ||
type unit = uDistance | ||
| uArea | ||
| uMass | ||
| uVolume | ||
| uVolumeFlowRate | ||
| uTemperature | ||
| uTime | ||
| uFrequency | ||
| uSpeed | ||
| uPace | ||
| uPressure | ||
| uDitgital | ||
| uIlluminance | ||
| uPartsPer | ||
| uVoltage | ||
| uCurrent | ||
| uPower | ||
| uApparentPower | ||
| uReactivePower | ||
| uEnergy | ||
| uReactiveEnergy | ||
| uAngle; | ||
type measure = "distance" | ||
| "area" | ||
| "mass" | ||
| "volume" | ||
| "volumeFlowRate" | ||
| "temperature" | ||
| "time" | ||
| "frequency" | ||
| "speed" | ||
| "pace" | ||
| "pressure" | ||
| "ditgital" | ||
| "illuminance" | ||
| "partsPer" | ||
| "voltage" | ||
| "current" | ||
| "power" | ||
| "apparentPower" | ||
| "reactivePower" | ||
| "energy" | ||
| "reactiveEnergy" | ||
| "angle"; | ||
type measure = "distance" | ||
| "area" | ||
| "mass" | ||
| "volume" | ||
| "volumeFlowRate" | ||
| "temperature" | ||
| "time" | ||
| "frequency" | ||
| "speed" | ||
| "pace" | ||
| "pressure" | ||
| "ditgital" | ||
| "illuminance" | ||
| "partsPer" | ||
| "voltage" | ||
| "current" | ||
| "power" | ||
| "apparentPower" | ||
| "reactivePower" | ||
| "energy" | ||
| "reactiveEnergy" | ||
| "angle"; | ||
type system = "metric" | ||
| "imperial" | ||
| "bits" | ||
| "bytes"; | ||
| "imperial" | ||
| "bits" | ||
| "bytes"; | ||
class Convert { | ||
constructor(numerator: number, denominator: number); | ||
from(from: unit): this; | ||
from(from: unit): this; | ||
to(to: unit): number; | ||
@@ -82,0 +82,0 @@ toBest(options?: { exclude?: unit[], cutOffNumber?: number }): { val: number, unit: string, singular: string, plural: string }; |
{ | ||
"name": "@eomm/convert-units", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Convert between quantities in different units", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -47,4 +47,4 @@ # @eomm/convert-units | ||
convert(12000).from('mm').toBest({ exclude: ['m'] }) | ||
// 1200 Centimeters (the smallest unit excluding meters) | ||
convert(12000).from('mm').toBest({ exclude: ['m', 'dm'] }) | ||
// 1200 Centimeters (the smallest unit excluding meters and decimeters) | ||
@@ -55,3 +55,3 @@ convert(900).from('mm').toBest({ cutOffNumber: 10 }); | ||
convert(1000).from('mm').toBest({ cutOffNumber: 10 }) | ||
// 100 Centimeters (the smallest unit with a value equal to or above 10) | ||
// 10 Decimeters (the smallest unit with a value equal to or above 10) | ||
``` | ||
@@ -85,3 +85,3 @@ | ||
convert().possibilities() | ||
// [ 'mm', 'cm', 'm', 'in', 'ft-us', 'ft', 'mi', 'mcg', 'mg', 'g', 'kg', 'oz', 'lb', 'mt', 't', 'ml', 'l', 'tsp', 'Tbs', 'fl-oz', 'cup', 'pnt', 'qt', 'gal', 'ea', 'dz' ]; | ||
// [ 'mm', 'cm', 'dm', 'm', 'in', 'ft-us', 'ft', 'mi', 'mcg', 'mg', 'g', 'kg', 'oz', 'lb', 'mt', 't', 'ml', 'l', 'tsp', 'Tbs', 'fl-oz', 'cup', 'pnt', 'qt', 'gal', 'ea', 'dz' ]; | ||
``` | ||
@@ -139,2 +139,3 @@ | ||
* cm | ||
* dm | ||
* m | ||
@@ -141,0 +142,0 @@ * in |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2100
378
47075