Skip to content

Commit ef64636

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 ef64636

File tree

1 file changed

+77
-42
lines changed

1 file changed

+77
-42
lines changed

Diff for: pkg/templates/sprig_wrapper.go

+77-42
Original file line numberDiff line numberDiff line change
@@ -11,69 +11,104 @@ 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+
37+
// STRING LIST
38+
"concat",
39+
"join",
40+
"split",
41+
"splitn",
42+
43+
// INTEGER MATH
44+
"add",
45+
"div",
46+
"mul",
47+
"round",
48+
"sub",
49+
50+
// INTEGER SLICE
7451
"until",
7552
"untilStep",
76-
"upper",
53+
54+
// FLOAT MATH
55+
// --
56+
57+
// DATE
58+
"date",
59+
"mustToDate",
60+
"now",
61+
"toDate",
62+
63+
// DEFAULTS
64+
"default",
65+
"empty",
66+
"fromJson",
67+
"mustFromJson",
68+
"mustToRawJson",
69+
"ternary",
70+
"toRawJson",
71+
72+
// ENCODING
73+
// "b64enc" -- Implemented locally
74+
// "b64dec" -- Implemented locally
75+
76+
// LISTS AND LIST
77+
"append",
78+
"has",
79+
"list",
80+
"mustAppend",
81+
"mustHas",
82+
"mustPrepend",
83+
"prepend",
84+
"mustSlice",
85+
"slice",
86+
87+
// DICTIONARIES AND DICT
88+
"dict",
89+
"dig",
90+
"get",
91+
"hasKey",
92+
"merge",
93+
"mustMerge",
94+
"set",
95+
"unset",
96+
97+
// TYPE CONVERSION
98+
// "atoi" -- Implemented locally
99+
100+
// PATH AND FILEPATH
101+
// --
102+
103+
// FLOW CONTROL
104+
"fail",
105+
106+
// VERSION COMPARISON
107+
"semver",
108+
"semverCompare",
109+
110+
// CRYPTOGRAPHIC AND SECURITY
111+
"htpasswd",
77112
}
78113
)
79114

0 commit comments

Comments
 (0)