@speed-highlight/core 1.1.13 → 1.2.1
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/dist/detect.js +1 -1
- package/dist/node/detect.js +1 -1
- package/package.json +29 -14
package/dist/detect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],["http",[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],["js",[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require)\b/g,10]],["ts",[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|implements|interface|namespace)\b/g,10]],["py",[/\b(def|print|class|and|or|lambda)\b/g,10]],["sql",[/\b(SELECT|INSERT|FROM)\b/g,50]],["pl",[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],["lua",[/#!(\/usr)?\/bin\/lua/g,500]],["make",[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],["uri",[/https?:|mailto:|tel:|ftp:/g,30]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["diff",[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gim,10]]],t=t=>a.map((([a,...e])=>[a,e.reduce(((a,[e,s])=>a+[...t.matchAll(e)].length*s),0)])).filter((([a,t])=>t>20)).sort(((a,t)=>t[1]-a[1]))[0]?.[0]||"plain";export{t as detectLanguage};
|
package/dist/node/detect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],["http",[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],["js",[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require)\b/g,10]],["ts",[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|implements|interface|namespace)\b/g,10]],["py",[/\b(def|print|class|and|or|lambda)\b/g,10]],["sql",[/\b(SELECT|INSERT|FROM)\b/g,50]],["pl",[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],["lua",[/#!(\/usr)?\/bin\/lua/g,500]],["make",[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],["uri",[/https?:|mailto:|tel:|ftp:/g,30]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["diff",[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null)\b
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=[["bash",[/#!(\/usr)?\/bin\/bash/g,500],[/\b(if|elif|then|fi|echo)\b|\$/g,10]],["html",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^\s+<!DOCTYPE\s+html/g,500]],["http",[/^(GET|HEAD|POST|PUT|DELETE|PATCH|HTTP)\b/g,500]],["js",[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require)\b/g,10]],["ts",[/\b(console|await|async|function|export|import|this|class|for|let|const|map|join|require|implements|interface|namespace)\b/g,10]],["py",[/\b(def|print|class|and|or|lambda)\b/g,10]],["sql",[/\b(SELECT|INSERT|FROM)\b/g,50]],["pl",[/#!(\/usr)?\/bin\/perl/g,500],[/\b(use|print)\b|\$/g,10]],["lua",[/#!(\/usr)?\/bin\/lua/g,500]],["make",[/\b(ifneq|endif|if|elif|then|fi|echo|.PHONY|^[a-z]+ ?:$)\b|\$/gm,10]],["uri",[/https?:|mailto:|tel:|ftp:/g,30]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["diff",[/^[+><-]/gm,10],[/^@@ ?[-+,0-9 ]+ ?@@/gm,25]],["md",[/^(>|\t\*|\t\d+.)/gm,10],[/\[.*\](.*)/g,10]],["docker",[/^(FROM|ENTRYPOINT|RUN)/gm,500]],["xml",[/<\/?[a-z-]+[^\n>]*>/g,10],[/^<\?xml/g,500]],["c",[/#include\b|\bprintf\s+\(/g,100]],["rs",[/^\s+(use|fn|mut|match)\b/gm,100]],["go",[/\b(func|fmt|package)\b/g,100]],["java",[/^import\s+java/gm,500]],["asm",[/^(section|global main|extern|\t(call|mov|ret))/gm,100]],["css",[/^(@import|@page|@media|(\.|#)[a-z]+)/gm,20]],["json",[/\b(true|false|null|\{})\b|\"[^"]+\":/g,10]],["yaml",[/^(\s+)?[a-z][a-z0-9]*:/gim,10]]];exports.detectLanguage=t=>e.map((([e,...a])=>[e,a.reduce(((e,[a,s])=>e+[...t.matchAll(a)].length*s),0)])).filter((([e,t])=>t>20)).sort(((e,t)=>t[1]-e[1]))[0]?.[0]||"plain";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@speed-highlight/core",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "🌈 Light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": "git://github.com/speed-highlight/core.git"
|
|
25
25
|
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/speed-highlight/core/issues"
|
|
28
|
+
},
|
|
26
29
|
"keywords": [
|
|
27
30
|
"javascript",
|
|
28
31
|
"syntax-highlighting",
|
|
@@ -39,24 +42,35 @@
|
|
|
39
42
|
],
|
|
40
43
|
"author": "matubu",
|
|
41
44
|
"license": "CC0-1.0",
|
|
42
|
-
"bugs": {
|
|
43
|
-
"url": "https://github.com/speed-highlight/core/issues"
|
|
44
|
-
},
|
|
45
45
|
"homepage": "https://github.com/speed-highlight/core#readme",
|
|
46
|
-
"publishConfig": {
|
|
47
|
-
"registry": "https://npm.pkg.github.com/",
|
|
48
|
-
"access": "public"
|
|
49
|
-
},
|
|
50
|
-
"type": "module",
|
|
51
|
-
"files": [
|
|
52
|
-
"dist"
|
|
53
|
-
],
|
|
54
46
|
"devDependencies": {
|
|
55
47
|
"@rollup/plugin-dynamic-import-vars": "^2.0.4",
|
|
56
48
|
"@rollup/plugin-terser": "^0.4.3",
|
|
49
|
+
"@semantic-release/git": "^10.0.1",
|
|
57
50
|
"rollup": "^2.75.7",
|
|
58
|
-
"rollup-plugin-copy": "^3.4.0"
|
|
51
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
52
|
+
"semantic-release": "^21.0.7"
|
|
53
|
+
},
|
|
54
|
+
"release": {
|
|
55
|
+
"branches": [
|
|
56
|
+
"main"
|
|
57
|
+
],
|
|
58
|
+
"plugins": [
|
|
59
|
+
"@semantic-release/commit-analyzer",
|
|
60
|
+
"@semantic-release/release-notes-generator",
|
|
61
|
+
"@semantic-release/git",
|
|
62
|
+
"@semantic-release/npm",
|
|
63
|
+
"@semantic-release/github"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"private": false,
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public",
|
|
69
|
+
"provenance": true
|
|
59
70
|
},
|
|
71
|
+
"files": [
|
|
72
|
+
"dist"
|
|
73
|
+
],
|
|
60
74
|
"typesVersions": {
|
|
61
75
|
"*": {
|
|
62
76
|
"*": [
|
|
@@ -64,5 +78,6 @@
|
|
|
64
78
|
"dist"
|
|
65
79
|
]
|
|
66
80
|
}
|
|
67
|
-
}
|
|
81
|
+
},
|
|
82
|
+
"type": "module"
|
|
68
83
|
}
|