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

@cloudflare/util-formatters

Package Overview
Dependencies
Maintainers
27
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 1.1.0 to 2.0.0

16

CHANGELOG.md

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

# [2.0.0](http://stash.cfops.it:7999/fe/stratus/compare/@cloudflare/util-formatters@1.1.0...@cloudflare/util-formatters@2.0.0) (2019-07-30)
### Features
* **util-formatters:** UI-2490 Change function to name for more specific ([3b19db3](http://stash.cfops.it:7999/fe/stratus/commits/3b19db3))
### BREAKING CHANGES
* **util-formatters:** Changes the function name
# 1.1.0 (2019-07-24)

@@ -8,0 +24,0 @@

4

es/formatters.js

@@ -9,3 +9,3 @@ import { format as d3Format } from 'd3-format';

export var formatBytes = function formatBytes(number, includeDecimals) {
return formatNumber(number, true, includeDecimals ? 2 : 0) // Add space between value and SI unit
return formatNumberForAnalytics(number, true, includeDecimals ? 2 : 0) // Add space between value and SI unit
.replace(/([a-zA-Z]?)$/, ' $1') + 'B';

@@ -21,3 +21,3 @@ };

export var formatNumber = function formatNumber(number) {
export var formatNumberForAnalytics = function formatNumberForAnalytics(number) {
var useSI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

@@ -24,0 +24,0 @@ var significantDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;

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

import { formatNumber, formatBytes } from './formatters';
export { formatNumber, formatBytes };
import { formatNumberForAnalytics, formatBytes } from './formatters';
export { formatNumberForAnalytics, formatBytes };

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

});
exports.formatNumber = exports.formatBytes = void 0;
exports.formatNumberForAnalytics = exports.formatBytes = void 0;

@@ -17,3 +17,3 @@ var _d3Format = require("d3-format");

var formatBytes = function formatBytes(number, includeDecimals) {
return formatNumber(number, true, includeDecimals ? 2 : 0) // Add space between value and SI unit
return formatNumberForAnalytics(number, true, includeDecimals ? 2 : 0) // Add space between value and SI unit
.replace(/([a-zA-Z]?)$/, ' $1') + 'B';

@@ -32,3 +32,3 @@ };

var formatNumber = function formatNumber(number) {
var formatNumberForAnalytics = function formatNumberForAnalytics(number) {
var useSI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

@@ -50,2 +50,2 @@ var significantDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;

exports.formatNumber = formatNumber;
exports.formatNumberForAnalytics = formatNumberForAnalytics;

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

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

@@ -12,0 +12,0 @@ });

{
"name": "@cloudflare/util-formatters",
"description": "",
"version": "1.1.0",
"version": "2.0.0",
"types": "./src",

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

},
"gitHead": "3e6c16c4a85bcc8ce6dcdd644cce23ddefe86ede"
"gitHead": "35818da5672f7a97888d3ad18efac60494075475"
}

@@ -10,3 +10,3 @@ import { format as d3Format } from 'd3-format';

return (
formatNumber(number, true, includeDecimals ? 2 : 0)
formatNumberForAnalytics(number, true, includeDecimals ? 2 : 0)
// Add space between value and SI unit

@@ -24,3 +24,3 @@ .replace(/([a-zA-Z]?)$/, ' $1') + 'B'

*/
export const formatNumber = (
export const formatNumberForAnalytics = (
number,

@@ -27,0 +27,0 @@ useSI = false,

@@ -1,3 +0,3 @@

import { formatNumber, formatBytes } from './formatters';
import { formatNumberForAnalytics, formatBytes } from './formatters';
export { formatNumber, formatBytes };
export { formatNumberForAnalytics, formatBytes };
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