Leon4gr45 commited on
Commit
0bffd89
·
verified ·
1 Parent(s): 22ef5b5

Upload folder using huggingface_hub (part 14)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. node_modules/micromark-factory-whitespace/dev/index.d.ts.map +1 -0
  3. node_modules/micromark-factory-whitespace/dev/index.js +53 -0
  4. node_modules/micromark-factory-whitespace/index.d.ts +22 -0
  5. node_modules/micromark-factory-whitespace/index.d.ts.map +1 -0
  6. node_modules/micromark-factory-whitespace/index.js +44 -0
  7. node_modules/micromark-factory-whitespace/license +22 -0
  8. node_modules/micromark-factory-whitespace/package.json +57 -0
  9. node_modules/micromark-factory-whitespace/readme.md +205 -0
  10. node_modules/micromark-util-character/dev/index.d.ts +195 -0
  11. node_modules/micromark-util-character/dev/index.d.ts.map +1 -0
  12. node_modules/micromark-util-character/dev/index.js +252 -0
  13. node_modules/micromark-util-character/index.d.ts +195 -0
  14. node_modules/micromark-util-character/index.d.ts.map +1 -0
  15. node_modules/micromark-util-character/index.js +246 -0
  16. node_modules/micromark-util-character/license +22 -0
  17. node_modules/micromark-util-character/package.json +57 -0
  18. node_modules/micromark-util-character/readme.md +446 -0
  19. node_modules/micromark-util-chunked/dev/index.d.ts +41 -0
  20. node_modules/micromark-util-chunked/dev/index.d.ts.map +1 -0
  21. node_modules/micromark-util-chunked/dev/index.js +89 -0
  22. node_modules/micromark-util-chunked/index.d.ts +41 -0
  23. node_modules/micromark-util-chunked/index.d.ts.map +1 -0
  24. node_modules/micromark-util-chunked/index.js +81 -0
  25. node_modules/micromark-util-chunked/license +22 -0
  26. node_modules/micromark-util-chunked/package.json +57 -0
  27. node_modules/micromark-util-chunked/readme.md +219 -0
  28. node_modules/micromark-util-classify-character/dev/index.d.ts +18 -0
  29. node_modules/micromark-util-classify-character/dev/index.d.ts.map +1 -0
  30. node_modules/micromark-util-classify-character/dev/index.js +38 -0
  31. node_modules/micromark-util-classify-character/index.d.ts +18 -0
  32. node_modules/micromark-util-classify-character/index.d.ts.map +1 -0
  33. node_modules/micromark-util-classify-character/index.js +27 -0
  34. node_modules/micromark-util-classify-character/license +22 -0
  35. node_modules/micromark-util-classify-character/package.json +59 -0
  36. node_modules/micromark-util-classify-character/readme.md +205 -0
  37. node_modules/micromark-util-combine-extensions/index.d.ts +22 -0
  38. node_modules/micromark-util-combine-extensions/index.d.ts.map +1 -0
  39. node_modules/micromark-util-combine-extensions/index.js +143 -0
  40. node_modules/micromark-util-combine-extensions/license +22 -0
  41. node_modules/micromark-util-combine-extensions/package.json +52 -0
  42. node_modules/micromark-util-combine-extensions/readme.md +201 -0
  43. node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts +16 -0
  44. node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map +1 -0
  45. node_modules/micromark-util-decode-numeric-character-reference/dev/index.js +42 -0
  46. node_modules/micromark-util-decode-numeric-character-reference/index.d.ts +16 -0
  47. node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map +1 -0
  48. node_modules/micromark-util-decode-numeric-character-reference/index.js +32 -0
  49. node_modules/micromark-util-decode-numeric-character-reference/license +22 -0
  50. node_modules/micromark-util-decode-numeric-character-reference/package.json +59 -0
.gitattributes CHANGED
@@ -54,3 +54,5 @@ node_modules/better-sqlite3/build/Release/better_sqlite3.node filter=lfs diff=lf
54
  node_modules/esbuild/bin/esbuild filter=lfs diff=lfs merge=lfs -text
55
  node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
56
  node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
 
 
 
54
  node_modules/esbuild/bin/esbuild filter=lfs diff=lfs merge=lfs -text
55
  node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node filter=lfs diff=lfs merge=lfs -text
56
  node_modules/lightningcss-linux-x64-musl/lightningcss.linux-x64-musl.node filter=lfs diff=lfs merge=lfs -text
