@rsdoctor/utils
Advanced tools
Comparing version 0.3.10-beta.1 to 0.3.10
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,10 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
// If the importer is in node compatibility mode or this is not an ESM | ||
// file that has been converted to a CommonJS file using a Babel- | ||
// compatible transform (i.e. "__esModule" has not been set), then set | ||
// "default" to the CommonJS "module.exports" for node compatibility. | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -38,4 +28,4 @@ var algorithm_exports = {}; | ||
module.exports = __toCommonJS(algorithm_exports); | ||
var import_zlib = require("zlib"); | ||
var import_buffer = require("buffer"); | ||
var import_lz4 = __toESM(require("lz4")); | ||
function mergeIntervals(intervals) { | ||
@@ -58,14 +48,6 @@ intervals.sort((a, b) => a[0] - b[0]); | ||
function compressText(input) { | ||
const inputBuffer = import_buffer.Buffer.from(input); | ||
let output = import_buffer.Buffer.alloc(import_lz4.default.encodeBound(input.length)); | ||
const compressedSize = import_lz4.default.encodeBlock(inputBuffer, output); | ||
output = output.slice(0, compressedSize); | ||
return output.toString("base64"); | ||
return (0, import_zlib.deflateSync)(input).toString("base64"); | ||
} | ||
function decompressText(input) { | ||
let uncompressedBlock = import_buffer.Buffer.alloc(input.length * 10); | ||
const inputBuffer = import_buffer.Buffer.from(input, "base64"); | ||
const uncompressedSize = import_lz4.default.decodeBlock(inputBuffer, uncompressedBlock); | ||
uncompressedBlock = uncompressedBlock.slice(0, uncompressedSize); | ||
return uncompressedBlock.toString("utf-8"); | ||
return (0, import_zlib.inflateSync)(import_buffer.Buffer.from(input, "base64")).toString(); | ||
} | ||
@@ -72,0 +54,0 @@ function random(min, max) { |
@@ -0,3 +1,3 @@ | ||
import { deflateSync, inflateSync } from "zlib"; | ||
import { Buffer } from "buffer"; | ||
import lz4 from "lz4"; | ||
function mergeIntervals(intervals) { | ||
@@ -20,14 +20,6 @@ intervals.sort((a, b) => a[0] - b[0]); | ||
function compressText(input) { | ||
const inputBuffer = Buffer.from(input); | ||
let output = Buffer.alloc(lz4.encodeBound(input.length)); | ||
const compressedSize = lz4.encodeBlock(inputBuffer, output); | ||
output = output.slice(0, compressedSize); | ||
return output.toString("base64"); | ||
return deflateSync(input).toString("base64"); | ||
} | ||
function decompressText(input) { | ||
let uncompressedBlock = Buffer.alloc(input.length * 10); | ||
const inputBuffer = Buffer.from(input, "base64"); | ||
const uncompressedSize = lz4.decodeBlock(inputBuffer, uncompressedBlock); | ||
uncompressedBlock = uncompressedBlock.slice(0, uncompressedSize); | ||
return uncompressedBlock.toString("utf-8"); | ||
return inflateSync(Buffer.from(input, "base64")).toString(); | ||
} | ||
@@ -34,0 +26,0 @@ function random(min, max) { |
{ | ||
"name": "@rsdoctor/utils", | ||
"version": "0.3.10-beta.1", | ||
"version": "0.3.10", | ||
"repository": { | ||
@@ -70,12 +70,12 @@ "type": "git", | ||
"dependencies": { | ||
"@babel/code-frame": "7.24.2", | ||
"@types/estree": "1.0.0", | ||
"@babel/code-frame": "7.24.7", | ||
"@types/estree": "1.0.5", | ||
"acorn": "^8.10.0", | ||
"acorn-import-assertions": "1.9.0", | ||
"acorn-walk": "8.3.2", | ||
"acorn-walk": "8.3.3", | ||
"chalk": "^4.1.2", | ||
"connect": "3.7.0", | ||
"deep-eql": "4.1.0", | ||
"deep-eql": "4.1.4", | ||
"envinfo": "7.13.0", | ||
"filesize": "^10.1.2", | ||
"filesize": "^10.1.4", | ||
"fs-extra": "^11.1.1", | ||
@@ -86,15 +86,13 @@ "get-port": "5.1.1", | ||
"lodash": "^4.17.21", | ||
"lz4": "^0.6.5", | ||
"rslog": "^1.2.0", | ||
"rslog": "^1.2.2", | ||
"strip-ansi": "^6.0.1", | ||
"@rsdoctor/types": "0.3.10-beta.1" | ||
"@rsdoctor/types": "0.3.10" | ||
}, | ||
"devDependencies": { | ||
"@types/babel__code-frame": "7.0.3", | ||
"@types/connect": "3.4.35", | ||
"@types/deep-eql": "4.0.0", | ||
"@types/babel__code-frame": "7.0.6", | ||
"@types/connect": "3.4.38", | ||
"@types/deep-eql": "4.0.2", | ||
"@types/envinfo": "7.8.4", | ||
"@types/fs-extra": "^11.0.2", | ||
"@types/lodash": "^4.17.0", | ||
"@types/lz4": "^0.6.4", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/lodash": "^4.17.7", | ||
"@types/node": "^16", | ||
@@ -101,0 +99,0 @@ "tslib": "2.4.1", |
Sorry, the diff of this file is not supported yet
18
9
286224
7185
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@rsdoctor/types@0.3.10(transitive)
+ Added@types/connect@3.4.38(transitive)
+ Added@types/estree@1.0.5(transitive)
+ Added@types/tapable@2.2.7(transitive)
+ Added@types/webpack@5.28.5(transitive)
+ Addedacorn-walk@8.3.3(transitive)
+ Addeddeep-eql@4.1.4(transitive)
- Removedlz4@^0.6.5
- Removed@babel/code-frame@7.24.2(transitive)
- Removed@rsdoctor/types@0.3.10-beta.1(transitive)
- Removed@types/connect@3.4.35(transitive)
- Removed@types/estree@1.0.0(transitive)
- Removed@types/tapable@2.2.2(transitive)
- Removed@types/webpack@5.28.0(transitive)
- Removedacorn-walk@8.3.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedcuint@0.2.2(transitive)
- Removeddeep-eql@4.1.0(transitive)
- Removedieee754@1.2.1(transitive)
- Removedlz4@0.6.5(transitive)
- Removednan@2.22.2(transitive)
- Removedxxhashjs@0.2.2(transitive)
Updated@babel/code-frame@7.24.7
Updated@rsdoctor/types@0.3.10
Updated@types/estree@1.0.5
Updatedacorn-walk@8.3.3
Updateddeep-eql@4.1.4
Updatedfilesize@^10.1.4
Updatedrslog@^1.2.2