mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
fix: Add CLI flag reference to JSDoc, improve initComptime warning
- Add "Equivalent to the CLI --feature flag" to bun.d.ts JSDoc - Improve initComptime doc comment warning about undefined behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2
packages/bun-types/bun.d.ts
vendored
2
packages/bun-types/bun.d.ts
vendored
@@ -1897,6 +1897,8 @@ declare module "bun" {
|
||||
* When `feature("FLAG_NAME")` is called, it returns `true` if FLAG_NAME is in this array,
|
||||
* or `false` otherwise. This enables static dead-code elimination at bundle time.
|
||||
*
|
||||
* Equivalent to the CLI `--feature` flag.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* await Bun.build({
|
||||
|
||||
@@ -1623,8 +1623,8 @@ pub const StringSet = struct {
|
||||
}
|
||||
|
||||
/// Initialize an empty StringSet at comptime (for use as a static constant).
|
||||
/// WARNING: The resulting set has an undefined allocator and must not be mutated.
|
||||
/// Do not call insert(), clone(), or any method that allocates on a comptime-initialized set.
|
||||
/// WARNING: The resulting set must not be mutated. Any attempt to call insert(),
|
||||
/// clone(), or other allocating methods will result in undefined behavior.
|
||||
pub fn initComptime() StringSet {
|
||||
return StringSet{
|
||||
.map = Map.initContext(undefined, .{}),
|
||||
|
||||
Reference in New Issue
Block a user