@haventech/supertype
Advanced tools
Comparing version 6.0.0-beta.3 to 6.0.0-beta.4
export { Supertype } from './Supertype'; | ||
import 'reflect-metadata'; | ||
/** | ||
@@ -3,0 +4,0 @@ * |
@@ -7,2 +7,3 @@ "use strict"; | ||
const ObjectTemplate_1 = require("./ObjectTemplate"); | ||
require("reflect-metadata"); | ||
/** | ||
@@ -132,4 +133,14 @@ * | ||
target.__amorphicprops__ = target.hasOwnProperty('__amorphicprops__') ? target.__amorphicprops__ : {}; | ||
let type = props.type; | ||
if (typeof props.getType === 'function') { | ||
var reflectionType = Reflect.getMetadata('design:type', target, targetKey); | ||
var declaredType = props.type; | ||
var type = reflectionType !== Array ? declaredType || reflectionType : declaredType; | ||
// Type mismatches | ||
if (declaredType && reflectionType && reflectionType !== Array) { | ||
target.__exceptions__ = target.__exceptions__ || {}; | ||
target.__exceptions__[targetKey] = function (className, prop) { | ||
return className + '.' + prop + ' - decorator type does not match actual type'; | ||
}; | ||
// Deferred type | ||
} | ||
else if (typeof props.getType === 'function') { | ||
target.__deferredType__ = target.hasOwnProperty('__deferredType__') ? target.__deferredType__ : {}; | ||
@@ -147,2 +158,9 @@ target.__deferredType__[targetKey] = props.getType; | ||
} | ||
if (reflectionType === Array) { | ||
props.type = Array; | ||
props.of = type; | ||
} | ||
else { | ||
props.type = type; | ||
} | ||
target.__amorphicprops__[targetKey] = props; | ||
@@ -158,2 +176,2 @@ }; | ||
exports.remote = remote; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHlDQUF3QztBQUEvQixzR0FBQSxTQUFTLE9BQUE7QUFDbEIscURBQWtEO0FBRWxEOzs7Ozs7OztNQVFNO0FBQ04sU0FBZ0IsY0FBYyxDQUFDL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gICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRhcmdldC5wcm90b3R5cGUsIHByb3BlcnR5TmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IGVudW1lcmFibGU6IHRydWUsIHdyaXRhYmxlOiB0cnVlLCB2YWx1ZTogZGVmaW5lUHJvcGVydHkudmFsdWUgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGFyZ2V0LnByb3RvdHlwZSwgcHJvcGVydHlOYW1lLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3RUZW1wbGF0ZS5jbG9uZShkZWZpbmVQcm9wZXJ0eS52YWx1ZSwgZGVmaW5lUHJvcGVydHkub2YgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkudHlwZSB8fCBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpc1snX18nICsgcHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbJ19fJyArIHByb3BlcnR5TmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgaWYgKHRhcmdldC5wcm90b3R5cGUuX19leGNlcHRpb25zX18pIHtcbiAgICAgICAgICAgIG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fID0gb2JqZWN0VGVtcGxhdGUuX19leGNlcHRpb25zX18gfHwgW107XG4gICAgICAgICAgICBmb3IgKHZhciBleGNlcHRpb25LZXkgaW4gdGFyZ2V0LnByb3RvdHlwZS5fX2V4Y2VwdGlvbnNfXykge1xuICAgICAgICAgICAgICAgIG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBmdW5jOiB0YXJnZXQucHJvdG90eXBlLl9fZXhjZXB0aW9uc19fW2V4Y2VwdGlvbktleV0sXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzOiBnZXROYW1lLFxuICAgICAgICAgICAgICAgICAgICBwcm9wOiBleGNlcHRpb25LZXlcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGFyZ2V0LnByb3RvdHlwZS5fX2Ftb3JwaGljcHJvcHNfXztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXROYW1lKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFRlbXBsYXRlLmdldE5hbWUodGFyZ2V0KTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXREaWN0aW9uYXJ5KCkge1xuICAgIC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gICAgICAgIGRlbGV0ZSBwcm9wcy5nZXRUeXBlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKCF0eXBlKSB7XG4gICAgICAgICAgICB0YXJnZXQuX19leGNlcHRpb25zX18gPSB0YXJnZXQuX19leGNlcHRpb25zX18gfHwge307XG4gICAgICAgICAgICB0YXJnZXQuX19leGNlcHRpb25zX19bdGFyZ2V0S2V5XSA9IGZ1bmN0aW9uIChjbGFzc05hbWUsIHByb3ApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xhc3NOYW1lICsgJy4nICsgcHJvcCArXG4gICAgICAgICAgICAgICAgJyAtIHR5cGUgaXMgdW5kZWZpbmVkLiBDaXJjdWxhciByZWZlcmVuY2U/IFRyeSBAcHJvcGVydHkoe2dldFR5cGU6ICgpID0+IHtyZXR1cm4gJyArXG4gICAgICAgICAgICAgICAgcHJvcFswXS50b1VwcGVyQ2FzZSgpICsgcHJvcC5zdWJzdHIoMSkgKyAnfX0pJztcblxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB0YXJnZXQuX19hbW9ycGhpY3Byb3BzX19bdGFyZ2V0S2V5XSA9IHByb3BzO1xuICAgIH07XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gcmVtb3RlKGRlZmluZVByb3BlcnR5KSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uICh0YXJnZXQsIHByb3BlcnR5TmFtZSwgZGVzY3JpcHRvcikge1xuICAgIH1cbn0iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHlDQUF3QztBQUEvQixzR0FBQSxTQUFTLE9BQUE7QUFDbEIscURBQWtEO0FBRWxELDRCQUEwQjtBQUUxQjs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HkudmFsdWUgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGFyZ2V0LnByb3RvdHlwZSwgcHJvcGVydHlOYW1lLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3RUZW1wbGF0ZS5jbG9uZShkZWZpbmVQcm9wZXJ0eS52YWx1ZSwgZGVmaW5lUHJvcGVydHkub2YgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkudHlwZSB8fCBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpc1snX18nICsgcHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbJ19fJyArIHByb3BlcnR5TmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgaWYgKHRhcmdldC5wcm90b3R5cGUuX19leGNlcHRpb25zX18pIHtcbiAgICAgICAgICAgIG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fID0gb2JqZWN0VGVtcGxhdGUuX19leGNlcHRpb25zX18gfHwgW107XG4gICAgICAgICAgICBmb3IgKHZhciBleGNlcHRpb25LZXkgaW4gdGFyZ2V0LnByb3RvdHlwZS5fX2V4Y2VwdGlvbnNfXykge1xuICAgICAgICAgICAgICAgIG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBmdW5jOiB0YXJnZXQucHJvdG90eXBlLl9fZXhjZXB0aW9uc19fW2V4Y2VwdGlvbktleV0sXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzOiBnZXROYW1lLFxuICAgICAgICAgICAgICAgICAgICBwcm9wOiBleGNlcHRpb25LZXlcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGFyZ2V0LnByb3RvdHlwZS5fX2Ftb3JwaGljcHJvcHNfXztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXROYW1lKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFRlbXBsYXRlLmdldE5hbWUodGFyZ2V0KTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXREaWN0aW9uYXJ5KCkge1xuICAgICAgICAgICAgb2JqZWN0VGVtcGxhdGUuZ2V0Q2xhc3NlcygpO1xuICAgICAgICB9XG4gICAgICAgIGZ1bmN0aW9uIGdldFBhcmVudCgpIHtcbiAgICAgICAgICAgIGdldERpY3Rpb25hcnkoKTtcbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQuX19zaGFkb3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udG9VcHBlckNhc2UoKSArIHByb3Auc3Vic3RyKDEpICsgJ319KSc7XG5cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHJlZmxlY3Rpb25UeXBlID09PSBBcnJheSkge1xuICAgICAgICAgICAgcHJvcHMudHlwZSA9IEFycmF5O1xuICAgICAgICAgICAgcHJvcHMub2YgPSB0eXBlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcHJvcHMudHlwZSA9IHR5cGU7XG4gICAgICAgIH1cbiAgICAgICAgdGFyZ2V0Ll9fYW1vcnBoaWNwcm9wc19fW3RhcmdldEtleV0gPSBwcm9wcztcbiAgICB9O1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIHJlbW90ZShkZWZpbmVQcm9wZXJ0eSkge1xuICAgIHJldHVybiBmdW5jdGlvbiAodGFyZ2V0LCBwcm9wZXJ0eU5hbWUsIGRlc2NyaXB0b3IpIHtcbiAgICB9XG59Il19 |
{ | ||
"name": "@haventech/supertype", | ||
"description": "A type system for classical inheritence, mix-ins and composition.", | ||
"version": "6.0.0-beta.3", | ||
"version": "6.0.0-beta.4", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "types": "dist/index.d.ts", |
export { Supertype } from './Supertype'; | ||
import { ObjectTemplate } from './ObjectTemplate'; | ||
import 'reflect-metadata'; | ||
/** | ||
@@ -145,4 +147,14 @@ * | ||
target.__amorphicprops__ = target.hasOwnProperty('__amorphicprops__') ? target.__amorphicprops__ : {}; | ||
let type = props.type; | ||
if (typeof props.getType === 'function') { | ||
var reflectionType = Reflect.getMetadata('design:type', target, targetKey); | ||
var declaredType = props.type; | ||
var type = reflectionType !== Array ? declaredType || reflectionType : declaredType; | ||
// Type mismatches | ||
if (declaredType && reflectionType && reflectionType !== Array) { | ||
target.__exceptions__ = target.__exceptions__ || {}; | ||
target.__exceptions__[targetKey] = function (className, prop) { | ||
return className + '.' + prop + ' - decorator type does not match actual type'; | ||
}; | ||
// Deferred type | ||
} | ||
else if (typeof props.getType === 'function') { | ||
target.__deferredType__ = target.hasOwnProperty('__deferredType__') ? target.__deferredType__ : {}; | ||
@@ -161,2 +173,9 @@ target.__deferredType__[targetKey] = props.getType; | ||
} | ||
if (reflectionType === Array) { | ||
props.type = Array; | ||
props.of = type; | ||
} | ||
else { | ||
props.type = type; | ||
} | ||
target.__amorphicprops__[targetKey] = props; | ||
@@ -163,0 +182,0 @@ }; |
@@ -418,3 +418,3 @@ import * as serializer from './serializer'; | ||
*/ | ||
static createIfNeeded(template?, thisObj?) { | ||
static createIfNeeded(template?, thisObj?) { | ||
if (template.__createParameters__) { | ||
@@ -548,3 +548,3 @@ const createParameters = template.__createParameters__; | ||
*/ | ||
static _setupProperty(propertyName, defineProperty, objectProperties, defineProperties) { | ||
static _setupProperty(propertyName, defineProperty, objectProperties, defineProperties) { | ||
// Determine whether value needs to be re-initialized in constructor | ||
@@ -793,3 +793,3 @@ const value = defineProperty.value; | ||
*/ | ||
static _getBaseClass(template) { | ||
static _getBaseClass(template) { | ||
while (template.__parent__) { | ||
@@ -796,0 +796,0 @@ template = template.__parent__; |
Sorry, the diff of this file is too big to display
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
368128
4525