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

Hierarchies with unmatched settings terminate early #53

Open
MikeTschudi opened this issue Oct 20, 2020 · 0 comments
Open

Hierarchies with unmatched settings terminate early #53

MikeTschudi opened this issue Oct 20, 2020 · 0 comments

Comments

@MikeTschudi
Copy link
Member

When hierarchies are present and a match fails, processing terminates. E.g., in

  let template = {
    msg: '{{organization.name||My Community}}<br />{{organization.nonexistantproperty.sharedTheme.logo.small||https://www.arcgis.com/sharing/rest/content/items/28989a5ecc2d4b2fbf62ac0f5075b7ff/data}}<br />{{organization.name||My Community}}',
  }

  var settings = {
    organization: {
      name: "myOrg"
    }
  };

  let result = adlib(template, settings)

  t.plan(1);
  t.equal(result.msg, 'myOrg<br />https://www.arcgis.com/sharing/rest/content/items/28989a5ecc2d4b2fbf62ac0f5075b7ff/data<br />myOrg');
  t.end();

adlib produces

myOrg<br />https://www.arcgis.com/sharing/rest/content/items/28989a5ecc2d4b2fbf62ac0f5075b7ff/data<br />organization.name

--only the first organization.name is replaced.

If the defaults are removed,

myOrg<br />{{organization.nonexistantproperty.sharedTheme.logo.small}}<br />myOrg

is produced as expected.

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

No branches or pull requests

1 participant