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

expansion of @id doesn't work correctly if it contains a : and starts with a number #523

Closed
ndr-brt opened this issue Jun 1, 2023 · 1 comment · Fixed by #533
Closed

Comments

@ndr-brt
Copy link
Contributor

ndr-brt commented Jun 1, 2023

The expansion seems to be buggy on version 8.2.0.
If a @id value contains a ':' and it starts with a number it gets expanded in the wrong way

How to replicate

From the node repl:

> const jsonld = require('jsonld');

> jsonld.expand({'@id': 'a3:42', '@type': 'Any'}).then(result => console.log(result))
> [ { '@id': 'a3:42', '@type': [ 'Any' ] } ] // CORRECT

> jsonld.expand({'@id': '3:42', '@type': 'Any'}).then(result => console.log(result))
> [ { '@id': '42', '@type': [ 'Any' ] } ] // WRONG
@ndr-brt ndr-brt changed the title expansion of @id doesn't work correctly if to contains a : and starts with a number expansion of @id doesn't work correctly if it contains a : and starts with a number Jun 1, 2023
@davidlehn
Copy link
Member

Thanks. Addressed in #533.

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