Mercurial > irccd
comparison doc/src/api/module/Irccd.Util/Irccd.Util.cut.md @ 614:ebdc614db066
Docs: get rid of metadata
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 17 Dec 2017 09:21:49 +0100 |
parents | bb9771fb5f44 |
children |
comparison
equal
deleted
inserted
replaced
613:0c7241258289 | 614:ebdc614db066 |
---|---|
1 --- | 1 # Function Irccd.Util.cut |
2 function: cut | 2 |
3 js: true | 3 Cut a piece of data into several lines. |
4 summary: "Cut a piece of data into several lines." | |
5 synopsis: "lines = Irccd.Util.cut(data, maxc, maxl)" | |
6 arguments: | |
7 - "**data**: a string or an array of strings," | |
8 - "**maxc**: max number of colums (Optional, default: 72)," | |
9 - "**maxl**: max number of lines (Optional, default: undefined)." | |
10 returns: "A list of strings ready to be sent or undefined if the data is too big." | |
11 throws: | |
12 - "**RangeError** if maxl or maxc are negative numbers," | |
13 - "**RangeError** if one word length was bigger than maxc," | |
14 - "**TypeError** if data is not a string or a list of strings." | |
15 --- | |
16 | 4 |
17 The argument data is a string or a list of strings. In any case, all strings | 5 The argument data is a string or a list of strings. In any case, all strings |
18 are first splitted by spaces and trimmed. This ensure that useless | 6 are first splitted by spaces and trimmed. This ensure that useless |
19 whitespaces are discarded. | 7 whitespaces are discarded. |
20 | 8 |
26 | 14 |
27 If maxl is used as a limit and the data can not fit within the bounds, | 15 If maxl is used as a limit and the data can not fit within the bounds, |
28 undefined is returned. | 16 undefined is returned. |
29 | 17 |
30 An empty list may be returned if empty strings were found. | 18 An empty list may be returned if empty strings were found. |
19 | |
20 # Synopsis | |
21 | |
22 ```javascript | |
23 lines = Irccd.Util.cut(data, maxc, maxl) | |
24 ``` | |
25 | |
26 # Arguments | |
27 | |
28 - "**data**: a string or an array of strings," | |
29 - "**maxc**: max number of colums (Optional, default: 72)," | |
30 - "**maxl**: max number of lines (Optional, default: undefined)." | |
31 | |
32 # Returns | |
33 | |
34 A list of strings ready to be sent or undefined if the data is too big. | |
35 | |
36 # Throws | |
37 | |
38 - **RangeError** if maxl or maxc are negative numbers, | |
39 - **RangeError** if one word length was bigger than maxc, | |
40 - **TypeError** if data is not a string or a list of strings. | |
41 |