mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 19:55:26 +00:00
* use parsed options while signing * update project layout to v3 * fix .gitignore * remove example template * misc updates * bump tlsx version * hide template sig warning with env * js: retain value while using log * fix nil pointer derefernce * misc doc update --------- Co-authored-by: sandeep <8293321+ehsandeep@users.noreply.github.com>
17 lines
469 B
Go
17 lines
469 B
Go
package generators
|
|
|
|
import stringsutil "github.com/projectdiscovery/utils/strings"
|
|
|
|
// SliceToMap converts a slice of strings to map of string splitting each item at sep as "key sep value"
|
|
func SliceToMap(s []string, sep string) map[string]interface{} {
|
|
m := make(map[string]interface{})
|
|
for _, sliceItem := range s {
|
|
key, _ := stringsutil.Before(sliceItem, sep)
|
|
value, _ := stringsutil.After(sliceItem, sep)
|
|
if key != "" {
|
|
m[key] = value
|
|
}
|
|
}
|
|
return m
|
|
}
|