File: functions.return.each.styl

package info (click to toggle)
node-stylus 0.54.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 5,392 kB
  • ctags: 913
  • sloc: makefile: 38
file content (23 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

join1(delim, vals)
  buf = ''
  for val, i in vals
    if i
      buf += delim + val
    else
      buf += val

join2(delim, vals)
  buf = ''
  for val, i in vals
    buf += i ? delim + val : val

body
  foo join1(' ', 1 2 3)
  foo join1(', ', 1 2 3)
  foo join1(',', 1 2 3)

body
  foo join2(' ', 1 2 3)
  foo join2(', ', 1 2 3)
  foo join2(',', 1 2 3)