Skip to content

Commit 2f1bc28

Browse files
committed
Reorganize the Sprig list by category
Aligns the list with the Sprig doc website Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
1 parent 9d06462 commit 2f1bc28

File tree

1 file changed

+63
-42
lines changed

1 file changed

+63
-42
lines changed

Diff for: pkg/templates/sprig_wrapper.go

+63-42
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,90 @@ var (
1111
sprigFuncMap = sprig.FuncMap()
1212

1313
// exportedSprigFunctions lists all of the functions from sprig that will be exposed
14+
// ref: https://masterminds.github.io/sprig/
1415
exportedSprigFunctions = []string{
15-
"add",
16-
"append",
16+
// STRING
1717
"cat",
18-
"concat",
1918
"contains",
20-
"date",
21-
"default",
22-
"dict",
23-
"dig",
24-
"div",
25-
"empty",
26-
"fail",
27-
"fromJson",
28-
"get",
29-
"has",
30-
"hasKey",
3119
"hasPrefix",
3220
"hasSuffix",
33-
"htpasswd",
34-
"join",
35-
"list",
3621
"lower",
37-
"merge",
38-
"mul",
39-
"mustAppend",
40-
"mustFromJson",
41-
"mustHas",
42-
"mustMerge",
43-
"mustPrepend",
4422
"mustRegexFind",
4523
"mustRegexFindAll",
4624
"mustRegexMatch",
47-
"mustSlice",
48-
"mustToDate",
49-
"mustToRawJson",
50-
"now",
51-
"prepend",
5225
"quote",
5326
"regexFind",
5427
"regexFindAll",
5528
"regexMatch",
5629
"regexQuoteMeta",
5730
"replace",
58-
"round",
59-
"semver",
60-
"semverCompare",
61-
"set",
62-
"slice",
63-
"split",
64-
"splitn",
65-
"sub",
6631
"substr",
67-
"ternary",
68-
"toDate",
69-
"toRawJson",
7032
"trim",
7133
"trimAll",
7234
"trunc",
73-
"unset",
35+
"upper",
36+
// STRING LIST
37+
"concat",
38+
"join",
39+
"split",
40+
"splitn",
41+
// INTEGER MATH
42+
"add",
43+
"div",
44+
"mul",
45+
"round",
46+
"sub",
47+
// INTEGER SLICE
7448
"until",
7549
"untilStep",
76-
"upper",
50+
// FLOAT MATH
51+
// --
52+
// DATE
53+
"date",
54+
"mustToDate",
55+
"now",
56+
"toDate",
57+
// DEFAULTS
58+
"default",
59+
"empty",
60+
"fromJson",
61+
"mustFromJson",
62+
"mustToRawJson",
63+
"ternary",
64+
"toRawJson",
65+
// ENCODING
66+
// "b64enc" -- Implemented locally
67+
// "b64dec" -- Implemented locally
68+
// LISTS AND LIST
69+
"append",
70+
"has",
71+
"list",
72+
"mustAppend",
73+
"mustHas",
74+
"mustPrepend",
75+
"prepend",
76+
"mustSlice",
77+
"slice",
78+
// DICTIONARIES AND DICT
79+
"dict",
80+
"dig",
81+
"get",
82+
"hasKey",
83+
"merge",
84+
"mustMerge",
85+
"set",
86+
"unset",
87+
// TYPE CONVERSION
88+
// "atoi" -- Implemented locally
89+
// PATH AND FILEPATH
90+
// --
91+
// FLOW CONTROL
92+
"fail",
93+
// VERSION COMPARISON
94+
"semver",
95+
"semverCompare",
96+
// CRYPTOGRAPHIC AND SECURITY
97+
"htpasswd",
7798
}
7899
)
79100

0 commit comments

Comments
 (0)