How to use the common-tags.commaListsAnd function in common-tags

To help you get started, we’ve selected a few common-tags examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / common-tags / common-tags-tests.ts View on Github external
import * as commonTags from 'common-tags';

/* Test Built-in Tags */

commonTags.commaLists `
  I like ${['apples', 'bananas', 'watermelons']}
  They're good!
`;

commonTags.commaListsAnd`
  I like ${['apples', 'bananas', 'watermelons']}
  They're good!
`;

commonTags.commaListsOr`
  I like ${['apples', 'bananas', 'watermelons']}
  They're good!
`;

let fruits = ['apple', 'orange', 'watermelon'];

commonTags.html`
  <div class="list">
    <ul>
      ${fruits.map(fruit =&gt; `<li>${fruit}</li>`)}
      ${'<li>kiwi</li>\n<li>guava</li>'}</ul></div>