Skip to content

Commit

Permalink
Merge branch 'master' into pr/yeion7/88
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Sep 26, 2019
2 parents 9c1dd36 + 4b8401d commit c535c38
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 15 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-syntax-bigint",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-export-default-from",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.2.2",
"@babel/plugin-syntax-bigint": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.3.0",
"@babel/plugin-proposal-do-expressions": "^7.2.0",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
Expand Down
2 changes: 2 additions & 0 deletions src/object/ObjectValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const ObjectValue = ({ object, styles }) => {
const mkStyle = key => ({ ...themeStyles[key], ...styles });

switch (typeof object) {
case 'bigint':
return <span style={mkStyle('objectValueNumber')}>{String(object)}n</span>;
case 'number':
return <span style={mkStyle('objectValueNumber')}>{String(object)}</span>;
case 'string':
Expand Down
6 changes: 6 additions & 0 deletions src/object/ObjectValue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ describe('ObjectValue', () => {
const tree = TestRenderer.create(<ObjectValue object={0} />);
expect(tree).toMatchSnapshot();
});

it('should render bigint', () => {
const tree = TestRenderer.create(<ObjectValue object={9007199254740993n} />).toJSON();
expect(tree.type).toBe('span');
expect(tree.children).toEqual(['9007199254740993', 'n']);
});

it('should render number', () => {
const tree = TestRenderer.create(<ObjectValue object={0} />).toJSON();
Expand Down
5 changes: 5 additions & 0 deletions stories/object-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ storiesOf('Numbers', module)
.add('exponential', () => <Inspector data={1e100} />)
.add('NaN', () => <Inspector data={NaN} />)
.add('Infinity', () => <Inspector data={Infinity} />);

storiesOf('BigInts', module)
.add('positive', () => <Inspector data={42n} />)
.add('zero', () => <Inspector data={0n} />)
.add('negative', () => <Inspector data={-1n} />)

storiesOf('Strings', module)
.add('empty string', () => <Inspector data="" />)
Expand Down
39 changes: 24 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-syntax-bigint@^7.2.0":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.4.4.tgz#3c6f77ba5f4aefbabfd5183117278c9695971093"
integrity sha512-tXyL/mlth1QBl5OwpsABCmAWm4u9xvUIk5nsLd2wWKrC6C4Qm9JvmN18IAGlIXkMvWZTRJVuGRXSLCuz+1hG9Q==
dependencies:
"@babel/helper-plugin-utils" "^7.0.0"

"@babel/plugin-syntax-decorators@^7.2.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b"
Expand Down Expand Up @@ -4320,14 +4327,16 @@ eslint-scope@^4.0.0, eslint-scope@^4.0.3:
estraverse "^4.1.1"

eslint-utils@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512"
integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==
version "1.4.2"
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab"
integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==
dependencies:
eslint-visitor-keys "^1.0.0"

eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==
version "1.1.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==

eslint@^5.13.0:
version "5.16.0"
Expand Down Expand Up @@ -6719,9 +6728,9 @@ locate-path@^3.0.0:
path-exists "^3.0.0"

lodash-es@^4.17.11:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.11.tgz#145ab4a7ac5c5e52a3531fb4f310255a152b4be0"
integrity sha512-DHb1ub+rMjjrxqlB3H56/6MXtm1lSksDp2rA2cNWjG8mlDUYFhUj3Di2Zn5IwSU87xLv8tNIQ7sSwE/YOX/D/Q==
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78"
integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==

lodash.debounce@^4.0.8:
version "4.0.8"
Expand All @@ -6744,9 +6753,9 @@ lodash.isplainobject@^4.0.6:
integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=

lodash.mergewith@^4.6.1:
version "4.6.1"
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927"
integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz#617121f89ac55f59047c7aec1ccd6654c6590f55"
integrity sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==

lodash.pick@^4.4.0:
version "4.4.0"
Expand Down Expand Up @@ -7085,9 +7094,9 @@ mississippi@^3.0.0:
through2 "^2.0.0"

mixin-deep@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe"
integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==
version "1.3.2"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==
dependencies:
for-in "^1.0.2"
is-extendable "^1.0.1"
Expand Down

0 comments on commit c535c38

Please sign in to comment.