@readme/syntax-highlighter 14.0.0 → 15.0.0-beta.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/dist/index.js +27753 -2
- package/dist/index.node.js +393 -1
- package/dist-utils/canonical.d.ts +60 -0
- package/dist-utils/canonical.js +66 -0
- package/dist-utils/index.d.ts +89 -0
- package/dist-utils/index.js +9 -0
- package/dist-utils/modes.d.ts +82 -0
- package/dist-utils/modes.js +105 -0
- package/dist-utils/uppercase.d.ts +1 -0
- package/dist-utils/uppercase.js +114 -0
- package/knip.ts +12 -0
- package/package.json +34 -18
- package/src/codeEditor/{cm.options.js → cm.options.ts} +4 -2
- package/src/codeEditor/{index.jsx → index.tsx} +22 -29
- package/src/codeMirror/index.jsx +1 -1
- package/src/index.js +4 -4
- package/src/utils/{canonical.js → canonical.ts} +4 -2
- package/src/utils/index.ts +5 -0
- package/src/utils/{modes.js → modes.ts} +6 -8
- package/src/utils/{uppercase.js → uppercase.ts} +4 -4
- package/tsconfig.json +12 -0
- package/webpack.config.js +14 -7
- package/dist/index.js.LICENSE.txt +0 -9
- /package/src/{index.node.js → index.node.ts} +0 -0
package/dist/index.node.js
CHANGED
|
@@ -1 +1,393 @@
|
|
|
1
|
-
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 42:
|
|
6
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
11
|
+
value: true
|
|
12
|
+
}));
|
|
13
|
+
var modeAliases = {
|
|
14
|
+
aspx: 'asp',
|
|
15
|
+
bash: 'shell',
|
|
16
|
+
'c++': 'cplusplus',
|
|
17
|
+
'c#': 'csharp',
|
|
18
|
+
clj: 'clojure',
|
|
19
|
+
cljc: 'clojure',
|
|
20
|
+
cljx: 'clojure',
|
|
21
|
+
coffeescript: 'javascript',
|
|
22
|
+
cpp: 'cplusplus',
|
|
23
|
+
cql: 'sql',
|
|
24
|
+
cs: 'csharp',
|
|
25
|
+
docker: 'dockerfile',
|
|
26
|
+
ecmascript: 'javascript',
|
|
27
|
+
erl: 'erlang',
|
|
28
|
+
gql: 'graphql',
|
|
29
|
+
gradle: 'groovy',
|
|
30
|
+
handlebars: 'html',
|
|
31
|
+
hbs: 'html',
|
|
32
|
+
jl: 'julia',
|
|
33
|
+
jruby: 'ruby',
|
|
34
|
+
js: 'javascript',
|
|
35
|
+
kt: 'kotlin',
|
|
36
|
+
less: 'css',
|
|
37
|
+
macruby: 'ruby',
|
|
38
|
+
md: 'markdown',
|
|
39
|
+
ml: 'ocaml',
|
|
40
|
+
mssql: 'sql',
|
|
41
|
+
mysql: 'sql',
|
|
42
|
+
node: 'javascript',
|
|
43
|
+
'obj-c': 'objectivec',
|
|
44
|
+
'obj-c++': 'objectivecplusplus',
|
|
45
|
+
'objc++': 'objectivecplusplus',
|
|
46
|
+
objc: 'objectivec',
|
|
47
|
+
objcpp: 'objectivecplusplus',
|
|
48
|
+
objectivecpp: 'objectivecplusplus',
|
|
49
|
+
pgsql: 'sql',
|
|
50
|
+
pl: 'perl',
|
|
51
|
+
plsql: 'sql',
|
|
52
|
+
postgres: 'sql',
|
|
53
|
+
postgresql: 'sql',
|
|
54
|
+
ps1: 'powershell',
|
|
55
|
+
py: 'python',
|
|
56
|
+
rake: 'ruby',
|
|
57
|
+
rb: 'ruby',
|
|
58
|
+
rbx: 'ruby',
|
|
59
|
+
rs: 'rust',
|
|
60
|
+
sass: 'css',
|
|
61
|
+
scss: 'css',
|
|
62
|
+
sh: 'shell',
|
|
63
|
+
solidity: 'sol',
|
|
64
|
+
sqlite: 'sql',
|
|
65
|
+
styl: 'css',
|
|
66
|
+
stylus: 'css',
|
|
67
|
+
xhtml: 'html',
|
|
68
|
+
yml: 'yaml',
|
|
69
|
+
zsh: 'shell'
|
|
70
|
+
};
|
|
71
|
+
var canonical = function canonical(language) {
|
|
72
|
+
if (language in modeAliases) return modeAliases[language];
|
|
73
|
+
return language;
|
|
74
|
+
};
|
|
75
|
+
exports["default"] = canonical;
|
|
76
|
+
|
|
77
|
+
/***/ }),
|
|
78
|
+
|
|
79
|
+
/***/ 476:
|
|
80
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
85
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
86
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
87
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
88
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
89
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
90
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
91
|
+
value: true
|
|
92
|
+
}));
|
|
93
|
+
exports.modes = void 0;
|
|
94
|
+
exports.getMode = getMode;
|
|
95
|
+
// This is a mapping of languages that we support, but aren't directly loading the mode extension
|
|
96
|
+
// Within `/src/codeMirror/index.jsx` and /src/codeEditor.index.jsx
|
|
97
|
+
//
|
|
98
|
+
// This list also includes a number of language aliases, as because of the way we're using
|
|
99
|
+
// `CodeMirror.runMode` we can't take advantage of its known aliases in the mode extensions that
|
|
100
|
+
// we're loading.
|
|
101
|
+
//
|
|
102
|
+
// There are 2 types of lookup, single and array. e.g. `html` needs to be rendered using
|
|
103
|
+
// `htmlmixed`, but `java`, needs to be rendered using the `clike` mode.
|
|
104
|
+
//
|
|
105
|
+
exports.modes = {
|
|
106
|
+
asp: 'clike',
|
|
107
|
+
aspx: 'clike',
|
|
108
|
+
bash: 'shell',
|
|
109
|
+
c: 'clike',
|
|
110
|
+
'c#': ['clike', 'text/x-csharp'],
|
|
111
|
+
'c++': ['clike', 'text/x-c++src'],
|
|
112
|
+
clj: 'clojure',
|
|
113
|
+
cljc: 'clojure',
|
|
114
|
+
cljx: 'clojure',
|
|
115
|
+
coffeescript: 'javascript',
|
|
116
|
+
cplusplus: ['clike', 'text/x-c++src'],
|
|
117
|
+
cpp: ['clike', 'text/x-c++src'],
|
|
118
|
+
cql: ['sql', 'text/x-cassandra'],
|
|
119
|
+
cs: ['clike', 'text/x-csharp'],
|
|
120
|
+
csharp: ['clike', 'text/x-csharp'],
|
|
121
|
+
curl: 'shell',
|
|
122
|
+
d: 'd',
|
|
123
|
+
diff: 'diff',
|
|
124
|
+
ecmascript: 'javascript',
|
|
125
|
+
erl: 'erlang',
|
|
126
|
+
go: ['go', 'text/x-go'],
|
|
127
|
+
gradle: 'groovy',
|
|
128
|
+
gql: 'graphql',
|
|
129
|
+
handlebars: 'htmlmixed',
|
|
130
|
+
hbs: 'htmlmixed',
|
|
131
|
+
html: 'htmlmixed',
|
|
132
|
+
java: ['clike', 'text/x-java'],
|
|
133
|
+
jl: 'julia',
|
|
134
|
+
js: 'javascript',
|
|
135
|
+
jsx: 'jsx',
|
|
136
|
+
json: ['javascript', 'application/ld+json'],
|
|
137
|
+
jruby: 'ruby',
|
|
138
|
+
kotlin: ['clike', 'text/x-kotlin'],
|
|
139
|
+
kt: ['clike', 'text/x-kotlin'],
|
|
140
|
+
less: 'css',
|
|
141
|
+
liquid: 'htmlmixed',
|
|
142
|
+
lua: 'lua',
|
|
143
|
+
node: 'javascript',
|
|
144
|
+
macruby: 'ruby',
|
|
145
|
+
markdown: 'gfm',
|
|
146
|
+
ml: ['mllike', 'text/x-ocaml'],
|
|
147
|
+
mssql: ['sql', 'text/x-mssql'],
|
|
148
|
+
mysql: ['sql', 'text/x-mysql'],
|
|
149
|
+
objc: ['clike', 'text/x-objectivec'],
|
|
150
|
+
'objc++': ['clike', 'text/x-objectivec++'],
|
|
151
|
+
objcpp: ['clike', 'text/x-objectivec++'],
|
|
152
|
+
objectivec: ['clike', 'text/x-objectivec'],
|
|
153
|
+
objectivecpp: ['clike', 'text/x-objectivec++'],
|
|
154
|
+
objectivecplusplus: ['clike', 'text/x-objectivec++'],
|
|
155
|
+
ocaml: ['mllike', 'text/x-ocaml'],
|
|
156
|
+
php: ['php', 'text/x-php'],
|
|
157
|
+
pgsql: ['sql', 'text/x-pgsql'],
|
|
158
|
+
pl: 'perl',
|
|
159
|
+
plsql: ['sql', 'text/x-plsql'],
|
|
160
|
+
postgres: ['sql', 'text/x-pgsql'],
|
|
161
|
+
postgresql: ['sql', 'text/x-pgsql'],
|
|
162
|
+
ps1: 'powershell',
|
|
163
|
+
py: 'python',
|
|
164
|
+
r: 'r',
|
|
165
|
+
rake: 'ruby',
|
|
166
|
+
rb: 'ruby',
|
|
167
|
+
rbx: 'ruby',
|
|
168
|
+
rs: 'rust',
|
|
169
|
+
sass: 'css',
|
|
170
|
+
scala: ['clike', 'text/x-scala'],
|
|
171
|
+
scss: 'css',
|
|
172
|
+
sh: 'shell',
|
|
173
|
+
sol: 'solidity',
|
|
174
|
+
solidity: 'solidity',
|
|
175
|
+
sql: ['sql', 'text/x-sql'],
|
|
176
|
+
sqlite: ['sql', 'text/x-sqlite'],
|
|
177
|
+
styl: 'css',
|
|
178
|
+
stylus: 'css',
|
|
179
|
+
text: ['null', 'text/plain'],
|
|
180
|
+
ts: ['javascript', 'text/typescript'],
|
|
181
|
+
typescript: ['javascript', 'text/typescript'],
|
|
182
|
+
xhtml: 'htmlmixed',
|
|
183
|
+
yml: 'yaml',
|
|
184
|
+
zsh: 'shell'
|
|
185
|
+
};
|
|
186
|
+
function getMode(lang) {
|
|
187
|
+
var mode = lang;
|
|
188
|
+
if (mode in exports.modes) {
|
|
189
|
+
mode = exports.modes[mode];
|
|
190
|
+
if (Array.isArray(mode)) {
|
|
191
|
+
var _mode = mode;
|
|
192
|
+
var _mode2 = _slicedToArray(_mode, 2);
|
|
193
|
+
mode = _mode2[1];
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return mode;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/***/ }),
|
|
200
|
+
|
|
201
|
+
/***/ 638:
|
|
202
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
207
|
+
return mod && mod.__esModule ? mod : {
|
|
208
|
+
"default": mod
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
212
|
+
value: true
|
|
213
|
+
}));
|
|
214
|
+
exports.getMode = exports.modes = exports.canonical = exports.uppercase = void 0;
|
|
215
|
+
var canonical_1 = __importDefault(__webpack_require__(42));
|
|
216
|
+
exports.canonical = canonical_1.default;
|
|
217
|
+
var modes_1 = __webpack_require__(476);
|
|
218
|
+
Object.defineProperty(exports, "modes", ({
|
|
219
|
+
enumerable: true,
|
|
220
|
+
get: function get() {
|
|
221
|
+
return modes_1.modes;
|
|
222
|
+
}
|
|
223
|
+
}));
|
|
224
|
+
Object.defineProperty(exports, "getMode", ({
|
|
225
|
+
enumerable: true,
|
|
226
|
+
get: function get() {
|
|
227
|
+
return modes_1.getMode;
|
|
228
|
+
}
|
|
229
|
+
}));
|
|
230
|
+
var uppercase_1 = __importDefault(__webpack_require__(704));
|
|
231
|
+
exports.uppercase = uppercase_1.default;
|
|
232
|
+
|
|
233
|
+
/***/ }),
|
|
234
|
+
|
|
235
|
+
/***/ 704:
|
|
236
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
241
|
+
value: true
|
|
242
|
+
}));
|
|
243
|
+
exports["default"] = uppercase;
|
|
244
|
+
var codeTypes = {
|
|
245
|
+
asp: 'ASP.NET',
|
|
246
|
+
aspx: 'ASP.NET',
|
|
247
|
+
bash: 'Bash',
|
|
248
|
+
c: 'C',
|
|
249
|
+
'c#': 'C#',
|
|
250
|
+
'c++': 'C++',
|
|
251
|
+
coffeescript: 'CoffeeScript',
|
|
252
|
+
clj: 'Clojure',
|
|
253
|
+
cljc: 'Clojure',
|
|
254
|
+
cljx: 'Clojure',
|
|
255
|
+
clojure: 'Clojure',
|
|
256
|
+
cplusplus: 'C++',
|
|
257
|
+
cpp: 'C++',
|
|
258
|
+
cql: 'Cassandra',
|
|
259
|
+
cs: 'C#',
|
|
260
|
+
csharp: 'C#',
|
|
261
|
+
css: 'CSS',
|
|
262
|
+
curl: 'cURL',
|
|
263
|
+
d: 'D',
|
|
264
|
+
dart: 'Dart',
|
|
265
|
+
diff: 'Diff',
|
|
266
|
+
dockerfile: 'Dockerfile',
|
|
267
|
+
ecmascript: 'ECMAScript',
|
|
268
|
+
erl: 'Erlang',
|
|
269
|
+
erlang: 'Erlang',
|
|
270
|
+
go: 'Go',
|
|
271
|
+
gql: 'GraphQL',
|
|
272
|
+
gradle: 'Gradle',
|
|
273
|
+
graphql: 'GraphQL',
|
|
274
|
+
groovy: 'Groovy',
|
|
275
|
+
handlebars: 'Handlebars',
|
|
276
|
+
hbs: 'Handlebars',
|
|
277
|
+
haml: 'HAML',
|
|
278
|
+
haxe: 'Haxe',
|
|
279
|
+
html: 'HTML',
|
|
280
|
+
http: 'HTTP',
|
|
281
|
+
java: 'Java',
|
|
282
|
+
javascript: 'JavaScript',
|
|
283
|
+
jinja2: 'Jinja2',
|
|
284
|
+
jl: 'Julia',
|
|
285
|
+
jruby: 'JRuby',
|
|
286
|
+
js: 'JavaScript',
|
|
287
|
+
json: 'JSON',
|
|
288
|
+
jsx: 'JSX',
|
|
289
|
+
julia: 'Julia',
|
|
290
|
+
kotlin: 'Kotlin',
|
|
291
|
+
kt: 'Kotlin',
|
|
292
|
+
less: 'LESS',
|
|
293
|
+
liquid: 'Liquid',
|
|
294
|
+
lua: 'Lua',
|
|
295
|
+
macruby: 'MacRuby',
|
|
296
|
+
markdown: 'Markdown',
|
|
297
|
+
md: 'Markdown',
|
|
298
|
+
mermaid: 'Mermaid',
|
|
299
|
+
// syntax highlighting not supported yet
|
|
300
|
+
ml: 'OCaml',
|
|
301
|
+
mssql: 'SQL Server',
|
|
302
|
+
mysql: 'MySQL',
|
|
303
|
+
node: 'Node',
|
|
304
|
+
objc: 'Objective-C',
|
|
305
|
+
'objc++': 'Objective-C++',
|
|
306
|
+
objcpp: 'Objective-C++',
|
|
307
|
+
objectivec: 'Objective-C',
|
|
308
|
+
objectivecpp: 'Objective-C++',
|
|
309
|
+
objectivecplusplus: 'Objective-C++',
|
|
310
|
+
ocaml: 'OCaml',
|
|
311
|
+
perl: 'Perl',
|
|
312
|
+
php: 'PHP',
|
|
313
|
+
pl: 'Perl',
|
|
314
|
+
pgsql: 'PL/pgSQL',
|
|
315
|
+
plsql: 'PL/SQL',
|
|
316
|
+
postgres: 'PostgreSQL',
|
|
317
|
+
postgresql: 'PostgreSQL',
|
|
318
|
+
powershell: 'PowerShell',
|
|
319
|
+
ps1: 'PowerShell',
|
|
320
|
+
python: 'Python',
|
|
321
|
+
py: 'Python',
|
|
322
|
+
r: 'R',
|
|
323
|
+
rake: 'Rake',
|
|
324
|
+
rb: 'Ruby',
|
|
325
|
+
rbx: 'Rubinius',
|
|
326
|
+
rs: 'Rust',
|
|
327
|
+
ruby: 'Ruby',
|
|
328
|
+
rust: 'Rust',
|
|
329
|
+
sass: 'Sass',
|
|
330
|
+
scala: 'Scala',
|
|
331
|
+
scss: 'SCSS',
|
|
332
|
+
sh: 'Shell',
|
|
333
|
+
shell: 'Shell',
|
|
334
|
+
smarty: 'Smarty',
|
|
335
|
+
solidity: 'Solidity',
|
|
336
|
+
sql: 'SQL',
|
|
337
|
+
sqlite: 'SQLite',
|
|
338
|
+
stylus: 'Stylus',
|
|
339
|
+
styl: 'Stylus',
|
|
340
|
+
swift: 'Swift',
|
|
341
|
+
text: 'Text',
|
|
342
|
+
toml: 'TOML',
|
|
343
|
+
twig: 'Twig',
|
|
344
|
+
typescript: 'TypeScript',
|
|
345
|
+
xhtml: 'XHTML',
|
|
346
|
+
xml: 'XML',
|
|
347
|
+
yaml: 'YAML',
|
|
348
|
+
yml: 'YAML',
|
|
349
|
+
zsh: 'Zsh'
|
|
350
|
+
};
|
|
351
|
+
function uppercase(language) {
|
|
352
|
+
if (language in codeTypes) return codeTypes[language];
|
|
353
|
+
return language;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/***/ })
|
|
357
|
+
|
|
358
|
+
/******/ });
|
|
359
|
+
/************************************************************************/
|
|
360
|
+
/******/ // The module cache
|
|
361
|
+
/******/ var __webpack_module_cache__ = {};
|
|
362
|
+
/******/
|
|
363
|
+
/******/ // The require function
|
|
364
|
+
/******/ function __webpack_require__(moduleId) {
|
|
365
|
+
/******/ // Check if module is in cache
|
|
366
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
367
|
+
/******/ if (cachedModule !== undefined) {
|
|
368
|
+
/******/ return cachedModule.exports;
|
|
369
|
+
/******/ }
|
|
370
|
+
/******/ // Create a new module (and put it into the cache)
|
|
371
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
372
|
+
/******/ // no module.id needed
|
|
373
|
+
/******/ // no module.loaded needed
|
|
374
|
+
/******/ exports: {}
|
|
375
|
+
/******/ };
|
|
376
|
+
/******/
|
|
377
|
+
/******/ // Execute the module function
|
|
378
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
379
|
+
/******/
|
|
380
|
+
/******/ // Return the exports of the module
|
|
381
|
+
/******/ return module.exports;
|
|
382
|
+
/******/ }
|
|
383
|
+
/******/
|
|
384
|
+
/************************************************************************/
|
|
385
|
+
/******/
|
|
386
|
+
/******/ // startup
|
|
387
|
+
/******/ // Load entry module and return exports
|
|
388
|
+
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
389
|
+
/******/ var __webpack_exports__ = __webpack_require__(638);
|
|
390
|
+
/******/ module.exports = __webpack_exports__;
|
|
391
|
+
/******/
|
|
392
|
+
/******/ })()
|
|
393
|
+
;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
declare const modeAliases: {
|
|
2
|
+
readonly aspx: "asp";
|
|
3
|
+
readonly bash: "shell";
|
|
4
|
+
readonly 'c++': "cplusplus";
|
|
5
|
+
readonly 'c#': "csharp";
|
|
6
|
+
readonly clj: "clojure";
|
|
7
|
+
readonly cljc: "clojure";
|
|
8
|
+
readonly cljx: "clojure";
|
|
9
|
+
readonly coffeescript: "javascript";
|
|
10
|
+
readonly cpp: "cplusplus";
|
|
11
|
+
readonly cql: "sql";
|
|
12
|
+
readonly cs: "csharp";
|
|
13
|
+
readonly docker: "dockerfile";
|
|
14
|
+
readonly ecmascript: "javascript";
|
|
15
|
+
readonly erl: "erlang";
|
|
16
|
+
readonly gql: "graphql";
|
|
17
|
+
readonly gradle: "groovy";
|
|
18
|
+
readonly handlebars: "html";
|
|
19
|
+
readonly hbs: "html";
|
|
20
|
+
readonly jl: "julia";
|
|
21
|
+
readonly jruby: "ruby";
|
|
22
|
+
readonly js: "javascript";
|
|
23
|
+
readonly kt: "kotlin";
|
|
24
|
+
readonly less: "css";
|
|
25
|
+
readonly macruby: "ruby";
|
|
26
|
+
readonly md: "markdown";
|
|
27
|
+
readonly ml: "ocaml";
|
|
28
|
+
readonly mssql: "sql";
|
|
29
|
+
readonly mysql: "sql";
|
|
30
|
+
readonly node: "javascript";
|
|
31
|
+
readonly 'obj-c': "objectivec";
|
|
32
|
+
readonly 'obj-c++': "objectivecplusplus";
|
|
33
|
+
readonly 'objc++': "objectivecplusplus";
|
|
34
|
+
readonly objc: "objectivec";
|
|
35
|
+
readonly objcpp: "objectivecplusplus";
|
|
36
|
+
readonly objectivecpp: "objectivecplusplus";
|
|
37
|
+
readonly pgsql: "sql";
|
|
38
|
+
readonly pl: "perl";
|
|
39
|
+
readonly plsql: "sql";
|
|
40
|
+
readonly postgres: "sql";
|
|
41
|
+
readonly postgresql: "sql";
|
|
42
|
+
readonly ps1: "powershell";
|
|
43
|
+
readonly py: "python";
|
|
44
|
+
readonly rake: "ruby";
|
|
45
|
+
readonly rb: "ruby";
|
|
46
|
+
readonly rbx: "ruby";
|
|
47
|
+
readonly rs: "rust";
|
|
48
|
+
readonly sass: "css";
|
|
49
|
+
readonly scss: "css";
|
|
50
|
+
readonly sh: "shell";
|
|
51
|
+
readonly solidity: "sol";
|
|
52
|
+
readonly sqlite: "sql";
|
|
53
|
+
readonly styl: "css";
|
|
54
|
+
readonly stylus: "css";
|
|
55
|
+
readonly xhtml: "html";
|
|
56
|
+
readonly yml: "yaml";
|
|
57
|
+
readonly zsh: "shell";
|
|
58
|
+
};
|
|
59
|
+
declare const canonical: (language: keyof typeof modeAliases) => "stylus" | "html" | "ruby" | "rb" | "asp" | "shell" | "cplusplus" | "csharp" | "clojure" | "javascript" | "sql" | "dockerfile" | "erlang" | "graphql" | "groovy" | "julia" | "kotlin" | "css" | "markdown" | "ocaml" | "objectivec" | "objectivecplusplus" | "perl" | "powershell" | "python" | "rust" | "sol" | "yaml" | "aspx" | "bash" | "c++" | "c#" | "clj" | "cljc" | "cljx" | "coffeescript" | "cpp" | "cql" | "cs" | "docker" | "ecmascript" | "erl" | "gql" | "gradle" | "handlebars" | "hbs" | "jl" | "jruby" | "js" | "kt" | "less" | "macruby" | "md" | "ml" | "mssql" | "mysql" | "node" | "obj-c" | "obj-c++" | "objc++" | "objc" | "objcpp" | "objectivecpp" | "pgsql" | "pl" | "plsql" | "postgres" | "postgresql" | "ps1" | "py" | "rake" | "rbx" | "rs" | "sass" | "scss" | "sh" | "solidity" | "sqlite" | "styl" | "xhtml" | "yml" | "zsh";
|
|
60
|
+
export default canonical;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const modeAliases = {
|
|
4
|
+
aspx: 'asp',
|
|
5
|
+
bash: 'shell',
|
|
6
|
+
'c++': 'cplusplus',
|
|
7
|
+
'c#': 'csharp',
|
|
8
|
+
clj: 'clojure',
|
|
9
|
+
cljc: 'clojure',
|
|
10
|
+
cljx: 'clojure',
|
|
11
|
+
coffeescript: 'javascript',
|
|
12
|
+
cpp: 'cplusplus',
|
|
13
|
+
cql: 'sql',
|
|
14
|
+
cs: 'csharp',
|
|
15
|
+
docker: 'dockerfile',
|
|
16
|
+
ecmascript: 'javascript',
|
|
17
|
+
erl: 'erlang',
|
|
18
|
+
gql: 'graphql',
|
|
19
|
+
gradle: 'groovy',
|
|
20
|
+
handlebars: 'html',
|
|
21
|
+
hbs: 'html',
|
|
22
|
+
jl: 'julia',
|
|
23
|
+
jruby: 'ruby',
|
|
24
|
+
js: 'javascript',
|
|
25
|
+
kt: 'kotlin',
|
|
26
|
+
less: 'css',
|
|
27
|
+
macruby: 'ruby',
|
|
28
|
+
md: 'markdown',
|
|
29
|
+
ml: 'ocaml',
|
|
30
|
+
mssql: 'sql',
|
|
31
|
+
mysql: 'sql',
|
|
32
|
+
node: 'javascript',
|
|
33
|
+
'obj-c': 'objectivec',
|
|
34
|
+
'obj-c++': 'objectivecplusplus',
|
|
35
|
+
'objc++': 'objectivecplusplus',
|
|
36
|
+
objc: 'objectivec',
|
|
37
|
+
objcpp: 'objectivecplusplus',
|
|
38
|
+
objectivecpp: 'objectivecplusplus',
|
|
39
|
+
pgsql: 'sql',
|
|
40
|
+
pl: 'perl',
|
|
41
|
+
plsql: 'sql',
|
|
42
|
+
postgres: 'sql',
|
|
43
|
+
postgresql: 'sql',
|
|
44
|
+
ps1: 'powershell',
|
|
45
|
+
py: 'python',
|
|
46
|
+
rake: 'ruby',
|
|
47
|
+
rb: 'ruby',
|
|
48
|
+
rbx: 'ruby',
|
|
49
|
+
rs: 'rust',
|
|
50
|
+
sass: 'css',
|
|
51
|
+
scss: 'css',
|
|
52
|
+
sh: 'shell',
|
|
53
|
+
solidity: 'sol',
|
|
54
|
+
sqlite: 'sql',
|
|
55
|
+
styl: 'css',
|
|
56
|
+
stylus: 'css',
|
|
57
|
+
xhtml: 'html',
|
|
58
|
+
yml: 'yaml',
|
|
59
|
+
zsh: 'shell',
|
|
60
|
+
};
|
|
61
|
+
const canonical = (language) => {
|
|
62
|
+
if (language in modeAliases)
|
|
63
|
+
return modeAliases[language];
|
|
64
|
+
return language;
|
|
65
|
+
};
|
|
66
|
+
exports.default = canonical;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { getMode } from './modes';
|
|
2
|
+
import uppercase from './uppercase';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
uppercase: typeof uppercase;
|
|
5
|
+
canonical: (language: "stylus" | "rb" | "aspx" | "bash" | "c++" | "c#" | "clj" | "cljc" | "cljx" | "coffeescript" | "cpp" | "cql" | "cs" | "docker" | "ecmascript" | "erl" | "gql" | "gradle" | "handlebars" | "hbs" | "jl" | "jruby" | "js" | "kt" | "less" | "macruby" | "md" | "ml" | "mssql" | "mysql" | "node" | "obj-c" | "obj-c++" | "objc++" | "objc" | "objcpp" | "objectivecpp" | "pgsql" | "pl" | "plsql" | "postgres" | "postgresql" | "ps1" | "py" | "rake" | "rbx" | "rs" | "sass" | "scss" | "sh" | "solidity" | "sqlite" | "styl" | "xhtml" | "yml" | "zsh") => "stylus" | "html" | "ruby" | "rb" | "asp" | "shell" | "cplusplus" | "csharp" | "clojure" | "javascript" | "sql" | "dockerfile" | "erlang" | "graphql" | "groovy" | "julia" | "kotlin" | "css" | "markdown" | "ocaml" | "objectivec" | "objectivecplusplus" | "perl" | "powershell" | "python" | "rust" | "sol" | "yaml" | "aspx" | "bash" | "c++" | "c#" | "clj" | "cljc" | "cljx" | "coffeescript" | "cpp" | "cql" | "cs" | "docker" | "ecmascript" | "erl" | "gql" | "gradle" | "handlebars" | "hbs" | "jl" | "jruby" | "js" | "kt" | "less" | "macruby" | "md" | "ml" | "mssql" | "mysql" | "node" | "obj-c" | "obj-c++" | "objc++" | "objc" | "objcpp" | "objectivecpp" | "pgsql" | "pl" | "plsql" | "postgres" | "postgresql" | "ps1" | "py" | "rake" | "rbx" | "rs" | "sass" | "scss" | "sh" | "solidity" | "sqlite" | "styl" | "xhtml" | "yml" | "zsh";
|
|
6
|
+
modes: {
|
|
7
|
+
readonly asp: "clike";
|
|
8
|
+
readonly aspx: "clike";
|
|
9
|
+
readonly bash: "shell";
|
|
10
|
+
readonly c: "clike";
|
|
11
|
+
readonly 'c#': readonly ["clike", "text/x-csharp"];
|
|
12
|
+
readonly 'c++': readonly ["clike", "text/x-c++src"];
|
|
13
|
+
readonly clj: "clojure";
|
|
14
|
+
readonly cljc: "clojure";
|
|
15
|
+
readonly cljx: "clojure";
|
|
16
|
+
readonly coffeescript: "javascript";
|
|
17
|
+
readonly cplusplus: readonly ["clike", "text/x-c++src"];
|
|
18
|
+
readonly cpp: readonly ["clike", "text/x-c++src"];
|
|
19
|
+
readonly cql: readonly ["sql", "text/x-cassandra"];
|
|
20
|
+
readonly cs: readonly ["clike", "text/x-csharp"];
|
|
21
|
+
readonly csharp: readonly ["clike", "text/x-csharp"];
|
|
22
|
+
readonly curl: "shell";
|
|
23
|
+
readonly d: "d";
|
|
24
|
+
readonly diff: "diff";
|
|
25
|
+
readonly ecmascript: "javascript";
|
|
26
|
+
readonly erl: "erlang";
|
|
27
|
+
readonly go: readonly ["go", "text/x-go"];
|
|
28
|
+
readonly gradle: "groovy";
|
|
29
|
+
readonly gql: "graphql";
|
|
30
|
+
readonly handlebars: "htmlmixed";
|
|
31
|
+
readonly hbs: "htmlmixed";
|
|
32
|
+
readonly html: "htmlmixed";
|
|
33
|
+
readonly java: readonly ["clike", "text/x-java"];
|
|
34
|
+
readonly jl: "julia";
|
|
35
|
+
readonly js: "javascript";
|
|
36
|
+
readonly jsx: "jsx";
|
|
37
|
+
readonly json: readonly ["javascript", "application/ld+json"];
|
|
38
|
+
readonly jruby: "ruby";
|
|
39
|
+
readonly kotlin: readonly ["clike", "text/x-kotlin"];
|
|
40
|
+
readonly kt: readonly ["clike", "text/x-kotlin"];
|
|
41
|
+
readonly less: "css";
|
|
42
|
+
readonly liquid: "htmlmixed";
|
|
43
|
+
readonly lua: "lua";
|
|
44
|
+
readonly node: "javascript";
|
|
45
|
+
readonly macruby: "ruby";
|
|
46
|
+
readonly markdown: "gfm";
|
|
47
|
+
readonly ml: readonly ["mllike", "text/x-ocaml"];
|
|
48
|
+
readonly mssql: readonly ["sql", "text/x-mssql"];
|
|
49
|
+
readonly mysql: readonly ["sql", "text/x-mysql"];
|
|
50
|
+
readonly objc: readonly ["clike", "text/x-objectivec"];
|
|
51
|
+
readonly 'objc++': readonly ["clike", "text/x-objectivec++"];
|
|
52
|
+
readonly objcpp: readonly ["clike", "text/x-objectivec++"];
|
|
53
|
+
readonly objectivec: readonly ["clike", "text/x-objectivec"];
|
|
54
|
+
readonly objectivecpp: readonly ["clike", "text/x-objectivec++"];
|
|
55
|
+
readonly objectivecplusplus: readonly ["clike", "text/x-objectivec++"];
|
|
56
|
+
readonly ocaml: readonly ["mllike", "text/x-ocaml"];
|
|
57
|
+
readonly php: readonly ["php", "text/x-php"];
|
|
58
|
+
readonly pgsql: readonly ["sql", "text/x-pgsql"];
|
|
59
|
+
readonly pl: "perl";
|
|
60
|
+
readonly plsql: readonly ["sql", "text/x-plsql"];
|
|
61
|
+
readonly postgres: readonly ["sql", "text/x-pgsql"];
|
|
62
|
+
readonly postgresql: readonly ["sql", "text/x-pgsql"];
|
|
63
|
+
readonly ps1: "powershell";
|
|
64
|
+
readonly py: "python";
|
|
65
|
+
readonly r: "r";
|
|
66
|
+
readonly rake: "ruby";
|
|
67
|
+
readonly rb: "ruby";
|
|
68
|
+
readonly rbx: "ruby";
|
|
69
|
+
readonly rs: "rust";
|
|
70
|
+
readonly sass: "css";
|
|
71
|
+
readonly scala: readonly ["clike", "text/x-scala"];
|
|
72
|
+
readonly scss: "css";
|
|
73
|
+
readonly sh: "shell";
|
|
74
|
+
readonly sol: "solidity";
|
|
75
|
+
readonly solidity: "solidity";
|
|
76
|
+
readonly sql: readonly ["sql", "text/x-sql"];
|
|
77
|
+
readonly sqlite: readonly ["sql", "text/x-sqlite"];
|
|
78
|
+
readonly styl: "css";
|
|
79
|
+
readonly stylus: "css";
|
|
80
|
+
readonly text: readonly ["null", "text/plain"];
|
|
81
|
+
readonly ts: readonly ["javascript", "text/typescript"];
|
|
82
|
+
readonly typescript: readonly ["javascript", "text/typescript"];
|
|
83
|
+
readonly xhtml: "htmlmixed";
|
|
84
|
+
readonly yml: "yaml";
|
|
85
|
+
readonly zsh: "shell";
|
|
86
|
+
};
|
|
87
|
+
getMode: typeof getMode;
|
|
88
|
+
};
|
|
89
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const canonical_1 = __importDefault(require("./canonical"));
|
|
7
|
+
const modes_1 = require("./modes");
|
|
8
|
+
const uppercase_1 = __importDefault(require("./uppercase"));
|
|
9
|
+
exports.default = { uppercase: uppercase_1.default, canonical: canonical_1.default, modes: modes_1.modes, getMode: modes_1.getMode };
|