Socket
Socket
Sign inDemoInstall

@worldsibu/convector-core-model

Package Overview
Dependencies
Maintainers
1
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@worldsibu/convector-core-model - npm Package Compare versions

Comparing version 1.2.1-0-alpha.38c096fa to 1.2.1-0-alpha.57ce2bb4

15

dist/src/convector-model.d.ts
import * as yup from 'yup';
export declare type RequiredKeys<T> = {
[K in keyof T]-?: string extends K ? never : number extends K ? never : {} extends Pick<T, K> ? never : K;
} extends {
[_ in keyof T]-?: infer U;
} ? U extends keyof T ? U : never : never;
export declare type OptionalKeys<T> = {
[K in keyof T]-?: string extends K ? never : number extends K ? never : {} extends Pick<T, K> ? K : never;
} extends {
[_ in keyof T]-?: infer U;
} ? U extends keyof T ? U : never : never;
export declare type FlatConvectorModel<T> = {
[L in Exclude<keyof T, keyof ConvectorModel<any>>]: T[L];
[L in Exclude<OptionalKeys<T>, keyof ConvectorModel<any>>]?: T[L];
} & {
[L in Exclude<RequiredKeys<T>, keyof ConvectorModel<any>>]: T[L];
};

@@ -11,2 +23,3 @@ export interface History<T> {

export declare abstract class ConvectorModel<T extends ConvectorModel<any>> {
private static type;
static schema<T extends ConvectorModel<any>>(this: Function & {

@@ -13,0 +26,0 @@ prototype: T;

16

dist/src/convector-model.js

@@ -27,3 +27,3 @@ "use strict";

return tslib_1.__awaiter(this, void 0, void 0, function () {
var content;
var content, model;
return tslib_1.__generator(this, function (_a) {

@@ -36,3 +36,7 @@ switch (_a.label) {

content = _a.sent();
return [2, new type(content)];
model = new type(content);
if (content.type !== model.type) {
throw new Error("Possible ID collision, element " + id + " of type " + content.type + " is not " + model.type);
}
return [2, model];
}

@@ -53,3 +57,3 @@ });

type = this;
if (args[0] && args[0].prototype.__proto__.constructor === ConvectorModel) {
if (args[0] && 'type' in args[0] && args[0].type === ConvectorModel.type) {
type = args.shift();

@@ -165,3 +169,3 @@ }

.filter(function (k) { return !k.startsWith('_'); })
.filter(function (k) { return !skipEmpty || _this[k] !== undefined || _this[k] !== null; })
.filter(function (k) { return !skipEmpty || !(_this[k] === undefined || _this[k] === null); })
.reduce(function (result, key) {

@@ -181,2 +185,5 @@ return (tslib_1.__assign({}, result, (_a = {}, _a[key] = _this[key], _a)));

}
if (result[key] instanceof ConvectorModel) {
result[key] = result[key].toJSON(true);
}
return result;

@@ -210,2 +217,3 @@ }, base);

};
ConvectorModel.type = 'io.convector.model';
tslib_1.__decorate([

@@ -212,0 +220,0 @@ required_decorator_1.Required(),

{
"name": "@worldsibu/convector-core-model",
"version": "1.2.1-0-alpha.38c096fa",
"version": "1.2.1-0-alpha.57ce2bb4",
"description": "Convector Model base class",

@@ -35,4 +35,4 @@ "license": "Apache-2.0",

"dependencies": {
"@worldsibu/convector-core-errors": "1.2.1-0-alpha.38c096fa",
"@worldsibu/convector-core-storage": "1.2.1-0-alpha.38c096fa",
"@worldsibu/convector-core-errors": "1.2.1-0-alpha.57ce2bb4",
"@worldsibu/convector-core-storage": "1.2.1-0-alpha.57ce2bb4",
"tslib": "^1.9.0",

@@ -39,0 +39,0 @@ "yup": "^0.26.10"

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