加入了pako和axios的测试。

This commit is contained in:
Kane Wang 2023-02-13 16:52:44 +08:00
parent 946cf852d2
commit db0ac8c960
28 changed files with 2048 additions and 1587 deletions

View File

@ -0,0 +1,4 @@
node_modules
dist
target
tsconfig.json

60
code/ts/pako/.eslintrc.js Normal file
View File

@ -0,0 +1,60 @@
/*
* @Author: Kane
* @Date: 2023-02-09 15:26:18
* @LastEditors: Kane
* @LastEditTime: 2023-02-10 10:25:42
* @FilePath: /后端辅助工具/.eslintrc.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
// project: ["./tsconfig.json",],
tsconfigRootDir: __dirname,
},
plugins: [
"@typescript-eslint",
],
extends: [
// "standard-with-typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-console": "warn",
"quote-props": ["warn", "as-needed",],
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
indent: ["warn", 4,],
"no-unused-vars": "off",
semi: ["error", "always",], // 控制行尾部分号
"comma-dangle": ["error", {
arrays: "always",
objects: "always",
imports: "never",
exports: "never",
functions: "never",
},], // 数组和对象键值对最后一个逗号
"comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": ["error", "never",],
"no-undef-init": "error",
"no-invalid-this": "error",
"no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
// "comma-spacing": ["error", { "before": false, "after": true, },],
"brace-style": ["error", "allman", { allowSingleLine: true, },],
"prefer-const": "warn",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off",
},
};

21
code/ts/pako/package-lock.json generated Normal file
View File

@ -0,0 +1,21 @@
{
"name": "pako",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pako",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"pako": "^2.1.0"
}
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="
}
}
}

19
code/ts/pako/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "pako",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node index.js"
},
"keywords": [
"pako"
],
"type": "module",
"author": "Kane",
"license": "ISC",
"dependencies": {
"pako": "^2.1.0"
}
}

22
code/ts/pako/src/index.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,37 @@
/*
* @Author: Kane
* @Date: 2023-02-13 14:54:46
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 14:55:19
* @FilePath: /pako/src/utils/StringConverter.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
function Uint8ArrayToString(fileData)
{
var dataString = "";
for (var i = 0; i < fileData.length; i++)
{
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
function stringToUint8Array(str)
{
var arr = [];
for (var i = 0, j = str.length; i < j; ++i)
{
arr.push(str.charCodeAt(i));
}
var tmpUint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
export { Uint8ArrayToString, stringToUint8Array };

View File

@ -1,9 +1,13 @@
{
"name": "后端辅助工具",
"name": "utils",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"axios": "^1.3.2",
"pako": "^2.1.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
@ -361,6 +365,21 @@
"node": ">=8"
}
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "1.3.2",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.3.2.tgz",
"integrity": "sha512-1M3O703bYqYuPhbHeya5bnhpYVsDDRyQSabNja04mZtboLNSuZ4YrltestrLXfHgmzua4TpUqRiVKbiQuo2epw==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
@ -429,6 +448,17 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/concat-map": {
"version": "0.0.1",
"resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz",
@ -472,6 +502,14 @@
"integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
"dev": true
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmmirror.com/dir-glob/-/dir-glob-3.0.1.tgz",
@ -774,6 +812,32 @@
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
"dev": true
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
@ -1040,6 +1104,25 @@
"node": ">=8.6"
}
},
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz",
@ -1120,6 +1203,11 @@
"node": ">=10"
}
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/parent-module/-/parent-module-1.0.1.tgz",
@ -1186,6 +1274,11 @@
"node": ">= 0.8.0"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.0.tgz",

View File

@ -3,5 +3,9 @@
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "^8.33.0"
},
"dependencies": {
"axios": "^1.3.2",
"pako": "^2.1.0"
}
}

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-10 15:08:53
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 00:40:30
* @LastEditTime: 2023-02-13 10:04:33
* @FilePath: //src/DataType/DataType.ts
* @Description:
*
@ -61,6 +61,12 @@ function dataTypes()
overplusArugsWithTuple(1, 2, 3, "test");
console.log(overplusArgusWithArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
//测试null
const nulltest: null = null;
let var_2: { x: string; } = { x: "test", };
// var_2 = null;
}

View File

@ -0,0 +1,11 @@
/*
* @Author: Kane
* @Date: 2023-02-13 15:46:17
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 15:46:17
* @FilePath: //src/axios/AxiosTest.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import axios from "axios";

View File

@ -0,0 +1,19 @@
/*
* @Author: Kane
* @Date: 2023-02-13 15:53:45
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 15:56:26
* @FilePath: //src/axios/request.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import axios, { AxiosInstance } from "axios";
const service = axios.create({
baseURL: "",
timeout: 10000,
timeoutErrorMessage: "请求超时!",
});

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-09 22:14:30
* @LastEditors: Kane
* @LastEditTime: 2023-02-12 23:52:33
* @LastEditTime: 2023-02-13 15:59:43
* @FilePath: //src/main.ts
* @Description:
*
@ -10,10 +10,12 @@
*/
import { dataTypes } from "./DataType/DataType";
import { pakoTest } from "./gzip/PakoTest";
const greetings = "hello, this is kane's typescript!";
console.log(greetings);
console.log("all");
dataTypes();
//dataTypes();
pakoTest();

