-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(pluginutils): support bigint and symbol in dataToEsm #1047
Conversation
@@ -2,6 +2,13 @@ import test from 'ava'; | |||
|
|||
import { dataToEsm } from '../'; | |||
|
|||
test('support bigint and symbol', (t) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split these into separate tests. (that may seem pedantic, but this PR essentially adds two features in support for two different entities)
@@ -2,6 +2,13 @@ import test from 'ava'; | |||
|
|||
import { dataToEsm } from '../'; | |||
|
|||
test('support bigint and symbol', (t) => { | |||
t.is( | |||
dataToEsm({ bigint: 0, symbol: Symbol.for('') }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see a few different values (within the same t
test func) tried here for sanity check
@@ -4,8 +4,8 @@ import makeLegalIdentifier from './makeLegalIdentifier'; | |||
|
|||
export type Indent = string | null | undefined; | |||
|
|||
function stringify(obj: unknown): string { | |||
return (JSON.stringify(obj) || 'undefined').replace( | |||
function stringify(val: boolean | number | string): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this change necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because rest types (undefined
object
symbol
bigint
) already and should be handled in serialize
, I think this will make the code more strong.
if it's not necessary, this change could be reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted this change for CI undue error.
Looks like there are some failures caused by these changes in CI. Please have a look |
Closing as abandoned. The error is visible here: https://github.com/rollup/plugins/runs/5281573593?check_suite_focus=true#step:7:241. If you get around to cleaning that up, please update your fork and give us a ping. |
@shellscape Oh, sorry, I missed. The typo error has been corrected. |
Thanks for updating it! |
Looks like there is a failing test to take a look at. |
@shellscape Thanks for your careful guidance |
Rollup Plugin Name:
pluginutils
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
bigint
undefined
bigint
Symbol.for()
undefined
Symbol.for()