@@ -22,7 +22,7 @@ export const isCodePointBetween = (
2222 * A code point that exists between 0 (`0x0000` NUL)
2323 * and 127 (`0x007F` DEL).
2424 *
25- * @see https://infra.spec.whatwg.org/#ascii-byte
25+ * @see { @link https://infra.spec.whatwg.org/#ascii-byte}
2626 */
2727export const isAscii = ( v : string ) : boolean => isCodePointBetween ( v , 0x00 , 0x7F )
2828
@@ -31,7 +31,7 @@ export const isAscii = (v: string): boolean => isCodePointBetween(v, 0x00, 0x7F)
3131 * - `U+D800` HIGH SURROGATES
3232 * - `U+DFFF` LOW SURROGATES
3333 *
34- * @see https://infra.spec.whatwg.org/#surrogate
34+ * @see { @link https://infra.spec.whatwg.org/#surrogate}
3535 */
3636export const isSurrogate = ( v : string ) : boolean => {
3737 for ( const codePoint of v ) {
@@ -46,8 +46,8 @@ export const isSurrogate = (v: string): boolean => {
4646/**
4747 * A code point that is not a Unicode surrogate.
4848 *
49- * @see https://infra.spec.whatwg.org/#surrogate
50- * @see https://infra.spec.whatwg.org/#scalar-value
49+ * @see { @link https://infra.spec.whatwg.org/#surrogate}
50+ * @see { @link https://infra.spec.whatwg.org/#scalar-value}
5151 */
5252export const isScalarValue = ( v : string ) : boolean => ! isSurrogate ( v )
5353
@@ -65,40 +65,14 @@ export const isScalarValue = (v: string): boolean => !isSurrogate(v)
6565 */
6666export const isNonCharacter = ( v : string ) : boolean => {
6767 return isCodePointBetween ( v , 0xFDD0 , 0xFDEF ) ||
68+ // deno-fmt-ignore
6869 [
69- 0xFFFE ,
70- 0xFFFF ,
71- 0x1FFFE ,
72- 0x1FFFF ,
73- 0x2FFFE ,
74- 0x2FFFF ,
75- 0x3FFFE ,
76- 0x3FFFF ,
77- 0x4FFFE ,
78- 0x4FFFF ,
79- 0x5FFFE ,
80- 0x5FFFF ,
81- 0x6FFFE ,
82- 0x6FFFF ,
83- 0x7FFFE ,
84- 0x7FFFF ,
85- 0x8FFFE ,
86- 0x8FFFF ,
87- 0x9FFFE ,
88- 0x9FFFF ,
89- 0xAFFFE ,
90- 0xAFFFF ,
91- 0xBFFFE ,
92- 0xBFFFF ,
93- 0xCFFFE ,
94- 0xCFFFF ,
95- 0xDFFFE ,
96- 0xDFFFF ,
97- 0xEFFFE ,
98- 0xEFFFF ,
99- 0xFFFFE ,
100- 0xFFFFF ,
101- 0x10FFFE ,
70+ 0xFFFE , 0xFFFF , 0x1FFFE , 0x1FFFF , 0x2FFFE , 0x2FFFF ,
71+ 0x3FFFE , 0x3FFFF , 0x4FFFE , 0x4FFFF , 0x5FFFE , 0x5FFFF ,
72+ 0x6FFFE , 0x6FFFF , 0x7FFFE , 0x7FFFF , 0x8FFFE , 0x8FFFF ,
73+ 0x9FFFE , 0x9FFFF , 0xAFFFE , 0xAFFFF , 0xBFFFE , 0xBFFFF ,
74+ 0xCFFFE , 0xCFFFF , 0xDFFFE , 0xDFFFF , 0xEFFFE , 0xEFFFF ,
75+ 0xFFFFE , 0xFFFFF , 0x10FFFE ,
10276 ] . includes ( v . codePointAt ( 0 ) as number )
10377}
10478
@@ -108,7 +82,7 @@ export const isNonCharacter = (v: string): boolean => {
10882 * - `U+000A` EOL, LF, NL - End of line
10983 * - `U+000D` CR - Carriage return
11084 *
111- * @see https://infra.spec.whatwg.org/#ascii-tab-or-newline
85+ * @see { @link https://infra.spec.whatwg.org/#ascii-tab-or-newline}
11286 */
11387export const isAsciiTabOrNewline = ( v : string ) : boolean =>
11488 v === '\u{0009}' || v === '\u{000A}' || v === '\u{000D}'
@@ -117,27 +91,37 @@ export const isAsciiTabOrNewline = (v: string): boolean =>
11791 * A code point that's either an ASCII tab or newline,
11892 * `U+000C` FF Form Feed, or `U+0020` SP Space.
11993 *
120- * @see https://infra.spec.whatwg.org/#ascii-tab-or-newline
121- * @see https://infra.spec.whatwg.org/#ascii-whitespace
94+ * @see { @link https://infra.spec.whatwg.org/#ascii-tab-or-newline}
95+ * @see { @link https://infra.spec.whatwg.org/#ascii-whitespace}
12296 */
123- export const isAsciiWhitespace = ( v : string ) : boolean =>
97+ export const isAsciiWsp = ( v : string ) : boolean =>
12498 isAsciiTabOrNewline ( v ) || v === '\u{000C}' || v === '\u{0020}'
12599
100+ /**
101+ * A code point that's either an ASCII tab or newline,
102+ * `U+000C` FF Form Feed, or `U+0020` SP Space.
103+ *
104+ * @see {@link https://infra.spec.whatwg.org/#ascii-tab-or-newline }
105+ * @see {@link https://infra.spec.whatwg.org/#ascii-whitespace }
106+ * @deprecated Use `isAsciiWsp()` instead.
107+ */
108+ export const isAsciiWhitespace = ( v : string ) : boolean => isAsciiWsp ( v )
109+
126110/**
127111 * A code point inclusively between the range of:
128112 * - `U+0000` NULL
129113 * - `U+001F` INFORMATION SEPARATOR ONE
130114 *
131- * @see https://infra.spec.whatwg.org/#c0-control
115+ * @see { @link https://infra.spec.whatwg.org/#c0-control}
132116 */
133117export const isC0Control = ( v : string ) : boolean =>
134118 isCodePointBetween ( v , 0x0000 , 0x001F )
135119
136120/**
137121 * A code point that's either a C0 control or U+0020 SPACE.
138122 *
139- * @see https://infra.spec.whatwg.org/#c0-control
140- * @see https://infra.spec.whatwg.org/#c0-control-or-space
123+ * @see { @link https://infra.spec.whatwg.org/#c0-control}
124+ * @see { @link https://infra.spec.whatwg.org/#c0-control-or-space}
141125 */
142126export const isC0ControlOrSpace = ( v : string ) : boolean =>
143127 isC0Control ( v ) || v === '\u{0020}'
@@ -148,8 +132,8 @@ export const isC0ControlOrSpace = (v: string): boolean =>
148132 * - `U+007F` DELETE
149133 * - `U+009F` APPLICATION PROGRAMMING COMMAND
150134 *
151- * @see https://infra.spec.whatwg.org/#c0-control
152- * @see https://infra.spec.whatwg.org/#control
135+ * @see { @link https://infra.spec.whatwg.org/#c0-control}
136+ * @see { @link https://infra.spec.whatwg.org/#control}
153137 */
154138export const isControl = ( v : string ) : boolean =>
155139 isC0Control ( v ) || isCodePointBetween ( v , 0x007F , 0x009F )
@@ -158,7 +142,7 @@ export const isControl = (v: string): boolean =>
158142 * A code point that is inclusively between the range of
159143 * `U+0030` (0) and `U+0039` (9).
160144 *
161- * @see https://infra.spec.whatwg.org/#ascii-digit
145+ * @see { @link https://infra.spec.whatwg.org/#ascii-digit}
162146 */
163147export const isAsciiDigit = ( v : string ) : boolean =>
164148 isCodePointBetween ( v , 0x0030 , 0x0039 )
@@ -167,25 +151,25 @@ export const isAsciiDigit = (v: string): boolean =>
167151 * A code point that is inclusively between the range of
168152 * `U+0041` (A) and `U+0046` (F).
169153 *
170- * @see https://infra.spec.whatwg.org/#ascii-upper-hex-digit
154+ * @see { @link https://infra.spec.whatwg.org/#ascii-upper-hex-digit}
171155 */
172156export const isAsciiUpperHexDigit = ( v : string ) : boolean =>
173157 isCodePointBetween ( v , 0x0041 , 0x0046 )
174158
175159/**
176160 * A code point that is inclusively between the range of
177161 * `U+0061` (a) and `U+0066` (f).
178- * @see https://infra.spec.whatwg.org/#ascii-lower-hex-digit
162+ * @see { @link https://infra.spec.whatwg.org/#ascii-lower-hex-digit}
179163 */
180164export const isAsciiLowerHexDigit = ( v : string ) : boolean =>
181165 isCodePointBetween ( v , 0x0061 , 0x0066 )
182166
183167/**
184168 * A code point that is either an ASCII lower or upper hex digit.
185169 *
186- * @see https://infra.spec.whatwg.org/#ascii-upper-hex-digit
187- * @see https://infra.spec.whatwg.org/#ascii-lower-hex-digit
188- * @see https://infra.spec.whatwg.org/#ascii-hex-digit
170+ * @see { @link https://infra.spec.whatwg.org/#ascii-upper-hex-digit}
171+ * @see { @link https://infra.spec.whatwg.org/#ascii-lower-hex-digit}
172+ * @see { @link https://infra.spec.whatwg.org/#ascii-hex-digit}
189173 */
190174export const isAsciiHexDigit = ( v : string ) : boolean =>
191175 isAsciiLowerHexDigit ( v ) || isAsciiUpperHexDigit ( v )
@@ -194,7 +178,7 @@ export const isAsciiHexDigit = (v: string): boolean =>
194178 * A code point that is inclusively between the range of
195179 * `U+0041` (A) and `U+005A` (Z).
196180 *
197- * @see https://infra.spec.whatwg.org/#ascii-upper-alpha
181+ * @see { @link https://infra.spec.whatwg.org/#ascii-upper-alpha}
198182 */
199183export const isAsciiUpperAlpha = ( v : string ) : boolean =>
200184 isCodePointBetween ( v , 0x0041 , 0x005A )
@@ -203,7 +187,7 @@ export const isAsciiUpperAlpha = (v: string): boolean =>
203187 * A code point that is inclusively between the range of
204188 * `U+0061` (a) and `U+007A` (z).
205189 *
206- * @see https://infra.spec.whatwg.org/#ascii-lower-alpha
190+ * @see { @link https://infra.spec.whatwg.org/#ascii-lower-alpha}
207191 */
208192export const isAsciiLowerAlpha = ( v : string ) : boolean =>
209193 isCodePointBetween ( v , 0x0061 , 0x007A )
@@ -212,18 +196,18 @@ export const isAsciiLowerAlpha = (v: string): boolean =>
212196 * A code point that is either an ASCII lower alpha or
213197 * ASCII upper alpha.
214198 *
215- * @see https://infra.spec.whatwg.org/#ascii-lower-alpha
216- * @see https://infra.spec.whatwg.org/#ascii-upper-alpha
217- * @see https://infra.spec.whatwg.org/#ascii-alpha
199+ * @see { @link https://infra.spec.whatwg.org/#ascii-lower-alpha}
200+ * @see { @link https://infra.spec.whatwg.org/#ascii-upper-alpha}
201+ * @see { @link https://infra.spec.whatwg.org/#ascii-alpha}
218202 */
219203export const isAsciiAlpha = ( v : string ) : boolean =>
220204 isAsciiLowerAlpha ( v ) || isAsciiUpperAlpha ( v )
221205
222206/**
223207 * A code point that is an ASCII digit or ASCII alpha.
224208 *
225- * @see https://infra.spec.whatwg.org/#ascii-numeric
226- * @see https://infra.spec.whatwg.org/#ascii-alpha
209+ * @see {{ @link https://infra.spec.whatwg.org/#ascii-numeric}
210+ * @see {{ @link https://infra.spec.whatwg.org/#ascii-alpha}
227211 */
228212export const isAsciiAlphanumeric = ( v : string ) : boolean =>
229213 isAsciiDigit ( v ) || isAsciiAlpha ( v )
0 commit comments