repositorypackage
0.0.0-20221111215449-858d54b1a760
Repository: https://github.com/frantjc/go-js.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# README
go-js
Deprecated in favor of go-fn
which removes JavaScript specific stuff that doesn't work as nicely in Go without optional paramter handling.
Go module for functions that mimic useful JavaScript functions using Go 1.18's Generics
Install
go get github.com/frantjc/go-js
Usage
See examples.
import (
"fmt"
"github.com/frantjc/go-js"
)
// ...
array := []int{1, 2, 3, 4}
mappable := js.MappableArray[int, string](array)
some := mappable.Map(func(a, _ int, _ []int) string {
return fmt.Sprint(a)
}).Some(func(b string, _ int, _ []string) bool {
return b == "1"
})
fmt.Println(some)
// true
// ...