Skip to content
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

Added support for non-NaNish base 16 numbers in jsonpath #328

Merged
merged 4 commits into from Feb 21, 2017

Conversation

jonerer
Copy link
Contributor

@jonerer jonerer commented Feb 16, 2017

This is related to #327

@yasserf
Copy link
Contributor

yasserf commented Feb 16, 2017

Hey, awesome thank you! Would you mind also signing our CLA? https://deepstream.io/info/community/cla/

expect( record[ 0 ] ).toBe( undefined );
expect( record[ pathName] ).toBe( 'value' );
expect( jsonPath.get( record, pathName )).toBe( 'value' );
expect( record[ pathName ]).toBe( 'value' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe adjust the tabs here :)

@@ -124,6 +124,6 @@ function tokenize( path ) {
}

return cache[ path ] = parts.map( function( part ) {
return !isNaN( part ) ? parseInt( part, 10 ) : part;
return part;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe do

return cache[ path ] = parts.slice(0);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm actually, parts is created just a few lines above it, and isn't sent anywhere. So I guess I don't even need to copy it. I'll just cache[ path ] = parts

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm actually, parts is created just a few lines above it, and isn't sent anywhere. So I guess I don't even need to copy it. I'll just cache[ path ] = parts

Even better :)

@@ -137,6 +137,16 @@ describe( 'objects are created from paths and their value is set correctly', fun
});
});

it( 'even when the path is not NaNish and could be interpreted as a base 16 number', function() {
var record = {};
let pathName = '0x02335';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let fails build ( we can put a use strict at the top since this just tests though if you want )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I changed to "var". Thanks!

@yasserf yasserf merged commit 8f64cb3 into deepstreamIO:master Feb 21, 2017
@yasserf
Copy link
Contributor

yasserf commented Feb 21, 2017

Great thanks!

@ralphtheninja
Copy link
Contributor

@yasserf How often do you release versions? We could really use an updated version of the client lib. I'm not sure what to bump here, maybe it should be npm version major since this PR affects the key format.

@yasserf
Copy link
Contributor

yasserf commented Feb 22, 2017

Hey @ralphtheninja, can do a quick release with that. Don't think this should be a major though, otherwise we will need to postpone it till 3.0 which is not due for a while.

@ralphtheninja
Copy link
Contributor

Hey @ralphtheninja, can do a quick release with that. Don't think this should be a major though, otherwise we will need to postpone it till 3.0 which is not due for a while.

Check! A patch can be fine too. It depends on how you look at the change, since you could consider this a bug fix :)

@yasserf
Copy link
Contributor

yasserf commented Feb 22, 2017

awesome, will plan a release to coincide with deepstream.io asap, just pending changelogs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants