Package Exports
- array-semantic-join
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (array-semantic-join) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
array-semantic-join by Kontentino
Helper function whose input is an array and output is a semantic string with joined items of the input array.
Installation
$ npm install array-semantic-join
or
$ yarn add array-semantic-join
Usage
import arraySemanticJoin from 'array-semantic-join';
...
const userNames = ['John', 'Jane', 'Patrick'];
...
<span>
{arraySemanticJoin(userNames)} // output: "John, Jane and Patrick"
</span>
<span>
{arraySemanticJoin(userNames, { word: 'a' } )} // output: "John, Jane a Patrick"
</span>
<span>
{arraySemanticJoin(userNames, { word: 'und' } )} // output: "John, Jane und Patrick"
</span>
...Docs
| Function |
|---|
| arraySemanticJoin(inputArray: Array, options?: { word: String }): String |