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

@cloudflare/util-formatters

Package Overview
Dependencies
Maintainers
30
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudflare/util-formatters - npm Package Compare versions

Comparing version 2.4.6 to 2.4.7

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [2.4.7](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-formatters@2.4.6...@cloudflare/util-formatters@2.4.7) (2020-01-13)
**Note:** Version bump only for package @cloudflare/util-formatters
## [2.4.6](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-formatters@2.4.4...@cloudflare/util-formatters@2.4.6) (2019-12-17)

@@ -8,0 +16,0 @@

@@ -53,2 +53,10 @@ import { ESupportedLocales } from '@cloudflare/intl-core';

* @param {String} locale
* @param {Boolean} [includeDecimals]
* @param {Boolean} [useBit]
* @return {String}
*/
export declare const formatBits: (number: number, locale: ESupportedLocales | undefined, includeDecimals: boolean, useBit?: boolean) => string;
/**
* @param {Number} number
* @param {String} locale
* @param {Boolean} [useSI]

@@ -55,0 +63,0 @@ * @param {Number} [decimalPlaces]

@@ -143,2 +143,17 @@ import { format as d3Format } from 'd3-format';

* @param {String} locale
* @param {Boolean} [includeDecimals]
* @param {Boolean} [useBit]
* @return {String}
*/
export var formatBits = function formatBits(number) {
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_LOCALE;
var includeDecimals = arguments.length > 2 ? arguments[2] : undefined;
var useBit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
return formatNumber(number, locale, true, includeDecimals ? 2 : 0) // Add space between value and SI unit
.replace(/([a-zA-Z]?)$/, ' $1') + "".concat(useBit ? 'bit' : 'b');
};
/**
* @param {Number} number
* @param {String} locale
* @param {Boolean} [useSI]

@@ -145,0 +160,0 @@ * @param {Number} [decimalPlaces]

4

es/index.js

@@ -1,2 +0,2 @@

import { formatNumberForAnalytics, formatBytes, formatNumber, formatDate, formatCurrency, localizeNumberWithPrecision, DateFormatters } from './formatters';
export { formatNumberForAnalytics, formatBytes, formatNumber, formatDate, formatCurrency, localizeNumberWithPrecision, DateFormatters };
import { formatNumberForAnalytics, formatBytes, formatBits, formatNumber, formatDate, formatCurrency, localizeNumberWithPrecision, DateFormatters } from './formatters';
export { formatNumberForAnalytics, formatBytes, formatBits, formatNumber, formatDate, formatCurrency, localizeNumberWithPrecision, DateFormatters };

@@ -6,3 +6,3 @@ "use strict";

});
exports.formatNumberForAnalytics = exports.formatBytes = exports.formatCurrency = exports.formatNumber = exports.localizeNumberWithPrecision = exports.formatDate = exports.DateFormatters = void 0;
exports.formatNumberForAnalytics = exports.formatBits = exports.formatBytes = exports.formatCurrency = exports.formatNumber = exports.localizeNumberWithPrecision = exports.formatDate = exports.DateFormatters = void 0;

@@ -169,2 +169,20 @@ var _d3Format = require("d3-format");

* @param {String} locale
* @param {Boolean} [includeDecimals]
* @param {Boolean} [useBit]
* @return {String}
*/
exports.formatBytes = formatBytes;
var formatBits = function formatBits(number) {
var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_LOCALE;
var includeDecimals = arguments.length > 2 ? arguments[2] : undefined;
var useBit = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
return formatNumber(number, locale, true, includeDecimals ? 2 : 0) // Add space between value and SI unit
.replace(/([a-zA-Z]?)$/, ' $1') + "".concat(useBit ? 'bit' : 'b');
};
/**
* @param {Number} number
* @param {String} locale
* @param {Boolean} [useSI]

@@ -177,3 +195,3 @@ * @param {Number} [decimalPlaces]

exports.formatBytes = formatBytes;
exports.formatBits = formatBits;

@@ -180,0 +198,0 @@ var formatNumberForAnalytics = function formatNumberForAnalytics(number) {

@@ -18,2 +18,8 @@ "use strict";

});
Object.defineProperty(exports, "formatBits", {
enumerable: true,
get: function get() {
return _formatters.formatBits;
}
});
Object.defineProperty(exports, "formatNumber", {

@@ -20,0 +26,0 @@ enumerable: true,

{
"name": "@cloudflare/util-formatters",
"description": "",
"version": "2.4.6",
"version": "2.4.7",
"types": "./dist/index.d.ts",

@@ -25,3 +25,3 @@ "main": "lib/index.js",

},
"gitHead": "0e0e4fc58fbd1d2c888bad3336101d800e747c7d"
"gitHead": "d579ed8cf46b8fefbe92ff2c516b7702b696bffb"
}
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