-
Notifications
You must be signed in to change notification settings - Fork 21
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
Explode values after non-explodes #19
Comments
@geraintluff I am using this function now to "normalize" an RFC6570 template (which is submitted by users in an ldo, so I don't know what syntax they submit) : function normalizeLDO(ldo) {
var op = false;
var tpls = ldo.href.split('{');
if (tpls.length > 1) {
var href = ['#',ldo.href].join('');
return href.replace(/\/\{\//g,'{/').split('}{').map(function(p){
var cOp = p.substring(0,1);
if ((cOp === '.' || cOp === '/') && (!op || op === cOp)) {
op = cOp;
return [',',p.substring(1)].join('');
} else {
return (!op) ? p : ['}{',p].join('');
}
}).join('').substring(1);
}
return ldo;
} |
I'm also having problems with explodes after a list of non-explode variables. This isn't tested out in
I tested the same examples against this other implementation and it passed, but we have a bit of fairly central code that depends on this so I'm not sure whether it is more appropriate to fix here or switch over. |
Test case PR is here, but there are several open PRs with no response, so not sure how long that will take to get through. |
Hey Geraint,
given the template
{/id}{/foo*}{?rql*}
and the URI 'http://localhost/ab/foo/bar'
de-substitution produces
{ foo: [ 'ab', 'foo', 'bar' ] }
but shouldn't it be
{ id: 'ab', foo: [ 'foo', 'bar' ] }
???
The comma delimited syntax
{/id,foo*}
works but I think the above should work the same...The text was updated successfully, but these errors were encountered: