22 lines
5.6 KiB
JavaScript
22 lines
5.6 KiB
JavaScript
/*
|
|
* @Author: Kane
|
|
* @Date: 2023-02-13 14:48:51
|
|
* @LastEditors: Kane
|
|
* @LastEditTime: 2023-02-13 16:11:33
|
|
* @FilePath: /pako/src/index.js
|
|
* @Description:
|
|
*
|
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
|
*/
|
|
import { Uint8ArrayToString, stringToUint8Array } from "./utils/StringConverter.js";
|
|
import { deflate, inflate } from "pako";
|
|
|
|
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;">我司与慧择渠道合作对接的旅游险产品“任性游”,合作方提出拓展承保港澳地区,原产品医疗保障对应的条款仅支持境内,需切换成境外条款。</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><br></p><p>123</p><p><br></p><p><br></p><p><br></p><p><br></p><p><br></p>';
|
|
const buffer = stringToUint8Array(htmlText);
|
|
const text = Uint8ArrayToString(buffer);
|
|
|
|
const compressed = deflate(buffer);
|
|
const uncomporessed = inflate(compressed);
|
|
|
|
console.log(compressed.toString());
|
|
//console.log(uncomporessed);
|