Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

yasoo

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yasoo - npm Package Compare versions

Comparing version
0.12.3
to
0.12.4
+1
-1
PKG-INFO
Metadata-Version: 2.1
Name: yasoo
Version: 0.12.3
Version: 0.12.4
Summary: Yet another serializer of objects

@@ -5,0 +5,0 @@ Home-page: https://github.com/drorvinkler/yasoo

@@ -9,3 +9,3 @@ import setuptools

name="yasoo",
version="0.12.3",
version="0.12.4",
author="Dror A. Vinkler",

@@ -12,0 +12,0 @@ description="Yet another serializer of objects",

Metadata-Version: 2.1
Name: yasoo
Version: 0.12.3
Version: 0.12.4
Summary: Yet another serializer of objects

@@ -5,0 +5,0 @@ Home-page: https://github.com/drorvinkler/yasoo

@@ -24,2 +24,3 @@ import json

from yasoo.utils import fully_qualified_string_to_type, NoneType
from .constants import ENUM_VALUE_KEY, ITERABLE_VALUE_KEY

@@ -238,3 +239,8 @@ from .objects import DictWithSerializedKeys

)
return obj_type(**data)
kwargs = {k: v for k, v in data.items() if fields[k].init}
result = obj_type(**kwargs)
for k, v in data.items():
if k not in kwargs:
setattr(result, k, v)
return result

@@ -241,0 +247,0 @@ def _load_dict_with_serialized_keys(

@@ -65,2 +65,3 @@ from functools import lru_cache

mandatory: bool = attr.attrib()
init: bool = attr.attrib()
validator: Optional[callable] = attr.attrib(default=None)

@@ -80,3 +81,10 @@ converter: Optional[callable] = attr.attrib(default=None)

return [
Field(f.name, f.type, f.default == attr.NOTHING, f.validator, f.converter)
Field(
f.name,
f.type,
f.default == attr.NOTHING,
f.init,
f.validator,
f.converter,
)
for f in attr.fields(obj_type)

@@ -87,3 +95,3 @@ ]

return [
Field(f.name, f.type, _dataclass_field_mandatory(f))
Field(f.name, f.type, _dataclass_field_mandatory(f), f.init)
for f in dataclasses.fields(obj_type)

@@ -90,0 +98,0 @@ ]