UNPKG
@nesvet/n
Version:
latest (1.2.1)
1.2.1
1.2.0
1.1.29
1.1.28
1.1.27
1.1.26
1.1.25
1.1.24
1.1.23
1.1.22
1.1.21
1.1.20
1.1.19
1.1.18
1.1.17
1.1.16
1.1.15
1.1.14
1.1.13
1.1.12
1.1.11
1.1.10
1.1.9
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.85
1.0.84
1.0.83
1.0.82
1.0.81
1.0.80
1.0.76
1.0.75
1.0.74
1.0.73
1.0.72
1.0.71
1.0.70
1.0.69
1.0.68
1.0.67
1.0.66
1.0.65
1.0.64
1.0.63
1.0.62
1.0.61
1.0.60
1.0.59
1.0.58
1.0.57
1.0.56
1.0.42
1.0.33
1.0.32
1.0.31
1.0.30
Various utilities
github.com/nesvet/n
nesvet/n
@nesvet/n
/
dist
/
indent.js
7 lines
•
260 B
JavaScript
View Raw
1
2
3
4
5
6
7
export
function
indent
(
string
, indentation =
"\t"
, times =
1
) {
if
(!
string
)
return
string
;
const
prefix = indentation.
repeat
(times);
return
string
.
split
(
"\n"
).
map
(
line
=>
`
${prefix}
${line}
`
).
join
(
"\n"
); }
//# sourceMappingURL=indent.js.map