xshell 1.3.80 → 1.4.2

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/repl.js CHANGED
@@ -1,4 +1,11 @@
1
- import { __rewriteRelativeImportExtension } from "tslib";
1
+ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
2
+ if (typeof path === "string" && /^\.\.?\//.test(path)) {
3
+ return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
4
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
5
+ });
6
+ }
7
+ return path;
8
+ };
2
9
  import repl from 'node:repl';
3
10
  import process from 'node:process';
4
11
  import { fileURLToPath } from 'url';
package/server.js CHANGED
@@ -9,7 +9,7 @@ import { default as Koa } from 'koa';
9
9
  import KoaCors from '@koa/cors';
10
10
  import KoaCompress from 'koa-compress';
11
11
  import resolve_safely from 'resolve-path';
12
- import { contentType as get_content_type } from 'mime-types';
12
+ import { mimes } from 'mrmime';
13
13
  // --- my libs
14
14
  import { t } from './i18n/instance.js';
15
15
  import { request as _request, Remote, get_socket_ip } from './net.js';
@@ -801,10 +801,7 @@ export class Server {
801
801
  response.set('content-type', (Server.js_exts.has(fext) ?
802
802
  'text/javascript; chatset=utf-8'
803
803
  :
804
- fext === 'mp4' ?
805
- 'video/mp4'
806
- :
807
- get_content_type(`file.${fext}`) || 'application/octet-stream'));
804
+ mimes[fext] || 'application/octet-stream'));
808
805
  }
809
806
  set_text(response, body, status) {
810
807
  if (status)
package/tsconfig.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "exclude": [
3
- "./test.ts"
3
+ "./test.ts",
4
+ "./i18n/test/"
4
5
  ],
5
6
 
6
7
  "compilerOptions": {
@@ -20,7 +21,7 @@
20
21
  "pretty": true,
21
22
  "newLine": "lf",
22
23
  "lib": ["ESNext", "DOM"],
23
- "importHelpers": true,
24
+ "importHelpers": false,
24
25
 
25
26
  "incremental": true,
26
27
  "tsBuildInfoFile": "T:/1/xsh/.tsbuildinfo",
@@ -1,5 +0,0 @@
1
- import { PluginItem } from '@babel/core';
2
- export declare let unmarkeds: any[];
3
- export declare function Checker({ filepath }: {
4
- filepath: any;
5
- }): PluginItem;
@@ -1,64 +0,0 @@
1
- import * as types from '@babel/types';
2
- export let unmarkeds = [];
3
- let t = 0;
4
- let Trans = 0;
5
- function is_t(node) {
6
- if (types.isCallExpression(node)) {
7
- // t('chtext')
8
- if (types.isIdentifier(node.callee) && node.callee.name === 't')
9
- return true;
10
- // i18n.t('chtext') | i18n.__('chtext')
11
- if (types.isMemberExpression(node.callee) &&
12
- types.isIdentifier(node.callee.object) &&
13
- types.isIdentifier(node.callee.property) &&
14
- node.callee.object.name === 'i18n' &&
15
- (node.callee.property.name === 't' || node.callee.property.name === '__'))
16
- return true;
17
- }
18
- return false;
19
- }
20
- function is_trans(node) {
21
- // <Trans>
22
- return (types.isJSXElement(node) &&
23
- types.isJSXOpeningElement(node.openingElement) &&
24
- types.isJSXIdentifier(node.openingElement.name) &&
25
- node.openingElement.name.name === 'Trans');
26
- }
27
- const has_unmarked_chinese_characters = (str) => !t && !Trans && /[\u4e00-\u9fa5]/.test(str);
28
- export function Checker({ filepath }) {
29
- return {
30
- CallExpression: {
31
- enter({ node }) {
32
- if (is_t(node))
33
- t++;
34
- },
35
- exit({ node }) {
36
- if (is_t(node))
37
- t--;
38
- },
39
- },
40
- JSXElement: {
41
- enter({ node }) {
42
- if (is_trans(node))
43
- Trans++;
44
- },
45
- exit({ node }) {
46
- if (is_trans(node))
47
- Trans--;
48
- },
49
- },
50
- JSXText: ({ node }) => {
51
- if (has_unmarked_chinese_characters(node.value))
52
- unmarkeds.push({ filepath, loc: node.loc, value: node.value });
53
- },
54
- StringLiteral: ({ node }) => {
55
- if (has_unmarked_chinese_characters(node.value))
56
- unmarkeds.push({ filepath, loc: node.loc, value: node.value });
57
- },
58
- TemplateElement: ({ node }) => {
59
- if (has_unmarked_chinese_characters(node.value.raw))
60
- unmarkeds.push({ filepath, loc: node.loc, value: node.value.cooked });
61
- },
62
- };
63
- }
64
- //# sourceMappingURL=checker.js.map