This repository was archived by the owner on Jul 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +125
-1
lines changed
Expand file tree Collapse file tree 4 files changed +125
-1
lines changed Original file line number Diff line number Diff line change 2727
2828.PHONY : push
2929push :
30- hippofactory -s ${BINDLE_SERVER_URL} .
30+ hippofactory -s ${BINDLE_SERVER_URL} .
31+
32+ doc : lib/* .gr
33+ grain doc lib/env.gr -o lib/env.md
34+ grain doc lib/mediatype.gr -o lib/mediatype.md
35+ grain doc lib/stringutil.gr -o lib/stringutil.md
Original file line number Diff line number Diff line change 1+ ### Env.** splitEnvVar**
2+
3+ ``` grain
4+ splitEnvVar : String -> (String, String)
5+ ```
6+
7+ Split an environment variable at the first equals sign.
8+
9+ Parameters:
10+
11+ | param| type| description|
12+ | -----| ----| -----------|
13+ | ` item ` | ` String ` | An environment variable pair, separated by an equals sign (=).|
14+
15+ Returns:
16+
17+ | type| description|
18+ | ----| -----------|
19+ | ` (String, String) ` | A tuple key/value pair.|
20+
21+ ### Env.** envMap**
22+
23+ ``` grain
24+ envMap : () -> Map.Map<a, b>
25+ ```
26+
27+ Get the environment variables as a Map<String, String>
28+
29+ Returns:
30+
31+ | type| description|
32+ | ----| -----------|
33+ | ` Map.Map<a, b> ` | A map of all environment variables.|
34+
Original file line number Diff line number Diff line change 1+ ### Mediatype.** default_mt**
2+
3+ ``` grain
4+ default_mt : String
5+ ```
6+
7+ ### Mediatype.** guess**
8+
9+ ``` grain
10+ guess : String -> String
11+ ```
12+
13+ Guess the media type of this file
14+
15+ Per recommendation, if no media type is found for an extension,
16+ this returns ` application/octet-stream ` .
17+
18+ Parameters:
19+
20+ | param| type| description|
21+ | -----| ----| -----------|
22+ | ` filename ` | ` String ` | The name of the file|
23+
24+ Returns:
25+
26+ | type| description|
27+ | ----| -----------|
28+ | ` String ` | A media type|
29+
Original file line number Diff line number Diff line change 1+ ### Stringutil.** reverse**
2+
3+ ``` grain
4+ reverse : String -> String
5+ ```
6+
7+ Return a String that is the reverse of the given String.
8+
9+ Parameters:
10+
11+ | param| type| description|
12+ | -----| ----| -----------|
13+ | ` str ` | ` String ` | The string to reverse.|
14+
15+ Returns:
16+
17+ | type| description|
18+ | ----| -----------|
19+ | ` String ` | A reversed version of the given string|
20+
21+ ### Stringutil.** lastIndexOf**
22+
23+ ``` grain
24+ lastIndexOf : (String, String) -> Option<Number>
25+ ```
26+
27+ Get the index of the last appearance of needle in the haystack.
28+
29+ For a multi-character needle, this will return the end of that sequence,
30+ not the beginning (as indexOf does).
31+
32+ Parameters:
33+
34+ | param| type| description|
35+ | -----| ----| -----------|
36+ | ` needle ` | ` String ` | The string to search for|
37+ | ` haystack ` | ` String ` | The string to be searched|
38+
39+ Returns:
40+
41+ | type| description|
42+ | ----| -----------|
43+ | ` Option<Number> ` | The offset, if found, or a number|
44+
45+ ### Stringutil.** afterLast**
46+
47+ ``` grain
48+ afterLast : (String, String) -> String
49+ ```
50+
51+ ### Stringutil.** beforeLast**
52+
53+ ``` grain
54+ beforeLast : (String, String) -> String
55+ ```
56+
You can’t perform that action at this time.
0 commit comments