@berish/serber
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -22,4 +22,4 @@ "use strict"; | ||
try { | ||
const isInitial = plugin.isInitial(obj, params); | ||
if (isInitial) { | ||
const isInitial = plugin.isInitial && plugin.isInitial(obj, params); | ||
if (isInitial && plugin.serialize) { | ||
if (plugin.beforeSerialize) | ||
@@ -51,4 +51,4 @@ plugin.beforeSerialize(obj, params); | ||
? yield plugin.isInitialAsync(obj, params) | ||
: plugin.isInitial(obj, params); | ||
if (isInitial) { | ||
: plugin.isInitial && plugin.isInitial(obj, params); | ||
if (isInitial && (plugin.serializeAsync || plugin.serialize)) { | ||
if (plugin.beforeSerializeAsync) | ||
@@ -84,4 +84,4 @@ yield plugin.beforeSerializeAsync(obj, params); | ||
try { | ||
const isOutput = plugin.isOutput(obj, params); | ||
if (isOutput) { | ||
const isOutput = plugin.isOutput && plugin.isOutput(obj, params); | ||
if (isOutput && plugin.deserialize) { | ||
if (plugin.beforeDeserialize) | ||
@@ -111,4 +111,6 @@ plugin.beforeDeserialize(obj, params); | ||
try { | ||
const isOutput = plugin.isOutputAsync ? yield plugin.isOutputAsync(obj, params) : plugin.isOutput(obj, params); | ||
if (isOutput) { | ||
const isOutput = plugin.isOutputAsync | ||
? yield plugin.isOutputAsync(obj, params) | ||
: plugin.isOutput && plugin.isOutput(obj, params); | ||
if (isOutput && (plugin.deserializeAsync || plugin.deserialize)) { | ||
if (plugin.beforeDeserializeAsync) | ||
@@ -115,0 +117,0 @@ yield plugin.beforeDeserializeAsync(obj, params); |
@@ -13,6 +13,6 @@ import { SERBER_INSTANCE_SYMBOL, SERBER_KEY_SYMBOL, SERBER_PARENT_OBJECT_SYMBOL, SERBER_PATH_SYMBOL, SERBER_ROOT_OBJECT_SYMBOL } from './const'; | ||
} = {}> { | ||
isInitial(obj: Input, options?: Params & ISerberPluginDefaultParams): boolean; | ||
isOutput(obj: Output, options?: Params & ISerberPluginDefaultParams): boolean; | ||
serialize(obj: Input, options?: Params & ISerberPluginDefaultParams): Output; | ||
deserialize(obj: Output, options?: Params & ISerberPluginDefaultParams): Input; | ||
isInitial?(obj: Input, options?: Params & ISerberPluginDefaultParams): boolean; | ||
isOutput?(obj: Output, options?: Params & ISerberPluginDefaultParams): boolean; | ||
serialize?(obj: Input, options?: Params & ISerberPluginDefaultParams): Output; | ||
deserialize?(obj: Output, options?: Params & ISerberPluginDefaultParams): Input; | ||
isInitialAsync?(obj: Input, options?: Params & ISerberPluginDefaultParams): boolean | Promise<boolean>; | ||
@@ -19,0 +19,0 @@ isOutputAsync?(obj: Output, options?: Params & ISerberPluginDefaultParams): boolean | Promise<boolean>; |
{ | ||
"name": "@berish/serber", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"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
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
57013
681