Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@omegagrid/core

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omegagrid/core - npm Package Compare versions

Comparing version 0.2.14 to 0.2.15

1

dist/common/numbers.d.ts

@@ -6,2 +6,3 @@ import { DecimalSeparator, ValueFormatter } from "../types";

signDisplay?: 'auto' | 'never' | 'always' | 'exceptZero' | 'negative';
brackets?: boolean;
} & Intl.NumberFormatOptions;

@@ -8,0 +9,0 @@ export type NumberFormatterFunction = ValueFormatter<number>;

@@ -41,5 +41,14 @@ "use strict";

exports.getNumberFormatter = getNumberFormatter;
function createUnitNumberFormatter(locale, format) {
function createExtendedNumberFormatter(locale, format) {
const formatter = new Intl.NumberFormat(locale, format);
return { format: (value) => formatter.format(value) + (format.um || '') };
return { format: (value) => {
let str = formatter.format(value);
if (format.um)
str + (format.um || '');
if (format.brackets)
str = `(${str})`;
if (format.color)
str = `<span style="color:${format.color}">${str}</span>`;
return str;
} };
}

@@ -49,4 +58,4 @@ function createNumberFormatter(locale, format = '', fixFormat) {

const formatters = formats.map(options => (0, utils_1.isObject)(options)
? (options.um
? createUnitNumberFormatter(locale, options)
? ((options.um || options.color || options.brackets)
? createExtendedNumberFormatter(locale, options)
: new Intl.NumberFormat(locale, options)) : { format: (0, dates_1.getDateFormatter)(locale, options) });

@@ -84,2 +93,6 @@ if (formatters.length == 1)

switch (ch.toLowerCase()) {
case '(':
format.brackets = true;
++offset;
break;
case '[':

@@ -86,0 +99,0 @@ format.color = '';

2

package.json
{
"name": "@omegagrid/core",
"version": "0.2.14",
"version": "0.2.15",
"license": "UNLICENSED",

@@ -5,0 +5,0 @@ "description": "Core components",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc