format-quantity 2.1.0 → 3.1.0

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.1.0",
2
+ "version": "3.1.0",
3
3
  "name": "format-quantity",
4
4
  "author": "Jake Boone <jakeboone02@gmail.com>",
5
5
  "description": "Number formatter for imperial measurements with support for vulgar fractions",
@@ -11,12 +11,17 @@
11
11
  "exports": {
12
12
  "./package.json": "./package.json",
13
13
  ".": {
14
- "types": "./dist/format-quantity.d.ts",
15
- "import": "./dist/format-quantity.mjs",
16
- "require": "./dist/cjs/index.js"
14
+ "import": {
15
+ "types": "./dist/format-quantity.d.mts",
16
+ "default": "./dist/format-quantity.mjs"
17
+ },
18
+ "require": {
19
+ "types": "./dist/cjs/index.d.ts",
20
+ "default": "./dist/cjs/index.js"
21
+ }
17
22
  }
18
23
  },
19
- "types": "./dist/format-quantity.d.ts",
24
+ "types": "./dist/format-quantity.legacy-esm.d.ts",
20
25
  "unpkg": "./dist/format-quantity.umd.min.js",
21
26
  "license": "MIT",
22
27
  "keywords": [
@@ -40,28 +45,36 @@
40
45
  "url": "https://github.com/jakeboone02/format-quantity"
41
46
  },
42
47
  "scripts": {
43
- "start": "bun ./server.ts",
44
- "build": "tsup",
45
- "test": "jest",
46
- "watch": "jest --watch",
48
+ "start": "bun --hot main.html",
49
+ "build": "bun --bun x tsdown",
50
+ "docs:plugins": "bun build ./node_modules/typedoc-plugin-katex/src/index.tsx --outdir=. --target=node --external=typedoc --entry-naming=typedoc-plugin-katex.mjs",
51
+ "docs": "typedoc",
52
+ "test": "bun test",
53
+ "watch": "bun test --watch",
54
+ "lint": "bunx oxlint --type-aware --report-unused-disable-directives --type-check",
47
55
  "publish:npm": "np",
48
- "pretty-print": "prettier --write *.{mjs,ts,json} src/*.*"
56
+ "codesandbox-ci": "bash .codesandbox/ci.sh",
57
+ "pretty-print": "prettier --write '*.{html,ts,json}' 'src/*.*'"
49
58
  },
50
59
  "devDependencies": {
51
- "@types/jest": "^29.5.2",
52
- "@types/node": "^20.3.1",
53
- "bun-types": "^0.6.9",
54
- "jest": "^29.5.0",
55
- "np": "^8.0.4",
56
- "prettier": "^2.8.8",
57
- "ts-jest": "^29.1.0",
58
- "tsup": "^7.0.0",
59
- "typescript": "^5.1.3"
60
- },
61
- "publishConfig": {
62
- "registry": "https://registry.npmjs.org"
60
+ "@types/bun": "^1.3.9",
61
+ "@types/node": "^25.2.3",
62
+ "@types/web": "^0.0.332",
63
+ "@typescript/native-preview": "^7.0.0-dev.20260212.1",
64
+ "np": "^11.0.2",
65
+ "oxlint": "^1.47.0",
66
+ "oxlint-tsgolint": "^0.12.1",
67
+ "prettier": "3.8.1",
68
+ "prettier-plugin-organize-imports": "4.3.0",
69
+ "tsdown": "^0.20.3",
70
+ "typedoc": "^0.28.16",
71
+ "typedoc-plugin-katex": "^0.1.2",
72
+ "typescript": "^5.9.3"
63
73
  },
64
74
  "engines": {
65
75
  "node": ">=16"
76
+ },
77
+ "dependencies": {
78
+ "numeric-quantity": "^3.2.0"
66
79
  }
67
80
  }
