Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Rich-Harris/magic-string
/ functions
Functions
330 in github.com/Rich-Harris/magic-string
⨍
Functions
330
◇
Types & classes
66
↓ 1 callers
Method
remove
* Removes the characters from `start` to `end` (of the original string, **not** the generated string). * Content appended or prepended at positions
src/MagicString.ts:899
↓ 1 callers
Function
removed
()
tests/MagicString/replace-all.test.ts:161
↓ 1 callers
Function
sliceOutcome
(fn: () => string, expected: typeof MagicStringError | typeof EditModelError)
tests/fuzz/random-edits.test.ts:138
↓ 1 callers
Function
storeNames
(s: MagicString)
benchmark/magic-string.bench.ts:26
↓ 1 callers
Function
throws
Whether `fn` threw `expected`; any other error is a crash and propagates
tests/fuzz/random-edits.test.ts:126
↓ 1 callers
Method
toString
()
benchmark/data.js:149
↓ 1 callers
Method
toString
()
benchmark/data-min.js:127
↓ 1 callers
Method
toString
()
benchmark/data-min.js:569
↓ 1 callers
Method
toString
* Returns the intro followed by every source's generated string, joined by their separators.
src/Bundle.ts:428
↓ 1 callers
Method
toString
()
src/Chunk.ts:151
↓ 1 callers
Method
toUrl
()
benchmark/data-min.js:130
↓ 1 callers
Method
toUrl
* Returns a DataURI containing the sourcemap. Useful for doing this sort of thing: * `generateMap(options?: SourceMapOptions): SourceMap;`
src/SourceMap.ts:133
↓ 1 callers
Method
trim
(charType)
benchmark/data.js:733
↓ 1 callers
Method
trim
(t)
benchmark/data-min.js:819
↓ 1 callers
Method
trimEnd
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the end.
src/Bundle.ts:511
↓ 1 callers
Method
trimStart
(rx)
benchmark/data.js:115
↓ 1 callers
Method
trimStart
(charType)
benchmark/data.js:780
↓ 1 callers
Method
trimStart
(charType)
benchmark/data.js:1028
↓ 1 callers
Method
trimStart
(t)
benchmark/data-min.js:100
↓ 1 callers
Method
trimStart
(t)
benchmark/data-min.js:643
↓ 1 callers
Method
trimStart
(t)
benchmark/data-min.js:822
↓ 1 callers
Method
trimStart
* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start.
src/Bundle.ts:482
↓ 1 callers
Method
update
* Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. * * The fourth argument is optional
src/MagicString.ts:754
↓ 1 callers
Function
w
()
benchmark/data-min.js:112
↓ 1 callers
Function
writeVlq
(pos: number, num: number)
src/utils/MappingsEncoder.ts:26
Method
addSourcemapLocation
* Adds the specified character index (with respect to the original string) to sourcemap mappings, if `hires` is false.
src/MagicString.ts:199
Method
append
(content)
benchmark/data.js:301
Method
append
(str, options)
benchmark/data.js:873
Method
append
(t)
benchmark/data-min.js:252
Method
append
(t, e)
benchmark/data-min.js:711
Method
append
* Appends the specified content to the end of the string.
src/MagicString.ts:206
Method
appendLeft
(content: string)
src/Chunk.ts:37
Method
appendRight
(index, content)
benchmark/data.js:317
Method
appendRight
(t, e)
benchmark/data-min.js:262
Method
appendRight
(content: string)
src/Chunk.ts:41
Method
clone
()
benchmark/data.js:880
Method
clone
()
benchmark/data-min.js:714
Method
constructor
(arg)
benchmark/data.js:3
Method
constructor
(start, end, content)
benchmark/data.js:14
Method
constructor
(properties)
benchmark/data.js:141
Method
constructor
(hires)
benchmark/data.js:214
Method
constructor
(string, options = {})
benchmark/data.js:278
Method
constructor
(options = {})
benchmark/data.js:833
Method
constructor
(t)
benchmark/data-min.js:3
Method
constructor
(t, e, n)
benchmark/data-min.js:14
Method
constructor
(t)
benchmark/data-min.js:119
Method
constructor
(t)
benchmark/data-min.js:179
Method
constructor
(t, e = {})
benchmark/data-min.js:229
Method
constructor
(t = {})
benchmark/data-min.js:676
Method
constructor
(properties: DecodedSourceMap | (Omit<DecodedSourceMap, 'mappings'> & { mappings: string }))
src/SourceMap.ts:95
Method
constructor
(options: BundleOptions = {})
src/Bundle.ts:73
Method
constructor
* Wraps `string` for editing; every index passed to the editing methods refers to this original string.
src/MagicString.ts:173
Method
constructor
(arg?: BitSet)
src/BitSet.ts:4
Method
constructor
(start: number, end: number, content: string)
src/Chunk.ts:19
Method
constructor
(message: string, options?: ErrorOptions)
src/MagicStringError.ts:10
Method
constructor
(hires: SourceMapOptions['hires'], encoder: MappingsEncoder | null = null)
src/utils/Mappings.ts:27
Method
constructor
()
src/utils/MappingsEncoder.ts:54
Method
constructor
(original: string)
tests/fuzz/edit-model.ts:23
Method
eachPrevious
(fn)
benchmark/data.js:53
Method
eachPrevious
(t)
benchmark/data-min.js:52
Method
generateDecodedMap
* Generates a sourcemap object with raw mappings in array form, rather than encoded as a string. * Useful if you need to manipulate the sourcemap f
src/MagicString.ts:328
Method
generateMap
(options)
benchmark/data.js:385
Method
generateMap
(options)
benchmark/data.js:956
Method
generateMap
(t)
benchmark/data-min.js:760
Method
generateMap
* Generates a version 3 sourcemap.
src/MagicString.ts:344
Method
getIndentString
()
benchmark/data.js:388
Method
getIndentString
()
benchmark/data-min.js:315
Method
getIndentString
* Returns the indentation string guessed from the original content, falling back to a single tab character. * This is the value `s.indent()` uses w
src/MagicString.ts:395
Method
getReplacement
(match, str)
benchmark/data.js:788
Method
getReplacement
(match: RegExpMatchArray, index: number, str: string)
src/MagicString.ts:1432
Method
hasChanged
* Indicates if the string has been changed.
src/MagicString.ts:1354
Method
i
(r, s)
benchmark/data-min.js:657
Function
includeContent
(source)
tests/Bundle/generate-map.test.ts:659
Method
indent
(indentStr, options)
benchmark/data.js:391
Method
indent
(indentStr)
benchmark/data.js:973
Method
indent
(t)
benchmark/data-min.js:773
Method
indent
(indentStr?: string | IndentOptions, options?: IndentOptions)
src/MagicString.ts:413
Method
indentAt
(index: number)
src/MagicString.ts:469
Method
indentPiece
(str: string)
src/MagicString.ts:451
Method
insert
()
benchmark/data.js:455
Method
insert
@internal
src/MagicString.ts:560
Method
insertLeft
(index, content)
benchmark/data.js:460
Method
insertLeft
@internal
src/MagicString.ts:565
Method
insertRight
(index, content)
benchmark/data.js:469
Method
insertRight
@internal
src/MagicString.ts:577
Method
isEmpty
()
benchmark/data.js:1011
Method
isEmpty
()
benchmark/data-min.js:807
Method
isEmpty
* Returns true if the bundle's output is empty (disregarding white space).
src/Bundle.ts:443
Method
isEmpty
* Returns true if the resulting source is empty (disregarding white space).
src/MagicString.ts:1213
Method
lastLine
()
benchmark/data.js:609
Method
lastLine
* Returns everything after the last newline in the generated string, or the whole string if there is no newline.
src/MagicString.ts:990
Method
length
()
benchmark/data.js:1016
Method
length
()
benchmark/data-min.js:813
Method
length
* Returns the length of the bundle's output; unlike `MagicString#length`, this equals `bundle.toString().length`.
src/Bundle.ts:458
Method
length
* Returns the length of the generated string, counting only content attached to the original characters. * Content outside the string body (`s.prep
src/MagicString.ts:1238
Method
move
(start, end, index)
benchmark/data.js:478
Method
move
* Moves the characters from `start` and `end` to `index`. * * `affinity` controls where the range is anchored at `index`. With the * default
src/MagicString.ts:597
Method
n
(r, s)
benchmark/data-min.js:650
Method
prepend
(content)
benchmark/data.js:554
Method
prepend
(str)
benchmark/data.js:997
← previous
next →
201–300 of 330, ranked by callers