You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use uppercase acronyms in template functions (#98)
## Description
See discussions in
- #84
## Changes
The functions are now using uppercase acronym, old ones are aliased, but
marked as deprecated.
## Fixes#84
## Checklist
- [X] I have read the **CONTRIBUTING.md** document.
- [X] My code follows the code style of this project.
- [ ] I have added tests to cover my changes.
- [X] All new and existing tests passed.
- [X] I have updated the documentation accordingly.
- [X] This change requires a change to the documentation on the website.
## Additional Information
<!-- Any additional information regarding this pull request. -->
---------
Co-authored-by: Atomys <[email protected]>
The function converts a Go data structure into a JSON string, allowing the data to be easily serialized for storage, transmission, or further processing.
The function converts a Go data structure into a pretty-printed JSON string, formatting the output with indentation and line breaks for better readability.
The function serializes a Go data structure into a YAML string, converting the data into a format suitable for YAML representation. In addition to toYaml, toIndentYaml takes a parameter to define the indentation width in spaces.
176
+
The function serializes a Go data structure into a YAML string, converting the data into a format suitable for YAML representation. In addition to toYAML, toIndentYAML takes a parameter to define the indentation width in spaces.
177
177
178
-
<tabledata-header-hidden><thead><tr><thwidth="164">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go">ToIndentYAML(indent int, v any) (string, error)
178
+
<tabledata-header-hidden><thead><tr><thwidth="164">Name</th><th>Value</th></tr></thead><tbody><tr><td>Signature</td><td><preclass="language-go"><codeclass="lang-go">toIndentYAML(indent int, v any) (string, error)
Copy file name to clipboardexpand all lines: docs/roadmap-to-sprout-v1.0.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -103,4 +103,4 @@ This page will be updated each time function are re-implemented correctly in Spr
103
103
104
104
A list of functions wanted for v1 based on issues, pull requests from sprig, feedback on sprout. All functions listed here will be implemented for the v1.
105
105
106
-
<table><thead><tr><th width="94" data-type="checkbox">DONE</th><th>Functions</th><th>Description</th></tr></thead><tbody><tr><td>true</td><td><code>toYaml</code></td><td>Convert a struct to a YAML String</td></tr><tr><td>true</td><td><code>fromYaml</code></td><td>Convert YAML String to a struct</td></tr><tr><td>true</td><td><code>toBool</code></td><td>Convert any to a boolean</td></tr><tr><td>true</td><td><code>toDuration</code></td><td>Convert any to a <code>time.Duration</code></td></tr><tr><td>true</td><td><code>default</code>,<code>empty</code>,<code>coalesce</code></td><td>Don't trigger default go value as false</td></tr><tr><td>true</td><td><code>dig</code></td><td>Dig into a map without crashes in format <code>book.author.name</code></td></tr><tr><td>true</td><td><code>sha512sum</code></td><td>Support of SHA512</td></tr><tr><td>true</td><td><code>md5sum</code></td><td>Support of md5 hash</td></tr><tr><td>true</td><td><code>hasField</code></td><td>Detect if a field are present in an object using reflect. <a href="https://github.com/Masterminds/sprig/issues/401">Source</a></td></tr><tr><td>true</td><td><code>toDuration</code></td><td>convert a value to a <code>time.Duration</code></td></tr><tr><td>true</td><td><code>toCamelCase</code>, <code>toPascalCase</code>, <code>toKebakCase</code>, <code>toDotCase</code>, <code>topathCase</code>, <code>toConstantCase</code>,<code>toSnakeCase</code>,<code>toTitleCase</code></td><td>A batch of functions to change casing of a string to aby casing you want.</td></tr><tr><td>true</td><td><code>capitalize</code>, <code>uncapitalize</code></td><td>Capitalize / Uncapitalize a string (Upper/lower only the first character)</td></tr><tr><td>true</td><td><code>flatten</code></td><td>Flatten nested list be one level</td></tr><tr><td>true</td><td><code>regexpFindSubmatch</code>, <code>regexpAllSubmatches</code>,<code>regexpFindNamedSubmatch</code>, <code>regexpAllNamedSubmatches</code></td><td>Collection of function to found and retrieve submatches and named submatches</td></tr><tr><td>true</td><td><code>cidr</code>, <code>ip</code>, <code>mac</code></td><td>A collection of functions for network ip manipulation</td></tr><tr><td>true</td><td><code>toLocalDate</code></td><td>Convert to a <code>time.Time</code> with a timezone support</td></tr></tbody></table>
106
+
<table><thead><tr><th width="94" data-type="checkbox">DONE</th><th>Functions</th><th>Description</th></tr></thead><tbody><tr><td>true</td><td><code>toYAML</code></td><td>Convert a struct to a YAML String</td></tr><tr><td>true</td><td><code>fromYAML</code></td><td>Convert YAML String to a struct</td></tr><tr><td>true</td><td><code>toBool</code></td><td>Convert any to a boolean</td></tr><tr><td>true</td><td><code>toDuration</code></td><td>Convert any to a <code>time.Duration</code></td></tr><tr><td>true</td><td><code>default</code>,<code>empty</code>,<code>coalesce</code></td><td>Don't trigger default go value as false</td></tr><tr><td>true</td><td><code>dig</code></td><td>Dig into a map without crashes in format <code>book.author.name</code></td></tr><tr><td>true</td><td><code>sha512sum</code></td><td>Support of SHA512</td></tr><tr><td>true</td><td><code>md5sum</code></td><td>Support of md5 hash</td></tr><tr><td>true</td><td><code>hasField</code></td><td>Detect if a field are present in an object using reflect. <a href="https://github.com/Masterminds/sprig/issues/401">Source</a></td></tr><tr><td>true</td><td><code>toDuration</code></td><td>convert a value to a <code>time.Duration</code></td></tr><tr><td>true</td><td><code>toCamelCase</code>, <code>toPascalCase</code>, <code>toKebakCase</code>, <code>toDotCase</code>, <code>topathCase</code>, <code>toConstantCase</code>,<code>toSnakeCase</code>,<code>toTitleCase</code></td><td>A batch of functions to change casing of a string to aby casing you want.</td></tr><tr><td>true</td><td><code>capitalize</code>, <code>uncapitalize</code></td><td>Capitalize / Uncapitalize a string (Upper/lower only the first character)</td></tr><tr><td>true</td><td><code>flatten</code></td><td>Flatten nested list be one level</td></tr><tr><td>true</td><td><code>regexpFindSubmatch</code>, <code>regexpAllSubmatches</code>,<code>regexpFindNamedSubmatch</code>, <code>regexpAllNamedSubmatches</code></td><td>Collection of function to found and retrieve submatches and named submatches</td></tr><tr><td>true</td><td><code>cidr</code>, <code>ip</code>, <code>mac</code></td><td>A collection of functions for network ip manipulation</td></tr><tr><td>true</td><td><code>toLocalDate</code></td><td>Convert to a <code>time.Time</code> with a timezone support</td></tr></tbody></table>
0 commit comments