@panneau/display-unit 3.0.162 → 3.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +2 -1
- package/lib/index.js +2 -1
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import isObject from 'lodash/isObject';
|
|
1
2
|
import prettyBytes from 'pretty-bytes';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import React, { useMemo } from 'react';
|
|
@@ -25,7 +26,7 @@ var Unit = function Unit(_ref) {
|
|
|
25
26
|
if (value === null) {
|
|
26
27
|
return null;
|
|
27
28
|
}
|
|
28
|
-
if (format === 'bytes') {
|
|
29
|
+
if (format === 'bytes' && !isObject(value)) {
|
|
29
30
|
return prettyBytes(parseInt(value, 10));
|
|
30
31
|
}
|
|
31
32
|
if (format === 'dimensions') {
|
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var isObject = require('lodash/isObject');
|
|
5
6
|
var prettyBytes = require('pretty-bytes');
|
|
6
7
|
var PropTypes = require('prop-types');
|
|
7
8
|
var React = require('react');
|
|
@@ -29,7 +30,7 @@ var Unit = function Unit(_ref) {
|
|
|
29
30
|
if (value === null) {
|
|
30
31
|
return null;
|
|
31
32
|
}
|
|
32
|
-
if (format === 'bytes') {
|
|
33
|
+
if (format === 'bytes' && !isObject(value)) {
|
|
33
34
|
return prettyBytes(parseInt(value, 10));
|
|
34
35
|
}
|
|
35
36
|
if (format === 'dimensions') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/display-unit",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.164",
|
|
4
4
|
"description": "Unit display",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.12.5",
|
|
49
|
-
"@panneau/core": "^3.0.
|
|
50
|
-
"@panneau/themes": "^3.0.
|
|
49
|
+
"@panneau/core": "^3.0.164",
|
|
50
|
+
"@panneau/themes": "^3.0.164",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
52
52
|
"pretty-bytes": "^6.1.1",
|
|
53
53
|
"prop-types": "^15.7.2",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "7a1511eb7b08a09cfcf708d1ca314a12155e9bd8"
|
|
60
60
|
}
|