UNPKG

482 BJavaScriptView Raw
1var utils = require('../utils')
2 , nodes = require('../nodes');
3
4/**
5 * Return the separator of the given `list`.
6 *
7 * Examples:
8 *
9 * list1 = a b c
10 * list-separator(list1)
11 * // => ' '
12 *
13 * list2 = a, b, c
14 * list-separator(list2)
15 * // => ','
16 *
17 * @param {Experssion} list
18 * @return {String}
19 * @api public
20 */
21
22(module.exports = function listSeparator(list){
23 list = utils.unwrap(list);
24 return new nodes.String(list.isList ? ',' : ' ');
25}).raw = true;