57
+ node_modules/monaco-editor/dev/vs/editor/editor.main.js.map filter=lfs diff=lfs merge=lfs -text
58
+ node_modules/monaco-editor/dev/vs/language/typescript/tsWorker.js filter=lfs diff=lfs merge=lfs -text
node_modules/micromark-factory-whitespace/dev/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;GAiBG;AACH,2CAPW,OAAO,MAEP,KAAK,GAEH,KAAK,CA6BjB;6BAnDgC,sBAAsB;2BAAtB,sBAAsB"}
node_modules/micromark-factory-whitespace/dev/index.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {Effects, State} from 'micromark-util-types'
3
+ */
4
+
5
+ import {factorySpace} from 'micromark-factory-space'
6
+ import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
7
+ import {types} from 'micromark-util-symbol'
8
+
9
+ /**
10
+ * Parse spaces and tabs.
11
+ *
12
+ * There is no `nok` parameter:
13
+ *
14
+ * * line endings or spaces in markdown are often optional, in which case this
15
+ * factory can be used and `ok` will be switched to whether spaces were found
16
+ * or not
17
+ * * one line ending or space can be detected with
18
+ * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`
19
+ *
20
+ * @param {Effects} effects
21
+ * Context.
22
+ * @param {State} ok
23
+ * State switched to when successful.
24
+ * @returns {State}
25
+ * Start state.
26
+ */
27
+ export function factoryWhitespace(effects, ok) {
28
+ /** @type {boolean} */
29
+ let seen
30
+
31
+ return start
32
+
33
+ /** @type {State} */
34
+ function start(code) {
35
+ if (markdownLineEnding(code)) {
36
+ effects.enter(types.lineEnding)
37
+ effects.consume(code)
38
+ effects.exit(types.lineEnding)
39
+ seen = true
40
+ return start
41
+ }
42
+
43
+ if (markdownSpace(code)) {
44
+ return factorySpace(
45
+ effects,
46
+ start,
47
+ seen ? types.linePrefix : types.lineSuffix
48
+ )(code)
49
+ }
50
+
51
+ return ok(code)
52
+ }
53
+ }
node_modules/micromark-factory-whitespace/index.d.ts ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Parse spaces and tabs.
3
+ *
4
+ * There is no `nok` parameter:
5
+ *
6
+ * * line endings or spaces in markdown are often optional, in which case this
7
+ * factory can be used and `ok` will be switched to whether spaces were found
8
+ * or not
9
+ * * one line ending or space can be detected with
10
+ * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`
11
+ *
12
+ * @param {Effects} effects
13
+ * Context.
14
+ * @param {State} ok
15
+ * State switched to when successful.
16
+ * @returns {State}
17
+ * Start state.
18
+ */
19
+ export function factoryWhitespace(effects: Effects, ok: State): State;
20
+ import type { Effects } from 'micromark-util-types';
21
+ import type { State } from 'micromark-util-types';
22
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-factory-whitespace/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;GAiBG;AACH,2CAPW,OAAO,MAEP,KAAK,GAEH,KAAK,CA6BjB;6BAnDgC,sBAAsB;2BAAtB,sBAAsB"}
node_modules/micromark-factory-whitespace/index.js ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {Effects, State} from 'micromark-util-types'
3
+ */
4
+
5
+ import { factorySpace } from 'micromark-factory-space';
6
+ import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
7
+ /**
8
+ * Parse spaces and tabs.
9
+ *
10
+ * There is no `nok` parameter:
11
+ *
12
+ * * line endings or spaces in markdown are often optional, in which case this
13
+ * factory can be used and `ok` will be switched to whether spaces were found
14
+ * or not
15
+ * * one line ending or space can be detected with
16
+ * `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`
17
+ *
18
+ * @param {Effects} effects
19
+ * Context.
20
+ * @param {State} ok
21
+ * State switched to when successful.
22
+ * @returns {State}
23
+ * Start state.
24
+ */
25
+ export function factoryWhitespace(effects, ok) {
26
+ /** @type {boolean} */
27
+ let seen;
28
+ return start;
29
+
30
+ /** @type {State} */
31
+ function start(code) {
32
+ if (markdownLineEnding(code)) {
33
+ effects.enter("lineEnding");
34
+ effects.consume(code);
35
+ effects.exit("lineEnding");
36
+ seen = true;
37
+ return start;
38
+ }
39
+ if (markdownSpace(code)) {
40
+ return factorySpace(effects, start, seen ? "linePrefix" : "lineSuffix")(code);
41
+ }
42
+ return ok(code);
43
+ }
44
+ }
node_modules/micromark-factory-whitespace/license ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
node_modules/micromark-factory-whitespace/package.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "micromark-factory-whitespace",
3
+ "version": "2.0.1",
4
+ "description": "micromark factory to parse markdown whitespace (found in lots of places)",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "micromark",
8
+ "factory",
9
+ "whitespace"
10
+ ],
11
+ "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-factory-whitespace",
12
+ "bugs": "https://github.com/micromark/micromark/issues",
13
+ "funding": [
14
+ {
15
+ "type": "GitHub Sponsors",
16
+ "url": "https://github.com/sponsors/unifiedjs"
17
+ },
18
+ {
19
+ "type": "OpenCollective",
20
+ "url": "https://opencollective.com/unified"
21
+ }
22
+ ],
23
+ "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
24
+ "contributors": [
25
+ "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
26
+ ],
27
+ "sideEffects": false,
28
+ "type": "module",
29
+ "files": [
30
+ "dev/",
31
+ "index.d.ts.map",
32
+ "index.d.ts",
33
+ "index.js"
34
+ ],
35
+ "exports": {
36
+ "development": "./dev/index.js",
37
+ "default": "./index.js"
38
+ },
39
+ "dependencies": {
40
+ "micromark-factory-space": "^2.0.0",
41
+ "micromark-util-character": "^2.0.0",
42
+ "micromark-util-symbol": "^2.0.0",
43
+ "micromark-util-types": "^2.0.0"
44
+ },
45
+ "scripts": {
46
+ "build": "micromark-build"
47
+ },
48
+ "xo": {
49
+ "envs": [
50
+ "shared-node-browser"
51
+ ],
52
+ "prettier": true,
53
+ "rules": {
54
+ "unicorn/prefer-code-point": "off"
55
+ }
56
+ }
57
+ }
node_modules/micromark-factory-whitespace/readme.md ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # micromark-factory-whitespace
2
+
3
+ [![Build][build-badge]][build]
4
+ [![Coverage][coverage-badge]][coverage]
5
+ [![Downloads][downloads-badge]][downloads]
6
+ [![Size][bundle-size-badge]][bundle-size]
7
+ [![Sponsors][sponsors-badge]][opencollective]
8
+ [![Backers][backers-badge]][opencollective]
9
+ [![Chat][chat-badge]][chat]
10
+
11
+ [micromark][] factory to parse [markdown line endings or spaces][ws] (found in
12
+ lots of places).
13
+
14
+ ## Contents
15
+
16
+ * [What is this?](#what-is-this)
17
+ * [When should I use this?](#when-should-i-use-this)
18
+ * [Install](#install)
19
+ * [Use](#use)
20
+ * [API](#api)
21
+ * [`factoryWhitespace(…)`](#factorywhitespace)
22
+ * [Types](#types)
23
+ * [Compatibility](#compatibility)
24
+ * [Security](#security)
25
+ * [Contribute](#contribute)
26
+ * [License](#license)
27
+
28
+ ## What is this?
29
+
30
+ This package exposes states to parse whitespace.
31
+
32
+ ## When should I use this?
33
+
34
+ This package is useful when you are making your own micromark extensions.
35
+
36
+ ## Install
37
+
38
+ This package is [ESM only][esm].
39
+ In Node.js (version 16+), install with [npm][]:
40
+
41
+ ```sh
42
+ npm install micromark-factory-whitespace
43
+ ```
44
+
45
+ In Deno with [`esm.sh`][esmsh]:
46
+
47
+ ```js
48
+ import {factoryWhitespace} from 'https://esm.sh/micromark-factory-whitespace@1'
49
+ ```
50
+
51
+ In browsers with [`esm.sh`][esmsh]:
52
+
53
+ ```html
54
+ <script type="module">
55
+ import {factoryWhitespace} from 'https://esm.sh/micromark-factory-whitespace@1?bundle'
56
+ </script>
57
+ ```
58
+
59
+ ## Use
60
+
61
+ ```js
62
+ import {factoryWhitespace} from 'micromark-factory-whitespace'
63
+ import {codes, types} from 'micromark-util-symbol'
64
+
65
+ // A micromark tokenizer that uses the factory:
66
+ /**
67
+ * @this {TokenizeContext}
68
+ * Context.
69
+ * @type {Tokenizer}
70
+ */
71
+ function tokenizeTitle(effects, ok, nok) {
72
+ return start
73
+
74
+ /** @type {State} */
75
+ function start(code) {
76
+ return markdownLineEndingOrSpace(code)
77
+ ? factoryWhitespace(effects, before)(code)
78
+ : nok(code)
79
+ }
80
+
81
+ // …
82
+ }
83
+ ```
84
+
85
+ ## API
86
+
87
+ This module exports the identifier
88
+ [`factoryWhitespace`][api-factory-whitespace].
89
+ There is no default export.
90
+
91
+ ### `factoryWhitespace(…)`
92
+
93
+ Parse spaces and tabs.
94
+
95
+ There is no `nok` parameter:
96
+
97
+ * line endings or spaces in markdown are often optional, in which case this
98
+ factory can be used and `ok` will be switched to whether spaces were found
99
+ or not
100
+ * one line ending or space can be detected with
101
+ [`markdownLineEndingOrSpace(code)`][ws] right before using
102
+ `factoryWhitespace`
103
+
104
+ ###### Parameters
105
+
106
+ * `effects` (`Effects`)
107
+ — context
108
+ * `ok` (`State`)
109
+ — state switched to when successful
110
+
111
+ ###### Returns
112
+
113
+ Start state (`State`).
114
+
115
+ ## Types
116
+
117
+ This package is fully typed with [TypeScript][].
118
+ It exports no additional types.
119
+
120
+ ## Compatibility
121
+
122
+ Projects maintained by the unified collective are compatible with maintained
123
+ versions of Node.js.
124
+
125
+ When we cut a new major release, we drop support for unmaintained versions of
126
+ Node.
127
+ This means we try to keep the current release line,
128
+ `micromark-factory-whitespace@2`, compatible with Node.js 16.
129
+ This package works with `micromark@3`.
130
+
131
+ ## Security
132
+
133
+ This package is safe.
134
+ See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
135
+ submit a security report.
136
+
137
+ ## Contribute
138
+
139
+ See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
140
+ to get started.
141
+ See [`support.md`][support] for ways to get help.
142
+
143
+ This project has a [code of conduct][coc].
144
+ By interacting with this repository, organisation, or community you agree to
145
+ abide by its terms.
146
+
147
+ ## License
148
+
149
+ [MIT][license] © [Titus Wormer][author]
150
+
151
+ <!-- Definitions -->
152
+
153
+ [build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
154
+
155
+ [build]: https://github.com/micromark/micromark/actions
156
+
157
+ [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
158
+
159
+ [coverage]: https://codecov.io/github/micromark/micromark
160
+
161
+ [downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-whitespace.svg
162
+
163
+ [downloads]: https://www.npmjs.com/package/micromark-factory-whitespace
164
+
165
+ [bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-whitespace
166
+
167
+ [bundle-size]: https://bundlejs.com/?q=micromark-factory-whitespace
168
+
169
+ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
170
+
171
+ [backers-badge]: https://opencollective.com/unified/backers/badge.svg
172
+
173
+ [opencollective]: https://opencollective.com/unified
174
+
175
+ [npm]: https://docs.npmjs.com/cli/install
176
+
177
+ [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
178
+
179
+ [esmsh]: https://esm.sh
180
+
181
+ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
182
+
183
+ [chat]: https://github.com/micromark/micromark/discussions
184
+
185
+ [license]: https://github.com/micromark/micromark/blob/main/license
186
+
187
+ [author]: https://wooorm.com
188
+
189
+ [health]: https://github.com/micromark/.github
190
+
191
+ [securitymd]: https://github.com/micromark/.github/blob/main/security.md
192
+
193
+ [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
194
+
195
+ [support]: https://github.com/micromark/.github/blob/main/support.md
196
+
197
+ [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
198
+
199
+ [ws]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-character#markdownlineendingorspacecode
200
+
201
+ [typescript]: https://www.typescriptlang.org
202
+
203
+ [micromark]: https://github.com/micromark/micromark
204
+
205
+ [api-factory-whitespace]: #factorywhitespace
node_modules/micromark-util-character/dev/index.d.ts ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Check whether a character code is an ASCII control character.
3
+ *
4
+ * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
5
+ * to U+001F (US), or U+007F (DEL).
6
+ *
7
+ * @param {Code} code
8
+ * Code.
9
+ * @returns {boolean}
10
+ * Whether it matches.
11
+ */
12
+ export function asciiControl(code: Code): boolean;
13
+ /**
14
+ * Check whether a character code is a markdown line ending.
15
+ *
16
+ * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
17
+ * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
18
+ *
19
+ * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
20
+ * RETURN (CR) are replaced by these virtual characters depending on whether
21
+ * they occurred together.
22
+ *
23
+ * @param {Code} code
24
+ * Code.
25
+ * @returns {boolean}
26
+ * Whether it matches.
27
+ */
28
+ export function markdownLineEnding(code: Code): boolean;
29
+ /**
30
+ * Check whether a character code is a markdown line ending (see
31
+ * `markdownLineEnding`) or markdown space (see `markdownSpace`).
32
+ *
33
+ * @param {Code} code
34
+ * Code.
35
+ * @returns {boolean}
36
+ * Whether it matches.
37
+ */
38
+ export function markdownLineEndingOrSpace(code: Code): boolean;
39
+ /**
40
+ * Check whether a character code is a markdown space.
41
+ *
42
+ * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
43
+ * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
44
+ *
45
+ * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
46
+ * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
47
+ * SPACE (VS) characters, depending on the column at which the tab occurred.
48
+ *
49
+ * @param {Code} code
50
+ * Code.
51
+ * @returns {boolean}
52
+ * Whether it matches.
53
+ */
54
+ export function markdownSpace(code: Code): boolean;
55
+ /**
56
+ * Check whether the character code represents an ASCII alpha (`a` through `z`,
57
+ * case insensitive).
58
+ *
59
+ * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
60
+ *
61
+ * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
62
+ * to U+005A (`Z`).
63
+ *
64
+ * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
65
+ * to U+007A (`z`).
66
+ *
67
+ * @param code
68
+ * Code.
69
+ * @returns {boolean}
70
+ * Whether it matches.
71
+ */
72
+ export const asciiAlpha: (code: Code) => boolean;
73
+ /**
74
+ * Check whether the character code represents an ASCII alphanumeric (`a`
75
+ * through `z`, case insensitive, or `0` through `9`).
76
+ *
77
+ * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
78
+ * (see `asciiAlpha`).
79
+ *
80
+ * @param code
81
+ * Code.
82
+ * @returns {boolean}
83
+ * Whether it matches.
84
+ */
85
+ export const asciiAlphanumeric: (code: Code) => boolean;
86
+ /**
87
+ * Check whether the character code represents an ASCII atext.
88
+ *
89
+ * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
90
+ * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
91
+ * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
92
+ * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
93
+ * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
94
+ * (`{`) to U+007E TILDE (`~`).
95
+ *
96
+ * See:
97
+ * **\[RFC5322]**:
98
+ * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
99
+ * P. Resnick.
100
+ * IETF.
101
+ *
102
+ * @param code
103
+ * Code.
104
+ * @returns {boolean}
105
+ * Whether it matches.
106
+ */
107
+ export const asciiAtext: (code: Code) => boolean;
108
+ /**
109
+ * Check whether the character code represents an ASCII digit (`0` through `9`).
110
+ *
111
+ * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
112
+ * U+0039 (`9`).
113
+ *
114
+ * @param code
115
+ * Code.
116
+ * @returns {boolean}
117
+ * Whether it matches.
118
+ */
119
+ export const asciiDigit: (code: Code) => boolean;
120
+ /**
121
+ * Check whether the character code represents an ASCII hex digit (`a` through
122
+ * `f`, case insensitive, or `0` through `9`).
123
+ *
124
+ * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
125
+ * digit, or an ASCII lower hex digit.
126
+ *
127
+ * An **ASCII upper hex digit** is a character in the inclusive range U+0041
128
+ * (`A`) to U+0046 (`F`).
129
+ *
130
+ * An **ASCII lower hex digit** is a character in the inclusive range U+0061
131
+ * (`a`) to U+0066 (`f`).
132
+ *
133
+ * @param code
134
+ * Code.
135
+ * @returns {boolean}
136
+ * Whether it matches.
137
+ */
138
+ export const asciiHexDigit: (code: Code) => boolean;
139
+ /**
140
+ * Check whether the character code represents ASCII punctuation.
141
+ *
142
+ * An **ASCII punctuation** is a character in the inclusive ranges U+0021
143
+ * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
144
+ * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
145
+ * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
146
+ *
147
+ * @param code
148
+ * Code.
149
+ * @returns {boolean}
150
+ * Whether it matches.
151
+ */
152
+ export const asciiPunctuation: (code: Code) => boolean;
153
+ /**
154
+ * Check whether the character code represents Unicode punctuation.
155
+ *
156
+ * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
157
+ * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
158
+ * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
159
+ * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
160
+ * punctuation (see `asciiPunctuation`).
161
+ *
162
+ * See:
163
+ * **\[UNICODE]**:
164
+ * [The Unicode Standard](https://www.unicode.org/versions/).
165
+ * Unicode Consortium.
166
+ *
167
+ * @param code
168
+ * Code.
169
+ * @returns
170
+ * Whether it matches.
171
+ */
172
+ export const unicodePunctuation: (code: Code) => boolean;
173
+ /**
174
+ * Check whether the character code represents Unicode whitespace.
175
+ *
176
+ * Note that this does handle micromark specific markdown whitespace characters.
177
+ * See `markdownLineEndingOrSpace` to check that.
178
+ *
179
+ * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
180
+ * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
181
+ * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
182
+ *
183
+ * See:
184
+ * **\[UNICODE]**:
185
+ * [The Unicode Standard](https://www.unicode.org/versions/).
186
+ * Unicode Consortium.
187
+ *
188
+ * @param code
189
+ * Code.
190
+ * @returns
191
+ * Whether it matches.
192
+ */
193
+ export const unicodeWhitespace: (code: Code) => boolean;
194
+ import type { Code } from 'micromark-util-types';
195
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-character/dev/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;GAUG;AACH,mCALW,IAAI,GAEF,OAAO,CASnB;AAkDD;;;;;;;;;;;;;;GAcG;AACH,yCALW,IAAI,GAEF,OAAO,CAKnB;AAED;;;;;;;;GAQG;AACH,gDALW,IAAI,GAEF,OAAO,CAKnB;AAED;;;;;;;;;;;;;;GAcG;AACH,oCALW,IAAI,GAEF,OAAO,CASnB;AAhLD;;;;;;;;;;;;;;;;GAgBG;AACH,gCAmNoB,IAAI,KAAK,OAAO,CAnNY;AAEhD;;;;;;;;;;;GAWG;AACH,uCAqMoB,IAAI,KAAK,OAAO,CArMqB;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,gCA8KoB,IAAI,KAAK,OAAO,CA9KuB;AAqB3D;;;;;;;;;;GAUG;AACH,gCA8IoB,IAAI,KAAK,OAAO,CA9IM;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,mCA0HoB,IAAI,KAAK,OAAO,CA1HiB;AAErD;;;;;;;;;;;;GAYG;AACH,sCA2GoB,IAAI,KAAK,OAAO,CA3GwB;AA2D5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCA6BoB,IAAI,KAAK,OAAO,CA7BwB;AAE5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uCAOoB,IAAI,KAAK,OAAO,CAPa;0BAlO1B,sBAAsB"}
node_modules/micromark-util-character/dev/index.js ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {Code} from 'micromark-util-types'
3
+ */
4
+
5
+ import {codes} from 'micromark-util-symbol'
6
+
7
+ /**
8
+ * Check whether the character code represents an ASCII alpha (`a` through `z`,
9
+ * case insensitive).
10
+ *
11
+ * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
12
+ *
13
+ * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
14
+ * to U+005A (`Z`).
15
+ *
16
+ * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
17
+ * to U+007A (`z`).
18
+ *
19
+ * @param code
20
+ * Code.
21
+ * @returns {boolean}
22
+ * Whether it matches.
23
+ */
24
+ export const asciiAlpha = regexCheck(/[A-Za-z]/)
25
+
26
+ /**
27
+ * Check whether the character code represents an ASCII alphanumeric (`a`
28
+ * through `z`, case insensitive, or `0` through `9`).
29
+ *
30
+ * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
31
+ * (see `asciiAlpha`).
32
+ *
33
+ * @param code
34
+ * Code.
35
+ * @returns {boolean}
36
+ * Whether it matches.
37
+ */
38
+ export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/)
39
+
40
+ /**
41
+ * Check whether the character code represents an ASCII atext.
42
+ *
43
+ * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
44
+ * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
45
+ * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
46
+ * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
47
+ * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
48
+ * (`{`) to U+007E TILDE (`~`).
49
+ *
50
+ * See:
51
+ * **\[RFC5322]**:
52
+ * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
53
+ * P. Resnick.
54
+ * IETF.
55
+ *
56
+ * @param code
57
+ * Code.
58
+ * @returns {boolean}
59
+ * Whether it matches.
60
+ */
61
+ export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/)
62
+
63
+ /**
64
+ * Check whether a character code is an ASCII control character.
65
+ *
66
+ * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
67
+ * to U+001F (US), or U+007F (DEL).
68
+ *
69
+ * @param {Code} code
70
+ * Code.
71
+ * @returns {boolean}
72
+ * Whether it matches.
73
+ */
74
+ export function asciiControl(code) {
75
+ return (
76
+ // Special whitespace codes (which have negative values), C0 and Control
77
+ // character DEL
78
+ code !== null && (code < codes.space || code === codes.del)
79
+ )
80
+ }
81
+
82
+ /**
83
+ * Check whether the character code represents an ASCII digit (`0` through `9`).
84
+ *
85
+ * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
86
+ * U+0039 (`9`).
87
+ *
88
+ * @param code
89
+ * Code.
90
+ * @returns {boolean}
91
+ * Whether it matches.
92
+ */
93
+ export const asciiDigit = regexCheck(/\d/)
94
+
95
+ /**
96
+ * Check whether the character code represents an ASCII hex digit (`a` through
97
+ * `f`, case insensitive, or `0` through `9`).
98
+ *
99
+ * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
100
+ * digit, or an ASCII lower hex digit.
101
+ *
102
+ * An **ASCII upper hex digit** is a character in the inclusive range U+0041
103
+ * (`A`) to U+0046 (`F`).
104
+ *
105
+ * An **ASCII lower hex digit** is a character in the inclusive range U+0061
106
+ * (`a`) to U+0066 (`f`).
107
+ *
108
+ * @param code
109
+ * Code.
110
+ * @returns {boolean}
111
+ * Whether it matches.
112
+ */
113
+ export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/)
114
+
115
+ /**
116
+ * Check whether the character code represents ASCII punctuation.
117
+ *
118
+ * An **ASCII punctuation** is a character in the inclusive ranges U+0021
119
+ * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
120
+ * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
121
+ * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
122
+ *
123
+ * @param code
124
+ * Code.
125
+ * @returns {boolean}
126
+ * Whether it matches.
127
+ */
128
+ export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)
129
+
130
+ /**
131
+ * Check whether a character code is a markdown line ending.
132
+ *
133
+ * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
134
+ * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
135
+ *
136
+ * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
137
+ * RETURN (CR) are replaced by these virtual characters depending on whether
138
+ * they occurred together.
139
+ *
140
+ * @param {Code} code
141
+ * Code.
142
+ * @returns {boolean}
143
+ * Whether it matches.
144
+ */
145
+ export function markdownLineEnding(code) {
146
+ return code !== null && code < codes.horizontalTab
147
+ }
148
+
149
+ /**
150
+ * Check whether a character code is a markdown line ending (see
151
+ * `markdownLineEnding`) or markdown space (see `markdownSpace`).
152
+ *
153
+ * @param {Code} code
154
+ * Code.
155
+ * @returns {boolean}
156
+ * Whether it matches.
157
+ */
158
+ export function markdownLineEndingOrSpace(code) {
159
+ return code !== null && (code < codes.nul || code === codes.space)
160
+ }
161
+
162
+ /**
163
+ * Check whether a character code is a markdown space.
164
+ *
165
+ * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
166
+ * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
167
+ *
168
+ * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
169
+ * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
170
+ * SPACE (VS) characters, depending on the column at which the tab occurred.
171
+ *
172
+ * @param {Code} code
173
+ * Code.
174
+ * @returns {boolean}
175
+ * Whether it matches.
176
+ */
177
+ export function markdownSpace(code) {
178
+ return (
179
+ code === codes.horizontalTab ||
180
+ code === codes.virtualSpace ||
181
+ code === codes.space
182
+ )
183
+ }
184
+
185
+ // Size note: removing ASCII from the regex and using `asciiPunctuation` here
186
+ // In fact adds to the bundle size.
187
+ /**
188
+ * Check whether the character code represents Unicode punctuation.
189
+ *
190
+ * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
191
+ * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
192
+ * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
193
+ * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
194
+ * punctuation (see `asciiPunctuation`).
195
+ *
196
+ * See:
197
+ * **\[UNICODE]**:
198
+ * [The Unicode Standard](https://www.unicode.org/versions/).
199
+ * Unicode Consortium.
200
+ *
201
+ * @param code
202
+ * Code.
203
+ * @returns
204
+ * Whether it matches.
205
+ */
206
+ export const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u)
207
+
208
+ /**
209
+ * Check whether the character code represents Unicode whitespace.
210
+ *
211
+ * Note that this does handle micromark specific markdown whitespace characters.
212
+ * See `markdownLineEndingOrSpace` to check that.
213
+ *
214
+ * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
215
+ * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
216
+ * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
217
+ *
218
+ * See:
219
+ * **\[UNICODE]**:
220
+ * [The Unicode Standard](https://www.unicode.org/versions/).
221
+ * Unicode Consortium.
222
+ *
223
+ * @param code
224
+ * Code.
225
+ * @returns
226
+ * Whether it matches.
227
+ */
228
+ export const unicodeWhitespace = regexCheck(/\s/)
229
+
230
+ /**
231
+ * Create a code check from a regex.
232
+ *
233
+ * @param {RegExp} regex
234
+ * Expression.
235
+ * @returns {(code: Code) => boolean}
236
+ * Check.
237
+ */
238
+ function regexCheck(regex) {
239
+ return check
240
+
241
+ /**
242
+ * Check whether a code matches the bound regex.
243
+ *
244
+ * @param {Code} code
245
+ * Character code.
246
+ * @returns {boolean}
247
+ * Whether the character code matches the bound regex.
248
+ */
249
+ function check(code) {
250
+ return code !== null && code > -1 && regex.test(String.fromCharCode(code))
251
+ }
252
+ }
node_modules/micromark-util-character/index.d.ts ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Check whether a character code is an ASCII control character.
3
+ *
4
+ * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
5
+ * to U+001F (US), or U+007F (DEL).
6
+ *
7
+ * @param {Code} code
8
+ * Code.
9
+ * @returns {boolean}
10
+ * Whether it matches.
11
+ */
12
+ export function asciiControl(code: Code): boolean;
13
+ /**
14
+ * Check whether a character code is a markdown line ending.
15
+ *
16
+ * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
17
+ * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
18
+ *
19
+ * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
20
+ * RETURN (CR) are replaced by these virtual characters depending on whether
21
+ * they occurred together.
22
+ *
23
+ * @param {Code} code
24
+ * Code.
25
+ * @returns {boolean}
26
+ * Whether it matches.
27
+ */
28
+ export function markdownLineEnding(code: Code): boolean;
29
+ /**
30
+ * Check whether a character code is a markdown line ending (see
31
+ * `markdownLineEnding`) or markdown space (see `markdownSpace`).
32
+ *
33
+ * @param {Code} code
34
+ * Code.
35
+ * @returns {boolean}
36
+ * Whether it matches.
37
+ */
38
+ export function markdownLineEndingOrSpace(code: Code): boolean;
39
+ /**
40
+ * Check whether a character code is a markdown space.
41
+ *
42
+ * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
43
+ * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
44
+ *
45
+ * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
46
+ * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
47
+ * SPACE (VS) characters, depending on the column at which the tab occurred.
48
+ *
49
+ * @param {Code} code
50
+ * Code.
51
+ * @returns {boolean}
52
+ * Whether it matches.
53
+ */
54
+ export function markdownSpace(code: Code): boolean;
55
+ /**
56
+ * Check whether the character code represents an ASCII alpha (`a` through `z`,
57
+ * case insensitive).
58
+ *
59
+ * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
60
+ *
61
+ * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
62
+ * to U+005A (`Z`).
63
+ *
64
+ * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
65
+ * to U+007A (`z`).
66
+ *
67
+ * @param code
68
+ * Code.
69
+ * @returns {boolean}
70
+ * Whether it matches.
71
+ */
72
+ export const asciiAlpha: (code: Code) => boolean;
73
+ /**
74
+ * Check whether the character code represents an ASCII alphanumeric (`a`
75
+ * through `z`, case insensitive, or `0` through `9`).
76
+ *
77
+ * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
78
+ * (see `asciiAlpha`).
79
+ *
80
+ * @param code
81
+ * Code.
82
+ * @returns {boolean}
83
+ * Whether it matches.
84
+ */
85
+ export const asciiAlphanumeric: (code: Code) => boolean;
86
+ /**
87
+ * Check whether the character code represents an ASCII atext.
88
+ *
89
+ * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
90
+ * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
91
+ * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
92
+ * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
93
+ * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
94
+ * (`{`) to U+007E TILDE (`~`).
95
+ *
96
+ * See:
97
+ * **\[RFC5322]**:
98
+ * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
99
+ * P. Resnick.
100
+ * IETF.
101
+ *
102
+ * @param code
103
+ * Code.
104
+ * @returns {boolean}
105
+ * Whether it matches.
106
+ */
107
+ export const asciiAtext: (code: Code) => boolean;
108
+ /**
109
+ * Check whether the character code represents an ASCII digit (`0` through `9`).
110
+ *
111
+ * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
112
+ * U+0039 (`9`).
113
+ *
114
+ * @param code
115
+ * Code.
116
+ * @returns {boolean}
117
+ * Whether it matches.
118
+ */
119
+ export const asciiDigit: (code: Code) => boolean;
120
+ /**
121
+ * Check whether the character code represents an ASCII hex digit (`a` through
122
+ * `f`, case insensitive, or `0` through `9`).
123
+ *
124
+ * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
125
+ * digit, or an ASCII lower hex digit.
126
+ *
127
+ * An **ASCII upper hex digit** is a character in the inclusive range U+0041
128
+ * (`A`) to U+0046 (`F`).
129
+ *
130
+ * An **ASCII lower hex digit** is a character in the inclusive range U+0061
131
+ * (`a`) to U+0066 (`f`).
132
+ *
133
+ * @param code
134
+ * Code.
135
+ * @returns {boolean}
136
+ * Whether it matches.
137
+ */
138
+ export const asciiHexDigit: (code: Code) => boolean;
139
+ /**
140
+ * Check whether the character code represents ASCII punctuation.
141
+ *
142
+ * An **ASCII punctuation** is a character in the inclusive ranges U+0021
143
+ * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
144
+ * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
145
+ * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
146
+ *
147
+ * @param code
148
+ * Code.
149
+ * @returns {boolean}
150
+ * Whether it matches.
151
+ */
152
+ export const asciiPunctuation: (code: Code) => boolean;
153
+ /**
154
+ * Check whether the character code represents Unicode punctuation.
155
+ *
156
+ * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
157
+ * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
158
+ * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
159
+ * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
160
+ * punctuation (see `asciiPunctuation`).
161
+ *
162
+ * See:
163
+ * **\[UNICODE]**:
164
+ * [The Unicode Standard](https://www.unicode.org/versions/).
165
+ * Unicode Consortium.
166
+ *
167
+ * @param code
168
+ * Code.
169
+ * @returns
170
+ * Whether it matches.
171
+ */
172
+ export const unicodePunctuation: (code: Code) => boolean;
173
+ /**
174
+ * Check whether the character code represents Unicode whitespace.
175
+ *
176
+ * Note that this does handle micromark specific markdown whitespace characters.
177
+ * See `markdownLineEndingOrSpace` to check that.
178
+ *
179
+ * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
180
+ * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
181
+ * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
182
+ *
183
+ * See:
184
+ * **\[UNICODE]**:
185
+ * [The Unicode Standard](https://www.unicode.org/versions/).
186
+ * Unicode Consortium.
187
+ *
188
+ * @param code
189
+ * Code.
190
+ * @returns
191
+ * Whether it matches.
192
+ */
193
+ export const unicodeWhitespace: (code: Code) => boolean;
194
+ import type { Code } from 'micromark-util-types';
195
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-character/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;GAUG;AACH,mCALW,IAAI,GAEF,OAAO,CASnB;AAkDD;;;;;;;;;;;;;;GAcG;AACH,yCALW,IAAI,GAEF,OAAO,CAKnB;AAED;;;;;;;;GAQG;AACH,gDALW,IAAI,GAEF,OAAO,CAKnB;AAED;;;;;;;;;;;;;;GAcG;AACH,oCALW,IAAI,GAEF,OAAO,CASnB;AAhLD;;;;;;;;;;;;;;;;GAgBG;AACH,gCAmNoB,IAAI,KAAK,OAAO,CAnNY;AAEhD;;;;;;;;;;;GAWG;AACH,uCAqMoB,IAAI,KAAK,OAAO,CArMqB;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,gCA8KoB,IAAI,KAAK,OAAO,CA9KuB;AAqB3D;;;;;;;;;;GAUG;AACH,gCA8IoB,IAAI,KAAK,OAAO,CA9IM;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,mCA0HoB,IAAI,KAAK,OAAO,CA1HiB;AAErD;;;;;;;;;;;;GAYG;AACH,sCA2GoB,IAAI,KAAK,OAAO,CA3GwB;AA2D5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCA6BoB,IAAI,KAAK,OAAO,CA7BwB;AAE5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uCAOoB,IAAI,KAAK,OAAO,CAPa;0BAlO1B,sBAAsB"}
node_modules/micromark-util-character/index.js ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {Code} from 'micromark-util-types'
3
+ */
4
+
5
+ /**
6
+ * Check whether the character code represents an ASCII alpha (`a` through `z`,
7
+ * case insensitive).
8
+ *
9
+ * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
10
+ *
11
+ * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
12
+ * to U+005A (`Z`).
13
+ *
14
+ * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
15
+ * to U+007A (`z`).
16
+ *
17
+ * @param code
18
+ * Code.
19
+ * @returns {boolean}
20
+ * Whether it matches.
21
+ */
22
+ export const asciiAlpha = regexCheck(/[A-Za-z]/);
23
+
24
+ /**
25
+ * Check whether the character code represents an ASCII alphanumeric (`a`
26
+ * through `z`, case insensitive, or `0` through `9`).
27
+ *
28
+ * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
29
+ * (see `asciiAlpha`).
30
+ *
31
+ * @param code
32
+ * Code.
33
+ * @returns {boolean}
34
+ * Whether it matches.
35
+ */
36
+ export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
37
+
38
+ /**
39
+ * Check whether the character code represents an ASCII atext.
40
+ *
41
+ * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
42
+ * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
43
+ * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
44
+ * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
45
+ * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
46
+ * (`{`) to U+007E TILDE (`~`).
47
+ *
48
+ * See:
49
+ * **\[RFC5322]**:
50
+ * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
51
+ * P. Resnick.
52
+ * IETF.
53
+ *
54
+ * @param code
55
+ * Code.
56
+ * @returns {boolean}
57
+ * Whether it matches.
58
+ */
59
+ export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
60
+
61
+ /**
62
+ * Check whether a character code is an ASCII control character.
63
+ *
64
+ * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
65
+ * to U+001F (US), or U+007F (DEL).
66
+ *
67
+ * @param {Code} code
68
+ * Code.
69
+ * @returns {boolean}
70
+ * Whether it matches.
71
+ */
72
+ export function asciiControl(code) {
73
+ return (
74
+ // Special whitespace codes (which have negative values), C0 and Control
75
+ // character DEL
76
+ code !== null && (code < 32 || code === 127)
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Check whether the character code represents an ASCII digit (`0` through `9`).
82
+ *
83
+ * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
84
+ * U+0039 (`9`).
85
+ *
86
+ * @param code
87
+ * Code.
88
+ * @returns {boolean}
89
+ * Whether it matches.
90
+ */
91
+ export const asciiDigit = regexCheck(/\d/);
92
+
93
+ /**
94
+ * Check whether the character code represents an ASCII hex digit (`a` through
95
+ * `f`, case insensitive, or `0` through `9`).
96
+ *
97
+ * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
98
+ * digit, or an ASCII lower hex digit.
99
+ *
100
+ * An **ASCII upper hex digit** is a character in the inclusive range U+0041
101
+ * (`A`) to U+0046 (`F`).
102
+ *
103
+ * An **ASCII lower hex digit** is a character in the inclusive range U+0061
104
+ * (`a`) to U+0066 (`f`).
105
+ *
106
+ * @param code
107
+ * Code.
108
+ * @returns {boolean}
109
+ * Whether it matches.
110
+ */
111
+ export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
112
+
113
+ /**
114
+ * Check whether the character code represents ASCII punctuation.
115
+ *
116
+ * An **ASCII punctuation** is a character in the inclusive ranges U+0021
117
+ * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
118
+ * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
119
+ * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
120
+ *
121
+ * @param code
122
+ * Code.
123
+ * @returns {boolean}
124
+ * Whether it matches.
125
+ */
126
+ export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
127
+
128
+ /**
129
+ * Check whether a character code is a markdown line ending.
130
+ *
131
+ * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
132
+ * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
133
+ *
134
+ * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
135
+ * RETURN (CR) are replaced by these virtual characters depending on whether
136
+ * they occurred together.
137
+ *
138
+ * @param {Code} code
139
+ * Code.
140
+ * @returns {boolean}
141
+ * Whether it matches.
142
+ */
143
+ export function markdownLineEnding(code) {
144
+ return code !== null && code < -2;
145
+ }
146
+
147
+ /**
148
+ * Check whether a character code is a markdown line ending (see
149
+ * `markdownLineEnding`) or markdown space (see `markdownSpace`).
150
+ *
151
+ * @param {Code} code
152
+ * Code.
153
+ * @returns {boolean}
154
+ * Whether it matches.
155
+ */
156
+ export function markdownLineEndingOrSpace(code) {
157
+ return code !== null && (code < 0 || code === 32);
158
+ }
159
+
160
+ /**
161
+ * Check whether a character code is a markdown space.
162
+ *
163
+ * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
164
+ * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
165
+ *
166
+ * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
167
+ * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
168
+ * SPACE (VS) characters, depending on the column at which the tab occurred.
169
+ *
170
+ * @param {Code} code
171
+ * Code.
172
+ * @returns {boolean}
173
+ * Whether it matches.
174
+ */
175
+ export function markdownSpace(code) {
176
+ return code === -2 || code === -1 || code === 32;
177
+ }
178
+
179
+ // Size note: removing ASCII from the regex and using `asciiPunctuation` here
180
+ // In fact adds to the bundle size.
181
+ /**
182
+ * Check whether the character code represents Unicode punctuation.
183
+ *
184
+ * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
185
+ * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
186
+ * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
187
+ * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
188
+ * punctuation (see `asciiPunctuation`).
189
+ *
190
+ * See:
191
+ * **\[UNICODE]**:
192
+ * [The Unicode Standard](https://www.unicode.org/versions/).
193
+ * Unicode Consortium.
194
+ *
195
+ * @param code
196
+ * Code.
197
+ * @returns
198
+ * Whether it matches.
199
+ */
200
+ export const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
201
+
202
+ /**
203
+ * Check whether the character code represents Unicode whitespace.
204
+ *
205
+ * Note that this does handle micromark specific markdown whitespace characters.
206
+ * See `markdownLineEndingOrSpace` to check that.
207
+ *
208
+ * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
209
+ * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
210
+ * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
211
+ *
212
+ * See:
213
+ * **\[UNICODE]**:
214
+ * [The Unicode Standard](https://www.unicode.org/versions/).
215
+ * Unicode Consortium.
216
+ *
217
+ * @param code
218
+ * Code.
219
+ * @returns
220
+ * Whether it matches.
221
+ */
222
+ export const unicodeWhitespace = regexCheck(/\s/);
223
+
224
+ /**
225
+ * Create a code check from a regex.
226
+ *
227
+ * @param {RegExp} regex
228
+ * Expression.
229
+ * @returns {(code: Code) => boolean}
230
+ * Check.
231
+ */
232
+ function regexCheck(regex) {
233
+ return check;
234
+
235
+ /**
236
+ * Check whether a code matches the bound regex.
237
+ *
238
+ * @param {Code} code
239
+ * Character code.
240
+ * @returns {boolean}
241
+ * Whether the character code matches the bound regex.
242
+ */
243
+ function check(code) {
244
+ return code !== null && code > -1 && regex.test(String.fromCharCode(code));
245
+ }
246
+ }
node_modules/micromark-util-character/license ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
node_modules/micromark-util-character/package.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "micromark-util-character",
3
+ "version": "2.1.1",
4
+ "description": "micromark utility to handle character codes",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "micromark",
8
+ "util",
9
+ "utility",
10
+ "character"
11
+ ],
12
+ "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-character",
13
+ "bugs": "https://github.com/micromark/micromark/issues",
14
+ "funding": [
15
+ {
16
+ "type": "GitHub Sponsors",
17
+ "url": "https://github.com/sponsors/unifiedjs"
18
+ },
19
+ {
20
+ "type": "OpenCollective",
21
+ "url": "https://opencollective.com/unified"
22
+ }
23
+ ],
24
+ "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
25
+ "contributors": [
26
+ "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
27
+ ],
28
+ "sideEffects": false,
29
+ "type": "module",
30
+ "files": [
31
+ "dev/",
32
+ "lib/",
33
+ "index.d.ts.map",
34
+ "index.d.ts",
35
+ "index.js"
36
+ ],
37
+ "exports": {
38
+ "development": "./dev/index.js",
39
+ "default": "./index.js"
40
+ },
41
+ "dependencies": {
42
+ "micromark-util-symbol": "^2.0.0",
43
+ "micromark-util-types": "^2.0.0"
44
+ },
45
+ "scripts": {
46
+ "build": "micromark-build"
47
+ },
48
+ "xo": {
49
+ "envs": [
50
+ "shared-node-browser"
51
+ ],
52
+ "prettier": true,
53
+ "rules": {
54
+ "unicorn/prefer-code-point": "off"
55
+ }
56
+ }
57
+ }
node_modules/micromark-util-character/readme.md ADDED
@@ -0,0 +1,446 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # micromark-util-character
2
+
3
+ [![Build][build-badge]][build]
4
+ [![Coverage][coverage-badge]][coverage]
5
+ [![Downloads][downloads-badge]][downloads]
6
+ [![Size][bundle-size-badge]][bundle-size]
7
+ [![Sponsors][sponsors-badge]][opencollective]
8
+ [![Backers][backers-badge]][opencollective]
9
+ [![Chat][chat-badge]][chat]
10
+
11
+ [micromark][] utility to handle [character codes][code].
12
+
13
+ ## Contents
14
+
15
+ * [What is this?](#what-is-this)
16
+ * [When should I use this?](#when-should-i-use-this)
17
+ * [Install](#install)
18
+ * [Use](#use)
19
+ * [API](#api)
20
+ * [`asciiAlpha(code)`](#asciialphacode)
21
+ * [`asciiAlphanumeric(code)`](#asciialphanumericcode)
22
+ * [`asciiAtext(code)`](#asciiatextcode)
23
+ * [`asciiControl(code)`](#asciicontrolcode)
24
+ * [`asciiDigit(code)`](#asciidigitcode)
25
+ * [`asciiHexDigit(code)`](#asciihexdigitcode)
26
+ * [`asciiPunctuation(code)`](#asciipunctuationcode)
27
+ * [`markdownLineEnding(code)`](#markdownlineendingcode)
28
+ * [`markdownLineEndingOrSpace(code)`](#markdownlineendingorspacecode)
29
+ * [`markdownSpace(code)`](#markdownspacecode)
30
+ * [`unicodePunctuation(code)`](#unicodepunctuationcode)
31
+ * [`unicodeWhitespace(code)`](#unicodewhitespacecode)
32
+ * [Types](#types)
33
+ * [Compatibility](#compatibility)
34
+ * [Security](#security)
35
+ * [Contribute](#contribute)
36
+ * [License](#license)
37
+
38
+ ## What is this?
39
+
40
+ This package exposes algorithms to check whether characters match groups.
41
+
42
+ ## When should I use this?
43
+
44
+ This package might be useful when you are making your own micromark extensions.
45
+
46
+ ## Install
47
+
48
+ This package is [ESM only][esm].
49
+ In Node.js (version 16+), install with [npm][]:
50
+
51
+ ```sh
52
+ npm install micromark-util-character
53
+ ```
54
+
55
+ In Deno with [`esm.sh`][esmsh]:
56
+
57
+ ```js
58
+ import * as character from 'https://esm.sh/micromark-util-character@1'
59
+ ```
60
+
61
+ In browsers with [`esm.sh`][esmsh]:
62
+
63
+ ```html
64
+ <script type="module">
65
+ import * as character from 'https://esm.sh/micromark-util-character@1?bundle'
66
+ </script>
67
+ ```
68
+
69
+ ## Use
70
+
71
+ ```js
72
+ import {asciiAlpha} from 'micromark-util-character'
73
+
74
+ console.log(asciiAlpha(64)) // false
75
+ console.log(asciiAlpha(65)) // true
76
+ ```
77
+
78
+ ## API
79
+
80
+ This module exports the identifiers
81
+ [`asciiAlpha`][api-ascii-alpha],
82
+ [`asciiAlphanumeric`][api-ascii-alphanumeric],
83
+ [`asciiAtext`][api-ascii-atext],
84
+ [`asciiControl`][api-ascii-control],
85
+ [`asciiDigit`][api-ascii-digit],
86
+ [`asciiHexDigit`][api-ascii-hex-digit],
87
+ [`asciiPunctuation`][api-ascii-punctuation],
88
+ [`markdownLineEnding`][api-markdown-line-ending],
89
+ [`markdownLineEndingOrSpace`][api-markdown-line-ending-or-space],
90
+ [`markdownSpace`][api-markdown-space],
91
+ [`unicodePunctuation`][api-unicode-punctuation],
92
+ [`unicodeWhitespace`][api-unicode-whitespace].
93
+ There is no default export.
94
+
95
+ ### `asciiAlpha(code)`
96
+
97
+ Check whether the [character code][code] represents an ASCII alpha (`a` through
98
+ `z`, case insensitive).
99
+
100
+ An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
101
+
102
+ An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
103
+ to U+005A (`Z`).
104
+
105
+ An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
106
+ to U+007A (`z`).
107
+
108
+ ###### Parameters
109
+
110
+ * `code` (`Code`)
111
+ — code
112
+
113
+ ###### Returns
114
+
115
+ Whether it matches (`boolean`).
116
+
117
+ ### `asciiAlphanumeric(code)`
118
+
119
+ Check whether the [character code][code] represents an ASCII alphanumeric (`a`
120
+ through `z`, case insensitive, or `0` through `9`).
121
+
122
+ An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
123
+ (see `asciiAlpha`).
124
+
125
+ ###### Parameters
126
+
127
+ * `code` (`Code`)
128
+ — code
129
+
130
+ ###### Returns
131
+
132
+ Whether it matches (`boolean`).
133
+
134
+ ### `asciiAtext(code)`
135
+
136
+ Check whether the [character code][code] represents an ASCII atext.
137
+
138
+ atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
139
+ the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
140
+ U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
141
+ SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
142
+ CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
143
+ (`{`) to U+007E TILDE (`~`) (**\[RFC5322]**).
144
+
145
+ See **\[RFC5322]**:\
146
+ [Internet Message Format](https://tools.ietf.org/html/rfc5322).\
147
+ P. Resnick.\
148
+ IETF.
149
+
150
+ ###### Parameters
151
+
152
+ * `code` (`Code`)
153
+ — code
154
+
155
+ ###### Returns
156
+
157
+ Whether it matches (`boolean`).
158
+
159
+ ### `asciiControl(code)`
160
+
161
+ Check whether a [character code][code] is an ASCII control character.
162
+
163
+ An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
164
+ to U+001F (US), or U+007F (DEL).
165
+
166
+ ###### Parameters
167
+
168
+ * `code` (`Code`)
169
+ — code
170
+
171
+ ###### Returns
172
+
173
+ Whether it matches (`boolean`).
174
+
175
+ ### `asciiDigit(code)`
176
+
177
+ Check whether the [character code][code] represents an ASCII digit (`0` through
178
+ `9`).
179
+
180
+ An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
181
+ U+0039 (`9`).
182
+
183
+ ###### Parameters
184
+
185
+ * `code` (`Code`)
186
+ — code
187
+
188
+ ###### Returns
189
+
190
+ Whether it matches (`boolean`).
191
+
192
+ ### `asciiHexDigit(code)`
193
+
194
+ Check whether the [character code][code] represents an ASCII hex digit (`a`
195
+ through `f`, case insensitive, or `0` through `9`).
196
+
197
+ An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
198
+ digit, or an ASCII lower hex digit.
199
+
200
+ An **ASCII upper hex digit** is a character in the inclusive range U+0041
201
+ (`A`) to U+0046 (`F`).
202
+
203
+ An **ASCII lower hex digit** is a character in the inclusive range U+0061
204
+ (`a`) to U+0066 (`f`).
205
+
206
+ ###### Parameters
207
+
208
+ * `code` (`Code`)
209
+ — code
210
+
211
+ ###### Returns
212
+
213
+ Whether it matches (`boolean`).
214
+
215
+ ### `asciiPunctuation(code)`
216
+
217
+ Check whether the [character code][code] represents ASCII punctuation.
218
+
219
+ An **ASCII punctuation** is a character in the inclusive ranges U+0021
220
+ EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
221
+ SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
222
+ (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
223
+
224
+ ###### Parameters
225
+
226
+ * `code` (`Code`)
227
+ — code
228
+
229
+ ###### Returns
230
+
231
+ Whether it matches (`boolean`).
232
+
233
+ ### `markdownLineEnding(code)`
234
+
235
+ Check whether a [character code][code] is a markdown line ending.
236
+
237
+ A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
238
+ LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
239
+
240
+ In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
241
+ RETURN (CR) are replaced by these virtual characters depending on whether
242
+ they occurred together.
243
+
244
+ ###### Parameters
245
+
246
+ * `code` (`Code`)
247
+ — code
248
+
249
+ ###### Returns
250
+
251
+ Whether it matches (`boolean`).
252
+
253
+ ### `markdownLineEndingOrSpace(code)`
254
+
255
+ Check whether a [character code][code] is a markdown line ending (see
256
+ `markdownLineEnding`) or markdown space (see `markdownSpace`).
257
+
258
+ ###### Parameters
259
+
260
+ * `code` (`Code`)
261
+ — code
262
+
263
+ ###### Returns
264
+
265
+ Whether it matches (`boolean`).
266
+
267
+ ### `markdownSpace(code)`
268
+
269
+ Check whether a [character code][code] is a markdown space.
270
+
271
+ A **markdown space** is the concrete character U+0020 SPACE (SP) and the
272
+ virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
273
+
274
+ In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
275
+ replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
276
+ SPACE (VS) characters, depending on the column at which the tab occurred.
277
+
278
+ ###### Parameters
279
+
280
+ * `code` (`Code`)
281
+ — code
282
+
283
+ ###### Returns
284
+
285
+ Whether it matches (`boolean`).
286
+
287
+ ### `unicodePunctuation(code)`
288
+
289
+ Check whether the [character code][code] represents Unicode punctuation.
290
+
291
+ A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
292
+ Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
293
+ (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
294
+ (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
295
+ punctuation (see `asciiPunctuation`) (**\[UNICODE]**).
296
+
297
+ See **\[UNICODE]**:\
298
+ [The Unicode Standard](https://www.unicode.org/versions/).\
299
+ Unicode Consortium.
300
+
301
+ ###### Parameters
302
+
303
+ * `code` (`Code`)
304
+ — code
305
+
306
+ ###### Returns
307
+
308
+ Whether it matches (`boolean`).
309
+
310
+ ### `unicodeWhitespace(code)`
311
+
312
+ Check whether the [character code][code] represents Unicode whitespace.
313
+
314
+ Note that this does handle micromark specific markdown whitespace characters.
315
+ See `markdownLineEndingOrSpace` to check that.
316
+
317
+ A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
318
+ Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
319
+ U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
320
+
321
+ See **\[UNICODE]**:\
322
+ [The Unicode Standard](https://www.unicode.org/versions/).\
323
+ Unicode Consortium.
324
+
325
+ ###### Parameters
326
+
327
+ * `code` (`Code`)
328
+ — code
329
+
330
+ ###### Returns
331
+
332
+ Whether it matches (`boolean`).
333
+
334
+ ## Types
335
+
336
+ This package is fully typed with [TypeScript][].
337
+ It exports no additional types.
338
+
339
+ ## Compatibility
340
+
341
+ Projects maintained by the unified collective are compatible with maintained
342
+ versions of Node.js.
343
+
344
+ When we cut a new major release, we drop support for unmaintained versions of
345
+ Node.
346
+ This means we try to keep the current release line,
347
+ `micromark-util-character@2`, compatible with Node.js 16.
348
+ This package works with `micromark@3`.
349
+
350
+ ## Security
351
+
352
+ This package is safe.
353
+ See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
354
+ submit a security report.
355
+
356
+ ## Contribute
357
+
358
+ See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
359
+ to get started.
360
+ See [`support.md`][support] for ways to get help.
361
+
362
+ This project has a [code of conduct][coc].
363
+ By interacting with this repository, organisation, or community you agree to
364
+ abide by its terms.
365
+
366
+ ## License
367
+
368
+ [MIT][license] © [Titus Wormer][author]
369
+
370
+ <!-- Definitions -->
371
+
372
+ [build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
373
+
374
+ [build]: https://github.com/micromark/micromark/actions
375
+
376
+ [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
377
+
378
+ [coverage]: https://codecov.io/github/micromark/micromark
379
+
380
+ [downloads-badge]: https://img.shields.io/npm/dm/micromark-util-character.svg
381
+
382
+ [downloads]: https://www.npmjs.com/package/micromark-util-character
383
+
384
+ [bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-character
385
+
386
+ [bundle-size]: https://bundlejs.com/?q=micromark-util-character
387
+
388
+ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
389
+
390
+ [backers-badge]: https://opencollective.com/unified/backers/badge.svg
391
+
392
+ [opencollective]: https://opencollective.com/unified
393
+
394
+ [npm]: https://docs.npmjs.com/cli/install
395
+
396
+ [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
397
+
398
+ [esmsh]: https://esm.sh
399
+
400
+ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
401
+
402
+ [chat]: https://github.com/micromark/micromark/discussions
403
+
404
+ [license]: https://github.com/micromark/micromark/blob/main/license
405
+
406
+ [author]: https://wooorm.com
407
+
408
+ [health]: https://github.com/micromark/.github
409
+
410
+ [securitymd]: https://github.com/micromark/.github/blob/main/security.md
411
+
412
+ [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
413
+
414
+ [support]: https://github.com/micromark/.github/blob/main/support.md
415
+
416
+ [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
417
+
418
+ [typescript]: https://www.typescriptlang.org
419
+
420
+ [micromark]: https://github.com/micromark/micromark
421
+
422
+ [code]: https://github.com/micromark/micromark#preprocess
423
+
424
+ [api-ascii-alpha]: #asciialphacode
425
+
426
+ [api-ascii-alphanumeric]: #asciialphanumericcode
427
+
428
+ [api-ascii-atext]: #asciiatextcode
429
+
430
+ [api-ascii-control]: #asciicontrolcode
431
+
432
+ [api-ascii-digit]: #asciidigitcode
433
+
434
+ [api-ascii-hex-digit]: #asciihexdigitcode
435
+
436
+ [api-ascii-punctuation]: #asciipunctuationcode
437
+
438
+ [api-markdown-line-ending]: #markdownlineendingcode
439
+
440
+ [api-markdown-line-ending-or-space]: #markdownlineendingorspacecode
441
+
442
+ [api-markdown-space]: #markdownspacecode
443
+
444
+ [api-unicode-punctuation]: #unicodepunctuationcode
445
+
446
+ [api-unicode-whitespace]: #unicodewhitespacecode
node_modules/micromark-util-chunked/dev/index.d.ts ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Like `Array#splice`, but smarter for giant arrays.
3
+ *
4
+ * `Array#splice` takes all items to be inserted as individual argument which
5
+ * causes a stack overflow in V8 when trying to insert 100k items for instance.
6
+ *
7
+ * Otherwise, this does not return the removed items, and takes `items` as an
8
+ * array instead of rest parameters.
9
+ *
10
+ * @template {unknown} T
11
+ * Item type.
12
+ * @param {Array<T>} list
13
+ * List to operate on.
14
+ * @param {number} start
15
+ * Index to remove/insert at (can be negative).
16
+ * @param {number} remove
17
+ * Number of items to remove.
18
+ * @param {Array<T>} items
19
+ * Items to inject into `list`.
20
+ * @returns {undefined}
21
+ * Nothing.
22
+ */
23
+ export function splice<T extends unknown>(list: Array<T>, start: number, remove: number, items: Array<T>): undefined;
24
+ /**
25
+ * Append `items` (an array) at the end of `list` (another array).
26
+ * When `list` was empty, returns `items` instead.
27
+ *
28
+ * This prevents a potentially expensive operation when `list` is empty,
29
+ * and adds items in batches to prevent V8 from hanging.
30
+ *
31
+ * @template {unknown} T
32
+ * Item type.
33
+ * @param {Array<T>} list
34
+ * List to operate on.
35
+ * @param {Array<T>} items
36
+ * Items to add to `list`.
37
+ * @returns {Array<T>}
38
+ * Either `list` or `items`.
39
+ */
40
+ export function push<T extends unknown>(list: Array<T>, items: Array<T>): Array<T>;
41
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-chunked/dev/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,uBAbuB,CAAC,SAAX,OAAS,QAEX,KAAK,CAAC,CAAC,CAAC,SAER,MAAM,UAEN,MAAM,SAEN,KAAK,CAAC,CAAC,CAAC,GAEN,SAAS,CA0CrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBATuB,CAAC,SAAX,OAAS,QAEX,KAAK,CAAC,CAAC,CAAC,SAER,KAAK,CAAC,CAAC,CAAC,GAEN,KAAK,CAAC,CAAC,CAAC,CAUpB"}
node_modules/micromark-util-chunked/dev/index.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {constants} from 'micromark-util-symbol'
2
+
3
+ /**
4
+ * Like `Array#splice`, but smarter for giant arrays.
5
+ *
6
+ * `Array#splice` takes all items to be inserted as individual argument which
7
+ * causes a stack overflow in V8 when trying to insert 100k items for instance.
8
+ *
9
+ * Otherwise, this does not return the removed items, and takes `items` as an
10
+ * array instead of rest parameters.
11
+ *
12
+ * @template {unknown} T
13
+ * Item type.
14
+ * @param {Array<T>} list
15
+ * List to operate on.
16
+ * @param {number} start
17
+ * Index to remove/insert at (can be negative).
18
+ * @param {number} remove
19
+ * Number of items to remove.
20
+ * @param {Array<T>} items
21
+ * Items to inject into `list`.
22
+ * @returns {undefined}
23
+ * Nothing.
24
+ */
25
+ export function splice(list, start, remove, items) {
26
+ const end = list.length
27
+ let chunkStart = 0
28
+ /** @type {Array<unknown>} */
29
+ let parameters
30
+
31
+ // Make start between zero and `end` (included).
32
+ if (start < 0) {
33
+ start = -start > end ? 0 : end + start
34
+ } else {
35
+ start = start > end ? end : start
36
+ }
37
+
38
+ remove = remove > 0 ? remove : 0
39
+
40
+ // No need to chunk the items if there’s only a couple (10k) items.
41
+ if (items.length < constants.v8MaxSafeChunkSize) {
42
+ parameters = Array.from(items)
43
+ parameters.unshift(start, remove)
44
+ // @ts-expect-error Hush, it’s fine.
45
+ list.splice(...parameters)
46
+ } else {
47
+ // Delete `remove` items starting from `start`
48
+ if (remove) list.splice(start, remove)
49
+
50
+ // Insert the items in chunks to not cause stack overflows.
51
+ while (chunkStart < items.length) {
52
+ parameters = items.slice(
53
+ chunkStart,
54
+ chunkStart + constants.v8MaxSafeChunkSize
55
+ )
56
+ parameters.unshift(start, 0)
57
+ // @ts-expect-error Hush, it’s fine.
58
+ list.splice(...parameters)
59
+
60
+ chunkStart += constants.v8MaxSafeChunkSize
61
+ start += constants.v8MaxSafeChunkSize
62
+ }
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Append `items` (an array) at the end of `list` (another array).
68
+ * When `list` was empty, returns `items` instead.
69
+ *
70
+ * This prevents a potentially expensive operation when `list` is empty,
71
+ * and adds items in batches to prevent V8 from hanging.
72
+ *
73
+ * @template {unknown} T
74
+ * Item type.
75
+ * @param {Array<T>} list
76
+ * List to operate on.
77
+ * @param {Array<T>} items
78
+ * Items to add to `list`.
79
+ * @returns {Array<T>}
80
+ * Either `list` or `items`.
81
+ */
82
+ export function push(list, items) {
83
+ if (list.length > 0) {
84
+ splice(list, list.length, 0, items)
85
+ return list
86
+ }
87
+
88
+ return items
89
+ }
node_modules/micromark-util-chunked/index.d.ts ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Like `Array#splice`, but smarter for giant arrays.
3
+ *
4
+ * `Array#splice` takes all items to be inserted as individual argument which
5
+ * causes a stack overflow in V8 when trying to insert 100k items for instance.
6
+ *
7
+ * Otherwise, this does not return the removed items, and takes `items` as an
8
+ * array instead of rest parameters.
9
+ *
10
+ * @template {unknown} T
11
+ * Item type.
12
+ * @param {Array<T>} list
13
+ * List to operate on.
14
+ * @param {number} start
15
+ * Index to remove/insert at (can be negative).
16
+ * @param {number} remove
17
+ * Number of items to remove.
18
+ * @param {Array<T>} items
19
+ * Items to inject into `list`.
20
+ * @returns {undefined}
21
+ * Nothing.
22
+ */
23
+ export function splice<T extends unknown>(list: Array<T>, start: number, remove: number, items: Array<T>): undefined;
24
+ /**
25
+ * Append `items` (an array) at the end of `list` (another array).
26
+ * When `list` was empty, returns `items` instead.
27
+ *
28
+ * This prevents a potentially expensive operation when `list` is empty,
29
+ * and adds items in batches to prevent V8 from hanging.
30
+ *
31
+ * @template {unknown} T
32
+ * Item type.
33
+ * @param {Array<T>} list
34
+ * List to operate on.
35
+ * @param {Array<T>} items
36
+ * Items to add to `list`.
37
+ * @returns {Array<T>}
38
+ * Either `list` or `items`.
39
+ */
40
+ export function push<T extends unknown>(list: Array<T>, items: Array<T>): Array<T>;
41
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-chunked/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,uBAbuB,CAAC,SAAX,OAAS,QAEX,KAAK,CAAC,CAAC,CAAC,SAER,MAAM,UAEN,MAAM,SAEN,KAAK,CAAC,CAAC,CAAC,GAEN,SAAS,CA0CrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBATuB,CAAC,SAAX,OAAS,QAEX,KAAK,CAAC,CAAC,CAAC,SAER,KAAK,CAAC,CAAC,CAAC,GAEN,KAAK,CAAC,CAAC,CAAC,CAUpB"}
node_modules/micromark-util-chunked/index.js ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Like `Array#splice`, but smarter for giant arrays.
3
+ *
4
+ * `Array#splice` takes all items to be inserted as individual argument which
5
+ * causes a stack overflow in V8 when trying to insert 100k items for instance.
6
+ *
7
+ * Otherwise, this does not return the removed items, and takes `items` as an
8
+ * array instead of rest parameters.
9
+ *
10
+ * @template {unknown} T
11
+ * Item type.
12
+ * @param {Array<T>} list
13
+ * List to operate on.
14
+ * @param {number} start
15
+ * Index to remove/insert at (can be negative).
16
+ * @param {number} remove
17
+ * Number of items to remove.
18
+ * @param {Array<T>} items
19
+ * Items to inject into `list`.
20
+ * @returns {undefined}
21
+ * Nothing.
22
+ */
23
+ export function splice(list, start, remove, items) {
24
+ const end = list.length;
25
+ let chunkStart = 0;
26
+ /** @type {Array<unknown>} */
27
+ let parameters;
28
+
29
+ // Make start between zero and `end` (included).
30
+ if (start < 0) {
31
+ start = -start > end ? 0 : end + start;
32
+ } else {
33
+ start = start > end ? end : start;
34
+ }
35
+ remove = remove > 0 ? remove : 0;
36
+
37
+ // No need to chunk the items if there’s only a couple (10k) items.
38
+ if (items.length < 10000) {
39
+ parameters = Array.from(items);
40
+ parameters.unshift(start, remove);
41
+ // @ts-expect-error Hush, it’s fine.
42
+ list.splice(...parameters);
43
+ } else {
44
+ // Delete `remove` items starting from `start`
45
+ if (remove) list.splice(start, remove);
46
+
47
+ // Insert the items in chunks to not cause stack overflows.
48
+ while (chunkStart < items.length) {
49
+ parameters = items.slice(chunkStart, chunkStart + 10000);
50
+ parameters.unshift(start, 0);
51
+ // @ts-expect-error Hush, it’s fine.
52
+ list.splice(...parameters);
53
+ chunkStart += 10000;
54
+ start += 10000;
55
+ }
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Append `items` (an array) at the end of `list` (another array).
61
+ * When `list` was empty, returns `items` instead.
62
+ *
63
+ * This prevents a potentially expensive operation when `list` is empty,
64
+ * and adds items in batches to prevent V8 from hanging.
65
+ *
66
+ * @template {unknown} T
67
+ * Item type.
68
+ * @param {Array<T>} list
69
+ * List to operate on.
70
+ * @param {Array<T>} items
71
+ * Items to add to `list`.
72
+ * @returns {Array<T>}
73
+ * Either `list` or `items`.
74
+ */
75
+ export function push(list, items) {
76
+ if (list.length > 0) {
77
+ splice(list, list.length, 0, items);
78
+ return list;
79
+ }
80
+ return items;
81
+ }
node_modules/micromark-util-chunked/license ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
node_modules/micromark-util-chunked/package.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "micromark-util-chunked",
3
+ "version": "2.0.1",
4
+ "description": "micromark utility to splice and push with giant arrays",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "micromark",
8
+ "util",
9
+ "utility",
10
+ "chunk",
11
+ "splice",
12
+ "push"
13
+ ],
14
+ "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-chunked",
15
+ "bugs": "https://github.com/micromark/micromark/issues",
16
+ "funding": [
17
+ {
18
+ "type": "GitHub Sponsors",
19
+ "url": "https://github.com/sponsors/unifiedjs"
20
+ },
21
+ {
22
+ "type": "OpenCollective",
23
+ "url": "https://opencollective.com/unified"
24
+ }
25
+ ],
26
+ "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
27
+ "contributors": [
28
+ "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
29
+ ],
30
+ "sideEffects": false,
31
+ "type": "module",
32
+ "files": [
33
+ "dev/",
34
+ "index.d.ts.map",
35
+ "index.d.ts",
36
+ "index.js"
37
+ ],
38
+ "exports": {
39
+ "development": "./dev/index.js",
40
+ "default": "./index.js"
41
+ },
42
+ "dependencies": {
43
+ "micromark-util-symbol": "^2.0.0"
44
+ },
45
+ "scripts": {
46
+ "build": "micromark-build"
47
+ },
48
+ "xo": {
49
+ "envs": [
50
+ "shared-node-browser"
51
+ ],
52
+ "prettier": true,
53
+ "rules": {
54
+ "unicorn/prefer-code-point": "off"
55
+ }
56
+ }
57
+ }
node_modules/micromark-util-chunked/readme.md ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # micromark-util-chunked
2
+
3
+ [![Build][build-badge]][build]
4
+ [![Coverage][coverage-badge]][coverage]
5
+ [![Downloads][downloads-badge]][downloads]
6
+ [![Size][bundle-size-badge]][bundle-size]
7
+ [![Sponsors][sponsors-badge]][opencollective]
8
+ [![Backers][backers-badge]][opencollective]
9
+ [![Chat][chat-badge]][chat]
10
+
11
+ [micromark][] utility to splice and push with giant arrays.
12
+
13
+ ## Contents
14
+
15
+ * [What is this?](#what-is-this)
16
+ * [When should I use this?](#when-should-i-use-this)
17
+ * [Install](#install)
18
+ * [Use](#use)
19
+ * [API](#api)
20
+ * [`push(list, items)`](#pushlist-items)
21
+ * [`splice(list, start, remove, items)`](#splicelist-start-remove-items)
22
+ * [Types](#types)
23
+ * [Compatibility](#compatibility)
24
+ * [Security](#security)
25
+ * [Contribute](#contribute)
26
+ * [License](#license)
27
+
28
+ ## What is this?
29
+
30
+ This package exposes an algorithm to splice for giant arrays, which V8 bugs
31
+ out on.
32
+
33
+ ## When should I use this?
34
+
35
+ This package might be useful when you are making your own micromark extensions.
36
+
37
+ ## Install
38
+
39
+ This package is [ESM only][esm].
40
+ In Node.js (version 16+), install with [npm][]:
41
+
42
+ ```sh
43
+ npm install micromark-util-chunked
44
+ ```
45
+
46
+ In Deno with [`esm.sh`][esmsh]:
47
+
48
+ ```js
49
+ import {push, splice} from 'https://esm.sh/micromark-util-chunked@1'
50
+ ```
51
+
52
+ In browsers with [`esm.sh`][esmsh]:
53
+
54
+ ```html
55
+ <script type="module">
56
+ import {push, splice} from 'https://esm.sh/micromark-util-chunked@1?bundle'
57
+ </script>
58
+ ```
59
+
60
+ ## Use
61
+
62
+ ```js
63
+ import {push, splice} from 'micromark-util-chunked'
64
+
65
+ // …
66
+
67
+ nextEvents = push(nextEvents, [
68
+ ['enter', events[open][1], context],
69
+ ['exit', events[open][1], context]
70
+ ])
71
+
72
+ // …
73
+
74
+ splice(events, open - 1, index - open + 3, nextEvents)
75
+
76
+ // …
77
+ ```
78
+
79
+ ## API
80
+
81
+ This module exports the identifiers [`push`][api-push]
82
+ and [`splice`][api-splice].
83
+ There is no default export.
84
+
85
+ ### `push(list, items)`
86
+
87
+ Append `items` (an array) at the end of `list` (another array).
88
+ When `list` was empty, returns `items` instead.
89
+
90
+ This prevents a potentially expensive operation when `list` is empty,
91
+ and adds items in batches to prevent V8 from hanging.
92
+
93
+ ###### Parameters
94
+
95
+ * `list` (`Array<unknown>`)
96
+ — list to operate on
97
+ * `items` (`Array<unknown>`)
98
+ — items to add to `list`
99
+
100
+ ###### Returns
101
+
102
+ Either `list` or `items` (`Array<unknown>`).
103
+
104
+ ### `splice(list, start, remove, items)`
105
+
106
+ Like `Array#splice`, but smarter for giant arrays.
107
+
108
+ `Array#splice` takes all items to be inserted as individual argument which
109
+ causes a stack overflow in V8 when trying to insert 100k items for instance.
110
+
111
+ Otherwise, this does not return the removed items, and takes `items` as an
112
+ array instead of rest parameters.
113
+
114
+ ###### Parameters
115
+
116
+ * `list` (`Array<unknown>`)
117
+ — list to operate on
118
+ * `start` (`number`)
119
+ — index to remove/insert at (can be negative)
120
+ * `remove` (`number`)
121
+ — number of items to remove
122
+ * `items` (`Array<unknown>`)
123
+ — items to inject into `list`
124
+
125
+ ###### Returns
126
+
127
+ Nothing (`undefined`).
128
+
129
+ ## Types
130
+
131
+ This package is fully typed with [TypeScript][].
132
+ It exports no additional types.
133
+
134
+ ## Compatibility
135
+
136
+ Projects maintained by the unified collective are compatible with maintained
137
+ versions of Node.js.
138
+
139
+ When we cut a new major release, we drop support for unmaintained versions of
140
+ Node.
141
+ This means we try to keep the current release line,
142
+ `micromark-util-chunked@2`, compatible with Node.js 16.
143
+ This package works with `micromark@3`.
144
+
145
+ ## Security
146
+
147
+ This package is safe.
148
+ See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
149
+ submit a security report.
150
+
151
+ ## Contribute
152
+
153
+ See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
154
+ to get started.
155
+ See [`support.md`][support] for ways to get help.
156
+
157
+ This project has a [code of conduct][coc].
158
+ By interacting with this repository, organisation, or community you agree to
159
+ abide by its terms.
160
+
161
+ ## License
162
+
163
+ [MIT][license] © [Titus Wormer][author]
164
+
165
+ <!-- Definitions -->
166
+
167
+ [build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
168
+
169
+ [build]: https://github.com/micromark/micromark/actions
170
+
171
+ [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
172
+
173
+ [coverage]: https://codecov.io/github/micromark/micromark
174
+
175
+ [downloads-badge]: https://img.shields.io/npm/dm/micromark-util-chunked.svg
176
+
177
+ [downloads]: https://www.npmjs.com/package/micromark-util-chunked
178
+
179
+ [bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-chunked
180
+
181
+ [bundle-size]: https://bundlejs.com/?q=micromark-util-chunked
182
+
183
+ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
184
+
185
+ [backers-badge]: https://opencollective.com/unified/backers/badge.svg
186
+
187
+ [opencollective]: https://opencollective.com/unified
188
+
189
+ [npm]: https://docs.npmjs.com/cli/install
190
+
191
+ [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
192
+
193
+ [esmsh]: https://esm.sh
194
+
195
+ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
196
+
197
+ [chat]: https://github.com/micromark/micromark/discussions
198
+
199
+ [license]: https://github.com/micromark/micromark/blob/main/license
200
+
201
+ [author]: https://wooorm.com
202
+
203
+ [health]: https://github.com/micromark/.github
204
+
205
+ [securitymd]: https://github.com/micromark/.github/blob/main/security.md
206
+
207
+ [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
208
+
209
+ [support]: https://github.com/micromark/.github/blob/main/support.md
210
+
211
+ [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
212
+
213
+ [typescript]: https://www.typescriptlang.org
214
+
215
+ [micromark]: https://github.com/micromark/micromark
216
+
217
+ [api-push]: #pushlist-items
218
+
219
+ [api-splice]: #splicelist-start-remove-items
node_modules/micromark-util-classify-character/dev/index.d.ts ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Classify whether a code represents whitespace, punctuation, or something
3
+ * else.
4
+ *
5
+ * Used for attention (emphasis, strong), whose sequences can open or close
6
+ * based on the class of surrounding characters.
7
+ *
8
+ * > 👉 **Note**: eof (`null`) is seen as whitespace.
9
+ *
10
+ * @param {Code} code
11
+ * Code.
12
+ * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
13
+ * Group.
14
+ */
15
+ export function classifyCharacter(code: Code): typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined;
16
+ import type { Code } from 'micromark-util-types';
17
+ import { constants } from 'micromark-util-symbol';
18
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-classify-character/dev/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,wCALW,IAAI,GAEF,OAAO,SAAS,CAAC,wBAAwB,GAAG,OAAO,SAAS,CAAC,yBAAyB,GAAG,SAAS,CAe9G;0BApCsB,sBAAsB;0BAQd,uBAAuB"}
node_modules/micromark-util-classify-character/dev/index.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {Code} from 'micromark-util-types'
3
+ */
4
+
5
+ import {
6
+ markdownLineEndingOrSpace,
7
+ unicodePunctuation,
8
+ unicodeWhitespace
9
+ } from 'micromark-util-character'
10
+ import {codes, constants} from 'micromark-util-symbol'
11
+
12
+ /**
13
+ * Classify whether a code represents whitespace, punctuation, or something
14
+ * else.
15
+ *
16
+ * Used for attention (emphasis, strong), whose sequences can open or close
17
+ * based on the class of surrounding characters.
18
+ *
19
+ * > 👉 **Note**: eof (`null`) is seen as whitespace.
20
+ *
21
+ * @param {Code} code
22
+ * Code.
23
+ * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
24
+ * Group.
25
+ */
26
+ export function classifyCharacter(code) {
27
+ if (
28
+ code === codes.eof ||
29
+ markdownLineEndingOrSpace(code) ||
30
+ unicodeWhitespace(code)
31
+ ) {
32
+ return constants.characterGroupWhitespace
33
+ }
34
+
35
+ if (unicodePunctuation(code)) {
36
+ return constants.characterGroupPunctuation
37
+ }
38
+ }
node_modules/micromark-util-classify-character/index.d.ts ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Classify whether a code represents whitespace, punctuation, or something
3
+ * else.
4
+ *
5
+ * Used for attention (emphasis, strong), whose sequences can open or close
6
+ * based on the class of surrounding characters.
7
+ *
8
+ * > 👉 **Note**: eof (`null`) is seen as whitespace.
9
+ *
10
+ * @param {Code} code
11
+ * Code.
12
+ * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
13
+ * Group.
14
+ */
15
+ export function classifyCharacter(code: Code): typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined;
16
+ import type { Code } from 'micromark-util-types';
17
+ import { constants } from 'micromark-util-symbol';
18
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-classify-character/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,wCALW,IAAI,GAEF,OAAO,SAAS,CAAC,wBAAwB,GAAG,OAAO,SAAS,CAAC,yBAAyB,GAAG,SAAS,CAe9G;0BApCsB,sBAAsB;0BAQd,uBAAuB"}
node_modules/micromark-util-classify-character/index.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {Code} from 'micromark-util-types'
3
+ */
4
+
5
+ import { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';
6
+ /**
7
+ * Classify whether a code represents whitespace, punctuation, or something
8
+ * else.
9
+ *
10
+ * Used for attention (emphasis, strong), whose sequences can open or close
11
+ * based on the class of surrounding characters.
12
+ *
13
+ * > 👉 **Note**: eof (`null`) is seen as whitespace.
14
+ *
15
+ * @param {Code} code
16
+ * Code.
17
+ * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
18
+ * Group.
19
+ */
20
+ export function classifyCharacter(code) {
21
+ if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {
22
+ return 1;
23
+ }
24
+ if (unicodePunctuation(code)) {
25
+ return 2;
26
+ }
27
+ }
node_modules/micromark-util-classify-character/license ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
node_modules/micromark-util-classify-character/package.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "micromark-util-classify-character",
3
+ "version": "2.0.1",
4
+ "description": "micromark utility to classify whether a character is whitespace or punctuation",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "micromark",
8
+ "util",
9
+ "utility",
10
+ "attention",
11
+ "classify",
12
+ "character"
13
+ ],
14
+ "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-classify-character",
15
+ "bugs": "https://github.com/micromark/micromark/issues",
16
+ "funding": [
17
+ {
18
+ "type": "GitHub Sponsors",
19
+ "url": "https://github.com/sponsors/unifiedjs"
20
+ },
21
+ {
22
+ "type": "OpenCollective",
23
+ "url": "https://opencollective.com/unified"
24
+ }
25
+ ],
26
+ "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
27
+ "contributors": [
28
+ "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
29
+ ],
30
+ "sideEffects": false,
31
+ "type": "module",
32
+ "files": [
33
+ "dev/",
34
+ "index.d.ts.map",
35
+ "index.d.ts",
36
+ "index.js"
37
+ ],
38
+ "exports": {
39
+ "development": "./dev/index.js",
40
+ "default": "./index.js"
41
+ },
42
+ "dependencies": {
43
+ "micromark-util-character": "^2.0.0",
44
+ "micromark-util-symbol": "^2.0.0",
45
+ "micromark-util-types": "^2.0.0"
46
+ },
47
+ "scripts": {
48
+ "build": "micromark-build"
49
+ },
50
+ "xo": {
51
+ "envs": [
52
+ "shared-node-browser"
53
+ ],
54
+ "prettier": true,
55
+ "rules": {
56
+ "unicorn/prefer-code-point": "off"
57
+ }
58
+ }
59
+ }
node_modules/micromark-util-classify-character/readme.md ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # micromark-util-classify-character
2
+
3
+ [![Build][build-badge]][build]
4
+ [![Coverage][coverage-badge]][coverage]
5
+ [![Downloads][downloads-badge]][downloads]
6
+ [![Size][bundle-size-badge]][bundle-size]
7
+ [![Sponsors][sponsors-badge]][opencollective]
8
+ [![Backers][backers-badge]][opencollective]
9
+ [![Chat][chat-badge]][chat]
10
+
11
+ [micromark][] utility to classify whether a character is whitespace or
12
+ punctuation.
13
+
14
+ ## Contents
15
+
16
+ * [What is this?](#what-is-this)
17
+ * [When should I use this?](#when-should-i-use-this)
18
+ * [Install](#install)
19
+ * [Use](#use)
20
+ * [API](#api)
21
+ * [`classifyCharacter(code)`](#classifycharactercode)
22
+ * [Types](#types)
23
+ * [Compatibility](#compatibility)
24
+ * [Security](#security)
25
+ * [Contribute](#contribute)
26
+ * [License](#license)
27
+
28
+ ## What is this?
29
+
30
+ This package exposes an algorithm to classify characters into 3 categories.
31
+
32
+ ## When should I use this?
33
+
34
+ This package might be useful when you are making your own micromark extensions.
35
+
36
+ ## Install
37
+
38
+ This package is [ESM only][esm].
39
+ In Node.js (version 16+), install with [npm][]:
40
+
41
+ ```sh
42
+ npm install micromark-util-classify-character
43
+ ```
44
+
45
+ In Deno with [`esm.sh`][esmsh]:
46
+
47
+ ```js
48
+ import {classifyCharacter} from 'https://esm.sh/micromark-util-classify-character@1'
49
+ ```
50
+
51
+ In browsers with [`esm.sh`][esmsh]:
52
+
53
+ ```html
54
+ <script type="module">
55
+ import {classifyCharacter} from 'https://esm.sh/micromark-util-classify-character@1?bundle'
56
+ </script>
57
+ ```
58
+
59
+ ## Use
60
+
61
+ ```js
62
+ /**
63
+ * @this {TokenizeContext}
64
+ * Context.
65
+ * @type {Tokenizer}
66
+ */
67
+ function tokenizeAttention(effects, ok) {
68
+ return start
69
+
70
+ // …
71
+
72
+ /** @type {State} */
73
+ function sequence(code) {
74
+ if (code === marker) {
75
+ // …
76
+ }
77
+
78
+ const token = effects.exit('attentionSequence')
79
+ const after = classifyCharacter(code)
80
+ const open =
81
+ !after || (after === constants.characterGroupPunctuation && before)
82
+ const close =
83
+ !before || (before === constants.characterGroupPunctuation && after)
84
+ // …
85
+ }
86
+
87
+ // …
88
+ }
89
+ ```
90
+
91
+ ## API
92
+
93
+ This module exports the identifier
94
+ [`classifyCharacter`][api-classify-character].
95
+ There is no default export.
96
+
97
+ ### `classifyCharacter(code)`
98
+
99
+ Classify whether a code represents whitespace, punctuation, or something
100
+ else.
101
+
102
+ Used for attention (emphasis, strong), whose sequences can open or close
103
+ based on the class of surrounding characters.
104
+
105
+ > 👉 **Note**: eof (`null`) is seen as whitespace.
106
+
107
+ ###### Parameters
108
+
109
+ * `code` (`Code`)
110
+ — code
111
+
112
+ ###### Returns
113
+
114
+ Group (`constants.characterGroupWhitespace`,
115
+ `constants.characterGroupPunctuation`, or `undefined`).
116
+
117
+ ## Types
118
+
119
+ This package is fully typed with [TypeScript][].
120
+ It exports no additional types.
121
+
122
+ ## Compatibility
123
+
124
+ Projects maintained by the unified collective are compatible with maintained
125
+ versions of Node.js.
126
+
127
+ When we cut a new major release, we drop support for unmaintained versions of
128
+ Node.
129
+ This means we try to keep the current release line,
130
+ `micromark-util-classify-character@2`, compatible with Node.js 16.
131
+ This package works with `micromark@3`.
132
+
133
+ ## Security
134
+
135
+ This package is safe.
136
+ See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
137
+ submit a security report.
138
+
139
+ ## Contribute
140
+
141
+ See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
142
+ to get started.
143
+ See [`support.md`][support] for ways to get help.
144
+
145
+ This project has a [code of conduct][coc].
146
+ By interacting with this repository, organisation, or community you agree to
147
+ abide by its terms.
148
+
149
+ ## License
150
+
151
+ [MIT][license] © [Titus Wormer][author]
152
+
153
+ <!-- Definitions -->
154
+
155
+ [build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
156
+
157
+ [build]: https://github.com/micromark/micromark/actions
158
+
159
+ [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
160
+
161
+ [coverage]: https://codecov.io/github/micromark/micromark
162
+
163
+ [downloads-badge]: https://img.shields.io/npm/dm/micromark-util-classify-character.svg
164
+
165
+ [downloads]: https://www.npmjs.com/package/micromark-util-classify-character
166
+
167
+ [bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-classify-character
168
+
169
+ [bundle-size]: https://bundlejs.com/?q=micromark-util-classify-character
170
+
171
+ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
172
+
173
+ [backers-badge]: https://opencollective.com/unified/backers/badge.svg
174
+
175
+ [opencollective]: https://opencollective.com/unified
176
+
177
+ [npm]: https://docs.npmjs.com/cli/install
178
+
179
+ [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
180
+
181
+ [esmsh]: https://esm.sh
182
+
183
+ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
184
+
185
+ [chat]: https://github.com/micromark/micromark/discussions
186
+
187
+ [license]: https://github.com/micromark/micromark/blob/main/license
188
+
189
+ [author]: https://wooorm.com
190
+
191
+ [health]: https://github.com/micromark/.github
192
+
193
+ [securitymd]: https://github.com/micromark/.github/blob/main/security.md
194
+
195
+ [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
196
+
197
+ [support]: https://github.com/micromark/.github/blob/main/support.md
198
+
199
+ [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
200
+
201
+ [typescript]: https://www.typescriptlang.org
202
+
203
+ [micromark]: https://github.com/micromark/micromark
204
+
205
+ [api-classify-character]: #classifycharactercode
node_modules/micromark-util-combine-extensions/index.d.ts ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Combine multiple syntax extensions into one.
3
+ *
4
+ * @param {ReadonlyArray<Extension>} extensions
5
+ * List of syntax extensions.
6
+ * @returns {NormalizedExtension}
7
+ * A single combined extension.
8
+ */
9
+ export function combineExtensions(extensions: ReadonlyArray<Extension>): NormalizedExtension;
10
+ /**
11
+ * Combine multiple HTML extensions into one.
12
+ *
13
+ * @param {ReadonlyArray<HtmlExtension>} htmlExtensions
14
+ * List of HTML extensions.
15
+ * @returns {HtmlExtension}
16
+ * Single combined HTML extension.
17
+ */
18
+ export function combineHtmlExtensions(htmlExtensions: ReadonlyArray<HtmlExtension>): HtmlExtension;
19
+ import type { Extension } from 'micromark-util-types';
20
+ import type { NormalizedExtension } from 'micromark-util-types';
21
+ import type { HtmlExtension } from 'micromark-util-types';
22
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-combine-extensions/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAaA;;;;;;;GAOG;AACH,8CALW,aAAa,CAAC,SAAS,CAAC,GAEtB,mBAAmB,CAa/B;AA+DD;;;;;;;GAOG;AACH,sDALW,aAAa,CAAC,aAAa,CAAC,GAE1B,aAAa,CAazB;+BA1GS,sBAAsB;yCAAtB,sBAAsB;mCAAtB,sBAAsB"}
node_modules/micromark-util-combine-extensions/index.js ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @import {
3
+ * Extension,
4
+ * Handles,
5
+ * HtmlExtension,
6
+ * NormalizedExtension
7
+ * } from 'micromark-util-types'
8
+ */
9
+
10
+ import {splice} from 'micromark-util-chunked'
11
+
12
+ const hasOwnProperty = {}.hasOwnProperty
13
+
14
+ /**
15
+ * Combine multiple syntax extensions into one.
16
+ *
17
+ * @param {ReadonlyArray<Extension>} extensions
18
+ * List of syntax extensions.
19
+ * @returns {NormalizedExtension}
20
+ * A single combined extension.
21
+ */
22
+ export function combineExtensions(extensions) {
23
+ /** @type {NormalizedExtension} */
24
+ const all = {}
25
+ let index = -1
26
+
27
+ while (++index < extensions.length) {
28
+ syntaxExtension(all, extensions[index])
29
+ }
30
+
31
+ return all
32
+ }
33
+
34
+ /**
35
+ * Merge `extension` into `all`.
36
+ *
37
+ * @param {NormalizedExtension} all
38
+ * Extension to merge into.
39
+ * @param {Extension} extension
40
+ * Extension to merge.
41
+ * @returns {undefined}
42
+ * Nothing.
43
+ */
44
+ function syntaxExtension(all, extension) {
45
+ /** @type {keyof Extension} */
46
+ let hook
47
+
48
+ for (hook in extension) {
49
+ const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined
50
+ /** @type {Record<string, unknown>} */
51
+ const left = maybe || (all[hook] = {})
52
+ /** @type {Record<string, unknown> | undefined} */
53
+ const right = extension[hook]
54
+ /** @type {string} */
55
+ let code
56
+
57
+ if (right) {
58
+ for (code in right) {
59
+ if (!hasOwnProperty.call(left, code)) left[code] = []
60
+ const value = right[code]
61
+ constructs(
62
+ // @ts-expect-error Looks like a list.
63
+ left[code],
64
+ Array.isArray(value) ? value : value ? [value] : []
65
+ )
66
+ }
67
+ }
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Merge `list` into `existing` (both lists of constructs).
73
+ * Mutates `existing`.
74
+ *
75
+ * @param {Array<unknown>} existing
76
+ * List of constructs to merge into.
77
+ * @param {Array<unknown>} list
78
+ * List of constructs to merge.
79
+ * @returns {undefined}
80
+ * Nothing.
81
+ */
82
+ function constructs(existing, list) {
83
+ let index = -1
84
+ /** @type {Array<unknown>} */
85
+ const before = []
86
+
87
+ while (++index < list.length) {
88
+ // @ts-expect-error Looks like an object.
89
+ ;(list[index].add === 'after' ? existing : before).push(list[index])
90
+ }
91
+
92
+ splice(existing, 0, 0, before)
93
+ }
94
+
95
+ /**
96
+ * Combine multiple HTML extensions into one.
97
+ *
98
+ * @param {ReadonlyArray<HtmlExtension>} htmlExtensions
99
+ * List of HTML extensions.
100
+ * @returns {HtmlExtension}
101
+ * Single combined HTML extension.
102
+ */
103
+ export function combineHtmlExtensions(htmlExtensions) {
104
+ /** @type {HtmlExtension} */
105
+ const handlers = {}
106
+ let index = -1
107
+
108
+ while (++index < htmlExtensions.length) {
109
+ htmlExtension(handlers, htmlExtensions[index])
110
+ }
111
+
112
+ return handlers
113
+ }
114
+
115
+ /**
116
+ * Merge `extension` into `all`.
117
+ *
118
+ * @param {HtmlExtension} all
119
+ * Extension to merge into.
120
+ * @param {HtmlExtension} extension
121
+ * Extension to merge.
122
+ * @returns {undefined}
123
+ * Nothing.
124
+ */
125
+ function htmlExtension(all, extension) {
126
+ /** @type {keyof HtmlExtension} */
127
+ let hook
128
+
129
+ for (hook in extension) {
130
+ const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined
131
+ const left = maybe || (all[hook] = {})
132
+ const right = extension[hook]
133
+ /** @type {keyof Handles} */
134
+ let type
135
+
136
+ if (right) {
137
+ for (type in right) {
138
+ // @ts-expect-error assume document vs regular handler are managed correctly.
139
+ left[type] = right[type]
140
+ }
141
+ }
142
+ }
143
+ }
node_modules/micromark-util-combine-extensions/license ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
node_modules/micromark-util-combine-extensions/package.json ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "micromark-util-combine-extensions",
3
+ "version": "2.0.1",
4
+ "description": "micromark utility to combine syntax or html extensions",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "micromark",
8
+ "util",
9
+ "utility",
10
+ "extension",
11
+ "combine",
12
+ "merge"
13
+ ],
14
+ "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-combine-extensions",
15
+ "bugs": "https://github.com/micromark/micromark/issues",
16
+ "funding": [
17
+ {
18
+ "type": "GitHub Sponsors",
19
+ "url": "https://github.com/sponsors/unifiedjs"
20
+ },
21
+ {
22
+ "type": "OpenCollective",
23
+ "url": "https://opencollective.com/unified"
24
+ }
25
+ ],
26
+ "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
27
+ "contributors": [
28
+ "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
29
+ ],
30
+ "sideEffects": false,
31
+ "type": "module",
32
+ "files": [
33
+ "index.d.ts.map",
34
+ "index.d.ts",
35
+ "index.js"
36
+ ],
37
+ "exports": "./index.js",
38
+ "dependencies": {
39
+ "micromark-util-chunked": "^2.0.0",
40
+ "micromark-util-types": "^2.0.0"
41
+ },
42
+ "xo": {
43
+ "envs": [
44
+ "shared-node-browser"
45
+ ],
46
+ "prettier": true,
47
+ "rules": {
48
+ "guard-for-in": "off",
49
+ "unicorn/prefer-code-point": "off"
50
+ }
51
+ }
52
+ }
node_modules/micromark-util-combine-extensions/readme.md ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # micromark-util-combine-extensions
2
+
3
+ [![Build][build-badge]][build]
4
+ [![Coverage][coverage-badge]][coverage]
5
+ [![Downloads][downloads-badge]][downloads]
6
+ [![Size][bundle-size-badge]][bundle-size]
7
+ [![Sponsors][sponsors-badge]][opencollective]
8
+ [![Backers][backers-badge]][opencollective]
9
+ [![Chat][chat-badge]][chat]
10
+
11
+ [micromark][] utility to combine [syntax][] or [html][] extensions.
12
+
13
+ ## Contents
14
+
15
+ * [What is this?](#what-is-this)
16
+ * [When should I use this?](#when-should-i-use-this)
17
+ * [Install](#install)
18
+ * [Use](#use)
19
+ * [API](#api)
20
+ * [`combineExtensions(extensions)`](#combineextensionsextensions)
21
+ * [`combineHtmlExtensions(htmlExtensions)`](#combinehtmlextensionshtmlextensions)
22
+ * [Types](#types)
23
+ * [Compatibility](#compatibility)
24
+ * [Security](#security)
25
+ * [Contribute](#contribute)
26
+ * [License](#license)
27
+
28
+ ## What is this?
29
+
30
+ This package can merge multiple extensions into one.
31
+
32
+ ## When should I use this?
33
+
34
+ This package might be useful when you are making “presets”, such as
35
+ [`micromark-extension-gfm`][micromark-extension-gfm].
36
+
37
+ ## Install
38
+
39
+ This package is [ESM only][esm].
40
+ In Node.js (version 16+), install with [npm][]:
41
+
42
+ ```sh
43
+ npm install micromark-util-combine-extensions
44
+ ```
45
+
46
+ In Deno with [`esm.sh`][esmsh]:
47
+
48
+ ```js
49
+ import {combineExtensions} from 'https://esm.sh/micromark-util-combine-extensions@1'
50
+ ```
51
+
52
+ In browsers with [`esm.sh`][esmsh]:
53
+
54
+ ```html
55
+ <script type="module">
56
+ import {combineExtensions} from 'https://esm.sh/micromark-util-combine-extensions@1?bundle'
57
+ </script>
58
+ ```
59
+
60
+ ## Use
61
+
62
+ ```js
63
+ import {gfmAutolinkLiteral} from 'micromark-extension-gfm-autolink-literal'
64
+ import {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough'
65
+ import {gfmTable} from 'micromark-extension-gfm-table'
66
+ import {gfmTaskListItem} from 'micromark-extension-gfm-task-list-item'
67
+ import {combineExtensions} from 'micromark-util-combine-extensions'
68
+
69
+ const gfm = combineExtensions([gfmAutolinkLiteral, gfmStrikethrough(), gfmTable, gfmTaskListItem])
70
+ ```
71
+
72
+ ## API
73
+
74
+ This module exports the identifiers
75
+ [`combineExtensions`][api-combine-extensions] and
76
+ [`combineHtmlExtensions`][api-combine-html-extensions].
77
+ There is no default export.
78
+
79
+ ### `combineExtensions(extensions)`
80
+
81
+ Combine multiple syntax extensions into one.
82
+
83
+ ###### Parameters
84
+
85
+ * `extensions` (`Array<Extension>`)
86
+ — list of syntax extensions
87
+
88
+ ###### Returns
89
+
90
+ A single combined extension (`Extension`).
91
+
92
+ ### `combineHtmlExtensions(htmlExtensions)`
93
+
94
+ Combine multiple html extensions into one.
95
+
96
+ ###### Parameters
97
+
98
+ * `htmlExtensions` (`Array<HtmlExtension>`)
99
+ — list of HTML extensions
100
+
101
+ ###### Returns
102
+
103
+ A single combined HTML extension (`HtmlExtension`).
104
+
105
+ ## Types
106
+
107
+ This package is fully typed with [TypeScript][].
108
+ It exports no additional types.
109
+
110
+ ## Compatibility
111
+
112
+ Projects maintained by the unified collective are compatible with maintained
113
+ versions of Node.js.
114
+
115
+ When we cut a new major release, we drop support for unmaintained versions of
116
+ Node.
117
+ This means we try to keep the current release line,
118
+ `micromark-util-combine-extensions@2`, compatible with Node.js 16.
119
+ This package works with `micromark@3`.
120
+
121
+ ## Security
122
+
123
+ This package is safe.
124
+ See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
125
+ submit a security report.
126
+
127
+ ## Contribute
128
+
129
+ See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
130
+ to get started.
131
+ See [`support.md`][support] for ways to get help.
132
+
133
+ This project has a [code of conduct][coc].
134
+ By interacting with this repository, organisation, or community you agree to
135
+ abide by its terms.
136
+
137
+ ## License
138
+
139
+ [MIT][license] © [Titus Wormer][author]
140
+
141
+ <!-- Definitions -->
142
+
143
+ [build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg
144
+
145
+ [build]: https://github.com/micromark/micromark/actions
146
+
147
+ [coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg
148
+
149
+ [coverage]: https://codecov.io/github/micromark/micromark
150
+
151
+ [downloads-badge]: https://img.shields.io/npm/dm/micromark-util-combine-extensions.svg
152
+
153
+ [downloads]: https://www.npmjs.com/package/micromark-util-combine-extensions
154
+
155
+ [bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-combine-extensions
156
+
157
+ [bundle-size]: https://bundlejs.com/?q=micromark-util-combine-extensions
158
+
159
+ [sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
160
+
161
+ [backers-badge]: https://opencollective.com/unified/backers/badge.svg
162
+
163
+ [opencollective]: https://opencollective.com/unified
164
+
165
+ [npm]: https://docs.npmjs.com/cli/install
166
+
167
+ [esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
168
+
169
+ [esmsh]: https://esm.sh
170
+
171
+ [chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg
172
+
173
+ [chat]: https://github.com/micromark/micromark/discussions
174
+
175
+ [license]: https://github.com/micromark/micromark/blob/main/license
176
+
177
+ [author]: https://wooorm.com
178
+
179
+ [health]: https://github.com/micromark/.github
180
+
181
+ [securitymd]: https://github.com/micromark/.github/blob/main/security.md
182
+
183
+ [contributing]: https://github.com/micromark/.github/blob/main/contributing.md
184
+
185
+ [support]: https://github.com/micromark/.github/blob/main/support.md
186
+
187
+ [coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md
188
+
189
+ [syntax]: https://github.com/micromark/micromark#syntaxextension
190
+
191
+ [html]: https://github.com/micromark/micromark#htmlextension
192
+
193
+ [typescript]: https://www.typescriptlang.org
194
+
195
+ [micromark]: https://github.com/micromark/micromark
196
+
197
+ [micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm
198
+
199
+ [api-combine-extensions]: #combineextensionsextensions
200
+
201
+ [api-combine-html-extensions]: #combinehtmlextensionshtmlextensions
node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Turn the number (in string form as either hexa- or plain decimal) coming from
3
+ * a numeric character reference into a character.
4
+ *
5
+ * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
6
+ * non-characters and control characters safe.
7
+ *
8
+ * @param {string} value
9
+ * Value to decode.
10
+ * @param {number} base
11
+ * Numeric base.
12
+ * @returns {string}
13
+ * Character.
14
+ */
15
+ export function decodeNumericCharacterReference(value: string, base: number): string;
16
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-decode-numeric-character-reference/dev/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,uDAPW,MAAM,QAEN,MAAM,GAEJ,MAAM,CA4BlB"}
node_modules/micromark-util-decode-numeric-character-reference/dev/index.js ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import {codes, values} from 'micromark-util-symbol'
2
+
3
+ /**
4
+ * Turn the number (in string form as either hexa- or plain decimal) coming from
5
+ * a numeric character reference into a character.
6
+ *
7
+ * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
8
+ * non-characters and control characters safe.
9
+ *
10
+ * @param {string} value
11
+ * Value to decode.
12
+ * @param {number} base
13
+ * Numeric base.
14
+ * @returns {string}
15
+ * Character.
16
+ */
17
+ export function decodeNumericCharacterReference(value, base) {
18
+ const code = Number.parseInt(value, base)
19
+
20
+ if (
21
+ // C0 except for HT, LF, FF, CR, space.
22
+ code < codes.ht ||
23
+ code === codes.vt ||
24
+ (code > codes.cr && code < codes.space) ||
25
+ // Control character (DEL) of C0, and C1 controls.
26
+ (code > codes.tilde && code < 160) ||
27
+ // Lone high surrogates and low surrogates.
28
+ (code > 55_295 && code < 57_344) ||
29
+ // Noncharacters.
30
+ (code > 64_975 && code < 65_008) ||
31
+ /* eslint-disable no-bitwise */
32
+ (code & 65_535) === 65_535 ||
33
+ (code & 65_535) === 65_534 ||
34
+ /* eslint-enable no-bitwise */
35
+ // Out of range
36
+ code > 1_114_111
37
+ ) {
38
+ return values.replacementCharacter
39
+ }
40
+
41
+ return String.fromCodePoint(code)
42
+ }
node_modules/micromark-util-decode-numeric-character-reference/index.d.ts ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Turn the number (in string form as either hexa- or plain decimal) coming from
3
+ * a numeric character reference into a character.
4
+ *
5
+ * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
6
+ * non-characters and control characters safe.
7
+ *
8
+ * @param {string} value
9
+ * Value to decode.
10
+ * @param {number} base
11
+ * Numeric base.
12
+ * @returns {string}
13
+ * Character.
14
+ */
15
+ export function decodeNumericCharacterReference(value: string, base: number): string;
16
+ //# sourceMappingURL=index.d.ts.map
node_modules/micromark-util-decode-numeric-character-reference/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,uDAPW,MAAM,QAEN,MAAM,GAEJ,MAAM,CA4BlB"}
node_modules/micromark-util-decode-numeric-character-reference/index.js ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Turn the number (in string form as either hexa- or plain decimal) coming from
3
+ * a numeric character reference into a character.
4
+ *
5
+ * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
6
+ * non-characters and control characters safe.
7
+ *
8
+ * @param {string} value
9
+ * Value to decode.
10
+ * @param {number} base
11
+ * Numeric base.
12
+ * @returns {string}
13
+ * Character.
14
+ */
15
+ export function decodeNumericCharacterReference(value, base) {
16
+ const code = Number.parseInt(value, base);
17
+ if (
18
+ // C0 except for HT, LF, FF, CR, space.
19
+ code < 9 || code === 11 || code > 13 && code < 32 ||
20
+ // Control character (DEL) of C0, and C1 controls.
21
+ code > 126 && code < 160 ||
22
+ // Lone high surrogates and low surrogates.
23
+ code > 55_295 && code < 57_344 ||
24
+ // Noncharacters.
25
+ code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */
26
+ (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */
27
+ // Out of range
28
+ code > 1_114_111) {
29
+ return "\uFFFD";
30
+ }
31
+ return String.fromCodePoint(code);
32
+ }
node_modules/micromark-util-decode-numeric-character-reference/license ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (The MIT License)
2
+
3
+ Copyright (c) Titus Wormer <tituswormer@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ 'Software'), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
node_modules/micromark-util-decode-numeric-character-reference/package.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "micromark-util-decode-numeric-character-reference",
3
+ "version": "2.0.2",
4
+ "description": "micromark utility to decode numeric character references",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "micromark",
8
+ "util",
9
+ "utility",
10
+ "decode",
11
+ "numeric",
12
+ "number",
13
+ "character",
14
+ "reference"
15
+ ],
16
+ "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-decode-numeric-character-reference",
17
+ "bugs": "https://github.com/micromark/micromark/issues",
18
+ "funding": [
19
+ {
20
+ "type": "GitHub Sponsors",
21
+ "url": "https://github.com/sponsors/unifiedjs"
22
+ },
23
+ {
24
+ "type": "OpenCollective",
25
+ "url": "https://opencollective.com/unified"
26
+ }
27
+ ],
28
+ "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
29
+ "contributors": [
30
+ "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
31
+ ],
32
+ "sideEffects": false,
33
+ "type": "module",
34
+ "files": [
35
+ "dev/",
36
+ "index.d.ts.map",
37
+ "index.d.ts",
38
+ "index.js"
39
+ ],
40
+ "exports": {
41
+ "development": "./dev/index.js",
42
+ "default": "./index.js"
43
+ },
44
+ "dependencies": {
45
+ "micromark-util-symbol": "^2.0.0"
46
+ },
47
+ "scripts": {
48
+ "build": "micromark-build"
49
+ },
50
+ "xo": {
51
+ "envs": [
52
+ "shared-node-browser"
53
+ ],
54
+ "prettier": true,
55
+ "rules": {
56
+ "unicorn/prefer-code-point": "off"
57
+ }
58
+ }
59
+ }