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

tserialize

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tserialize - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 1.5.0
- Полный отказ от reflect-metadata, библиотека не имеет зависимостей
- Закреплена сигнатура JsonStruct и JsonMeta
# 1.4.0

@@ -2,0 +6,0 @@ - Полный рефакторинг внутреннего хранилища данных, тесты проходит, но надо тестировать использование библиотеки в стороннем пакете

5

package.json
{
"name": "tserialize",
"version": "1.4.1",
"version": "1.5.0",
"description": "TypeScript serialize utils",

@@ -44,5 +44,2 @@ "types": "index.d.ts",

},
"dependencies": {
"reflect-metadata": "0.1.10"
},
"jest": {

@@ -49,0 +46,0 @@ "verbose": true,

@@ -9,3 +9,3 @@ import { PropertyMetadata, TDeserializeFunc, TSerializeFunc } from './types';

static make(propertyKey: string, name: string): PropertyMetaBuilder {
static make(propertyKey: string, name?: string): PropertyMetaBuilder {
const retVal = new PropertyMetaBuilder();

@@ -12,0 +12,0 @@ retVal.data.propertyKey = propertyKey;

@@ -9,15 +9,6 @@ import {ParentKey, PropertyMetaBuilder, RootMetaStore} from '../core';

*/
export function JsonMeta(TargetClass?: any): (target: object, propertyKey: string) => void {
export function JsonMeta(TargetClass: any): (target: object, propertyKey: string) => void {
return (target: object, propertyKey: string): void => {
const isDeprecatedUsage = !TargetClass || typeof TargetClass === 'string';
const proto = TargetClass;
if (isDeprecatedUsage) {
const targetClassName = (Reflect as any).getMetadata('design:type', target, propertyKey).name;
console.error(
`JsonMeta signature has changed, use(copy it) "JsonMeta(${targetClassName})"`
);
}
const proto = isDeprecatedUsage ? (Reflect as any).getMetadata('design:type', target, propertyKey) : TargetClass;
const deserializeFunc = proto.fromServer ? proto.fromServer : (value): any => deserialize(value, proto);

@@ -24,0 +15,0 @@

@@ -13,21 +13,11 @@ import { PropertyMetaBuilder, RootMetaStore } from './../core';

*/
export function JsonStruct(TargetClass?: any, rawName?: string): (target: object, propertyKey: string) => void {
export function JsonStruct(TargetClass: any, rawName?: string): (target: object, propertyKey: string) => void {
return (target: object, propertyKey: string): void => {
const isDeprecatedUsage = !TargetClass || typeof TargetClass === 'string';
const proto = TargetClass;
if (isDeprecatedUsage) {
const targetClassName = (Reflect as any).getMetadata('design:type', target, propertyKey).name;
console.error(
`JsonStruct signature has changed, use(copy it) "JsonStruct(${targetClassName}${TargetClass ? `, '${TargetClass}'` : ''})"`
);
}
const proto = isDeprecatedUsage ? (Reflect as any).getMetadata('design:type', target, propertyKey) : TargetClass;
const name = isDeprecatedUsage ? TargetClass : rawName;
const deserializeFunc = proto.fromServer ? proto.fromServer : (value): any => deserialize(value, proto);
const propertyMetadata = PropertyMetaBuilder.make(propertyKey, name).deserializer(deserializeFunc).struct().raw;
const propertyMetadata = PropertyMetaBuilder.make(propertyKey, rawName).deserializer(deserializeFunc).struct().raw;
RootMetaStore.setupPropertyMetadata(target, propertyMetadata);
};
}

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