@peersyst/react-utils
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -1,1 +0,4 @@ | ||
export default function (n: number | string, d: number): string; | ||
export interface MinDigitsOptions { | ||
fill?: "left" | "right"; | ||
} | ||
export default function (n: number | string, d: number, { fill }?: MinDigitsOptions): string; |
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
export default function (n, d) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? "left" : _ref$fill; | ||
var num = n.toString(); | ||
return _toConsumableArray(Array(d - num.length)).reduce(function () { | ||
var dif = d - num.length; | ||
var zeros = dif > 0 ? _toConsumableArray(Array(dif)).reduce(function () { | ||
var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; | ||
return prev + "0"; | ||
}, "") + num; | ||
}, "") : ""; | ||
return (fill === "left" ? zeros : "") + num + (fill === "right" ? zeros : ""); | ||
} |
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
export default function (n, d) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? "left" : _ref$fill; | ||
var num = n.toString(); | ||
return _toConsumableArray(Array(d - num.length)).reduce(function () { | ||
var dif = d - num.length; | ||
var zeros = dif > 0 ? _toConsumableArray(Array(dif)).reduce(function () { | ||
var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; | ||
return prev + "0"; | ||
}, "") + num; | ||
}, "") : ""; | ||
return (fill === "left" ? zeros : "") + num + (fill === "right" ? zeros : ""); | ||
} |
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
export default function (n, d) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? "left" : _ref$fill; | ||
var num = n.toString(); | ||
return _toConsumableArray(Array(d - num.length)).reduce(function () { | ||
var dif = d - num.length; | ||
var zeros = dif > 0 ? _toConsumableArray(Array(dif)).reduce(function () { | ||
var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; | ||
return prev + "0"; | ||
}, "") + num; | ||
}, "") : ""; | ||
return (fill === "left" ? zeros : "") + num + (fill === "right" ? zeros : ""); | ||
} |
@@ -13,7 +13,13 @@ "use strict"; | ||
function _default(n, d) { | ||
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, | ||
_ref$fill = _ref.fill, | ||
fill = _ref$fill === void 0 ? "left" : _ref$fill; | ||
var num = n.toString(); | ||
return (0, _toConsumableArray2["default"])(Array(d - num.length)).reduce(function () { | ||
var dif = d - num.length; | ||
var zeros = dif > 0 ? (0, _toConsumableArray2["default"])(Array(dif)).reduce(function () { | ||
var prev = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; | ||
return prev + "0"; | ||
}, "") + num; | ||
}, "") : ""; | ||
return (fill === "left" ? zeros : "") + num + (fill === "right" ? zeros : ""); | ||
} |
{ | ||
"name": "@peersyst/react-utils", | ||
"author": "Peersyst", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "./node/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82794
1865