@opensumi/ide-core-common 3.3.2-next-1725604464.0 → 3.3.2-next-1725605085.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/lib/mime.d.ts CHANGED
@@ -6,10 +6,4 @@ export declare const Mimes: Readonly<{
6
6
  latex: "text/latex";
7
7
  uriList: "text/uri-list";
8
8
  }>;
9
- export declare function normalizeMimeType(mimeType: string): string;
10
- export declare function normalizeMimeType(mimeType: string, strict: true): string | undefined;
11
- /**
12
- * Whether the provided mime type is a text stream like `stdout`, `stderr`.
13
- */
14
- export declare function isTextStreamMime(mimeType: string): boolean;
15
9
  //# sourceMappingURL=mime.d.ts.map
package/lib/mime.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mime.d.ts","sourceRoot":"","sources":["../src/mime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;EAOhB,CAAC;AAIH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AAC5D,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AAWtF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,WAEhD"}
1
+ {"version":3,"file":"mime.d.ts","sourceRoot":"","sources":["../src/mime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;EAOhB,CAAC"}
package/lib/mime.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTextStreamMime = exports.normalizeMimeType = exports.Mimes = void 0;
3
+ exports.Mimes = void 0;
4
4
  exports.Mimes = Object.freeze({
5
5
  text: 'text/plain',
6
6
  binary: 'application/octet-stream',
@@ -9,23 +9,4 @@ exports.Mimes = Object.freeze({
9
9
  latex: 'text/latex',
10
10
  uriList: 'text/uri-list',
11
11
  });
12
- const _simplePattern = /^(.+)\/(.+?)(;.+)?$/;
13
- function normalizeMimeType(mimeType, strict) {
14
- var _a;
15
- const match = _simplePattern.exec(mimeType);
16
- if (!match) {
17
- return strict ? undefined : mimeType;
18
- }
19
- // https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
20
- // media and subtype must ALWAYS be lowercase, parameter not
21
- return `${match[1].toLowerCase()}/${match[2].toLowerCase()}${(_a = match[3]) !== null && _a !== void 0 ? _a : ''}`;
22
- }
23
- exports.normalizeMimeType = normalizeMimeType;
24
- /**
25
- * Whether the provided mime type is a text stream like `stdout`, `stderr`.
26
- */
27
- function isTextStreamMime(mimeType) {
28
- return ['application/vnd.code.notebook.stdout', 'application/vnd.code.notebook.stderr'].includes(mimeType);
29
- }
30
- exports.isTextStreamMime = isTextStreamMime;
31
12
  //# sourceMappingURL=mime.js.map
package/lib/mime.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mime.js","sourceRoot":"","sources":["../src/mime.ts"],"names":[],"mappings":";;;AAAa,QAAA,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,0BAA0B;IAClC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,eAAe;CACzB,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAI7C,SAAgB,iBAAiB,CAAC,QAAgB,EAAE,MAAa;;IAC/D,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;KACtC;IACD,4DAA4D;IAC5D,4DAA4D;IAC5D,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAA,KAAK,CAAC,CAAC,CAAC,mCAAI,EAAE,EAAE,CAAC;AAChF,CAAC;AARD,8CAQC;AAED;;GAEG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAC/C,OAAO,CAAC,sCAAsC,EAAE,sCAAsC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7G,CAAC;AAFD,4CAEC"}
1
+ {"version":3,"file":"mime.js","sourceRoot":"","sources":["../src/mime.ts"],"names":[],"mappings":";;;AAAa,QAAA,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,0BAA0B;IAClC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,eAAe;IACzB,KAAK,EAAE,YAAY;IACnB,OAAO,EAAE,eAAe;CACzB,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/ide-core-common",
3
- "version": "3.3.2-next-1725604464.0",
3
+ "version": "3.3.2-next-1725605085.0",
4
4
  "description": "@opensumi/ide-core-common",
5
5
  "files": [
6
6
  "lib",
@@ -19,10 +19,10 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@opensumi/di": "^1.8.0",
22
- "@opensumi/ide-utils": "3.3.2-next-1725604464.0"
22
+ "@opensumi/ide-utils": "3.3.2-next-1725605085.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@opensumi/ide-dev-tool": "3.3.2-next-1725604464.0"
25
+ "@opensumi/ide-dev-tool": "3.3.2-next-1725605085.0"
26
26
  },
27
- "gitHead": "ab685778fe6197d12ce1b941b704900b2fac1237"
27
+ "gitHead": "44d1a108586e635a23c03debba9508f2f373e822"
28
28
  }
package/src/mime.ts CHANGED
@@ -6,24 +6,3 @@ export const Mimes = Object.freeze({
6
6
  latex: 'text/latex',
7
7
  uriList: 'text/uri-list',
8
8
  });
9
-
10
- const _simplePattern = /^(.+)\/(.+?)(;.+)?$/;
11
-
12
- export function normalizeMimeType(mimeType: string): string;
13
- export function normalizeMimeType(mimeType: string, strict: true): string | undefined;
14
- export function normalizeMimeType(mimeType: string, strict?: true): string | undefined {
15
- const match = _simplePattern.exec(mimeType);
16
- if (!match) {
17
- return strict ? undefined : mimeType;
18
- }
19
- // https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
20
- // media and subtype must ALWAYS be lowercase, parameter not
21
- return `${match[1].toLowerCase()}/${match[2].toLowerCase()}${match[3] ?? ''}`;
22
- }
23
-
24
- /**
25
- * Whether the provided mime type is a text stream like `stdout`, `stderr`.
26
- */
27
- export function isTextStreamMime(mimeType: string) {
28
- return ['application/vnd.code.notebook.stdout', 'application/vnd.code.notebook.stderr'].includes(mimeType);
29
- }