Socket
Socket
Sign inDemoInstall

ozone-type

Package Overview
Dependencies
Maintainers
5
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ozone-type - npm Package Compare versions

Comparing version 4.1.3-alpha.5 to 4.1.3-alpha.6

4

dist/Item.d.ts

@@ -49,7 +49,6 @@ export declare type UUID = string;

};
export declare type Patch<T> = {
export declare type Patch<T extends Item> = {
[P in keyof T]?: T[P] | null;
};
export declare class Item {
constructor(src?: Item);
id?: UUID;

@@ -65,2 +64,3 @@ version?: UUID;

modificationUser?: UUID;
constructor(src?: Item);
}

@@ -67,0 +67,0 @@ export declare class GenericItem extends Item {

@@ -55,2 +55,25 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

export { Item };
function toPatch(item) {
let patch = {};
for (let prop of Object.getOwnPropertyNames(item)) {
const val = item[prop];
if (val !== undefined) {
patch[prop] = val;
}
}
return patch;
}
function toPatchWithUndefinedAsNull(item) {
let patch = {};
for (let prop of Object.getOwnPropertyNames(item)) {
const val = item[prop];
if (val === undefined) {
patch[prop] = null;
}
else {
patch[prop] = val;
}
}
return patch;
}
export class GenericItem extends Item {

@@ -57,0 +80,0 @@ }

@@ -42,3 +42,5 @@ export type UUID = string

export type Patch<T> = {
type nullablePatchProps<T extends Item> = keyof T
export type Patch<T extends Item> = {
[P in keyof T]?: T[P] | null;

@@ -49,2 +51,13 @@ }

export class Item {
id?: UUID
version?: UUID
type?:string
_meta?: ItemMeta
name?: string
deleted?: boolean
traits?: string[]
tenant?: UUID
creationUser?: UUID
modificationUser?: UUID
constructor (src?: Item) {

@@ -64,15 +77,28 @@ if (src) {

}
}
id?: UUID
version?: UUID
type?:string
_meta?: ItemMeta
name?: string
deleted?: boolean
traits?: string[]
tenant?: UUID
creationUser?: UUID
modificationUser?: UUID
function toPatch<T extends Item>(item:T): Patch<T> {
let patch : any = {}
for (let prop of Object.getOwnPropertyNames(item)) {
const val:any|undefined|null = (item as any)[prop]
if (val !== undefined) {
patch[prop] = val
}
}
return patch as Patch<T>
}
function toPatchWithUndefinedAsNull<T extends Item>(item:T): Patch<T> {
let patch : any = {}
for (let prop of Object.getOwnPropertyNames(item)) {
const val:any|undefined|null = (item as any)[prop]
if (val === undefined) {
patch[prop] = null
} else {
patch[prop] = val
}
}
return patch as Patch<T>
}
export class GenericItem extends Item {

@@ -79,0 +105,0 @@ [key: string]: any;

{
"name": "ozone-type",
"version": "4.1.3-alpha.5",
"version": "4.1.3-alpha.6",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

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