@dynatrace-sdk/units
Advanced tools
Comparing version 0.11.0 to 0.11.1
@@ -5,2 +5,8 @@ # Units | ||
## 0.11.1 | ||
### Patch Changes | ||
- Bundle `date-fns` | ||
## 0.11.0 | ||
@@ -7,0 +13,0 @@ |
@@ -0,1 +1,6 @@ | ||
--- | ||
title: "Units" | ||
description: Tools for converting and formatting the units and numerical values. | ||
--- | ||
# Units | ||
@@ -15,3 +20,3 @@ | ||
<div class="col" style={{textAlign: 'right'}}> | ||
<a href="https://www.npmjs.com/package/@dynatrace-sdk/units/v/0.11.0">v0.11.0</a> | ||
<a href="https://www.npmjs.com/package/@dynatrace-sdk/units/v/0.11.1">v0.11.1</a> | ||
</div> | ||
@@ -24,2 +29,23 @@ </div> | ||
### Conversion example | ||
<details> | ||
<summary> | ||
Code example | ||
</summary> | ||
```javascript | ||
import { units, convert } from "@dynatrace-sdk/units"; | ||
// units.{unitGroup}.{unit} | ||
convert( | ||
1000, | ||
/* FromUnit */ units.length.meter, | ||
/* ToUnit */ units.length.kilometer | ||
); | ||
``` | ||
</details> | ||
## Interfaces | ||
@@ -417,14 +443,1 @@ | ||
TypeScript helper that returns all the possible convertible targets, where the first generic is <a href="#fromunit">FromUnit</a>, and second is <a href="#tounit">ToUnit</a>. | ||
### Conversion example | ||
```javascript | ||
import { units, convert } from "@dynatrace-sdk/units"; | ||
// units.{unitGroup}.{unit} | ||
convert( | ||
1000, | ||
/* FromUnit */ units.length.meter, | ||
/* ToUnit */ units.length.kilometer | ||
); | ||
``` |
{ | ||
"name": "@dynatrace-sdk/units", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"license": "Apache-2.0", | ||
@@ -17,3 +17,5 @@ "description": "Tools for converting and formatting the units and numerical values.", | ||
"dependencies": { | ||
"date-fns": "^2.30.0", | ||
"date-fns": "^2.30.0" | ||
}, | ||
"devDependencies": { | ||
"timezone-mock": "^1.3.6" | ||
@@ -20,0 +22,0 @@ }, |
@@ -1,6 +0,6 @@ | ||
import { ConvertibleUnit } from './types'; | ||
declare type Variants<U extends ConvertibleUnit> = string[]; | ||
declare type VariantNames<U extends ConvertibleUnit> = string[]; | ||
declare type VariantUnits<U extends ConvertibleUnit> = ConvertibleUnit[]; | ||
export declare function variants<U extends ConvertibleUnit>(unit: U): Variants<U>[]; | ||
import { Unit } from './types'; | ||
declare type Variants<U extends Unit> = string[]; | ||
declare type VariantNames<U extends Unit> = string[]; | ||
declare type VariantUnits<U extends Unit> = Unit[]; | ||
export declare function variants<U extends Unit>(unit: U): Variants<U>[]; | ||
/** | ||
@@ -11,3 +11,3 @@ * Provides all the unit names to which the provided unit can be converted to. | ||
*/ | ||
export declare function variantNames<U extends ConvertibleUnit>(unit: U): VariantNames<U>; | ||
export declare function variantNames<U extends Unit>(unit: U): VariantNames<U>; | ||
/** | ||
@@ -18,3 +18,3 @@ * Provides all the units to which the provided unit can be converted to. | ||
*/ | ||
export declare function variantUnits<U extends ConvertibleUnit>(unit: U): VariantUnits<U>; | ||
export declare function variantUnits<U extends Unit>(unit: U): VariantUnits<U>; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import type { Unit, FormattableUnit, ConvertibleUnit, OutputUnit, ConvertiblePack, UndefinedCoalescing } from '../util-convert/types'; | ||
import type { Unit, FormattableUnit, ConvertibleUnit, OutputUnit, FormattablePack, UndefinedCoalescing } from '../util-convert/types'; | ||
declare type Formatting = { | ||
@@ -20,3 +20,3 @@ separator: string; | ||
*/ | ||
export declare function formatPack({ group, index, exponent }: ConvertiblePack): string; | ||
export declare function formatPack({ group, index, exponent }: FormattablePack): string; | ||
export declare function formatPacks(packs: FormattableUnit): string; | ||
@@ -23,0 +23,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
742710
1
24458
1
- Removedtimezone-mock@^1.3.6
- Removedtimezone-mock@1.3.6(transitive)