package helpers

import "github.com/evanw/esbuild/internal/helpers"

Index

Functions

func HashCombine

func HashCombine(seed uint32, hash uint32) uint32

From: http://boost.sourceforge.net/doc/html/boost/hash_combine.html

func HashCombineString

func HashCombineString(seed uint32, text string) uint32

func IsInsideNodeModules

func IsInsideNodeModules(path string) bool

func MimeTypeByExtension

func MimeTypeByExtension(ext string) string

This is used instead of Go's built-in "mime.TypeByExtension" function because that function is broken on Windows: https://github.com/golang/go/issues/32350.

Types

type BitSet

type BitSet struct {
	// contains filtered or unexported fields
}

func NewBitSet

func NewBitSet(bitCount uint) BitSet

func (BitSet) Equals

func (bs BitSet) Equals(other BitSet) bool

func (BitSet) HasBit

func (bs BitSet) HasBit(bit uint) bool

func (BitSet) SetBit

func (bs BitSet) SetBit(bit uint)

func (BitSet) String

func (bs BitSet) String() string

type Joiner

type Joiner struct {
	// contains filtered or unexported fields
}

This provides an efficient way to join lots of big string and byte slices together. It avoids the cost of repeatedly reallocating as the buffer grows by measuring exactly how big the buffer should be and then allocating once. This is a measurable speedup.

func (*Joiner) AddBytes

func (j *Joiner) AddBytes(data []byte)

func (*Joiner) AddString

func (j *Joiner) AddString(data string)

func (*Joiner) Contains

func (j *Joiner) Contains(s string, b []byte) bool

func (*Joiner) Done

func (j *Joiner) Done() []byte

func (*Joiner) EnsureNewlineAtEnd

func (j *Joiner) EnsureNewlineAtEnd()

func (*Joiner) LastByte

func (j *Joiner) LastByte() byte

func (*Joiner) Length

func (j *Joiner) Length() uint32

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func (*Timer) Begin

func (t *Timer) Begin(name string)

func (*Timer) End

func (t *Timer) End(name string)

func (*Timer) Fork

func (t *Timer) Fork() *Timer

func (*Timer) Join

func (t *Timer) Join(other *Timer)

func (*Timer) Log

func (t *Timer) Log(log logger.Log)

Source Files

bitset.go hash.go joiner.go mime.go path.go timer.go

Version
v0.12.2
Published
May 25, 2021
Platform
windows/amd64
Imports
6 packages
Last checked
15 minutes ago

Tools for package owners.