New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jsonschema-key-compression

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonschema-key-compression - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

21

dist/es/compress.js

@@ -1,17 +0,1 @@

var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
/**

@@ -116,4 +100,5 @@ * compress the keys of an object via the compression-table

var compressedSort_1 = {};
Object.entries(query.sort).forEach(function (_a) {
var _b = __read(_a, 2), key = _b[0], direction = _b[1];
// do not use Object.entries, it is transpiled shitty
Object.keys(query.sort).forEach(function (key) {
var direction = query.sort[key];
var compressedField = compressedPath(table, key);

@@ -120,0 +105,0 @@ compressedSort_1[compressedField] = direction;

@@ -1,17 +0,1 @@

var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { flatClone } from './util';

@@ -36,4 +20,5 @@ import { compressedPath } from './compress';

var newProperties_1 = {};
Object.entries(schema.properties).forEach(function (_a) {
var _b = __read(_a, 2), key = _b[0], property = _b[1];
// do not use Object.entries, it is transpiled shitty
Object.keys(schema.properties).forEach(function (key) {
var property = schema.properties[key];
var compressedKey = compressedPath(compressionTable, key);

@@ -40,0 +25,0 @@ newProperties_1[compressedKey] = createCompressedJsonSchema(compressionTable, property);

@@ -1,17 +0,1 @@

var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
import { numberToLetter, alphabeticCompare } from './util';

@@ -47,4 +31,5 @@ /**

if (schema.properties) {
Object.entries(schema.properties).forEach(function (_a) {
var _b = __read(_a, 2), property = _b[0], deepSchema = _b[1];
// do not use Object.entries, it is transpiled shitty
Object.keys(schema.properties).forEach(function (property) {
var deepSchema = schema.properties[property];
ret.add(property);

@@ -51,0 +36,0 @@ if (!schema.properties) {

"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -123,4 +107,5 @@ exports.compressQuerySelector = exports.compressQuery = exports.compressedAndFlaggedKey = exports.throwErrorIfCompressionFlagUsed = exports.compressedPath = exports.compressObject = void 0;

var compressedSort_1 = {};
Object.entries(query.sort).forEach(function (_a) {
var _b = __read(_a, 2), key = _b[0], direction = _b[1];
// do not use Object.entries, it is transpiled shitty
Object.keys(query.sort).forEach(function (key) {
var direction = query.sort[key];
var compressedField = compressedPath(table, key);

@@ -127,0 +112,0 @@ compressedSort_1[compressedField] = direction;

"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -39,4 +23,5 @@ exports.createCompressedJsonSchema = void 0;

var newProperties_1 = {};
Object.entries(schema.properties).forEach(function (_a) {
var _b = __read(_a, 2), key = _b[0], property = _b[1];
// do not use Object.entries, it is transpiled shitty
Object.keys(schema.properties).forEach(function (key) {
var property = schema.properties[key];
var compressedKey = (0, compress_1.compressedPath)(compressionTable, key);

@@ -43,0 +28,0 @@ newProperties_1[compressedKey] = createCompressedJsonSchema(compressionTable, property);

"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -51,4 +35,5 @@ exports.uncompressedToCompressedTable = exports.compressedToUncompressedTable = exports.getPropertiesOfSchema = exports.createCompressionTable = exports.DEFAULT_COMPRESSION_FLAG = void 0;

if (schema.properties) {
Object.entries(schema.properties).forEach(function (_a) {
var _b = __read(_a, 2), property = _b[0], deepSchema = _b[1];
// do not use Object.entries, it is transpiled shitty
Object.keys(schema.properties).forEach(function (property) {
var deepSchema = schema.properties[property];
ret.add(property);

@@ -55,0 +40,0 @@ if (!schema.properties) {

14

package.json
{
"name": "jsonschema-key-compression",
"version": "1.6.0",
"version": "1.6.1",
"description": "Compress json-data based on its json-schema",

@@ -39,17 +39,17 @@ "author": "pubkey",

"devDependencies": {
"@types/faker": "5.5.8",
"@types/faker": "5.5.9",
"@types/mocha": "9.0.0",
"@types/node": "14.17.17",
"@types/node": "16.11.6",
"@types/node-gzip": "1.1.0",
"assert": "2.0.0",
"async-test-util": "1.7.3",
"async-test-util": "2.0.0",
"copyfiles": "2.4.1",
"faker": "5.5.3",
"mocha": "9.1.1",
"mocha": "9.1.3",
"node-gzip": "1.1.2",
"rimraf": "3.0.2",
"ts-node": "10.2.1",
"ts-node": "10.4.0",
"tslint": "6.1.3",
"typescript": "4.4.3"
"typescript": "4.4.4"
}
}

@@ -149,3 +149,5 @@ import type {

const compressedSort: any = {};
Object.entries(query.sort).forEach(([key, direction]) => {
// do not use Object.entries, it is transpiled shitty
Object.keys(query.sort).forEach(key => {
const direction = (query as any).sort[key];
const compressedField = compressedPath(

@@ -152,0 +154,0 @@ table,

@@ -35,3 +35,5 @@ import type {

} = {};
Object.entries(schema.properties).forEach(([key, property]) => {
// do not use Object.entries, it is transpiled shitty
Object.keys(schema.properties).forEach(key => {
const property = (schema as any).properties[key];
const compressedKey = compressedPath(compressionTable, key);

@@ -38,0 +40,0 @@ newProperties[compressedKey] = createCompressedJsonSchema(compressionTable, property);

@@ -54,3 +54,5 @@ import type {

if (schema.properties) {
Object.entries(schema.properties).forEach(([property, deepSchema]) => {
// do not use Object.entries, it is transpiled shitty
Object.keys(schema.properties).forEach(property => {
const deepSchema = (schema as any).properties[property];
ret.add(property);

@@ -57,0 +59,0 @@ if (!schema.properties) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc