Blame view

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