
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
-- import "vimagination.zapto.org/tsserver"
Package tsserver implements a simple wrapper around fs.FS to intercept calls to open Javascript files, and instead open their Typescript equivalents and generate the Javascript, commenting out any typescipt parts.
fs.FS implementation.package main
import (
"fmt"
"io"
"io/fs"
"os"
"strings"
"time"
"vimagination.zapto.org/tsserver"
)
type memFS map[string]string
func (m memFS) Open(path string) (fs.File, error) {
if str, ok := m[path]; ok {
return &memFile{
name: path,
Reader: strings.NewReader(str),
size: len(str),
}, nil
}
return nil, fs.ErrNotExist
}
type memFile struct {
name string
*strings.Reader
size int
}
func (m *memFile) Stat() (fs.FileInfo, error) { return m, nil }
func (m *memFile) Close() error { return nil }
func (m *memFile) Name() string { return m.name }
func (m *memFile) Size() int64 { return int64(m.size) }
func (m *memFile) Mode() fs.FileMode { return fs.ModePerm }
func (m *memFile) ModTime() time.Time { return time.Now() }
func (m *memFile) IsDir() bool { return false }
func (m *memFile) Sys() any { return m }
func main() {
files := tsserver.WrapFS(memFS{
"main.ts": "function hello(name: string) {console.log('Hello ' + name);}\n\nhello('Bob');",
})
file, err := files.Open("main.js")
if err != nil {
fmt.Println(err)
return
}
defer file.Close()
io.Copy(os.Stdout, file)
// Output:
// function hello(name/*: string*/) {console.log('Hello ' + name);}
//
// hello('Bob');
}
Full API docs can be found at:
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.