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

@lite-v3/common-helpers

Package Overview
Dependencies
Maintainers
7
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lite-v3/common-helpers - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

10

dist/number/thousandSeparator.d.ts

@@ -1,1 +0,9 @@

export default function thousandSeparator(numb: string, sparator?: string): string;
interface ThousandSeparatorOption {
/**
* @default '.'
*/
separator?: string;
isReturnEmptyStringOnEmptyNumb?: boolean;
}
export default function thousandSeparator(numb: string, options?: ThousandSeparatorOption | string): string;
export {};

17

dist/number/thousandSeparator.js

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

exports.default = thousandSeparator;
function thousandSeparator(numb) {
var sparator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '.';
function thousandSeparator(numb, options) {
var _options = options;
if (typeof _options === 'undefined') _options = {};
if (typeof _options === 'string') {
_options = {
separator: _options
};
}
var _separator = _options.separator, separator = _separator === void 0 ? '.' : _separator, isReturnEmptyStringOnEmptyNumb = _options.isReturnEmptyStringOnEmptyNumb;
if (!numb) {
return '0';
return isReturnEmptyStringOnEmptyNumb ? '' : '0';
}
var num = numb.toString().replace(/\D/g, '');
if (num === '') {
return '0';
return isReturnEmptyStringOnEmptyNumb ? '' : '0';
}

@@ -19,4 +26,4 @@ if (num.length <= 3) {

}
var result = num.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1".concat(sparator));
var result = num.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1".concat(separator));
return result; // Return format 3.000.000 || 4.500
}
{
"name": "@lite-v3/common-helpers",
"version": "0.1.2",
"version": "0.1.3",
"description": "Public common helpers for Tokopedia Web",

@@ -47,3 +47,3 @@ "repository": {

"@lite-v3/tsconfig": "^0.0.2",
"@tokopedia/lite-testing": "^1.2.0",
"@tokopedia/lite-testing": "^1.3.0",
"@types/node": "^16.11.1",

@@ -50,0 +50,0 @@ "lolex": "^4.1.0"

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