Files
otto/underscore/underscore.go
Steven Hartland 8d121dcad1 feat(underscore)!: update to v1.13.6 (#470)
Update underscore.js to v1.13.6.

BREAKING CHANGE: This changes the behaviour for the following underscore
functions, please see underscore.js documentation for details.
* .template
* .keys
* .after
* .range
* .reduce
* .reduceRight
* .reduceLeft

Fixes #110
2022-11-29 00:09:10 +00:00

49 lines
1.1 KiB
Go

// Package underscore contains the source for the JavaScript utility-belt library.
//
// import (
// _ "github.com/robertkrimen/otto/underscore"
// )
//
// Every Otto runtime will now include [underscore] for more information see the [underscore docs]
//
// By importing this package, you'll automatically load underscore every time you create a new Otto runtime.
//
// To prevent this behavior, you can do the following:
//
// import (
// "github.com/robertkrimen/otto/underscore"
// )
//
// func init() {
// underscore.Disable()
// }
//
// [underscore]: http://underscorejs.org
// [underscore docs]: https://github.com/documentcloud/underscore
package underscore
import (
_ "embed"
"github.com/robertkrimen/otto/registry"
)
//go:embed underscore-min.js
var underscore string
var entry *registry.Entry = registry.Register(Source)
// Enable underscore runtime inclusion.
func Enable() {
entry.Enable()
}
// Disable underscore runtime inclusion.
func Disable() {
entry.Disable()
}
// Source returns the underscore source.
func Source() string {
return underscore
}