@@ -1,83 +0,0 @@
1
- interface FormatQuantityOptions {
2
- /**
3
- * Output vulgar fractions, like "½" instead of "1/2", when appropriate.
4
- * Overrides the `fractionSlash` option.
5
- */
6
- vulgarFractions?: boolean;
7
- /**
8
- * Amount by which a number can deviate from the calculated quotient to be
9
- * considered a match. For example, 0.66 is close enough to 2 ÷ 3 (which
10
- * is 0.66666... repeating) to be considered equivalent so the function
11
- * will return "2/3". The smaller this number, the higher the likelihood that
12
- * the function will return a decimal instead of a fraction or mixed number.
13
- *
14
- * @default 0.0075
15
- */
16
- tolerance?: number;
17
- /**
18
- * Output the fraction slash character (⁄) instead of the "solidus"
19
- * slash (/) for fractions. Results appear like "1⁄2" instead of "1/2".
20
- * Overridden by the `vulgarFractions` option.
21
- */
22
- fractionSlash?: boolean;
23
- /**
24
- * Output in Roman numerals. Provided alue must be between 1 and 3999.
25
- * Decimal values will be ignored.
26
- */
27
- romanNumerals?: boolean;
28
- }
29
- type FormatQuantity = (qty: string | number, options?: boolean | FormatQuantityOptions) => string | null;
30
- type NonZeroNumChar = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
31
- type NumChar = '0' | NonZeroNumChar;
32
- type SimpleFraction = `${NonZeroNumChar}/${NonZeroNumChar}` | `${NonZeroNumChar}/${NonZeroNumChar}${NumChar}` | `${NonZeroNumChar}${NumChar}/${NonZeroNumChar}${NumChar}`;
33
- type Sixteenth = `${'1' | '3' | '5' | '7' | '9' | '11' | '13' | '15'}/16`;
34
- type VulgarFraction = '¼' | '½' | '¾' | '⅐' | '⅑' | '⅒' | '⅓' | '⅔' | '⅕' | '⅖' | '⅗' | '⅘' | '⅙' | '⅚' | '⅛' | '⅜' | '⅝' | '⅞';
35
- type FormatQuantityTests = Record<string, ([Parameters<FormatQuantity>[0], ReturnType<FormatQuantity>] | [
36
- Parameters<FormatQuantity>[0],
37
- ReturnType<FormatQuantity>,
38
- Parameters<FormatQuantity>[1]
39
- ])[]>;
40
-
41
- /**
42
- * Formats a number (or string that appears to be a number)
43
- * as one would see it written in imperial measurements, e.g.
44
- * "1 1/2" instead of "1.5". To use vulgar fraction characters
45
- * like "½", pass `true` as the second argument. For other options
46
- * see the [documentation](https://jakeboone02.github.io/format-quantity/).
47
- */
48
- declare const formatQuantity: FormatQuantity;
49
-
50
- declare const defaultTolerance: 0.0075;
51
- declare const defaultOptions: {
52
- vulgarFractions: false;
53
- tolerance: 0.0075;
54
- fractionSlash: false;
55
- romanNumerals: false;
56
- };
57
- /**
58
- * A map of vulgar or simple sixteenth fractions to their traditional ASCII
59
- * equivalents. Sixteenths map to themselves.
60
- */
61
- declare const vulgarToAsciiMap: {
62
- '\u00BC': "1/4";
63
- '\u00BD': "1/2";
64
- '\u00BE': "3/4";
65
- '\u2150': "1/7";
66
- '\u2151': "1/9";
67
- '\u2152': "1/10";
68
- '\u2153': "1/3";
69
- '\u2154': "2/3";
70
- '\u2155': "1/5";
71
- '\u2156': "2/5";
72
- '\u2157': "3/5";
73
- '\u2158': "4/5";
74
- '\u2159': "1/6";
75
- '\u215A': "5/6";
76
- '\u215B': "1/8";
77
- '\u215C': "3/8";
78
- '\u215D': "5/8";
79
- '\u215E': "7/8";
80
- };
81
- declare const fractionDecimalMatches: ([number, "⅓"] | [number, "⅔"] | [number, "⅕"] | [number, "⅖"] | [number, "⅗"] | [number, "⅘"] | [number, "⅙"] | [number, "⅚"] | [number, "⅐"] | [number, "⅑"] | [number, "⅒"] | [number, "⅛"] | [number, "¼"] | [number, "⅜"] | [number, "½"] | [number, "⅝"] | [number, "¾"] | [number, "⅞"] | [number, "1/16"] | [number, "3/16"] | [number, "5/16"] | [number, "7/16"] | [number, "9/16"] | [number, "11/16"] | [number, "13/16"] | [number, "15/16"])[];
82
-
83
- export { FormatQuantity, FormatQuantityOptions, FormatQuantityTests, SimpleFraction, Sixteenth, VulgarFraction, formatQuantity as default, defaultOptions, defaultTolerance, formatQuantity, fractionDecimalMatches, vulgarToAsciiMap };
@@ -1,2 +0,0 @@
1
- "use strict";var FormatQuantity=(()=>{var l=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var d=(t,o)=>{for(var r in o)l(t,r,{get:o[r],enumerable:!0})},y=(t,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of X(o))!b.call(t,e)&&e!==r&&l(t,e,{get:()=>o[e],enumerable:!(a=C(o,e))||a.enumerable});return t};var I=t=>y(l({},"__esModule",{value:!0}),t);var N={};d(N,{default:()=>Q,defaultOptions:()=>n,defaultTolerance:()=>D,formatQuantity:()=>c,fractionDecimalMatches:()=>u,vulgarToAsciiMap:()=>i});var D=.0075,n={vulgarFractions:!1,tolerance:.0075,fractionSlash:!1,romanNumerals:!1},i={"\xBC":"1/4","\xBD":"1/2","\xBE":"3/4","\u2150":"1/7","\u2151":"1/9","\u2152":"1/10","\u2153":"1/3","\u2154":"2/3","\u2155":"1/5","\u2156":"2/5","\u2157":"3/5","\u2158":"4/5","\u2159":"1/6","\u215A":"5/6","\u215B":"1/8","\u215C":"3/8","\u215D":"5/8","\u215E":"7/8"},u=[[.33,"\u2153"],[.66,"\u2154"],[.2,"\u2155"],[.4,"\u2156"],[.6,"\u2157"],[.8,"\u2158"],[.166,"\u2159"],[.833,"\u215A"],[.143,"\u2150"],[.111,"\u2151"],[.1,"\u2152"],[.125,"\u215B"],[.25,"\xBC"],[.375,"\u215C"],[.5,"\xBD"],[.625,"\u215D"],[.75,"\xBE"],[.875,"\u215E"],[.0625,"1/16"],[.1875,"3/16"],[.3125,"5/16"],[.4375,"7/16"],[.5625,"9/16"],[.6875,"11/16"],[.8125,"13/16"],[.9375,"15/16"]];var g=(t,o,r)=>Math.abs(t-o)<r,h=(t,{fractionSlash:o,vulgarFractions:r})=>{if(r)return t;let a=i[t]??t;return o?a.replace("/","\u2044"):a},x=t=>({...n,...typeof t=="boolean"?{vulgarFractions:t}:t}),$=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],M=t=>{if(typeof t!="number"||isNaN(t))return null;if(t<1||t>=4e3)return"";let r=`${Math.floor(t)}`.split(""),a="",e=3;for(;e--;)a=`${$[+r.pop()+e*10]||""}${a}`;return`${Array(+r.join("")+1).join("M")}${a}`},c=(t,o=n)=>{let r=typeof t=="string"?parseFloat(t):t;if(isNaN(r)||r===null)return null;if(r===0)return"";let a=x(o??n);if(a.romanNumerals)return M(r);let e=Math.abs(r),s=Math.floor(e),m=`${r<0?"-":""}${s===0?"":`${s} `}`,f=e-s;if(f===0)return`${r}`;for(let[F,V]of u)if(g(f,F,a.tolerance)){let p=h(V,a);return`${Object.hasOwn(i,p)?m.trim():m}${p}`}return`${r}`};var Q=c;return I(N);})();
2
- //# sourceMappingURL=format-quantity.umd.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/constants.ts","../src/formatQuantity.ts"],"sourcesContent":["import { formatQuantity } from './formatQuantity';\nexport * from './constants';\nexport * from './types';\nexport { formatQuantity };\nexport default formatQuantity;\n","import type {\n FormatQuantityOptions,\n SimpleFraction,\n Sixteenth,\n VulgarFraction,\n} from './types';\n\nexport const defaultTolerance = 0.0075 as const;\n\nexport const defaultOptions = {\n vulgarFractions: false,\n tolerance: defaultTolerance,\n fractionSlash: false,\n romanNumerals: false,\n} satisfies Required<FormatQuantityOptions>;\n\n/**\n * A map of vulgar or simple sixteenth fractions to their traditional ASCII\n * equivalents. Sixteenths map to themselves.\n */\nexport const vulgarToAsciiMap = {\n '¼': '1/4',\n '½': '1/2',\n '¾': '3/4',\n '⅐': '1/7',\n '⅑': '1/9',\n '⅒': '1/10',\n '⅓': '1/3',\n '⅔': '2/3',\n '⅕': '1/5',\n '⅖': '2/5',\n '⅗': '3/5',\n '⅘': '4/5',\n '⅙': '1/6',\n '⅚': '5/6',\n '⅛': '1/8',\n '⅜': '3/8',\n '⅝': '5/8',\n '⅞': '7/8',\n} satisfies Record<VulgarFraction, SimpleFraction>;\n\nexport const fractionDecimalMatches = [\n [0.33, '⅓'],\n [0.66, '⅔'],\n [0.2, '⅕'],\n [0.4, '⅖'],\n [0.6, '⅗'],\n [0.8, '⅘'],\n [0.166, '⅙'],\n [0.833, '⅚'],\n [0.143, '⅐'],\n [0.111, '⅑'],\n [0.1, '⅒'],\n [0.125, '⅛'],\n [0.25, '¼'],\n [0.375, '⅜'],\n [0.5, '½'],\n [0.625, '⅝'],\n [0.75, '¾'],\n [0.875, '⅞'],\n [0.0625, '1/16'],\n [0.1875, '3/16'],\n [0.3125, '5/16'],\n [0.4375, '7/16'],\n [0.5625, '9/16'],\n [0.6875, '11/16'],\n [0.8125, '13/16'],\n [0.9375, '15/16'],\n] satisfies [number, VulgarFraction | Sixteenth][];\n","import {\n defaultOptions,\n fractionDecimalMatches,\n vulgarToAsciiMap,\n} from './constants';\nimport type {\n FormatQuantity,\n FormatQuantityOptions,\n SimpleFraction,\n Sixteenth,\n VulgarFraction,\n} from './types';\n\n/**\n * Determines if two numbers are close enough to consider\n * them equal for the purposes of this package.\n */\nconst closeEnough = (n1: number, n2: number, tolerance: number) =>\n Math.abs(n1 - n2) < tolerance;\n\nconst getFraction = (\n vulgarFractionOrSixteenth: VulgarFraction | Sixteenth,\n { fractionSlash, vulgarFractions }: FormatQuantityOptions\n) => {\n if (vulgarFractions) {\n return vulgarFractionOrSixteenth;\n }\n\n const plainFraction: SimpleFraction =\n vulgarToAsciiMap[vulgarFractionOrSixteenth as VulgarFraction] ??\n vulgarFractionOrSixteenth;\n\n if (fractionSlash) {\n return plainFraction.replace('/', '⁄');\n }\n\n return plainFraction;\n};\n\nconst normalizeOptions = (\n options: Parameters<FormatQuantity>[1]\n): Required<FormatQuantityOptions> => ({\n ...defaultOptions,\n ...(typeof options === 'boolean' ? { vulgarFractions: options } : options),\n});\n\n// prettier-ignore\nconst romanNumeralValueKey = [\n \"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\",\n \"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\",\n \"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\",\n] as const;\n\n/**\n * Formats a number as Roman numerals. The number must be between\n * 1 and 3999 (inclusive).\n */\nexport const formatRomanNumerals = (qty: number) => {\n if (typeof qty !== 'number' || isNaN(qty)) {\n return null;\n }\n\n if (qty < 1 || qty >= 4000) {\n return '';\n }\n\n const floored = Math.floor(qty);\n\n const digits = `${floored}`.split('');\n let roman = '';\n let i = 3;\n while (i--) {\n roman = `${romanNumeralValueKey[+digits.pop()! + i * 10] || ''}${roman}`;\n }\n return `${Array(+digits.join('') + 1).join('M')}${roman}`;\n};\n\n/**\n * Formats a number (or string that appears to be a number)\n * as one would see it written in imperial measurements, e.g.\n * \"1 1/2\" instead of \"1.5\". To use vulgar fraction characters\n * like \"½\", pass `true` as the second argument. For other options\n * see the [documentation](https://jakeboone02.github.io/format-quantity/).\n */\nexport const formatQuantity: FormatQuantity = (\n qty,\n options = defaultOptions\n) => {\n // TODO: use numericQuantity instead of parseFloat?\n const qtyAsNumber = typeof qty === 'string' ? parseFloat(qty) : qty;\n\n // Return `null` if input is not number-like\n if (isNaN(qtyAsNumber) || qtyAsNumber === null) {\n return null;\n }\n\n // Return an empty string if the value is zero\n if (qtyAsNumber === 0) {\n return '';\n }\n\n // The default options parameter in the function signature only takes effect\n // if the parameter is `undefined`. The nullish coalescing operator below\n // covers the `null` case.\n const opts = normalizeOptions(options ?? defaultOptions);\n\n if (opts.romanNumerals) {\n return formatRomanNumerals(qtyAsNumber);\n }\n\n const absoluteValue = Math.abs(qtyAsNumber);\n const flooredAbsVal = Math.floor(absoluteValue);\n const flooredAbsValStr = `${qtyAsNumber < 0 ? '-' : ''}${\n flooredAbsVal === 0 ? '' : `${flooredAbsVal} `\n }`;\n const decimalValue = absoluteValue - flooredAbsVal;\n\n // For integers just return the given value as a string\n if (decimalValue === 0) {\n return `${qtyAsNumber}`;\n }\n\n for (const [num, vf] of fractionDecimalMatches) {\n if (closeEnough(decimalValue, num, opts.tolerance)) {\n const fraction = getFraction(vf, opts);\n const int = Object.hasOwn(vulgarToAsciiMap, fraction)\n ? flooredAbsValStr.trim()\n : flooredAbsValStr;\n return `${int}${fraction}`;\n }\n }\n\n return `${qtyAsNumber}`;\n};\n"],"mappings":"kcAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,mBAAAC,EAAA,qBAAAC,EAAA,mBAAAC,EAAA,2BAAAC,EAAA,qBAAAC,ICOO,IAAMC,EAAmB,MAEnBC,EAAiB,CAC5B,gBAAiB,GACjB,UAAW,MACX,cAAe,GACf,cAAe,EACjB,EAMaC,E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AAO,OAAOZ,EAAkBoB,CAAQ,EAChDL,EAAiB,KAAK,EACtBA,IACYK,IAIpB,MAAO,GAAGT,GACZ,EFjIA,IAAOU,EAAQC","names":["src_exports","__export","src_default","defaultOptions","defaultTolerance","formatQuantity","fractionDecimalMatches","vulgarToAsciiMap","defaultTolerance","defaultOptions","vulgarToAsciiMap","fractionDecimalMatches","closeEnough","n1","n2","tolerance","getFraction","vulgarFractionOrSixteenth","fractionSlash","vulgarFractions","plainFraction","vulgarToAsciiMap","normalizeOptions","options","defaultOptions","romanNumeralValueKey","formatRomanNumerals","qty","digits","roman","i","formatQuantity","qtyAsNumber","opts","absoluteValue","flooredAbsVal","flooredAbsValStr","decimalValue","num","vf","fractionDecimalMatches","fraction","src_default","formatQuantity"]}