FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScript/archive/code/node_modules/escape-goat/index.d.ts at main · iu5git/JavaScript · GitHub
iu5git
/
JavaScript
Public
Notifications
You must be signed in to change notification settings
Fork
21
Star
52
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScript
/
archive
/
code
/
node_modules
/
escape-goat
/
index.d.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
62 lines (46 loc) · 1.7 KB
Breadcrumbs
JavaScript
/
archive
/
code
/
node_modules
/
escape-goat
/
index.d.ts
Copy path
File metadata and controls
executable file
·
62 lines (46 loc) · 1.7 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
Escape a string for use in HTML.
Escapes the following characters in the given `string` argument: `&` `<` `>` `"` `'`.
@example
```
import {htmlEscape} from 'escape-goat';
htmlEscape('🦄 & 🐐');
//=> '🦄 & 🐐'
htmlEscape('Hello <em>World</em>');
//=> 'Hello <em>World</em>'
```
*/
export
function
htmlEscape
(
string
:
string
)
:
string
;
/**
Unescape an HTML string to use as a plain string.
Unescapes the following HTML entities in the given `htmlString` argument: `&` `<` `>` `"` `'`.
@example
```
import {htmlUnescape} from 'escape-goat';
htmlUnescape('🦄 & 🐐');
//=> '🦄 & 🐐'
```
*/
export
function
htmlUnescape
(
htmlString
:
string
)
:
string
;
/**
[Tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that escapes interpolated values.
@example
```
import {htmlEscapeTag} from 'escape-goat';
const url = 'https://sindresorhus.com?x="🦄"';
htmlEscapeTag`<a href="${url}">Unicorn</a>`;
//=> '<a href="https://sindresorhus.com?x="🦄"">Unicorn</a>'
```
*/
export
function
htmlEscapeTag
(
template
:
TemplateStringsArray
,
...
substitutions
:
readonly
unknown
[
]
)
:
string
;
/**
[Tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that unescapes interpolated values.
@example
```
import {htmlUnescapeTag} from 'escape-goat';
const escapedUrl = 'https://sindresorhus.com?x="🦄"';
htmlUnescapeTag`URL from HTML: ${url}`;
//=> 'URL from HTML: https://sindresorhus.com?x="🦄"'
```
*/
export
function
htmlUnescapeTag
(
template
:
TemplateStringsArray
,
...
substitutions
:
readonly
unknown
[
]
)
:
string
;
Back
|
FazBrowse Home
|
New Git URL