sim 2.3.0-preview.330.1 → 2.3.0-preview.331.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/dist/index.js CHANGED
@@ -59813,14 +59813,14 @@ function isCurrencyMarkerLetters(letters) {
59813
59813
  return !SCALE_SUFFIX.test(upper);
59814
59814
  return supportedCurrencyCodes.has(upper);
59815
59815
  }
59816
- var CURRENCY_MARKER_PREFIX = /^[\s\u00a0\u202f]*([+-]?)[\s\u00a0\u202f]*(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)[\s\u00a0\u202f]*/u;
59817
- var CURRENCY_MARKER_SUFFIX = /[\s\u00a0\u202f]*(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)\.?[\s\u00a0\u202f]*$/u;
59816
+ var CURRENCY_MARKER_PREFIX = /^\s*(?:([+-])\s*)?(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)\s*/u;
59817
+ var CURRENCY_MARKER_SUFFIX = /(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)\.?$/u;
59818
59818
  function isStrippableMarker(letters, symbol) {
59819
59819
  if (letters === undefined || symbol !== undefined)
59820
59820
  return true;
59821
59821
  return isCurrencyMarkerLetters(letters);
59822
59822
  }
59823
- var AMOUNT_SHAPE = /^[+-]?[\d.,]*\d[\d.,]*$/;
59823
+ var AMOUNT_SHAPE = /^[+-]?[.,]*\d[\d.,]*$/;
59824
59824
  function hasValidGrouping(text, separator) {
59825
59825
  const groups = text.split(separator);
59826
59826
  if (groups.length === 1)
@@ -59881,15 +59881,15 @@ function parseCurrencyInput(raw, currencyCode) {
59881
59881
  if (!isStrippableMarker(letters, symbol))
59882
59882
  return match;
59883
59883
  hadMarker = true;
59884
- return sign;
59884
+ return sign ?? "";
59885
59885
  });
59886
- const withoutMarkers = withoutPrefix.replace(CURRENCY_MARKER_SUFFIX, (match, letters, symbol) => {
59886
+ const withoutMarkers = withoutPrefix.trimEnd().replace(CURRENCY_MARKER_SUFFIX, (match, letters, symbol) => {
59887
59887
  if (!isStrippableMarker(letters, symbol))
59888
59888
  return match;
59889
59889
  hadMarker = true;
59890
59890
  return "";
59891
59891
  });
59892
- const cleaned = withoutMarkers.replace(/[\s\u00a0\u202f\u2019']/gu, "");
59892
+ const cleaned = withoutMarkers.replace(/[\s\u2019']/gu, "");
59893
59893
  if (!AMOUNT_SHAPE.test(cleaned))
59894
59894
  return null;
59895
59895
  const signed = /^[+-]/.test(cleaned);
package/dist/runtime.js CHANGED
@@ -59862,14 +59862,14 @@ function isCurrencyMarkerLetters(letters) {
59862
59862
  return !SCALE_SUFFIX.test(upper);
59863
59863
  return supportedCurrencyCodes.has(upper);
59864
59864
  }
59865
- var CURRENCY_MARKER_PREFIX = /^[\s\u00a0\u202f]*([+-]?)[\s\u00a0\u202f]*(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)[\s\u00a0\u202f]*/u;
59866
- var CURRENCY_MARKER_SUFFIX = /[\s\u00a0\u202f]*(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)\.?[\s\u00a0\u202f]*$/u;
59865
+ var CURRENCY_MARKER_PREFIX = /^\s*(?:([+-])\s*)?(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)\s*/u;
59866
+ var CURRENCY_MARKER_SUFFIX = /(?:\p{Sc}\p{L}{0,3}|(\p{L}{1,3})(\p{Sc})?)\.?$/u;
59867
59867
  function isStrippableMarker(letters, symbol) {
59868
59868
  if (letters === undefined || symbol !== undefined)
59869
59869
  return true;
59870
59870
  return isCurrencyMarkerLetters(letters);
59871
59871
  }
59872
- var AMOUNT_SHAPE = /^[+-]?[\d.,]*\d[\d.,]*$/;
59872
+ var AMOUNT_SHAPE = /^[+-]?[.,]*\d[\d.,]*$/;
59873
59873
  function hasValidGrouping(text, separator) {
59874
59874
  const groups = text.split(separator);
59875
59875
  if (groups.length === 1)
@@ -59930,15 +59930,15 @@ function parseCurrencyInput(raw, currencyCode) {
59930
59930
  if (!isStrippableMarker(letters, symbol))
59931
59931
  return match;
59932
59932
  hadMarker = true;
59933
- return sign;
59933
+ return sign ?? "";
59934
59934
  });
59935
- const withoutMarkers = withoutPrefix.replace(CURRENCY_MARKER_SUFFIX, (match, letters, symbol) => {
59935
+ const withoutMarkers = withoutPrefix.trimEnd().replace(CURRENCY_MARKER_SUFFIX, (match, letters, symbol) => {
59936
59936
  if (!isStrippableMarker(letters, symbol))
59937
59937
  return match;
59938
59938
  hadMarker = true;
59939
59939
  return "";
59940
59940
  });
59941
- const cleaned = withoutMarkers.replace(/[\s\u00a0\u202f\u2019']/gu, "");
59941
+ const cleaned = withoutMarkers.replace(/[\s\u2019']/gu, "");
59942
59942
  if (!AMOUNT_SHAPE.test(cleaned))
59943
59943
  return null;
59944
59944
  const signed = /^[+-]/.test(cleaned);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim",
3
- "version": "2.3.0-preview.330.1",
3
+ "version": "2.3.0-preview.331.1",
4
4
  "description": "Sim CLI - talk to the Sim API from your terminal",
5
5
  "type": "module",
6
6
  "bin": {