@tinta-lang/syntax 0.0.0-stage → 0.1.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.txt +13651 -0
- package/dist/directive.d.ts +40 -0
- package/dist/editing.d.ts +46 -0
- package/dist/enrichment.d.ts +5 -0
- package/dist/expression.d.ts +26 -0
- package/dist/image-destinations.d.ts +3 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +10118 -0
- package/dist/parser.d.ts +40 -0
- package/dist/registry.d.ts +144 -0
- package/dist/source.d.ts +28 -0
- package/package.json +280 -3
- package/parser-provenance.json +1419 -0
- package/patches/README.md +5 -0
- package/patches/micromark.patch +84 -0
- package/vendor/@noble/hashes/LICENSE +21 -0
- package/vendor/@noble/hashes/_md.js +209 -0
- package/vendor/@noble/hashes/_u64.js +77 -0
- package/vendor/@noble/hashes/package.json +91 -0
- package/vendor/@noble/hashes/sha2.js +446 -0
- package/vendor/@noble/hashes/utils.js +687 -0
- package/vendor/character-entities/index.js +2132 -0
- package/vendor/character-entities/license +22 -0
- package/vendor/character-entities/package.json +78 -0
- package/vendor/decode-named-character-reference/index.js +19 -0
- package/vendor/decode-named-character-reference/license +22 -0
- package/vendor/decode-named-character-reference/package.json +90 -0
- package/vendor/devlop/lib/default.js +9 -0
- package/vendor/devlop/license +22 -0
- package/vendor/devlop/package.json +80 -0
- package/vendor/longest-streak/index.js +36 -0
- package/vendor/longest-streak/license +22 -0
- package/vendor/longest-streak/package.json +73 -0
- package/vendor/markdown-table/index.js +393 -0
- package/vendor/markdown-table/license +22 -0
- package/vendor/markdown-table/package.json +77 -0
- package/vendor/mdast-util-from-markdown/index.js +2 -0
- package/vendor/mdast-util-from-markdown/lib/index.js +1270 -0
- package/vendor/mdast-util-from-markdown/license +22 -0
- package/vendor/mdast-util-from-markdown/package.json +98 -0
- package/vendor/mdast-util-gfm-strikethrough/index.js +5 -0
- package/vendor/mdast-util-gfm-strikethrough/lib/index.js +133 -0
- package/vendor/mdast-util-gfm-strikethrough/license +22 -0
- package/vendor/mdast-util-gfm-strikethrough/package.json +84 -0
- package/vendor/mdast-util-gfm-table/index.js +2 -0
- package/vendor/mdast-util-gfm-table/lib/index.js +300 -0
- package/vendor/mdast-util-gfm-table/license +22 -0
- package/vendor/mdast-util-gfm-table/package.json +101 -0
- package/vendor/mdast-util-gfm-task-list-item/index.js +4 -0
- package/vendor/mdast-util-gfm-task-list-item/lib/index.js +141 -0
- package/vendor/mdast-util-gfm-task-list-item/license +22 -0
- package/vendor/mdast-util-gfm-task-list-item/package.json +90 -0
- package/vendor/mdast-util-phrasing/index.js +1 -0
- package/vendor/mdast-util-phrasing/lib/index.js +45 -0
- package/vendor/mdast-util-phrasing/license +23 -0
- package/vendor/mdast-util-phrasing/package.json +78 -0
- package/vendor/mdast-util-to-markdown/index.js +3 -0
- package/vendor/mdast-util-to-markdown/lib/configure.js +98 -0
- package/vendor/mdast-util-to-markdown/lib/handle/blockquote.js +40 -0
- package/vendor/mdast-util-to-markdown/lib/handle/break.js +41 -0
- package/vendor/mdast-util-to-markdown/lib/handle/code.js +86 -0
- package/vendor/mdast-util-to-markdown/lib/handle/definition.js +83 -0
- package/vendor/mdast-util-to-markdown/lib/handle/emphasis.js +67 -0
- package/vendor/mdast-util-to-markdown/lib/handle/heading.js +84 -0
- package/vendor/mdast-util-to-markdown/lib/handle/html.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/handle/image-reference.js +78 -0
- package/vendor/mdast-util-to-markdown/lib/handle/image.js +92 -0
- package/vendor/mdast-util-to-markdown/lib/handle/index.js +45 -0
- package/vendor/mdast-util-to-markdown/lib/handle/inline-code.js +86 -0
- package/vendor/mdast-util-to-markdown/lib/handle/link-reference.js +78 -0
- package/vendor/mdast-util-to-markdown/lib/handle/link.js +129 -0
- package/vendor/mdast-util-to-markdown/lib/handle/list-item.js +73 -0
- package/vendor/mdast-util-to-markdown/lib/handle/list.js +107 -0
- package/vendor/mdast-util-to-markdown/lib/handle/paragraph.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/handle/root.js +34 -0
- package/vendor/mdast-util-to-markdown/lib/handle/strong.js +67 -0
- package/vendor/mdast-util-to-markdown/lib/handle/text.js +30 -0
- package/vendor/mdast-util-to-markdown/lib/handle/thematic-break.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/index.js +213 -0
- package/vendor/mdast-util-to-markdown/lib/join.js +56 -0
- package/vendor/mdast-util-to-markdown/lib/unsafe.js +160 -0
- package/vendor/mdast-util-to-markdown/lib/util/association.js +33 -0
- package/vendor/mdast-util-to-markdown/lib/util/character.js +32 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-bullet-ordered.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-bullet-other.js +42 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-bullet.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-emphasis.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-fence.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-list-item-indent.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-quote.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-rule-repetition.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-rule.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/check-strong.js +25 -0
- package/vendor/mdast-util-to-markdown/lib/util/compile-pattern.js +30 -0
- package/vendor/mdast-util-to-markdown/lib/util/container-flow.js +93 -0
- package/vendor/mdast-util-to-markdown/lib/util/container-phrasing.js +704 -0
- package/vendor/mdast-util-to-markdown/lib/util/encode-character-reference.js +11 -0
- package/vendor/mdast-util-to-markdown/lib/util/encode-info.js +82 -0
- package/vendor/mdast-util-to-markdown/lib/util/format-code-as-indented.js +27 -0
- package/vendor/mdast-util-to-markdown/lib/util/format-heading-as-setext.js +39 -0
- package/vendor/mdast-util-to-markdown/lib/util/format-link-as-autolink.js +39 -0
- package/vendor/mdast-util-to-markdown/lib/util/html-kind.js +63 -0
- package/vendor/mdast-util-to-markdown/lib/util/indent-lines.js +40 -0
- package/vendor/mdast-util-to-markdown/lib/util/pattern-in-scope.js +52 -0
- package/vendor/mdast-util-to-markdown/lib/util/safe.js +263 -0
- package/vendor/mdast-util-to-markdown/lib/util/track.js +55 -0
- package/vendor/mdast-util-to-markdown/license +22 -0
- package/vendor/mdast-util-to-markdown/package.json +88 -0
- package/vendor/mdast-util-to-string/index.js +5 -0
- package/vendor/mdast-util-to-string/lib/index.js +108 -0
- package/vendor/mdast-util-to-string/license +22 -0
- package/vendor/mdast-util-to-string/package.json +78 -0
- package/vendor/micromark/index.js +60 -0
- package/vendor/micromark/lib/compile.js +1068 -0
- package/vendor/micromark/lib/constructs.js +85 -0
- package/vendor/micromark/lib/create-tokenizer.js +615 -0
- package/vendor/micromark/lib/initialize/content.js +79 -0
- package/vendor/micromark/lib/initialize/document.js +370 -0
- package/vendor/micromark/lib/initialize/flow.js +58 -0
- package/vendor/micromark/lib/initialize/text.js +216 -0
- package/vendor/micromark/lib/parse.js +56 -0
- package/vendor/micromark/lib/postprocess.js +18 -0
- package/vendor/micromark/lib/preprocess.js +112 -0
- package/vendor/micromark/license +22 -0
- package/vendor/micromark/package.json +87 -0
- package/vendor/micromark-core-commonmark/index.js +22 -0
- package/vendor/micromark-core-commonmark/lib/attention.js +231 -0
- package/vendor/micromark-core-commonmark/lib/autolink.js +233 -0
- package/vendor/micromark-core-commonmark/lib/blank-line.js +61 -0
- package/vendor/micromark-core-commonmark/lib/block-quote.js +143 -0
- package/vendor/micromark-core-commonmark/lib/character-escape.js +64 -0
- package/vendor/micromark-core-commonmark/lib/character-reference.js +149 -0
- package/vendor/micromark-core-commonmark/lib/code-fenced.js +422 -0
- package/vendor/micromark-core-commonmark/lib/code-indented.js +159 -0
- package/vendor/micromark-core-commonmark/lib/code-text.js +225 -0
- package/vendor/micromark-core-commonmark/lib/content.js +163 -0
- package/vendor/micromark-core-commonmark/lib/definition.js +254 -0
- package/vendor/micromark-core-commonmark/lib/hard-break-escape.js +60 -0
- package/vendor/micromark-core-commonmark/lib/heading-atx.js +191 -0
- package/vendor/micromark-core-commonmark/lib/html-flow.js +827 -0
- package/vendor/micromark-core-commonmark/lib/html-text.js +678 -0
- package/vendor/micromark-core-commonmark/lib/label-end.js +561 -0
- package/vendor/micromark-core-commonmark/lib/label-start-image.js +110 -0
- package/vendor/micromark-core-commonmark/lib/label-start-link.js +63 -0
- package/vendor/micromark-core-commonmark/lib/line-ending.js +33 -0
- package/vendor/micromark-core-commonmark/lib/list.js +213 -0
- package/vendor/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/vendor/micromark-core-commonmark/lib/setext-underline.js +187 -0
- package/vendor/micromark-core-commonmark/lib/thematic-break.js +102 -0
- package/vendor/micromark-core-commonmark/license +22 -0
- package/vendor/micromark-core-commonmark/package.json +62 -0
- package/vendor/micromark-extension-gfm-strikethrough/index.js +3 -0
- package/vendor/micromark-extension-gfm-strikethrough/lib/html.js +26 -0
- package/vendor/micromark-extension-gfm-strikethrough/lib/syntax.js +142 -0
- package/vendor/micromark-extension-gfm-strikethrough/license +22 -0
- package/vendor/micromark-extension-gfm-strikethrough/package.json +129 -0
- package/vendor/micromark-extension-gfm-table/index.js +2 -0
- package/vendor/micromark-extension-gfm-table/lib/edit-map.js +222 -0
- package/vendor/micromark-extension-gfm-table/lib/html.js +135 -0
- package/vendor/micromark-extension-gfm-table/lib/infer.js +52 -0
- package/vendor/micromark-extension-gfm-table/lib/syntax.js +846 -0
- package/vendor/micromark-extension-gfm-table/license +22 -0
- package/vendor/micromark-extension-gfm-table/package.json +86 -0
- package/vendor/micromark-extension-gfm-task-list-item/index.js +2 -0
- package/vendor/micromark-extension-gfm-task-list-item/lib/html.js +29 -0
- package/vendor/micromark-extension-gfm-task-list-item/lib/syntax.js +158 -0
- package/vendor/micromark-extension-gfm-task-list-item/license +22 -0
- package/vendor/micromark-extension-gfm-task-list-item/package.json +131 -0
- package/vendor/micromark-factory-destination/index.js +206 -0
- package/vendor/micromark-factory-destination/license +22 -0
- package/vendor/micromark-factory-destination/package.json +57 -0
- package/vendor/micromark-factory-label/index.js +148 -0
- package/vendor/micromark-factory-label/license +22 -0
- package/vendor/micromark-factory-label/package.json +60 -0
- package/vendor/micromark-factory-space/index.js +116 -0
- package/vendor/micromark-factory-space/license +22 -0
- package/vendor/micromark-factory-space/package.json +46 -0
- package/vendor/micromark-factory-title/index.js +158 -0
- package/vendor/micromark-factory-title/license +22 -0
- package/vendor/micromark-factory-title/package.json +58 -0
- package/vendor/micromark-factory-whitespace/index.js +44 -0
- package/vendor/micromark-factory-whitespace/license +22 -0
- package/vendor/micromark-factory-whitespace/package.json +57 -0
- package/vendor/micromark-util-character/index.js +246 -0
- package/vendor/micromark-util-character/license +22 -0
- package/vendor/micromark-util-character/package.json +57 -0
- package/vendor/micromark-util-chunked/index.js +81 -0
- package/vendor/micromark-util-chunked/license +22 -0
- package/vendor/micromark-util-chunked/package.json +57 -0
- package/vendor/micromark-util-classify-character/index.js +27 -0
- package/vendor/micromark-util-classify-character/license +22 -0
- package/vendor/micromark-util-classify-character/package.json +59 -0
- package/vendor/micromark-util-combine-extensions/index.js +143 -0
- package/vendor/micromark-util-combine-extensions/license +22 -0
- package/vendor/micromark-util-combine-extensions/package.json +52 -0
- package/vendor/micromark-util-decode-numeric-character-reference/index.js +32 -0
- package/vendor/micromark-util-decode-numeric-character-reference/license +22 -0
- package/vendor/micromark-util-decode-numeric-character-reference/package.json +59 -0
- package/vendor/micromark-util-decode-string/index.js +45 -0
- package/vendor/micromark-util-decode-string/license +22 -0
- package/vendor/micromark-util-decode-string/package.json +63 -0
- package/vendor/micromark-util-edit-map/index.js +225 -0
- package/vendor/micromark-util-edit-map/license +22 -0
- package/vendor/micromark-util-edit-map/package.json +48 -0
- package/vendor/micromark-util-encode/index.js +33 -0
- package/vendor/micromark-util-encode/license +22 -0
- package/vendor/micromark-util-encode/package.json +47 -0
- package/vendor/micromark-util-html-tag-name/index.js +93 -0
- package/vendor/micromark-util-html-tag-name/license +22 -0
- package/vendor/micromark-util-html-tag-name/package.json +47 -0
- package/vendor/micromark-util-normalize-identifier/index.js +33 -0
- package/vendor/micromark-util-normalize-identifier/license +22 -0
- package/vendor/micromark-util-normalize-identifier/package.json +58 -0
- package/vendor/micromark-util-resolve-all/index.js +32 -0
- package/vendor/micromark-util-resolve-all/license +22 -0
- package/vendor/micromark-util-resolve-all/package.json +48 -0
- package/vendor/micromark-util-sanitize-uri/index.js +107 -0
- package/vendor/micromark-util-sanitize-uri/license +22 -0
- package/vendor/micromark-util-sanitize-uri/package.json +59 -0
- package/vendor/micromark-util-subtokenize/index.js +228 -0
- package/vendor/micromark-util-subtokenize/lib/splice-buffer.js +251 -0
- package/vendor/micromark-util-subtokenize/license +22 -0
- package/vendor/micromark-util-subtokenize/package.json +60 -0
- package/vendor/unist-util-is/index.js +7 -0
- package/vendor/unist-util-is/lib/index.js +296 -0
- package/vendor/unist-util-is/license +22 -0
- package/vendor/unist-util-is/package.json +103 -0
- package/vendor/unist-util-stringify-position/index.js +1 -0
- package/vendor/unist-util-stringify-position/lib/index.js +84 -0
- package/vendor/unist-util-stringify-position/license +22 -0
- package/vendor/unist-util-stringify-position/package.json +80 -0
- package/vendor/unist-util-visit/index.js +2 -0
- package/vendor/unist-util-visit/lib/index.js +312 -0
- package/vendor/unist-util-visit/license +22 -0
- package/vendor/unist-util-visit/package.json +108 -0
- package/vendor/unist-util-visit-parents/index.js +2 -0
- package/vendor/unist-util-visit-parents/lib/color.js +7 -0
- package/vendor/unist-util-visit-parents/lib/index.js +399 -0
- package/vendor/unist-util-visit-parents/license +22 -0
- package/vendor/unist-util-visit-parents/package.json +106 -0
- package/vendor/zwitch/index.js +118 -0
- package/vendor/zwitch/license +22 -0
- package/vendor/zwitch/package.json +72 -0
- package/README.md +0 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 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.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "character-entities",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "Map of named character references",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"html",
|
|
8
|
+
"entity",
|
|
9
|
+
"entities",
|
|
10
|
+
"character",
|
|
11
|
+
"reference",
|
|
12
|
+
"name",
|
|
13
|
+
"replacement"
|
|
14
|
+
],
|
|
15
|
+
"repository": "wooorm/character-entities",
|
|
16
|
+
"bugs": "https://github.com/wooorm/character-entities/issues",
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "https://github.com/sponsors/wooorm"
|
|
20
|
+
},
|
|
21
|
+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
|
22
|
+
"contributors": [
|
|
23
|
+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "index.js",
|
|
28
|
+
"types": "index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"index.d.ts",
|
|
31
|
+
"index.js"
|
|
32
|
+
],
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/tape": "^4.0.0",
|
|
35
|
+
"bail": "^2.0.0",
|
|
36
|
+
"c8": "^7.0.0",
|
|
37
|
+
"concat-stream": "^2.0.0",
|
|
38
|
+
"prettier": "^2.0.0",
|
|
39
|
+
"remark-cli": "^10.0.0",
|
|
40
|
+
"remark-preset-wooorm": "^9.0.0",
|
|
41
|
+
"rimraf": "^3.0.0",
|
|
42
|
+
"tape": "^5.0.0",
|
|
43
|
+
"type-coverage": "^2.0.0",
|
|
44
|
+
"typescript": "^4.0.0",
|
|
45
|
+
"xo": "^0.50.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"generate": "node build",
|
|
49
|
+
"prepublishOnly": "npm run build && npm run format",
|
|
50
|
+
"build": "rimraf \"*.d.ts\" && tsc && type-coverage",
|
|
51
|
+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
|
52
|
+
"test-api": "node --conditions development test.js",
|
|
53
|
+
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
|
|
54
|
+
"test": "npm run generate && npm run build && npm run format && npm run test-coverage"
|
|
55
|
+
},
|
|
56
|
+
"prettier": {
|
|
57
|
+
"tabWidth": 2,
|
|
58
|
+
"useTabs": false,
|
|
59
|
+
"singleQuote": true,
|
|
60
|
+
"bracketSpacing": false,
|
|
61
|
+
"semi": false,
|
|
62
|
+
"trailingComma": "none"
|
|
63
|
+
},
|
|
64
|
+
"xo": {
|
|
65
|
+
"prettier": true
|
|
66
|
+
},
|
|
67
|
+
"remarkConfig": {
|
|
68
|
+
"plugins": [
|
|
69
|
+
"preset-wooorm"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"typeCoverage": {
|
|
73
|
+
"atLeast": 100,
|
|
74
|
+
"detail": true,
|
|
75
|
+
"strict": true,
|
|
76
|
+
"ignoreCatch": true
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {characterEntities} from 'character-entities'
|
|
2
|
+
|
|
3
|
+
// To do: next major: use `Object.hasOwn`.
|
|
4
|
+
const own = {}.hasOwnProperty
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Decode a single character reference (without the `&` or `;`).
|
|
8
|
+
* You probably only need this when you’re building parsers yourself that follow
|
|
9
|
+
* different rules compared to HTML.
|
|
10
|
+
* This is optimized to be tiny in browsers.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} value
|
|
13
|
+
* `notin` (named), `#123` (deci), `#x123` (hexa).
|
|
14
|
+
* @returns {string|false}
|
|
15
|
+
* Decoded reference.
|
|
16
|
+
*/
|
|
17
|
+
export function decodeNamedCharacterReference(value) {
|
|
18
|
+
return own.call(characterEntities, value) ? characterEntities[value] : false
|
|
19
|
+
}
|
|
@@ -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.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
|
3
|
+
"bugs": "https://github.com/wooorm/decode-named-character-reference/issues",
|
|
4
|
+
"contributors": [
|
|
5
|
+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
|
6
|
+
],
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"character-entities": "^2.0.0"
|
|
9
|
+
},
|
|
10
|
+
"description": "Decode named character references",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@types/node": "^25.0.0",
|
|
13
|
+
"c8": "^10.0.0",
|
|
14
|
+
"prettier": "^3.0.0",
|
|
15
|
+
"remark-cli": "^12.0.0",
|
|
16
|
+
"remark-preset-wooorm": "^11.0.0",
|
|
17
|
+
"type-coverage": "^2.0.0",
|
|
18
|
+
"typescript": "^5.0.0",
|
|
19
|
+
"xo": "^1.0.0"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
"convex": "./index.js",
|
|
23
|
+
"deno": "./index.js",
|
|
24
|
+
"edge-light": "./index.js",
|
|
25
|
+
"react-native": "./index.js",
|
|
26
|
+
"worker": "./index.js",
|
|
27
|
+
"workerd": "./index.js",
|
|
28
|
+
"browser": "./index.dom.js",
|
|
29
|
+
"default": "./index.js"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"index.d.ts.map",
|
|
33
|
+
"index.d.ts",
|
|
34
|
+
"index.dom.d.ts.map",
|
|
35
|
+
"index.dom.d.ts",
|
|
36
|
+
"index.dom.js",
|
|
37
|
+
"index.js"
|
|
38
|
+
],
|
|
39
|
+
"funding": {
|
|
40
|
+
"type": "github",
|
|
41
|
+
"url": "https://github.com/sponsors/wooorm"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"character",
|
|
45
|
+
"decode",
|
|
46
|
+
"named",
|
|
47
|
+
"references"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"main#": "to do: next major: remove field",
|
|
51
|
+
"main": "index.js",
|
|
52
|
+
"name": "decode-named-character-reference",
|
|
53
|
+
"prettier": {
|
|
54
|
+
"bracketSpacing": false,
|
|
55
|
+
"semi": false,
|
|
56
|
+
"singleQuote": true,
|
|
57
|
+
"tabWidth": 2,
|
|
58
|
+
"trailingComma": "none",
|
|
59
|
+
"useTabs": false
|
|
60
|
+
},
|
|
61
|
+
"remarkConfig": {
|
|
62
|
+
"plugins": [
|
|
63
|
+
"remark-preset-wooorm"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"repository": "wooorm/decode-named-character-reference",
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc --build --clean && tsc --build && type-coverage",
|
|
69
|
+
"format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix",
|
|
70
|
+
"test-api": "node --conditions development test.js",
|
|
71
|
+
"test-coverage": "c8 --100 --reporter lcov -- npm run test-api",
|
|
72
|
+
"test": "npm run build && npm run format && npm run test-coverage"
|
|
73
|
+
},
|
|
74
|
+
"sideEffects": false,
|
|
75
|
+
"typeCoverage": {
|
|
76
|
+
"atLeast": 100,
|
|
77
|
+
"ignoreCatch": true
|
|
78
|
+
},
|
|
79
|
+
"types#": "to do: next major: remove field",
|
|
80
|
+
"types": "index.d.ts",
|
|
81
|
+
"type": "module",
|
|
82
|
+
"version": "1.3.0",
|
|
83
|
+
"xo": {
|
|
84
|
+
"prettier": true,
|
|
85
|
+
"rules": {
|
|
86
|
+
"unicorn/prefer-code-point": "off"
|
|
87
|
+
},
|
|
88
|
+
"space": true
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 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.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "devlop",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Do things in development and nothing otherwise",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"assert",
|
|
8
|
+
"deprecate",
|
|
9
|
+
"develop",
|
|
10
|
+
"development"
|
|
11
|
+
],
|
|
12
|
+
"repository": "wooorm/devlop",
|
|
13
|
+
"bugs": "https://github.com/wooorm/devlop/issues",
|
|
14
|
+
"funding": {
|
|
15
|
+
"type": "github",
|
|
16
|
+
"url": "https://github.com/sponsors/wooorm"
|
|
17
|
+
},
|
|
18
|
+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
|
19
|
+
"contributors": [
|
|
20
|
+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
|
21
|
+
],
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"type": "module",
|
|
24
|
+
"exports": {
|
|
25
|
+
"types": "./lib/development.d.ts",
|
|
26
|
+
"development": "./lib/development.js",
|
|
27
|
+
"default": "./lib/default.js"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"lib/"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"dequal": "^2.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
37
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
38
|
+
"@types/node": "^20.0.0",
|
|
39
|
+
"c8": "^8.0.0",
|
|
40
|
+
"esbuild": "^0.18.0",
|
|
41
|
+
"prettier": "^2.0.0",
|
|
42
|
+
"remark-cli": "^11.0.0",
|
|
43
|
+
"remark-preset-wooorm": "^9.0.0",
|
|
44
|
+
"type-coverage": "^2.0.0",
|
|
45
|
+
"typescript": "^5.0.0",
|
|
46
|
+
"xo": "^0.54.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"prepack": "npm run build && npm run format",
|
|
50
|
+
"build": "tsc --build --clean && tsc --build && type-coverage",
|
|
51
|
+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
|
52
|
+
"test-api-development": "node --conditions development test-development.js",
|
|
53
|
+
"test-api-default": "node test-default.js",
|
|
54
|
+
"test-api": "npm run test-api-development && npm run test-api-default",
|
|
55
|
+
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
|
|
56
|
+
"test": "npm run build && npm run format && npm run test-coverage"
|
|
57
|
+
},
|
|
58
|
+
"prettier": {
|
|
59
|
+
"bracketSpacing": false,
|
|
60
|
+
"semi": false,
|
|
61
|
+
"singleQuote": true,
|
|
62
|
+
"tabWidth": 2,
|
|
63
|
+
"trailingComma": "none",
|
|
64
|
+
"useTabs": false
|
|
65
|
+
},
|
|
66
|
+
"remarkConfig": {
|
|
67
|
+
"plugins": [
|
|
68
|
+
"remark-preset-wooorm"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"typeCoverage": {
|
|
72
|
+
"atLeast": 100,
|
|
73
|
+
"detail": true,
|
|
74
|
+
"ignoreCatch": true,
|
|
75
|
+
"strict": true
|
|
76
|
+
},
|
|
77
|
+
"xo": {
|
|
78
|
+
"prettier": true
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the count of the longest repeating streak of `substring` in `value`.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} value
|
|
5
|
+
* Content to search in.
|
|
6
|
+
* @param {string} substring
|
|
7
|
+
* Substring to look for, typically one character.
|
|
8
|
+
* @returns {number}
|
|
9
|
+
* Count of most frequent adjacent `substring`s in `value`.
|
|
10
|
+
*/
|
|
11
|
+
export function longestStreak(value, substring) {
|
|
12
|
+
const source = String(value)
|
|
13
|
+
let index = source.indexOf(substring)
|
|
14
|
+
let expected = index
|
|
15
|
+
let count = 0
|
|
16
|
+
let max = 0
|
|
17
|
+
|
|
18
|
+
if (typeof substring !== 'string') {
|
|
19
|
+
throw new TypeError('Expected substring')
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
while (index !== -1) {
|
|
23
|
+
if (index === expected) {
|
|
24
|
+
if (++count > max) {
|
|
25
|
+
max = count
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
count = 1
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
expected = index + substring.length
|
|
32
|
+
index = source.indexOf(substring, expected)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return max
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Titus Wormer <mailto: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.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "longest-streak",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "Count the longest repeating streak of a substring",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"count",
|
|
8
|
+
"length",
|
|
9
|
+
"longest",
|
|
10
|
+
"repeating",
|
|
11
|
+
"streak",
|
|
12
|
+
"substring",
|
|
13
|
+
"character"
|
|
14
|
+
],
|
|
15
|
+
"repository": "wooorm/longest-streak",
|
|
16
|
+
"bugs": "https://github.com/wooorm/longest-streak/issues",
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "https://github.com/sponsors/wooorm"
|
|
20
|
+
},
|
|
21
|
+
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
|
|
22
|
+
"contributors": [
|
|
23
|
+
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "index.js",
|
|
28
|
+
"types": "index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"index.d.ts",
|
|
31
|
+
"index.js"
|
|
32
|
+
],
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^18.0.0",
|
|
35
|
+
"c8": "^7.0.0",
|
|
36
|
+
"prettier": "^2.0.0",
|
|
37
|
+
"remark-cli": "^11.0.0",
|
|
38
|
+
"remark-preset-wooorm": "^9.0.0",
|
|
39
|
+
"type-coverage": "^2.0.0",
|
|
40
|
+
"typescript": "^4.0.0",
|
|
41
|
+
"xo": "^0.52.0"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"prepack": "npm run build && npm run format",
|
|
45
|
+
"build": "tsc --build --clean && tsc --build && type-coverage",
|
|
46
|
+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
|
|
47
|
+
"test-api": "node --conditions development test.js",
|
|
48
|
+
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
|
|
49
|
+
"test": "npm run build && npm run format && npm run test-coverage"
|
|
50
|
+
},
|
|
51
|
+
"prettier": {
|
|
52
|
+
"tabWidth": 2,
|
|
53
|
+
"useTabs": false,
|
|
54
|
+
"singleQuote": true,
|
|
55
|
+
"bracketSpacing": false,
|
|
56
|
+
"semi": false,
|
|
57
|
+
"trailingComma": "none"
|
|
58
|
+
},
|
|
59
|
+
"xo": {
|
|
60
|
+
"prettier": true
|
|
61
|
+
},
|
|
62
|
+
"remarkConfig": {
|
|
63
|
+
"plugins": [
|
|
64
|
+
"preset-wooorm"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"typeCoverage": {
|
|
68
|
+
"atLeast": 100,
|
|
69
|
+
"detail": true,
|
|
70
|
+
"strict": true,
|
|
71
|
+
"ignoreCatch": true
|
|
72
|
+
}
|
|
73
|
+
}
|