View File

@ -0,0 +1,38 @@
/*
* @Author: Kane
* @Date: 2023-02-13 14:54:46
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 14:55:19
* @FilePath: /pako/src/utils/StringConverter.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
function Uint8ArrayToString(fileData: Uint8Array): string
{
let dataString: string = "";
for (let i = 0; i < fileData.length; i++)
{
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
function stringToUint8Array(str: string): Uint8Array
{
const arr: number[] = [];
for (let i = 0, j = str.length; i < j; ++i)
{
arr.push(str.charCodeAt(i));
}
const tmpUint8Array: Uint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
export { Uint8ArrayToString, stringToUint8Array };

View File

@ -3,7 +3,7 @@
* @Author: Kane
* @Date: 2023-02-10 15:08:53
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 00:40:30
* @LastEditTime: 2023-02-13 10:04:33
* @FilePath: //src/DataType/DataType.ts
* @Description:
*
@ -11,39 +11,48 @@
*/
/*eslint no-unused-vars: "off" */
/*eslint @typescript-eslint/no-unused-vars: "off" */
Object.defineProperty(exports, "__esModule", { value: true });
exports.__esModule = true;
exports.dataTypes = void 0;
//Tuple
function dataTypes()
{
const tu = [1, 1, 2,];
const toArray = [1, 2, "3",];
const v1 = toArray;
const s1 = "string";
function dataTypes() {
var tu = [1, 1, 2,];
var toArray = [1, 2, "3",];
var v1 = toArray;
var s1 = "string";
console.log(typeof s1);
let point;
point = { x: 0, y: 0, };
function addOne(x, y = 1)
{
var point;
point = { x: 0, y: 0 };
function addOne(x, y) {
if (y === void 0) { y = 1; }
return x + y;
}
console.log(addOne(1));
function allParams(x, y)
{
const z = x + y;
function allParams(x, y) {
var z = x + y;
}
//剩余参数,数组形式
function overplusArgusWithArray(x, ...argus)
{
function overplusArgusWithArray(x) {
var argus = [];
for (var _i = 1; _i < arguments.length; _i++) {
argus[_i - 1] = arguments[_i];
}
return argus.length;
}
function overplusArugsWithTuple(x, ...argus)
{
console.log(`元组形式的参数表${argus},剩余参数的数量${argus.length}`);
function overplusArugsWithTuple(x) {
var argus = [];
for (var _i = 1; _i < arguments.length; _i++) {
argus[_i - 1] = arguments[_i];
}
console.log("\u5143\u7EC4\u5F62\u5F0F\u7684\u53C2\u6570\u8868".concat(argus, ",\u5269\u4F59\u53C2\u6570\u7684\u6570\u91CF").concat(argus.length, "\u3002"));
console.log(argus[2]);
return argus.length;
}
overplusArugsWithTuple(1, 2, 3, "test");
console.log(overplusArgusWithArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
//测试null
var nulltest = null;
var var_2 = { x: "test" };
// var_2 = null;
}
exports.dataTypes = dataTypes;
//# sourceMappingURL=DataType.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"DataType.js","sourceRoot":"","sources":["../../src/DataType/DataType.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;AACH,iCAAiC;AACjC,oDAAoD;;;AAGpD,OAAO;AACP,SAAS,SAAS;IAEd,IAAM,EAAE,GAAsC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IAEzD,IAAM,OAAO,GAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;IACvD,IAAM,EAAE,GAAwB,OAAO,CAAC;IAExC,IAAM,EAAE,GAAG,QAAQ,CAAC;IAEpB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAGvB,IAAI,KAGH,CAAC;IACF,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAG,CAAC;IAExB,SAAS,MAAM,CAAC,CAAS,EAAE,CAAa;QAAb,kBAAA,EAAA,KAAa;QAEpC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvB,SAAS,SAAS,CAAC,CAAS,EAAE,CAAS;QAEnC,IAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC;IAED,WAAW;IACX,SAAS,sBAAsB,CAAC,CAAS;QAAE,eAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,8BAAkB;;QAEzD,OAAO,KAAK,CAAC,MAAM,CAAC;IACxB,CAAC;IAED,SAAS,sBAAsB,CAAC,CAAS;QAAE,eAAkC;aAAlC,UAAkC,EAAlC,qBAAkC,EAAlC,IAAkC;YAAlC,8BAAkC;;QAGzE,OAAO,CAAC,GAAG,CAAC,0DAAW,KAAK,wDAAW,KAAK,CAAC,MAAM,WAAG,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtB,OAAO,KAAK,CAAC,MAAM,CAAC;IACxB,CAAC;IAED,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAExC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAEnE,QAAQ;IACR,IAAM,QAAQ,GAAS,IAAI,CAAC;IAC5B,IAAI,KAAK,GAAmB,EAAE,CAAC,EAAE,MAAM,EAAG,CAAC;IAE3C,gBAAgB;AACpB,CAAC;AAGQ,8BAAS"}

View File

@ -0,0 +1,3 @@
"use strict";
exports.__esModule = true;
//# sourceMappingURL=AxiosTest.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"AxiosTest.js","sourceRoot":"","sources":["../../src/axios/AxiosTest.ts"],"names":[],"mappings":""}

View File

@ -0,0 +1,19 @@
"use strict";
exports.__esModule = true;
/*
* @Author: Kane
* @Date: 2023-02-13 15:53:45
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 15:56:26
* @FilePath: //src/axios/request.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
var axios_1 = require("axios");
var service = axios_1["default"].create({
baseURL: "",
timeout: 10000,
timeoutErrorMessage: "请求超时!"
});
//# sourceMappingURL=request.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/axios/request.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;GASG;AACH,+BAA6C;AAE7C,IAAM,OAAO,GAAG,kBAAK,CAAC,MAAM,CAAC;IACzB,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,KAAK;IACd,mBAAmB,EAAE,OAAO;CAC/B,CAAC,CAAC"}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"version":3,"file":"PakoTest.js","sourceRoot":"","sources":["../../src/gzip/PakoTest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,6BAAwC;AACxC,wDAAgF;AAEhF,SAAS,QAAQ;IAEb,IAAM,QAAQ,GAAW,45MAA4pI,CAAC;IACtrI,IAAM,OAAO,GAAG,IAAA,kCAAkB,EAAC,QAAQ,CAAC,CAAC;IAE7C,IAAM,UAAU,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,CAAC;IACpC,IAAM,YAAY,GAAG,IAAA,kCAAkB,EAAC,IAAA,cAAO,EAAC,UAAU,CAAC,CAAC,CAAC;IAE7D,OAAO,CAAC,GAAG,CAAC,8CAAS,UAAU,CAAE,CAAC,CAAC;IACnC,uCAAuC;AAC3C,CAAC;AAEQ,4BAAQ"}

View File

@ -3,15 +3,17 @@
* @Author: Kane
* @Date: 2023-02-09 22:14:30
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 09:31:28
* @FilePath: //target/main.js
* @LastEditTime: 2023-02-13 15:59:43
* @FilePath: //src/main.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const DataType_1 = require("./DataType/DataType");
const greetings = "hello, this is kane's typescript!";
exports.__esModule = true;
var PakoTest_1 = require("./gzip/PakoTest");
var greetings = "hello, this is kane's typescript!";
console.log(greetings);
console.log("all");
(0, DataType_1.dataTypes)();
//dataTypes();
(0, PakoTest_1.pakoTest)();
//# sourceMappingURL=main.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAGH,4CAA2C;AAE3C,IAAM,SAAS,GAAG,mCAAmC,CAAC;AAEtD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACvB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAEnB,cAAc;AACd,IAAA,mBAAQ,GAAE,CAAC"}

View File

@ -0,0 +1,31 @@
"use strict";
/*
* @Author: Kane
* @Date: 2023-02-13 14:54:46
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 14:55:19
* @FilePath: /pako/src/utils/StringConverter.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
exports.__esModule = true;
exports.stringToUint8Array = exports.Uint8ArrayToString = void 0;
function Uint8ArrayToString(fileData) {
var dataString = "";
for (var i = 0; i < fileData.length; i++) {
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
exports.Uint8ArrayToString = Uint8ArrayToString;
function stringToUint8Array(str) {
var arr = [];
for (var i = 0, j = str.length; i < j; ++i) {
arr.push(str.charCodeAt(i));
}
var tmpUint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
exports.stringToUint8Array = stringToUint8Array;
//# sourceMappingURL=StringConvert.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"StringConvert.js","sourceRoot":"","sources":["../../src/utils/StringConvert.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,SAAS,kBAAkB,CAAC,QAAoB;IAE5C,IAAI,UAAU,GAAW,EAAE,CAAC;IAE5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EACxC;QACI,UAAU,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAClD;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAgBQ,gDAAkB;AAd3B,SAAS,kBAAkB,CAAC,GAAW;IAEnC,IAAM,GAAG,GAAa,EAAE,CAAC;IAEzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAC1C;QACI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/B;IAED,IAAM,aAAa,GAAe,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAEtD,OAAO,aAAa,CAAC;AACzB,CAAC;AAE4B,gDAAkB"}

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-09 15:24:20
* @LastEditors: Kane
* @LastEditTime: 2023-02-10 10:16:40
* @LastEditTime: 2023-02-13 15:58:39
* @FilePath: //tsconfig.json
* @Description:
*
@ -13,6 +13,7 @@
"outDir": "./target",
"strict": false,
"strictNullChecks": true,
"sourceMap": true,
},
// "files": [
// "./src/main.ts",

File diff suppressed because one or more lines are too long