Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
add docs - helper function: index and len (#156)
Browse files Browse the repository at this point in the history
* typo update

* Add note to mention mandatory and optional fields

* misc update

* Update nuclei.md

fixed a small typo

* update docs helperfunction: index and len

---------

Co-authored-by: Sandeep Singh <[email protected]>
Co-authored-by: sandeep <[email protected]>
Co-authored-by: shubhamrasal <[email protected]>
Co-authored-by: Pj Metz <[email protected]>
  • Loading branch information
5 people authored Jul 21, 2023
1 parent 0d3d60d commit 58b4ebb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/templating-guide/helper-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ Here is the list of all supported helper functions can be used in the RAW reques
| hmac(algorithm, data, secret) string | hmac function that accepts a hashing function type with data and secret | `hmac("sha1", "test", "scrt")` | `8856b111056d946d5c6c92a21b43c233596623c6` |
| html_escape(input interface{}) string | HTML escapes the given input | `html_escape("<body>test</body>")` | `&lt;body&gt;test&lt;/body&gt;` |
| html_unescape(input interface{}) string | HTML un-escapes the given input | `html_unescape("&lt;body&gt;test&lt;/body&gt;")` | `<body>test</body>` |
| index(stringOrSlice any, index int) string | receive string or []string return the string of the index | 1.`index(split("www.example.com", "."), 1)` </br> 2.`index("www.example.com",1)` | 1.`example` </br> </br> </br> </br> 2.`w` |
| join(separator string, elements ...interface{}) string | Joins the given elements using the specified separator | `join("_", 123, "hello", "world")` | `123_hello_world` |
| json_minify(json) string | Minifies a JSON string by removing unnecessary whitespace | `json_minify("{ \"name\": \"John Doe\", \"foo\": \"bar\" }")` | `{"foo":"bar","name":"John Doe"}` |
| json_prettify(json) string | Prettifies a JSON string by adding indentation | `json_prettify("{\"foo\":\"bar\",\"name\":\"John Doe\"}")` | `{\n \"foo\": \"bar\",\n \"name\": \"John Doe\"\n}` |
| len(arg interface{}) int | Returns the length of the input | `len("Hello")` | `5` |
| len(arg interface{}) int | Returns the length of the input | 1.`len("Hello") ` </br> 2. `len(split("www.example.com","."))` | 1. `5` </br> </br> 2. `3` |
| line_ends_with(str string, suffix ...string) bool | Checks if any line of the string ends with any of the provided substrings | `line_ends_with("Hello\nHi", "lo")` | `true` |
| line_starts_with(str string, prefix ...string) bool | Checks if any line of the string starts with any of the provided substrings | `line_starts_with("Hi\nHello", "He")` | `true` |
| md5(input interface{}) string | Calculates the MD5 (Message Digest) hash of the input | `md5("Hello")` | `8b1a9953c4611296a827abf8c47804d7` |
Expand Down

0 comments on commit 58b4ebb

Please sign in to comment.