@cpany/compress
Advanced tools
Comparing version 0.0.38 to 0.0.39
@@ -5,4 +5,4 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/load.ts | ||
const compressed = _compressed; | ||
const keyMap = new Map(((_a = compressed.keyMaps) != null ? _a : []).map((pair) => pair.reverse())); | ||
const stringMap = new Map(((_b = compressed.stringMaps) != null ? _b : []).map((pair) => pair.reverse())); | ||
const keyMap = new Map(((_a = compressed.keyMaps) != null ? _a : []).map(([key, value]) => [value, key])); | ||
const stringMap = new Map(((_b = compressed.stringMaps) != null ? _b : []).map(([key, value]) => [value, key])); | ||
return walkTransKey(compressed.data, keyMap, stringMap); | ||
@@ -31,4 +31,4 @@ } | ||
const newArr = []; | ||
for (const key in obj) { | ||
newArr.push(walkTransKey(obj[key], keyMap, stringMap)); | ||
for (const item of obj) { | ||
newArr.push(walkTransKey(item, keyMap, stringMap)); | ||
} | ||
@@ -35,0 +35,0 @@ return newArr; |
{ | ||
"name": "@cpany/compress", | ||
"version": "0.0.38", | ||
"version": "0.0.39", | ||
"description": "CPany compress package", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -7,8 +7,6 @@ import type { ICompressed } from './type'; | ||
const keyMap = new Map<string, string>( | ||
(compressed.keyMaps ?? []).map((pair) => pair.reverse() as [string, string]) | ||
(compressed.keyMaps ?? []).map(([key, value]) => [value, key]) | ||
); | ||
const stringMap = new Map<string, string>( | ||
(compressed.stringMaps ?? []).map( | ||
(pair) => pair.reverse() as [string, string] | ||
) | ||
(compressed.stringMaps ?? []).map(([key, value]) => [value, key]) | ||
); | ||
@@ -35,4 +33,4 @@ | ||
const newArr: any[] = []; | ||
for (const key in obj) { | ||
newArr.push(walkTransKey(obj[key], keyMap, stringMap)); | ||
for (const item of obj) { | ||
newArr.push(walkTransKey(item, keyMap, stringMap)); | ||
} | ||
@@ -39,0 +37,0 @@ return newArr; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17963
564