Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@berish/serber

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

@berish/serber - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

65

build/plugins/array.js
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -14,36 +23,44 @@ const const_1 = require("../const");

params[const_1.SERBER_KEY_SYMBOL] = params[const_1.SERBER_KEY_SYMBOL] || '';
return obj.map((m, i) => {
params[const_1.SERBER_PARENT_OBJECT_SYMBOL] = obj;
params[const_1.SERBER_KEY_SYMBOL] = i;
return params[const_1.SERBER_INSTANCE_SYMBOL].serialize(m, Object.assign(Object.assign({}, params), { [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(i) }));
});
const serialized = [];
const indexes = obj.keys();
for (const index of indexes) {
const newParams = Object.assign(Object.assign({}, params), { [const_1.SERBER_PARENT_OBJECT_SYMBOL]: obj, [const_1.SERBER_KEY_SYMBOL]: index, [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(index) });
serialized[index] = params[const_1.SERBER_INSTANCE_SYMBOL].serialize(obj[index], newParams);
}
return serialized;
},
serializeAsync: (obj, params) => {
serializeAsync: (obj, params) => __awaiter(void 0, void 0, void 0, function* () {
params[const_1.SERBER_PATH_SYMBOL] = params[const_1.SERBER_PATH_SYMBOL] || [];
params[const_1.SERBER_KEY_SYMBOL] = params[const_1.SERBER_KEY_SYMBOL] || '';
return Promise.all(obj.map((m, i) => {
params[const_1.SERBER_PARENT_OBJECT_SYMBOL] = obj;
params[const_1.SERBER_KEY_SYMBOL] = i;
return params[const_1.SERBER_INSTANCE_SYMBOL].serializeAsync(m, Object.assign(Object.assign({}, params), { [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(i) }));
}));
},
const serialized = [];
const indexes = obj.keys();
for (const index of indexes) {
const newParams = Object.assign(Object.assign({}, params), { [const_1.SERBER_PARENT_OBJECT_SYMBOL]: obj, [const_1.SERBER_KEY_SYMBOL]: index, [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(index) });
serialized[index] = yield params[const_1.SERBER_INSTANCE_SYMBOL].serializeAsync(obj[index], newParams);
}
return serialized;
}),
deserialize: (obj, params) => {
params[const_1.SERBER_PATH_SYMBOL] = params[const_1.SERBER_PATH_SYMBOL] || [];
params[const_1.SERBER_KEY_SYMBOL] = params[const_1.SERBER_KEY_SYMBOL] || '';
return obj.map((m, i) => {
params[const_1.SERBER_PARENT_OBJECT_SYMBOL] = obj;
params[const_1.SERBER_KEY_SYMBOL] = i;
return params[const_1.SERBER_INSTANCE_SYMBOL].deserialize(m, Object.assign(Object.assign({}, params), { [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(i) }));
});
const deserialized = [];
const indexes = obj.keys();
for (const index of indexes) {
const newParams = Object.assign(Object.assign({}, params), { [const_1.SERBER_PARENT_OBJECT_SYMBOL]: obj, [const_1.SERBER_KEY_SYMBOL]: index, [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(index) });
deserialized[index] = params[const_1.SERBER_INSTANCE_SYMBOL].deserialize(obj[index], newParams);
}
return deserialized;
},
deserializeAsync: (obj, params) => {
deserializeAsync: (obj, params) => __awaiter(void 0, void 0, void 0, function* () {
params[const_1.SERBER_PATH_SYMBOL] = params[const_1.SERBER_PATH_SYMBOL] || [];
params[const_1.SERBER_KEY_SYMBOL] = params[const_1.SERBER_KEY_SYMBOL] || '';
return Promise.all(obj.map((m, i) => {
params[const_1.SERBER_PARENT_OBJECT_SYMBOL] = obj;
params[const_1.SERBER_KEY_SYMBOL] = i;
return params[const_1.SERBER_INSTANCE_SYMBOL].deserializeAsync(m, Object.assign(Object.assign({}, params), { [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(i) }));
}));
},
const deserialized = [];
const indexes = obj.keys();
for (const index of indexes) {
const newParams = Object.assign(Object.assign({}, params), { [const_1.SERBER_PARENT_OBJECT_SYMBOL]: obj, [const_1.SERBER_KEY_SYMBOL]: index, [const_1.SERBER_PATH_SYMBOL]: params[const_1.SERBER_PATH_SYMBOL].concat(index) });
deserialized[index] = yield params[const_1.SERBER_INSTANCE_SYMBOL].deserializeAsync(obj[index], newParams);
}
return deserialized;
}),
};
//# sourceMappingURL=array.js.map
{
"name": "@berish/serber",
"version": "1.1.6",
"version": "1.1.7",
"description": "Serializable and deserializable adaptive adapter with plugins",

@@ -5,0 +5,0 @@ "main": "build/index.js",

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