@thi.ng/units 1.1.9 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
- <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- # ![@thi.ng/units](https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/banners/thing-units.svg?be5e195f)
2
+ <!-- Please see: https://codeberg.org/thi.ng/umbrella/src/branch/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
+ # ![@thi.ng/units](https://codeberg.org/thi.ng/umbrella/media/branch/develop/assets/banners/thing-units.svg?be5e195f)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/units.svg)](https://www.npmjs.com/package/@thi.ng/units)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/units.svg)
@@ -8,11 +8,12 @@
8
8
 
9
9
  > [!NOTE]
10
10
  > This is one of 214 standalone projects, maintained as part
11
- > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
11
+ > of the [@thi.ng/umbrella](https://codeberg.org/thi.ng/umbrella/) ecosystem
12
12
  > and anti-framework.
13
13
  >
14
- > 🚀 Please help me to work full-time on these projects by [sponsoring me on
15
- > GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
14
+ > 🚀 Please help me to work full-time on these projects by [sponsoring
15
+ > me](https://codeberg.org/thi.ng/umbrella/src/branch/develop/CONTRIBUTING.md#donations).
16
+ > Thank you! ❤️
16
17
 
17
18
  - [About](#about)
18
19
  - [Unit definitions](#unit-definitions)
@@ -659,7 +660,7 @@ console.log($eval(`(kg (* 200mm 300mm 0.5in glass))`));
659
660
 
660
661
  **BETA** - possibly breaking changes forthcoming
661
662
 
662
- [Search or submit any issues for this package](https://github.com/thi-ng/umbrella/issues?q=%5Bunits%5D+in%3Atitle)
663
+ [Search or submit any issues for this package](https://codeberg.org/thi.ng/umbrella/issues?q=%5Bunits%5D)
663
664
 
664
665
  ## Installation
665
666
 
@@ -687,15 +688,15 @@ For Node.js REPL:
687
688
  const units = await import("@thi.ng/units");
688
689
  ```
689
690
 
690
- Package sizes (brotli'd, pre-treeshake): ESM: 5.69 KB
691
+ Package sizes (brotli'd, pre-treeshake): ESM: 5.67 KB
691
692
 
692
693
  ## Dependencies
693
694
 
694
- - [@thi.ng/api](https://github.com/thi-ng/umbrella/tree/develop/packages/api)
695
- - [@thi.ng/checks](https://github.com/thi-ng/umbrella/tree/develop/packages/checks)
696
- - [@thi.ng/equiv](https://github.com/thi-ng/umbrella/tree/develop/packages/equiv)
697
- - [@thi.ng/errors](https://github.com/thi-ng/umbrella/tree/develop/packages/errors)
698
- - [@thi.ng/sexpr](https://github.com/thi-ng/umbrella/tree/develop/packages/sexpr)
695
+ - [@thi.ng/api](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/api)
696
+ - [@thi.ng/checks](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/checks)
697
+ - [@thi.ng/equiv](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/equiv)
698
+ - [@thi.ng/errors](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/errors)
699
+ - [@thi.ng/sexpr](https://codeberg.org/thi.ng/umbrella/src/branch/develop/packages/sexpr)
699
700
 
700
701
  Note: @thi.ng/api is in _most_ cases a type-only import (not used at runtime)
701
702
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/units",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
4
4
  "description": "Extensible SI unit creation, conversions, quantities & calculations (incl. Lisp-like DSL and ~170 predefined units & constants)",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -8,7 +8,7 @@
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/thi-ng/umbrella.git",
11
+ "url": "git+https://codeberg.org/thi.ng/umbrella.git",
12
12
  "directory": "packages/units"
13
13
  },
14
14
  "homepage": "https://thi.ng/units",
@@ -40,11 +40,11 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/api": "^8.12.17",
44
- "@thi.ng/checks": "^3.8.7",
45
- "@thi.ng/equiv": "^2.1.106",
46
- "@thi.ng/errors": "^2.6.6",
47
- "@thi.ng/sexpr": "^1.1.26"
43
+ "@thi.ng/api": "^8.12.18",
44
+ "@thi.ng/checks": "^3.8.8",
45
+ "@thi.ng/equiv": "^2.1.107",
46
+ "@thi.ng/errors": "^2.6.7",
47
+ "@thi.ng/sexpr": "^1.1.28"
48
48
  },
49
49
  "devDependencies": {
50
50
  "esbuild": "^0.27.2",
@@ -189,5 +189,5 @@
189
189
  "status": "beta",
190
190
  "year": 2021
191
191
  },
192
- "gitHead": "d46ec975b426bb2ceb137cab734395c97436d59b\n"
192
+ "gitHead": "929fb6590178a41cbb77cbb87e07c59c61381607\n"
193
193
  }
package/units/volume.d.ts CHANGED
@@ -5,6 +5,8 @@ export declare const km3: import("../api.js").NamedUnit;
5
5
  export declare const l: import("../api.js").NamedUnit;
6
6
  export declare const cl: import("../api.js").NamedUnit;
7
7
  export declare const ml: import("../api.js").NamedUnit;
8
+ /** 1 ml = 20 drops */
9
+ export declare const drop: import("../api.js").NamedUnit;
8
10
  export declare const gal: import("../api.js").NamedUnit;
9
11
  export declare const pt: import("../api.js").NamedUnit;
10
12
  export declare const floz: import("../api.js").NamedUnit;
package/units/volume.js CHANGED
@@ -7,20 +7,22 @@ const km3 = defUnit("km3", "cubic kilometer", pow(km, 3));
7
7
  const l = defUnit("l", "liter", mul(m3, 1e-3, true));
8
8
  const cl = defUnit("cl", "centiliter", prefix("c", l));
9
9
  const ml = defUnit("ml", "milliliter", prefix("m", l));
10
+ const drop = defUnit("drop", "drop", mul(ml, 1 / 20));
10
11
  const gal = defUnit("gal", "imperial gallon", mul(l, 4.54609));
11
12
  const pt = defUnit("pt", "imperial pint", mul(gal, 1 / 8));
12
- const floz = defUnit("fl oz", "imperial fluid ounce", mul(gal, 1 / 160));
13
- const us_gal = defUnit("us gal", "us gallon", mul(l, 3.785411784));
14
- const us_pt = defUnit("us pt", "us pint", mul(us_gal, 1 / 8));
15
- const us_cup = defUnit("us cup", "us cup", mul(us_gal, 1 / 16));
13
+ const floz = defUnit("fl_oz", "imperial fluid ounce", mul(gal, 1 / 160));
14
+ const us_gal = defUnit("us_gal", "us gallon", mul(l, 3.785411784));
15
+ const us_pt = defUnit("us_pt", "us pint", mul(us_gal, 1 / 8));
16
+ const us_cup = defUnit("us_cup", "us cup", mul(us_gal, 1 / 16));
16
17
  const us_floz = defUnit(
17
- "us fl oz",
18
+ "us_fl_oz",
18
19
  "us fluid ounce",
19
20
  mul(us_gal, 1 / 128)
20
21
  );
21
22
  export {
22
23
  cl,
23
24
  cm3,
25
+ drop,
24
26
  floz,
25
27
  gal,
26
28
  km3,