@rtorcato/js-common 1.4.2 → 1.6.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/CHANGELOG.md +20 -0
- package/README.md +5 -5
- package/dist/currency/currencies.js +1 -1
- package/dist/currency/index.js +1 -1
- package/dist/helloworld/index.js +1 -0
- package/dist/uuid/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-7MXMG6WN.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [1.6.0](https://github.com/rtorcato/js-common/compare/v1.5.0...v1.6.0) (2026-01-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added dev branch to CI ([751f124](https://github.com/rtorcato/js-common/commit/751f124d48e40452c43f70ce05239f220bd30c63))
|
|
7
|
+
* update packages and add fix for biome sorting ([0ed384c](https://github.com/rtorcato/js-common/commit/0ed384cfed2e4b285752a8e22f59aebd8ccb19c9))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **uuid:** add v7, version detection, and short UUID conversion ([d304168](https://github.com/rtorcato/js-common/commit/d304168206152b125ffb2269c1c0cc448f266d76))
|
|
13
|
+
|
|
14
|
+
# [1.5.0](https://github.com/rtorcato/js-common/compare/v1.4.2...v1.5.0) (2026-01-16)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **currency:** add lazy loading and new features ([e9369a8](https://github.com/rtorcato/js-common/commit/e9369a8af5355cea9d348c94776037158680f30d))
|
|
20
|
+
|
|
1
21
|
## [1.4.2](https://github.com/rtorcato/js-common/compare/v1.4.1...v1.4.2) (2026-01-16)
|
|
2
22
|
|
|
3
23
|
|
package/README.md
CHANGED
|
@@ -33,13 +33,13 @@ This package includes a command-line interface for many utilities:
|
|
|
33
33
|
npm install -g @rtorcato/js-common
|
|
34
34
|
|
|
35
35
|
# Or use with npx
|
|
36
|
-
npx @rtorcato/js-common --help
|
|
36
|
+
npx @rtorcato/js-common@latest --help
|
|
37
37
|
|
|
38
38
|
# Examples
|
|
39
|
-
npx @rtorcato/js-common date today
|
|
40
|
-
npx @rtorcato/js-common math sum 1 2 3 4 5
|
|
41
|
-
npx @rtorcato/js-common text capitalize "hello world"
|
|
42
|
-
npx @rtorcato/js-common
|
|
39
|
+
npx @rtorcato/js-common@latest date today
|
|
40
|
+
npx @rtorcato/js-common@latest math sum 1 2 3 4 5
|
|
41
|
+
npx @rtorcato/js-common@latest text capitalize "hello world"
|
|
42
|
+
npx @rtorcato/js-common@latest system node-version
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
See [CLI.md](./CLI.md) for complete CLI documentation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../chunks/chunk-ANN5UYCF.js";var R=["CAD","USD","AUD","EUR","GBP","JPY","CHF","CNY","NZD","SGD","SEK","NOK","DKK","MXN","HKD","KRW","TRY","RUB","INR","BRL","ZAR","ILS","MYR","PHP","PLN","THB","TWD","CZK","HUF","IDR","BGN","RON","HRK","COP","CRC","XCD","XDR","XAG","XAU","XPT","XPD","XTS","XXX"],D=R;export{R as currencies,D as default};
|
package/dist/currency/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../chunks/chunk-ANN5UYCF.js";var o=null;async function a(){if(o)return o;let{default:r}=await import("./currencies.js");return o=r,r}var l=r=>{try{let n=new Intl.NumberFormat("en",{currency:r,style:"currency"}).formatToParts(0).find(e=>e.type==="currency");return n?.value==="\xA4"?void 0:n?.value}catch{return}};function m(r,n="en"){try{return new Intl.DisplayNames([n],{type:"currency"}).of(r.toUpperCase())}catch{return}}function i(r){return{USD:"en-US",EUR:"de-DE",GBP:"en-GB",JPY:"ja-JP",CNY:"zh-CN",CAD:"en-CA",AUD:"en-AU",CHF:"de-CH",NZD:"en-NZ",SGD:"en-SG",HKD:"zh-HK",KRW:"ko-KR",INR:"en-IN",BRL:"pt-BR",MXN:"es-MX",RUB:"ru-RU",ZAR:"en-ZA",SEK:"sv-SE",NOK:"nb-NO",DKK:"da-DK",PLN:"pl-PL",TRY:"tr-TR",THB:"th-TH",MYR:"ms-MY",PHP:"en-PH",IDR:"id-ID",CZK:"cs-CZ",HUF:"hu-HU",ILS:"he-IL",TWD:"zh-TW"}[r.toUpperCase()]??"en"}function p(r,n="USD",e){let t=e??i(n);return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(Number(r))}function d(r,n="USD",e){let t=e??i(n);return new Intl.NumberFormat(t,{style:"currency",currency:n,notation:"compact",compactDisplay:"short"}).format(Number(r))}function s(r){let n=/\d+\.\d{3},\d{2}$/.test(r),e=r;n&&(e=r.replace(/\./g,"").replace(",","."));let t=e.replace(/[^0-9.-]+/g,""),c=Number.parseFloat(t);return Number.isNaN(c)?null:c}function f(r){let n={$:"USD","\u20AC":"EUR","\xA3":"GBP","\xA5":"JPY","\u20B9":"INR","\u20BD":"RUB",R$:"BRL","\u20A9":"KRW","\u0E3F":"THB","\u20AA":"ILS","\u20B1":"PHP","\u20AB":"VND",kr:"SEK",CHF:"CHF",C$:"CAD",A$:"AUD",NZ$:"NZD",HK$:"HKD",S$:"SGD"},e=r.match(/\b([A-Z]{3})\b/);if(e&&e[1]){let t=s(r);if(t!==null)return{amount:t,currency:e[1]}}for(let[t,c]of Object.entries(n))if(r.includes(t)){let u=s(r);if(u!==null)return{amount:u,currency:c}}return null}function y(r,n,e=2){return Number.parseFloat((r*n).toFixed(e))}async function g(r){return(await a()).includes(r.toUpperCase())}function b(r){try{return new Intl.NumberFormat("en",{style:"currency",currency:r}),!0}catch{return!1}}function C(r,n=2){let e=10**n;return Math.round(r*e)/e}export{y as convertCurrency,p as formatPrice,d as formatPriceCompact,i as getCurrencyLocale,m as getCurrencyName,l as getCurrencySymbol,b as isValidCurrency,g as isValidCurrencyCode,f as parseCurrencyString,s as parsePrice,C as roundTo};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/chunk-ANN5UYCF.js";function l(){return"Hello, World!"}export{l as helloWorld};
|
package/dist/uuid/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/chunk-ANN5UYCF.js";import
|
|
1
|
+
import"../chunks/chunk-ANN5UYCF.js";import i from"short-uuid";import{NIL as n,parse as e,stringify as U,validate as r,version as s,v4 as a,v7 as g}from"uuid";var o=i(),p=()=>a(),D=()=>g(),c=()=>o.new(),x=t=>o.fromUUID(t),d=t=>o.toUUID(t),l=t=>r(t),v=t=>r(t)&&s(t)===4,f=t=>t===n,m=t=>{if(!r(t))throw new Error("Invalid UUID");return s(t)},y=()=>n,b=t=>e(t),h=t=>U(t);export{h as bytesToUUID,d as fromShortUUID,y as getNilUUID,c as getShortUUID,p as getUUID,m as getUUIDVersion,D as getUUIDv7,f as isNilUUID,l as isUUID,v as isUUIDv4,x as toShortUUID,b as uuidToBytes};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var R=["CAD","USD","AUD","EUR","GBP","JPY","CHF","CNY","NZD","SGD","SEK","NOK","DKK","MXN","HKD","KRW","TRY","RUB","INR","BRL","ZAR","ILS","MYR","PHP","PLN","THB","TWD","CZK","HUF","IDR","BGN","RON","HRK","BRL","COP","CRC","XCD","XDR","XAG","XAU","XPT","XPD","XTS","XXX"],D=R;export{R as a,D as b};
|