Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

frantjc/go-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-js

push

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
// ...

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published