it-console/code/ts/后端辅助工具/target/gzip/PakoTest.js

22 lines
5.7 KiB
JavaScript
Raw Normal View History

2023-02-13 08:52:44 +00:00
/*
* @Author: Kane
* @Date: 2023-02-13 14:39:24
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 16:12:54
* @FilePath: //src/gzip/PakoTest.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
2023-02-13 16:23:26 +00:00
import { inflate, deflate } from "pako";
import { Uint8ArrayToString, stringToUint8Array } from "../utils/StringConvert";
2023-02-13 08:52:44 +00:00
function pakoTest() {
2023-02-13 16:23:26 +00:00
const htmlText = `'<p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">我司与慧择渠道合作对接的旅游险产品“任性游”,合作方提出拓展承保港澳地区,原产品医疗保障对应的条款仅支持境内,需切换成境外条款。</span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">为满足业务需求,现申请将方案初始化,以便条款切换。 </span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">附方案代码:</span></p><ul><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001392</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001391</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001390</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001389</span></li></ul><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;"> 如上需求,烦请各位领导支持,感谢!</span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">我司与慧择渠道合作对接的旅游险产品“任性游”,合作方提出拓展承保港澳地区,原产品医疗保障对应的条款仅支持境内,需切换成境外条款。</span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">为满足业务需求,现申请将方案初始化,以便条款切换。 </span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">附方案代码:</span></p><ul><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001392</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001391</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001390</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001389</span></li></ul><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;"> 如上需求,烦请各位领导支持,感谢!</span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">我司与慧择渠道合作对接的旅游险产品“任性游”,合作方提出拓展承保港澳地区,原产品医疗保障对应的条款仅支持境内,需切换成境外条款。</span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">为满足业务需求,现申请将方案初始化,以便条款切换。 </span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">附方案代码:</span></p><ul><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001392</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001391</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001390</span></li><li><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">P23YD9800H2000001389</span></li></ul><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;"> 如上需求,烦请各位领导支持,感谢!</span></p><p><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 14px;">我司与慧择渠道合作对接的旅游险产品“任性游”合作方提出拓展承保港澳地区原产品医疗保障对应的条款仅支持境内需切换成<E68DA2>
const u8array = stringToUint8Array(htmlText);
const compressed = deflate(u8array);
const uncompressed = Uint8ArrayToString(inflate(compressed));
console.log(`压缩后字符串${compressed}`);
2023-02-13 08:52:44 +00:00
//console.log(`解压后字符串${uncompressed}`);
}
2023-02-13 16:23:26 +00:00
export { pakoTest };
2023-02-13 08:52:44 +00:00
//# sourceMappingURL=PakoTest.js.map