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

@haventech/supertype

Package Overview
Dependencies
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@haventech/supertype - npm Package Compare versions

Comparing version 5.1.0-beta.0 to 6.0.0-beta.0

1

dist/decorators.d.ts
export { Supertype } from './Supertype';
import 'reflect-metadata';
/**

@@ -4,0 +3,0 @@ *

@@ -6,4 +6,3 @@ "use strict";

Object.defineProperty(exports, "Supertype", { enumerable: true, get: function () { return Supertype_1.Supertype; } });
var ObjectTemplate_1 = require("./ObjectTemplate");
require("reflect-metadata");
const ObjectTemplate_1 = require("./ObjectTemplate");
/**

@@ -112,3 +111,3 @@ *

function getName() {
return target.toString().match(/function ([^(]*)/)[1];
return ObjectTemplate_1.ObjectTemplate.getName(target);
}

@@ -134,14 +133,4 @@ function getDictionary() {

target.__amorphicprops__ = target.hasOwnProperty('__amorphicprops__') ? target.__amorphicprops__ : {};
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') {
let type = props.type;
if (typeof props.getType === 'function') {
target.__deferredType__ = target.hasOwnProperty('__deferredType__') ? target.__deferredType__ : {};

@@ -159,9 +148,2 @@ target.__deferredType__[targetKey] = props.getType;

}
if (reflectionType === Array) {
props.type = Array;
props.of = type;
}
else {
props.type = type;
}
target.__amorphicprops__[targetKey] = props;

@@ -177,2 +159,2 @@ };

exports.remote = remote;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLC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xuICAgICAgICAgICAgfTtcblxuICAgICAgICB0YXJnZXQuZ2V0UHJvcGVydGllcyA9IC8vIExlZ2FjeVxuICAgICAgICAgICAgdGFyZ2V0LmFtb3JwaGljR2V0UHJvcGVydGllcyA9IGZ1bmN0aW9uIGdldFByb3BlcnRpZXMoaW5jbHVkZVZpcnR1YWwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gb2JqZWN0VGVtcGxhdGUuX2dldERlZmluZVByb3BlcnRpZXModGFyZ2V0LCB1bmRlZmluZWQsIGluY2x1ZGVWaXJ0dWFsKTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgdGFyZ2V0LmNyZWF0ZVByb3BlcnR5ID0gLy8gTGVnYWN5XG4gICAgICAgICAgICB0YXJnZXQuYW1vcnBoaWNDcmVhdGVQcm9wZXJ0eSA9IGZ1bmN0aW9uIChwcm9wZXJ0eU5hbWUsIGRlZmluZVByb3BlcnR5KSB7XG4gICAgICAgICAgICAgICAgaWYgKGRlZmluZVByb3BlcnR5LmJvZHkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LnByb3RvdHlwZVtwcm9wZXJ0eU5hbWVdID0gb2JqZWN0VGVtcGxhdGUuX3NldHVwRnVuY3Rpb24ocHJvcGVydHlOYW1lLCBkZWZpbmVQcm9wZXJ0eS5ib2R5LFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkub24sIGRlZmluZVByb3BlcnR5LnZhbGlkYXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRhcmdldC5wcm90b3R5cGUuX19hbW9ycGhpY3Byb3BzX19bcHJvcGVydHlOYW1lXSA9IGRlZmluZVByb3BlcnR5O1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRlZmluZVByb3BlcnR5LnZhbHVlIGluIFsnc3RyaW5nJywgJ251bWJlciddIHx8IGRlZmluZVByb3BlcnR5LnZhbHVlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0YXJnZXQucHJvdG90eXBlLCBwcm9wZXJ0eU5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgeyBlbnVtZXJhYmxlOiB0cnVlLCB3cml0YWJsZTogdHJ1ZSwgdmFsdWU6IGRlZmluZVByb3BlcnR5LnZhbHVlIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRhcmdldC5wcm90b3R5cGUsIHByb3BlcnR5TmFtZSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGhpc1snX18nICsgcHJvcGVydHlOYW1lXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1snX18nICsgcHJvcGVydHlOYW1lXSA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0VGVtcGxhdGUuY2xvbmUoZGVmaW5lUHJvcGVydHkudmFsdWUsIGRlZmluZVByb3BlcnR5Lm9mIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmluZVByb3BlcnR5LnR5cGUgfHwgbnVsbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXNbJ19fJyArIHByb3BlcnR5TmFtZV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgIGlmICh0YXJnZXQucHJvdG90eXBlLl9fZXhjZXB0aW9uc19fKSB7XG4gICAgICAgICAgICBvYmplY3RUZW1wbGF0ZS5fX2V4Y2VwdGlvbnNfXyA9IG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fIHx8IFtdO1xuICAgICAgICAgICAgZm9yICh2YXIgZXhjZXB0aW9uS2V5IGluIHRhcmdldC5wcm90b3R5cGUuX19leGNlcHRpb25zX18pIHtcbiAgICAgICAgICAgICAgICBvYmplY3RUZW1wbGF0ZS5fX2V4Y2VwdGlvbnNfXy5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgZnVuYzogdGFyZ2V0LnByb3RvdHlwZS5fX2V4Y2VwdGlvbnNfX1tleGNlcHRpb25LZXldLFxuICAgICAgICAgICAgICAgICAgICBjbGFzczogZ2V0TmFtZSxcbiAgICAgICAgICAgICAgICAgICAgcHJvcDogZXhjZXB0aW9uS2V5XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0aWVzKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRhcmdldC5wcm90b3R5cGUuX19hbW9ycGhpY3Byb3BzX187XG4gICAgICAgIH1cbiAgICAgICAgZnVuY3Rpb24gZ2V0TmFtZSgpIHtcbiAgICAgICAgICAgIHJldHVybiB0YXJnZXQudG9TdHJpbmcoKS5tYXRjaCgvZnVuY3Rpb24gKFteKF0qK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IHByb3ApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xhc3NOYW1lICsgJy4nICsgcHJvcCArXG4gICAgICAgICAgICAgICAgJyAtIHR5cGUgaXMgdW5kZWZpbmVkLiBDaXJjdWxhciByZWZlcmVuY2U/IFRyeSBAcHJvcGVydHkoe2dldFR5cGU6ICgpID0+IHtyZXR1cm4gJyArXG4gICAgICAgICAgICAgICAgcHJvcFswXS50b1VwcGVyQ2FzZSgpICsgcHJvcC5zdWJzdHIoMSkgKyAnfX0pJztcblxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBpZiAocmVmbGVjdGlvblR5cGUgPT09IEFycmF5KSB7XG4gICAgICAgICAgICBwcm9wcy50eXBlID0gQXJyYXk7XG4gICAgICAgICAgICBwcm9wcy5vZiA9IHR5cGU7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBwcm9wcy50eXBlID0gdHlwZTtcbiAgICAgICAgfVxuICAgICAgICB0YXJnZXQuX19hbW9ycGhpY3Byb3BzX19bdGFyZ2V0S2V5XSA9IHByb3BzO1xuICAgIH07XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gcmVtb3RlKGRlZmluZVByb3BlcnR5KSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uICh0YXJnZXQsIHByb3BlcnR5TmFtZSwgZGVzY3JpcHRvcikge1xuICAgIH1cbn0iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb3JhdG9ycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kZWNvcmF0b3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHlDQUF3QztBQUEvQixzR0FBQSxTQUFTLE9BQUE7QUFDbEIscURBQWtEO0FBRWxEOzs7Ozs7OztNQVFNO0FBQ04sU0FBZ0IsY0FBYyxDQUFDLFdBQVksRUFBRS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WN0LmRlZmluZVByb3BlcnR5KHRhcmdldC5wcm90b3R5cGUsIHByb3BlcnR5TmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IGVudW1lcmFibGU6IHRydWUsIHdyaXRhYmxlOiB0cnVlLCB2YWx1ZTogZGVmaW5lUHJvcGVydHkudmFsdWUgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkodGFyZ2V0LnByb3RvdHlwZSwgcHJvcGVydHlOYW1lLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzWydfXycgKyBwcm9wZXJ0eU5hbWVdID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3RUZW1wbGF0ZS5jbG9uZShkZWZpbmVQcm9wZXJ0eS52YWx1ZSwgZGVmaW5lUHJvcGVydHkub2YgfHxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmaW5lUHJvcGVydHkudHlwZSB8fCBudWxsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpc1snX18nICsgcHJvcGVydHlOYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldDogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbJ19fJyArIHByb3BlcnR5TmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgaWYgKHRhcmdldC5wcm90b3R5cGUuX19leGNlcHRpb25zX18pIHtcbiAgICAgICAgICAgIG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fID0gb2JqZWN0VGVtcGxhdGUuX19leGNlcHRpb25zX18gfHwgW107XG4gICAgICAgICAgICBmb3IgKHZhciBleGNlcHRpb25LZXkgaW4gdGFyZ2V0LnByb3RvdHlwZS5fX2V4Y2VwdGlvbnNfXykge1xuICAgICAgICAgICAgICAgIG9iamVjdFRlbXBsYXRlLl9fZXhjZXB0aW9uc19fLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICBmdW5jOiB0YXJnZXQucHJvdG90eXBlLl9fZXhjZXB0aW9uc19fW2V4Y2VwdGlvbktleV0sXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzOiBnZXROYW1lLFxuICAgICAgICAgICAgICAgICAgICBwcm9wOiBleGNlcHRpb25LZXlcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGFyZ2V0LnByb3RvdHlwZS5fX2Ftb3JwaGljcHJvcHNfXztcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXROYW1lKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFRlbXBsYXRlLmdldE5hbWUodGFyZ2V0KTtcbiAgICAgICAgfVxuICAgICAgICBmdW5jdGlvbiBnZXREaWN0aW9uYXJ5KCkge1xuICAgICAgICAgICAgb2Jq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GV0ZSBwcm9wcy5nZXRUeXBlO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKCF0eXBlKSB7XG4gICAgICAgICAgICB0YXJnZXQuX19leGNlcHRpb25zX18gPSB0YXJnZXQuX19leGNlcHRpb25zX18gfHwge307XG4gICAgICAgICAgICB0YXJnZXQuX19leGNlcHRpb25zX19bdGFyZ2V0S2V5XSA9IGZ1bmN0aW9uIChjbGFzc05hbWUsIHByb3ApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY2xhc3NOYW1lICsgJy4nICsgcHJvcCArXG4gICAgICAgICAgICAgICAgJyAtIHR5cGUgaXMgdW5kZWZpbmVkLiBDaXJjdWxhciByZWZlcmVuY2U/IFRyeSBAcHJvcGVydHkoe2dldFR5cGU6ICgpID0+IHtyZXR1cm4gJyArXG4gICAgICAgICAgICAgICAgcHJvcFswXS50b1VwcGVyQ2FzZSgpICsgcHJvcC5zdWJzdHIoMSkgKyAnfX0pJztcblxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB0YXJnZXQuX19hbW9ycGhpY3Byb3BzX19bdGFyZ2V0S2V5XSA9IHByb3BzO1xuICAgIH07XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gcmVtb3RlKGRlZmluZVByb3BlcnR5KSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uICh0YXJnZXQsIHByb3BlcnR5TmFtZSwgZGVzY3JpcHRvcikge1xuICAgIH1cbn0iXX0=

8

dist/index.js

@@ -24,8 +24,8 @@ "use strict";

exports.SupertypeSession = exports.amorphicStatic = void 0;
var ObjectTemplate_1 = require("./ObjectTemplate");
const ObjectTemplate_1 = require("./ObjectTemplate");
ObjectTemplate_1.ObjectTemplate.init();
exports.default = ObjectTemplate_1.ObjectTemplate;
var amorphicStatic = ObjectTemplate_1.ObjectTemplate.amorphicStatic;
let amorphicStatic = ObjectTemplate_1.ObjectTemplate.amorphicStatic;
exports.amorphicStatic = amorphicStatic;
var SupertypeSession = ObjectTemplate_1.ObjectTemplate.amorphicStatic;
let SupertypeSession = ObjectTemplate_1.ObjectTemplate.amorphicStatic;
exports.SupertypeSession = SupertypeSession;

@@ -45,2 +45,2 @@ var StatsdHelper_1 = require("./StatsdHelper");

Object.defineProperty(exports, "remote", { enumerable: true, get: function () { return decorators_1.remote; } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHOzs7QUFFSCxtREFBa0Q7QUFFbEQsK0JBQWMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztBQUN0QixrQkFBZSwrQkFBYyxDQUFDO0FBRTlCLElBQUksY0FBYyxHQUFHLCtCQUFjLENBQUMsY0FBYyxDQUFDO0FBSzFDLHdDQUFjO0FBSnZCLElBQUksZ0JBQWdCLEdBQUcsK0JBQWMsQ0FBQyxjQUFjLENBQUM7QUFJNUIsNENBQWdCO0FBRnpDLCtDQUE4QztBQUFyQyw0R0FBQSxZQUFZLE9BQUE7QUFHckIscURBQW9EO0FBQTNDLGtIQUFBLGVBQWUsT0FBQTtBQUN4QixxREFBMEU7QUFBakUsa0hBQUEsZUFBZSxPQUFBO0FBQUUsdUhBQUEsb0JBQW9CLE9BQUE7QUFDOUMseUNBQXdDO0FBQS9CLHNHQUFBLFNBQVMsT0FBQTtBQUNsQiwyQ0FBZ0U7QUFBdkQsNEdBQUEsY0FBYyxPQUFBO0FBQUUsc0dBQUEsUUFBUSxPQUFBO0FBQUUsb0dBQUEsTUFBTSxPQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLyogQ29weXJpZ2h0IDIwMTEtMjAxMiBTYW0gRWxzYW1tYW5cbiBQZXJtaXNzaW9uIGlzIGhlcmVieSBncmFudGVkLCBmcmVlIG9m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dfQ==

@@ -176,2 +176,3 @@ import * as serializer from './serializer';

};
static getName(object: any): any;
/**

@@ -199,15 +200,2 @@ * Overridden by other Type Systems to cache or globally identify objects

/**
* Used by template setup to create an property descriptor for use by the constructor
*
* @param {unknown} propertyName is the name of the property
* @param {unknown} defineProperty is the property descriptor passed to the template
* @param {unknown} objectProperties is all properties that will be processed manually. A new property is
* added to this if the property needs to be initialized by value
* @param {unknown} defineProperties is all properties that will be passed to Object.defineProperties
* A new property will be added to this object
*
* @private
*/
static _setupProperty(propertyName: any, defineProperty: any, objectProperties: any, defineProperties: any): void;
/**
* Clone an object created from an ObjectTemplate

@@ -285,45 +273,22 @@ * Used only within supertype (see copyObject for general copy)

/**
/**
* Find the right subclass to instantiate by either looking at the
* declared list in the subClasses define property or walking through
* the subclasses of the declared template
*
* @param {unknown} template unknown
* @param {unknown} objId unknown
* @param {unknown} defineProperty unknown
* @returns {*}
* @private
*/
static _resolveSubClass(template: any, objId: any, defineProperty: any): any;
/**
* Walk recursively through extensions of template via __children__
* looking for a name match
* Return the highest level template
*
* @param {unknown} template unknown
* @param {unknown} templateName unknown
*
* @returns {*}
*
* @private
*/
static _findSubClass(template: any, templateName: any): any;
static _getBaseClass(template: any): any;
/**
* Return the highest level template
* An overridable function used to create an object from a template and optionally
* manage the caching of that object (used by derivative type systems). It
* preserves the original id of an object
*
* @param {unknown} template unknown
*
* @param {unknown} template of object
* @param {unknown} objId and id (if present)
* @param {unknown} defineProperty unknown
* @returns {*}
*
* @private
*/
static _getBaseClass(template: any): any;
/**
* An overridable function used to create an object from a template and optionally
* manage the caching of that object (used by derivative type systems). It
* preserves the original id of an object
*
* @param {unknown} template of object
* @param {unknown} objId and id (if present)
* @param {unknown} defineProperty unknown
* @returns {*}
* @private
*/
static _createEmptyObject(template: any, objId: any, defineProperty: any): any;

@@ -330,0 +295,0 @@ /**

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

}
var obj;
let obj;
if (creator) {

@@ -170,2 +170,2 @@ obj = creator(parent, prop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NDb250ZW50IjpbIi8qKlxuICogT2JqZWN0VGVtcGxhdGUudG9KU09OU3RyaW5nO1xuICovXG4vKipcbiAqIENvbnZlcnQgYW4gb2JqZWN0IHRvIEpTT04sIHN0cmlwcGluZyBhbnkgcmVjdXJzaXZlIG9iamVjdCByZWZlcmVuY2VzIHNvIHRoZXkgY2FuIGJlXG4gKiByZWNvbnN0aXR1dGVkIGxhdGVyXG4gKlxuICogQHBhcmFtIHt1bmtub3dufSBvYmogdW5rbm93blxuICogQHBhcmFtIHt1bmtub3dufSBjYiB1bmtub3duXG4gKlxuICogQHJldHVybnMge3Vua25vd259XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB0b0pTT05TdHJpbmcob2JqLCBjYj8pIHtcbiAgICB2YXIgaWRNYXAgPSBbXTtcblxuICAgIHRyeSB7XG4gICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmosIGZ1bmN0aW9uIGEoa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gJ19fb2JqZWN0VGVtcGxhdGVfXycgfHwga2V5ID09PSAnYW1vcnBoaWMnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmFsdWUgJiYgdmFsdWUuX190ZW1wbGF0ZV9fICYmIHZhbHVlLl9faWRfXykge1xuICAgICAgICAgICAgICAgIGlmIChpZE1hcFt2YWx1ZS5fX2lkX19dKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0geyBfX2lkX186IHZhbHVlLl9faWRfXy50b1N0cmluZygpIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZE1hcFt2YWx1ZS5fX2lkX18udG9TdHJpbmcoKV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjYikge1xuIC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AgICAgaWYgKG9iaiBpbnN0YW5jZW9mIEFycmF5KSB7XG4gICAgICAgICAgICBvYmogPSBvYmpbMF07XG4gICAgICAgICAgICBpZE1hcFtvYmouX19pZF9fLnRvU3RyaW5nKCldID0gb2JqO1xuICAgICAgICAgICAgcmV0dXJuIG9iajtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgKG9iaikgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghb2JqKSB7XG4gICAgICAgICAgICB0aGlzLm5vSW5pdCA9IHRydWU7XG4gICAgICAgICAgICBvYmogPSBuZXcgdGVtcGxhdGUoKTtcbiAgICAgICAgICAgIHRoaXMubm9Jbml0ID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIG9iaiA9IHRoaXMuX2NyZWF0ZUVtcHR5T2JqZWN0KHRlbXBsYXRlLCBnZXRJZChwb2pvLl9faWRfXy50b1N0cmluZygpKSwgZGVmaW5lUHJvcGVydHksIHBvam8uX190cmFuc2llbnRfXyk7XG4gICAgfVxuXG4gICAgaWRNYXBbZ2V0SWQocG9qby5fX2lkX18udG9TdHJpbmcoKSldID0gb2JqO1xuXG4gICAgLy8gR28gdGhyb3VnaCBhbGwgdGhlIHByb3BlcnRpZXMgYW5kIHRyYW5zZmVyIHRoZW0gdG8gbmV3bHkgY3JlYXRlZCBvYmplY3RcbiAgICB2YXIgcHJvcHMgPSBvYmouX190ZW1wbGF0ZV9fLmdldFByb3BlcnRpZXMoKTtcblxuICAgIGZvciAodmFyIHByb3BiIGluIHBvam8pIHtcbiAgICAgICAgcHJvcGIgPSBwcm9wYi5yZXBsYWNlKC9eX18vLCAnJyk7XG4gICAgICAgIHZhciBkZWZpbmVQcm9wID0gcHJvcHNbcHJvcGJdO1xuICAgICAgICBpZiAoIWRlZmluZVByb3ApXG4gICAgICAgICAgICBjb250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TtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpeCA9IDA7IGl4IDwgcG9qb1twb2pvUHJvcF0ubGVuZ3RoOyArK2l4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR5cGUgPSBwb2pvW3Bvam9Qcm9wXVtpeF0uX190ZW1wbGF0ZV9fIHx8IGRlZmluZVByb3Aub2Y7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocG9qb1twb2pvUHJvcF1baXhdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBvam9bcG9qb1Byb3BdW2l4XS5fX2lkX18gJiYgaWRNYXBbZ2V0SWQocG9qb1twb2pvUHJvcF1baXhdLl9faWRfXy50b1N0cmluZygpKV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3BiXVtpeF0gPSBpZE1hcFtnZXRJZChwb2pvW3Bvam9Qcm9wXVtpeF0uX19pZF9fLnRvU3RyaW5nKCkpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl1baXhdID0gdGhpcy5mcm9tUE9KTyhwb2pvW3Bvam9Qcm9wXVtpeF0sIGF0eXBlLCBkZWZpbmVQcm9wLCBpZE1hcCwgaWRRdWFsaWZpZXIsIG9iaiwgcHJvcGIsIGNyZWF0b3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl1baXhdID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3BiXSA9IFtdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGUuaXNPYmplY3RUZW1wbGF0ZSkgeyAvLyBUZW1wbGF0ZWQgb2JqZWN0c1xuICAgICAgICAgICAgICAgIHZhciBvdHlwZSA9IHBvam9bcG9qb1Byb3BdLl9fdGVtcGxhdGVfXyB8fCB0eXBlO1xuICAgICAgICAgICAgICAgIGlmIChwb2pvW3Bvam9Qcm9wXS5fX2lkX18gJiYgaWRNYXBbZ2V0SWQocG9qb1twb2pvUHJvcF0uX19pZF9fLnRvU3RyaW5nKCkpXSkge1xuICAgICAgICAgICAgICAgICAgICBvYmpbcHJvcGJdID0gaWRNYXBbZ2V0SWQocG9qb1twb2pvUHJvcF0uX19pZF9fLnRvU3RyaW5nKCkpXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl0gPSB0aGlzLmZyb21QT0pPKHBvam9bcG9qb1Byb3BdLCBvdHlwZSwgZGVmaW5lUHJvcCwgaWRNYXAsIGlkUXVhbGlmaWVyLCBvYmosIHByb3BiLCBjcmVhdG9yKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh0eXBlID09IERhdGUpIHtcbiAgICAgICAgICAgICAgICBpZiAocG9qb1twb2pvUHJvcF0pIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3BiXSA9IG5ldyBEYXRlKHBvam9bcG9qb1Byb3BdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl0gPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc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SBjYiB1bmtub3duXG4gKlxuICogQHJldHVybnMge3Vua25vd259XG4gKi9cbmV4cG9ydCBmdW5jdGlvbiB0b0pTT05TdHJpbmcob2JqLCBjYj8pIHtcbiAgICB2YXIgaWRNYXAgPSBbXTtcblxuICAgIHRyeSB7XG4gICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmosIGZ1bmN0aW9uIGEoa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGtleSA9PT0gJ19fb2JqZWN0VGVtcGxhdGVfXycgfHwga2V5ID09PSAnYW1vcnBoaWMnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmFsdWUgJiYgdmFsdWUuX190ZW1wbGF0ZV9fICYmIHZhbHVlLl9faWRfXykge1xuICAgICAgICAgICAgICAgIGlmIChpZE1hcFt2YWx1ZS5fX2lkX19dKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlID0geyBfX2lkX186IHZhbHVlLl9faWRfXy50b1N0cmluZygpIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZE1hcFt2YWx1ZS5fX2lkX18udG9TdHJpbmcoKV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBjYihrZXksIHZhbHVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgY2F0Y2ggKGUpIHtcbiAgICAgICAgdGhyb3cgZTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIHByb3BYZmVyKHByb3AsIHBvam8sIG9iaikge1xuICAgIGlmIChwb2pvW3Byb3BdKSB7XG4gICAgICAgIG9ialtwcm9wXSA9IHBv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JyArIHByb3BiIDogcHJvcGI7XG5cbiAgICAgICAgaWYgKHR5cGUgJiYgcG9qb1twb2pvUHJvcF0gPT0gbnVsbCkge1xuICAgICAgICAgICAgb2JqW3Byb3BiXSA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSBpZiAodHlwZSAmJiB0eXBlb2YgKHBvam9bcG9qb1Byb3BdKSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlID09IEFycmF5ICYmIGRlZmluZVByb3Aub2YgJiYgZGVmaW5lUHJvcC5vZi5pc09iamVjdFRlbXBsYXRlKSB7IC8vIEFycmF5IG9mIHRlbXBsYXRlZCBvYmplY3RzXG4gICAgICAgICAgICAgICAgdmFyIGFycmF5RGlyZWN0aW9ucyA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICBpZiAoY3JlYXRvcikge1xuICAgICAgICAgICAgICAgICAgICBhcnJheURpcmVjdGlvbnMgPSBjcmVhdG9yKG9iaiwgcHJvcGIsIGRlZmluZVByb3Aub2YsIGlkTWFwW3Bvam8uX19pZF9fLnRvU3RyaW5nKCldLCBwb2pvLl9fdHJhbnNpZW50X18pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKGFycmF5RGlyZWN0aW9ucykgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl0gPSBbXTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpeCA9IDA7IGl4IDwgcG9qb1twb2pvUHJvcF0ubGVuZ3RoOyArK2l4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR5cGUgPSBwb2pvW3Bvam9Qcm9wXVtpeF0uX190ZW1wbGF0ZV9fIHx8IGRlZmluZVByb3Aub2Y7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocG9qb1twb2pvUHJvcF1baXhdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBvam9bcG9qb1Byb3BdW2l4XS5fX2lkX18gJiYgaWRNYXBbZ2V0SWQocG9qb1twb2pvUHJvcF1baXhdLl9faWRfXy50b1N0cmluZygpKV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3BiXVtpeF0gPSBpZE1hcFtnZXRJZChwb2pvW3Bvam9Qcm9wXVtpeF0uX19pZF9fLnRvU3RyaW5nKCkpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl1baXhdID0gdGhpcy5mcm9tUE9KTyhwb2pvW3Bvam9Qcm9wXVtpeF0sIGF0eXBlLCBkZWZpbmVQcm9wLCBpZE1hcCwgaWRRdWFsaWZpZXIsIG9iaiwgcHJvcGIsIGNyZWF0b3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl1baXhdID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3BiXSA9IFtdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGUuaXNPYmplY3RUZW1wbGF0ZSkgeyAvLyBUZW1wbGF0ZWQgb2JqZWN0c1xuICAgICAgICAgICAgICAgIHZhciBvdHlwZSA9IHBvam9bcG9qb1Byb3BdLl9fdGVtcGxhdGVfXyB8fCB0eXBlO1xuICAgICAgICAgICAgICAgIGlmIChwb2pvW3Bvam9Qcm9wXS5fX2lkX18gJiYgaWRNYXBbZ2V0SWQocG9qb1twb2pvUHJvcF0uX19pZF9fLnRvU3RyaW5nKCkpXSkge1xuICAgICAgICAgICAgICAgICAgICBvYmpbcHJvcGJdID0gaWRNYXBbZ2V0SWQocG9qb1twb2pvUHJvcF0uX19pZF9fLnRvU3RyaW5nKCkpXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl0gPSB0aGlzLmZyb21QT0pPKHBvam9bcG9qb1Byb3BdLCBvdHlwZSwgZGVmaW5lUHJvcCwgaWRNYXAsIGlkUXVhbGlmaWVyLCBvYmosIHByb3BiLCBjcmVhdG9yKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh0eXBlID09IERhdGUpIHtcbiAgICAgICAgICAgICAgICBpZiAocG9qb1twb2pvUHJvcF0pIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqW3Byb3BiXSA9IG5ldyBEYXRlKHBvam9bcG9qb1Byb3BdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wYl0gPSBudWxsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIG9ialtwcm9wYl0gPSBwb2pvW3Bvam9Qcm9wXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIEZvciB0aGUgYmVuZWZpdCBvZiBwZXJzaXN0T2JqZWN0VGVtcGxhdGVcbiAgICBpZiAoIWNyZWF0b3IgJiYgcG9qby5faWQpIHtcbiAgICAgICAgb2JqLl9pZCA9IGdldElkKHBvam8uX2lkKTtcbiAgICB9XG5cbiAgICBpZiAoIWNyZWF0b3IpIHtcbiAgICAgICAgcHJvcFhmZXIoJ19fY2hhbmdlZF9fJywgcG9qbywgb2JqKTtcbiAgICAgICAgcHJvcFhmZXIoJ19fdmVyc2lvbl9fJywgcG9qbywgb2JqKTtcbiAgICB9XG5cbiAgICBwcm9wWGZlcignX190b1NlcnZlcl9fJywgcG9qbywgb2JqKTtcbiAgICBwcm9wWGZlcignX190b0NsaWVudF9fJywgcG9qbywgb2JqKTtcblxuICAgIHJldHVybiBvYmo7XG59O1xuXG5cbi8qKlxuICogT2JqZWN0VGVtcGxhdGUuZnJvbUpTT05cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGZyb21KU09OKHN0ciwgdGVtcGxhdGUsIGlkUXVhbGlmaWVyKSB7XG4gICAgcmV0dXJuIHRoaXMuZnJvbVBPSk8oSlNPTi5wYXJzZShzdHIpLCB0ZW1wbGF0ZSwgbnVsbCwgbnVsbCwgaWRRdWFsaWZpZXIpO1xufTtcbiJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatsdHelper = void 0;
var index_1 = require("./index");
const index_1 = require("./index");
/**
* mostly static utility functions to assist supertype in handling statsd operations
*/
var StatsdHelper = /** @class */ (function () {
function StatsdHelper() {
}
class StatsdHelper {
/**

@@ -16,5 +14,5 @@ * convert node time format hrtime to milliseconds

*/
StatsdHelper.convertHRTimeToMilliseconds = function (hrTime) {
static convertHRTimeToMilliseconds(hrTime) {
return hrTime[0] * 1000 + hrTime[1] / 1000000;
};
}
/**

@@ -26,15 +24,14 @@ * given a start time and a key, record the total amount of time and send stat info.

*/
StatsdHelper.computeTimingAndSend = function (hrTimeStart, statsKey, tags) {
var statsdClient = index_1.SupertypeSession.statsdClient;
static computeTimingAndSend(hrTimeStart, statsKey, tags) {
const statsdClient = index_1.SupertypeSession.statsdClient;
if (statsdClient
&& statsdClient.timing
&& typeof statsdClient.timing === 'function') {
var timerEndTime = process.hrtime(hrTimeStart);
var totalTimeInMilliseconds = this.convertHRTimeToMilliseconds(timerEndTime);
const timerEndTime = process.hrtime(hrTimeStart);
const totalTimeInMilliseconds = this.convertHRTimeToMilliseconds(timerEndTime);
statsdClient.timing(statsKey, totalTimeInMilliseconds, tags);
}
};
return StatsdHelper;
}());
}
}
exports.StatsdHelper = StatsdHelper;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3RhdHNkSGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N0YXRzZEhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxpQ0FBMkM7QUFNM0M7O0dBRUc7QUFDSDtJQUFBO0lBNkJBLENBQUM7SUEzQkc7Ozs7T0FJRztJQUNXLHdDQUEyQixHQUF6QyxVQUEwQyxNQUFjO1FBQ3BELE9BQU8sTUFBTSxDQUFDLENBQUMsQ0FBQyxHQUFHLElBQUksR0FBRyxNQUFNLENBQUMsQ0FBQyxDQUFDLEdBQUcsT0FBTyxDQUFDO0lBQ2xELENBQUM7SUFFRDs7Ozs7T0FLRztJQUNXLGlDQUFvQixHQUFsQyxVQUFtQyxXQUFtQixFQUFFLFFBQWdCLEVBQUUsSUFBSztRQUMzRSxJQUFNLFlBQVksR0FBRyx3QkFBZ0IsQ0FBQyxZQUFZLENBQUM7UUFFbkQsSUFBRyxZQUFZO2VBQ1IsWUFBWSxDQUFDLE1BQU07ZUFDbkIsT0FBTyxZQUFZLENBQUMsTUFBTSxLQUFLLFVBQVUsRUFBRTtZQUU5QyxJQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsTUFBTSxDQUFDLFdBQVcsQ0FBQyxDQUFDO1lBQ2pELElBQU0sdUJBQXVCLEdBQUcsSUFBSSxDQUFDLDJCQUEyQixDQUFDLFlBQVksQ0FBQyxDQUFDO1lBQy9FLFlBQVksQ0FBQyxNQUFNLENBQUMsUUFBUSxFQUFFLHVCQUF1QixFQUFFLElBQUksQ0FBQyxDQ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saXNlY29uZHMgPSB0aGlzLmNvbnZlcnRIUlRpbWVUb01pbGxpc2Vjb25kcyh0aW1lckVuZFRpbWUpO1xuICAgICAgICAgICAgc3RhdHNkQ2xpZW50LnRpbWluZyhzdGF0c0tleSwgdG90YWxUaW1lSW5NaWxsaXNlY29uZHMsIHRhZ3MpO1xuICAgICAgICB9XG4gICAgfVxufSJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Supertype = void 0;
var ObjectTemplate_1 = require("./ObjectTemplate");
var serializer = require("./serializer");
function constructorName(constructor) {
var namedFunction = constructor.toString().match(/function ([^(]*)/);
return namedFunction ? namedFunction[1] : null;
}
const ObjectTemplate_1 = require("./ObjectTemplate");
const serializer = require("./serializer");
/**

@@ -16,8 +12,7 @@ * This is the base class for typescript classes.

*/
var Supertype = /** @class */ (function () {
function Supertype(objectTemplate) {
if (objectTemplate === void 0) { objectTemplate = ObjectTemplate_1.ObjectTemplate; }
class Supertype {
constructor(objectTemplate = ObjectTemplate_1.ObjectTemplate) {
var template = this.__template__;
if (!template) {
throw new Error(constructorName(Object.getPrototypeOf(this).constructor) + ' missing @supertypeClass');
throw new Error(ObjectTemplate_1.ObjectTemplate.getName(Object.getPrototypeOf(this).constructor) + ' missing @supertypeClass');
}

@@ -43,34 +38,34 @@ // Tell constructor not to execute as this is an empty object

}
Supertype.amorphicCreateProperty = function (prop, defineProperty) {
static amorphicCreateProperty(prop, defineProperty) {
// Implemented in the decorator @supertypeClass
};
Supertype.amorphicGetProperties = function (includeVirtualProperties) {
}
static amorphicGetProperties(includeVirtualProperties) {
// Implemented in the decorator @supertypeClass
};
Supertype.amorphicFromJSON = function (json) {
}
static amorphicFromJSON(json) {
// Implemented in the decorator @supertypeClass
};
Supertype.createProperty = function (prop, defineProperty) {
}
static createProperty(prop, defineProperty) {
// Implemented in the decorator @supertypeClass
};
Supertype.getProperties = function () {
}
static getProperties() {
// Implemented in the decorator @supertypeClass
};
Supertype.prototype.amorphicGetClassName = function () {
}
amorphicGetClassName() {
// Implemented in the decorator @supertypeClass
return '';
};
Supertype.fromJSON = function (json, idPrefix) {
}
static fromJSON(json, idPrefix) {
// Implemented in the decorator @supertypeClass
};
Supertype.inject = function (injector) {
}
static inject(injector) {
// Implemented in Line 128, of ObjectTemplate.ts (static performInjections)
};
Supertype.prototype.amorphicToJSON = function (cb) {
}
amorphicToJSON(cb) {
return serializer.toJSONString(this, cb);
};
Supertype.prototype.amorphicGetPropertyDefinition = function (prop) {
}
amorphicGetPropertyDefinition(prop) {
return ObjectTemplate_1.ObjectTemplate._getDefineProperty(prop, this.__template__);
};
Supertype.prototype.amorphicGetPropertyValues = function (prop) {
}
amorphicGetPropertyValues(prop) {
var defineProperty = this.__prop__(prop) || this.__prop__('_' + prop);

@@ -81,4 +76,4 @@ if (typeof (defineProperty.values) === 'function') {

return defineProperty.values;
};
Supertype.prototype.amorphicGetPropertyDescriptions = function (prop) {
}
amorphicGetPropertyDescriptions(prop) {
var defineProperty = this.__prop__(prop) || this.__prop__('_' + prop);

@@ -89,30 +84,29 @@ if (typeof (defineProperty.descriptions) === 'function') {

return defineProperty.descriptions;
};
Supertype.prototype.createCopy = function (creator) {
var obj = this;
}
createCopy(creator) {
const obj = this;
return ObjectTemplate_1.ObjectTemplate.fromPOJO(obj, obj.__template__, null, null, undefined, null, null, creator);
};
Supertype.prototype.inject = function (injector) {
}
inject(injector) {
ObjectTemplate_1.ObjectTemplate.inject(this, injector);
};
Supertype.prototype.copyProperties = function (obj) {
}
copyProperties(obj) {
for (var prop in obj) {
this[prop] = obj[prop];
}
};
Supertype.prototype.__prop__ = function (prop) {
}
__prop__(prop) {
return this.amorphicGetPropertyDefinition(prop);
};
Supertype.prototype.__values__ = function (prop) {
}
__values__(prop) {
return this.amorphicGetPropertyValues(prop);
};
Supertype.prototype.__descriptions__ = function (prop) {
}
__descriptions__(prop) {
return this.amorphicGetPropertyDescriptions(prop);
};
Supertype.prototype.toJSONString = function (cb) {
}
toJSONString(cb) {
return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yaXB0aW9ucztcbiAgICB9XG5cbiAgICBjcmVhdGVDb3B5KGNyZWF0b3IpIHtcbiAgICAgICAgY29uc3Qgb2JqID0gdGhpcztcbiAgICAgICAgcmV0dXJuIE9iamVjdFRlbXBsYXRlLmZyb21QT0pPKG9iaiwgb2JqLl9fdGVtcGxhdGVfXywgbnVsbCwgbnVsbCwgdW5kZWZpbmVkLCBudWxsLCBudWxsLCBjcmVhdG9yKTtcbiAgICB9XG5cbiAgICBpbmplY3QoaW5qZWN0b3IpIHtcbiAgICAgICAgT2JqZWN0VGVtcGxhdGUuaW5qZWN0KHRoaXMsIGluamVjdG9yKTtcbiAgICB9XG5cbiAgICBjb3B5UHJvcGVydGllcyhvYmopIHtcbiAgICAgICAgZm9yICh2YXIgcHJvcCBpbiBvYmopIHtcbiAgICAgICAgICAgIHRoaXNbcHJvcF0gPSBvYmpbcHJvcF07XG4gICAgICAgIH1cbiAgICB9XG4gICAgX19wcm9wX18ocHJvcCkge1xuICAgICAgICByZXR1cm4gdGhpcy5hbW9ycGhpY0dldFByb3BlcnR5RGVmaW5pdGlvbihwcm9wKTtcbiAgICB9XG4gICAgX192YWx1ZXNfXyhwcm9wKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmFtb3JwaGljR2V0UHJvcGVydHlWYWx1ZXMocHJvcCk7XG4gICAgfVxuICAgIF9fZGVzY3JpcHRpb25zX18ocHJvcCl7XG4gICAgICAgIHJldHVybiB0aGlzLmFtb3JwaGljR2V0UHJvcGVydHlEZXNjcmlwdGlvbnMocHJvcCk7XG4gICAgfVxuICAgIHRvSlNPTlN0cmluZyhjYj8pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYW1vcnBoaWNUb0pTT04oY2IpXG4gICAgfVxufSJdfQ==
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BuildSupertypeConfig = exports.SupertypeConfig = void 0;
var nconf = require("nconf");
const nconf = require("nconf");
function createNewNConfProvider() {

@@ -11,4 +11,4 @@ return new nconf.Provider().argv().env({ separator: '__' });

*/
var SupertypeConfig = /** @class */ (function () {
function SupertypeConfig() {
class SupertypeConfig {
constructor() {
this.internalConfigStore = createNewNConfProvider();

@@ -22,5 +22,5 @@ }

*/
SupertypeConfig.prototype.get = function (key) {
get(key) {
return this.internalConfigStore.get(key);
};
}
/**

@@ -33,5 +33,5 @@ * Sets a value with a key

*/
SupertypeConfig.prototype.set = function (key, value) {
set(key, value) {
return this.internalConfigStore.set(key, value);
};
}
/**

@@ -43,8 +43,7 @@ * Load a configuration file into store

*/
SupertypeConfig.prototype.loadFile = function (fileKey, file) {
loadFile(fileKey, file) {
this.internalConfigStore.file(fileKey, file);
};
}
;
return SupertypeConfig;
}());
}
exports.SupertypeConfig = SupertypeConfig;

@@ -56,9 +55,9 @@ /**

function BuildSupertypeConfig(rootDir) {
var rootConfig = new SupertypeConfig();
const rootConfig = new SupertypeConfig();
if (!rootDir) {
throw new Error("Valid root path expected. rootDir[" + rootDir + "]");
throw new Error(`Valid root path expected. rootDir[${rootDir}]`);
}
else {
var configStore = {};
var envName = rootConfig.internalConfigStore.get('APP_ENV');
const configStore = {};
let envName = rootConfig.internalConfigStore.get('APP_ENV');
if (envName) {

@@ -68,9 +67,9 @@ envName = envName.toLowerCase();

if (envName) {
loadConfigFile(rootConfig.internalConfigStore, 'root_env', rootDir, "config_" + envName + ".json");
loadConfigFile(rootConfig.internalConfigStore, 'root_env', rootDir, `config_${envName}.json`);
}
loadConfigFile(rootConfig.internalConfigStore, 'root_secure', rootDir, "config_secure.json");
loadConfigFile(rootConfig.internalConfigStore, 'root', rootDir, "config.json");
loadConfigFile(rootConfig.internalConfigStore, 'root_secure', rootDir, `config_secure.json`);
loadConfigFile(rootConfig.internalConfigStore, 'root', rootDir, `config.json`);
configStore['root'] = rootConfig;
var appList = rootConfig.internalConfigStore.get('applications') || {};
for (var appKey in appList) {
const appList = rootConfig.internalConfigStore.get('applications') || {};
for (let appKey in appList) {
configStore[appKey] = buildAppSpecificConfigStore(appList[appKey], rootDir, envName);

@@ -83,24 +82,24 @@ }

function buildAppSpecificConfigStore(app, rootDir, envName) {
var appPath = rootDir + "/" + app; // Location of the App relative to root
var appCommonPath = rootDir + "/apps/common"; // Location of the common folder relative to root
var config = new SupertypeConfig();
var appCfgApi = config.internalConfigStore;
const appPath = `${rootDir}/${app}`; // Location of the App relative to root
const appCommonPath = `${rootDir}/apps/common`; // Location of the common folder relative to root
const config = new SupertypeConfig();
const appCfgApi = config.internalConfigStore;
// Load the new app environment values into the config
if (envName) {
loadConfigFile(appCfgApi, 'app_env', appPath, "config_" + envName + ".json");
loadConfigFile(appCfgApi, 'app_env', appPath, `config_${envName}.json`);
}
loadConfigFile(appCfgApi, 'app_secure', appPath, "config_secure.json");
loadConfigFile(appCfgApi, 'app', appPath, "config.json");
loadConfigFile(appCfgApi, 'app_secure', appPath, `config_secure.json`);
loadConfigFile(appCfgApi, 'app', appPath, `config.json`);
// Load the common folder configs to this config provider
if (envName) {
loadConfigFile(appCfgApi, 'common_env', appCommonPath, "config_" + envName + ".json");
loadConfigFile(appCfgApi, 'common_env', appCommonPath, `config_${envName}.json`);
}
loadConfigFile(appCfgApi, 'common_secure', appCommonPath, "config_secure.json");
loadConfigFile(appCfgApi, 'common', appCommonPath, "config.json");
loadConfigFile(appCfgApi, 'common_secure', appCommonPath, `config_secure.json`);
loadConfigFile(appCfgApi, 'common', appCommonPath, `config.json`);
// Load the root values here too
if (envName) {
loadConfigFile(appCfgApi, 'root_env', rootDir, "config_" + envName + ".json");
loadConfigFile(appCfgApi, 'root_env', rootDir, `config_${envName}.json`);
}
loadConfigFile(appCfgApi, 'root_secure', rootDir, "config_secure.json");
loadConfigFile(appCfgApi, 'root', rootDir, "config.json");
loadConfigFile(appCfgApi, 'root_secure', rootDir, `config_secure.json`);
loadConfigFile(appCfgApi, 'root', rootDir, `config.json`);
return config;

@@ -110,8 +109,8 @@ }

try {
config.file(name, appPath + "/" + fileName);
config.file(name, `${appPath}/${fileName}`);
}
catch (err) {
console.debug("Error loading " + appPath + "/" + fileName + " to config");
console.debug(`Error loading ${appPath}/${fileName} to config`);
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N1cGVydHlwZUNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2QkFBK0I7QUFLL0IsU0FBUyxzQkFBc0I7SUFDM0IsT0FBTyxJQUFJLEtBQUssQ0FBQyxRQUFRLEVBQUUsQ0FBQyxJQUFJLEVBQUUsQ0FBQyxHQUFHLENBQUMsRUFBQyxTQUFTLEVBQUUsSUFBSSxFQUFDLENBQUMsQ0FBQztBQUM5RCxDQUFDO0FBRUQ7O0dBRUc7QUFDSDtJQUdJO1FBQ0ksSUFBSSxDQUFDLG1CQUFtQixHQUFHLHNCQUFzQixFQUFFLENBQUM7SUFDeEQsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsNkJBQUcsR0FBSCxVQUFJLEdBQUc7UUFDSCxPQUFPLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDN0MsQ0FBQztJQUVEOzs7Ozs7T0FNRztJQUNILDZCQUFHLEdBQUgsVUFBSSxHQUFHLEVBQUUsS0FBSztRQUNWLE9BQU8sSUFBSSxDQUFDLG1CQUFtQixDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsS0FBSyxDQUFDLENBQUM7SUFDcEQsQ0FBQztJQUVEOzs7OztPQUtHO0lBQ0gsa0NBQVEsR0FBUixVQUFTLE9BQU8sRUFBRSxJQUFJO1FBQ2xCLElBQUksQ0FBQyxtQkFBbUIsQ0FBQyxJQUFJLENBQUMsT0FBTyxFQUFFLElBQUksQ0FBQyxDQUFDO0lBQ2pELENBQUM7SUFBQSxDQUFDO0lBQ04sc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OYW1lVG9Db25maWdNYXAgPSB7fTtcbiAgICAgICAgbGV0IGVudk5hbWUgPSByb290Q29uZmlnLmludGVybmFsQ29uZmlnU3RvcmUuZ2V0KCdBUFBfRU5WJyk7XG5cbiAgICAgICAgaWYgKGVudk5hbWUpIHtcbiAgICAgICAgICAgIGVudk5hbWUgPSBlbnZOYW1lLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZW52TmFtZSkge1xuICAgICAgICAgICAgbG9hZENvbmZpZ0ZpbGUocm9vdENvbmZpZy5pbnRlcm5hbENvbmZpZ1N0b3JlLCAncm9vdF9lbnYnLCByb290RGlyLCBgY29uZmlnXyR7ZW52TmFtZX0uanNvbmApO1xuICAgICAgICB9XG4gICAgICAgIGxvYWRDb25maWdGaWxlKHJvb3RDb25maWcuaW50ZXJuYWxDb25maWdTdG9yZSwgJ3Jvb3Rfc2VjdXJlJywgcm9vdERpciwgYGNvbmZpZ19zZWN1cmUuanNvbmApO1xuICAgICAgICBsb2FkQ29uZmlnRmlsZShyb290Q29uZmlnLmludGVybmFsQ29uZmlnU3RvcmUsICdyb290Jywgcm9vdERpciwgYGNvbmZpZy5qc29uYCk7XG5cblxuICAgICAgICBjb25maWdTdG9yZVsncm9vdCddID0gcm9vdENvbmZpZztcblxuICAgICAgICBjb25zdCBhcHBMaXN0ID0gcm9vdENvbmZpZy5pbnRlcm5hbENvbmZpZ1N0b3JlLmdldCgnYXBwbGljYXRpb25zJykgfHwge307XG5cbiAgICAgICAgZm9yIChsZXQgYXBwS2V5IGluIGFwcExpc3QpIHtcbiAgICAgICAgICAgIGNvbmZpZ1N0b3JlW2FwcEtleV0gPSBidWlsZEFwcFNwZWNpZmljQ29uZmlnU3RvcmUoYXBwTGlzdFthcHBLZXldLCByb290RGlyLCBlbnZOYW1lKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjb25maWdTdG9yZTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIGJ1aWx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readArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SupertypeLogger = void 0;
var levelToStr = { 60: 'fatal', 50: 'error', 40: 'warn', 30: 'info', 20: 'debug', 10: 'trace' };
var strToLevel = { 'fatal': 60, 'error': 50, 'warn': 40, 'info': 30, 'debug': 20, 'trace': 10 };
const levelToStr = { 60: 'fatal', 50: 'error', 40: 'warn', 30: 'info', 20: 'debug', 10: 'trace' };
const strToLevel = { 'fatal': 60, 'error': 50, 'warn': 40, 'info': 30, 'debug': 20, 'trace': 10 };
function isObject(obj) {

@@ -20,7 +13,7 @@ return obj != null

}
var SupertypeLogger = /** @class */ (function () {
class SupertypeLogger {
// for overriding
// sendToLog: Function;
// formatDateTime: Function;
function SupertypeLogger() {
constructor() {
this.context = {};

@@ -30,44 +23,20 @@ this.granularLevels = {};

}
SupertypeLogger.prototype.fatal = function () {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
this.log.apply(this, __spreadArrays([60], data));
};
SupertypeLogger.prototype.error = function () {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
this.log.apply(this, __spreadArrays([50], data));
};
SupertypeLogger.prototype.warn = function () {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
this.log.apply(this, __spreadArrays([40], data));
};
SupertypeLogger.prototype.info = function () {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
this.log.apply(this, __spreadArrays([30], data));
};
SupertypeLogger.prototype.debug = function () {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
this.log.apply(this, __spreadArrays([20], data));
};
SupertypeLogger.prototype.trace = function () {
var data = [];
for (var _i = 0; _i < arguments.length; _i++) {
data[_i] = arguments[_i];
}
this.log.apply(this, __spreadArrays([10], data));
};
fatal(...data) {
this.log(60, ...data);
}
error(...data) {
this.log(50, ...data);
}
warn(...data) {
this.log(40, ...data);
}
info(...data) {
this.log(30, ...data);
}
debug(...data) {
this.log(20, ...data);
}
trace(...data) {
this.log(10, ...data);
}
/**

@@ -77,13 +46,9 @@ * assign a custom send to log functionality.

*/
SupertypeLogger.prototype.setLogger = function (loggerFunction) {
setLogger(loggerFunction) {
this.sendToLog = loggerFunction;
};
}
// Log all arguments assuming the first one is level and the second one might be an object (similar to banyan)
SupertypeLogger.prototype.log = function (level) {
var data = [];
for (var _i = 1; _i < arguments.length; _i++) {
data[_i - 1] = arguments[_i];
}
var msg = '';
var obj = {
log(level, ...data) {
let msg = '';
const obj = {
time: (new Date()).toISOString(),

@@ -94,5 +59,5 @@ msg: '',

};
var amorphicContext = {};
const amorphicContext = {};
// Copy amorphic context into the data
for (var prop in this.context) {
for (const prop in this.context) {
obj[prop] = this.context[prop];

@@ -103,5 +68,5 @@ amorphicContext[prop] = this.context[prop];

obj.__amorphicContext = amorphicContext;
data.forEach(function (arg, index) {
data.forEach((arg, index) => {
if (index === 0 && isObject(arg)) {
for (var proper in arg) {
for (const proper in arg) {
obj[proper] = arg[proper];

@@ -111,3 +76,3 @@ }

else {
msg += arg + " ";
msg += `${arg} `;
}

@@ -120,3 +85,3 @@ });

if (obj.module && obj.activity) {
obj.msg += obj.module + "[" + obj.activity + "] - ";
obj.msg += `${obj.module}[${obj.activity}] - `;
}

@@ -126,15 +91,15 @@ obj.msg += msg;

else if (obj.module && obj.activity) {
obj.msg += obj.module + "[" + obj.activity + "]";
obj.msg += `${obj.module}[${obj.activity}]`;
}
if (this.isEnabled(levelToStr[obj.level], obj)) {
this.sendToLog.apply(this, __spreadArrays([levelToStr[obj.level], obj], data));
this.sendToLog(levelToStr[obj.level], obj, ...data);
}
};
SupertypeLogger.prototype.startContext = function (context) {
}
startContext(context) {
this.context = context;
};
}
// Save the properties in the context and return a new object that has the properties only so they can be cleared
SupertypeLogger.prototype.setContextProps = function (context) {
var reverse = {};
for (var prop in context) {
setContextProps(context) {
const reverse = {};
for (const prop in context) {
reverse[prop] = true;

@@ -144,5 +109,5 @@ this.context[prop] = context[prop];

return reverse;
};
}
// Parse log levels such as warn.activity
SupertypeLogger.prototype.setLevel = function (level) {
setLevel(level) {
var levels = level.split(';');

@@ -164,22 +129,19 @@ for (var ix = 0; ix < levels.length; ++ix) {

}
};
}
// Remove any properties recorded by setContext
SupertypeLogger.prototype.clearContextProps = function (contextToClear) {
for (var prop in contextToClear) {
clearContextProps(contextToClear) {
for (const prop in contextToClear) {
delete this.context[prop];
}
};
}
// Create a new logger and copy over it's context
SupertypeLogger.prototype.createChildLogger = function (context) {
var child = {};
for (var prop in this) {
child[prop] = this[prop];
}
createChildLogger(context) {
let child = new SupertypeLogger();
child.context = context || {};
for (var proper in this.context) {
for (let proper in this.context) {
child.context[proper] = this.context[proper];
}
return child; // bad practice but should fix
};
SupertypeLogger.prototype.formatDateTime = function (date) {
}
formatDateTime(date) {
return f(2, (date.getMonth() + 1), '/') + f(2, date.getDate(), '/') + f(4, date.getFullYear(), ' ') +

@@ -194,3 +156,3 @@ f(2, date.getHours(), ':') + f(2, date.getMinutes(), ':') + f(2, date.getSeconds(), ':') +

}
};
}
/**

@@ -203,11 +165,7 @@ * this function is designed to be replaced by the consumer of this class.

*/
SupertypeLogger.prototype.sendToLog = function (logLevel, logObject) {
var rawLogData = [];
for (var _i = 2; _i < arguments.length; _i++) {
rawLogData[_i - 2] = arguments[_i];
}
sendToLog(logLevel, logObject, ...rawLogData) {
console.log(this.prettyPrint(logLevel, logObject)); // eslint-disable-line no-console
};
SupertypeLogger.prototype.prettyPrint = function (level, json) {
var split = this.split(json, { time: 1, msg: 1, level: 1, name: 1 });
}
prettyPrint(level, json) {
let split = this.split(json, { time: 1, msg: 1, level: 1, name: 1 });
return this.formatDateTime(new Date(json.time)) + ': ' +

@@ -236,13 +194,13 @@ level.toUpperCase() + ': ' +

}
};
SupertypeLogger.prototype.split = function (json, props) {
var a = {};
var b = {};
for (var prop in json) {
}
split(json, props) {
const a = {};
const b = {};
for (const prop in json) {
(props[prop] ? b : a)[prop] = json[prop];
}
return [a, b];
};
}
// Logging is enabled if either the level threshold is met or the granular level matches
SupertypeLogger.prototype.isEnabled = function (level, obj) {
isEnabled(level, obj) {
level = strToLevel[level];

@@ -253,3 +211,3 @@ if (level >= strToLevel[this.level]) {

if (this.granularLevels) {
for (var levelr in this.granularLevels) {
for (let levelr in this.granularLevels) {
if (obj[levelr] && obj[levelr] == this.granularLevels[levelr]) {

@@ -260,6 +218,5 @@ return true;

}
};
return SupertypeLogger;
}());
}
}
exports.SupertypeLogger = SupertypeLogger;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N1cGVydHlwZUxvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsSUFBTSxVQUFVLEdBQUcsRUFBRSxFQUFFLEVBQUUsT0FBTyxFQUFFLEVBQUUsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsTUFBTSxFQUFFLEVBQUUsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxDQUFDO0FBQ2xHLElBQU0sVUFBVSxHQUFHLEVBQUUsT0FBTyxFQUFFLEVBQUUsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsTUFBTSxFQUFFLEVBQUUsRUFBRSxPQUFPLEVBQUUsRUFBRSxFQUFFLE9BQU8sRUFBRSxFQUFFLEVBQUUsQ0FBQztBQUVsRyxTQUFTLFFBQV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AgICAgbGV0IG1zZyA9ICcnO1xuICAgICAgICBjb25zdCBvYmo6IExvZ09iamVjdCA9IHtcbiAgICAgICAgICAgIHRpbWU6IChuZXcgRGF0ZSgpKS50b0lTT1N0cmluZygpLFxuICAgICAgICAgICAgbXNnOiAnJyxcbiAgICAgICAgICAgIGxldmVsOiAnaW5mbycsIC8vZGVmYXVsdCBpbmZvXG4gICAgICAgICAgICBfX2Ftb3JwaGljQ29udGV4dDoge31cbiAgICAgICAgfTtcblxuICAgICAgICBjb25zdCBhbW9ycGhpY0NvbnRleHQgPSB7fTtcbiAgICAgICAgLy8gQ29weSBhbW9ycGhpYyBjb250ZXh0IGludG8gdGhlIGRhdGFcbiAgICAgICAgZm9yIChjb25zdCBwcm9wIGluIHRoaXMuY29udGV4dCkge1xuICAgICAgICAgICAgb2JqW3Byb3BdID0gdGhpcy5jb250ZXh0W3Byb3BdO1xuICAgICAgICAgICAgYW1vcnBoaWNDb250ZXh0W3Byb3BdID0gdGhpcy5jb250ZXh0W3Byb3BdO1xuICAgICAgICB9XG5cbiAgICAgICAgb2JqLmxldmVsID0gbGV2ZWw7XG4gICAgICAgIG9iai5fX2Ftb3JwaGljQ29udGV4dCA9IGFtb3JwaGljQ29udGV4dDtcblxuICAgICAgICBkYXRhLmZvckVhY2goKGFyZywgaW5kZXgpID0+IHtcbiAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCAmJiBpc09iamVjdChhcmcpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBwcm9wZXIgaW4gYXJnKSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wZXJdID0gYXJnW3Byb3Blcl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbXNnICs9IGAke2FyZ30gYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKG9iai5tc2cubGVuZ3RoKSB7XG4gICAgICAgICAgICBvYmoubXNnICs9ICcgJztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtc2cubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAob2JqLm1vZHVsZSAmJiBvYmouYWN0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICBvYmoubXNnICs9IGAke29iai5tb2R1bGV9WyR7b2JqLmFjdGl2aXR5fV0gLSBgO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBvYmoubXNnICs9IG1zZztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChvYmoubW9kdWxlICYmIG9iai5hY3Rpdml0eSkge1xuICAgICAgICAgICAgb2JqLm1zZyArPSBgJHtvYmoubW9kdWxlfVske29iai5hY3Rpdml0eX1dYDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmlzRW5hYmxlZChsZXZlbFRvU3RyW29iai5sZXZlbF0sIG9iaikpIHtcbiAgICAgICAgICAgIHRoaXMuc2VuZFRvTG9nKGxldmVsVG9TdHJbb2JqLmxldmVsXSwgb2JqLCAuLi5kYXRhKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHN0YXJ0Q29udGV4dChjb250ZXh0KSB7XG4gICAgICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gICAgfVxuXG4gICAgLy8gU2F2ZSB0aGUgcHJvcGVydGllcyBpbiB0aGUgY29udGV4dCBhbmQgcmV0dXJuIGEgbmV3IG9iamVjdCB0aGF0IGhhcyB0aGUgcHJvcGVydGllcyBvbmx5IHNvIHRoZXkgY2FuIGJlIGNsZWFyZWRcbiAgICBzZXRDb250ZXh0UHJvcHMoY29udGV4dCkge1xuICAgICAgICBjb25zdCByZXZlcnNlID0ge307XG5cbiAgICAgICAgZm9yIChjb25zdCBwcm9wIGluIGNvbnRleHQpIHtcbiAgICAgICAgICAgIHJldmVyc2VbcHJvcF0gPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5jb250ZXh0W3Byb3BdID0gY29udGV4dFtwcm9wXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXZlcnNlO1xuICAgIH1cbiAgICAvLyBQYXJzZSBsb2cgbGV2ZWxzIHN1Y2ggYXMgd2Fybi5hY3Rpdml0eVxuICAgIHNldExldmVsKGxldmVsKSB7XG4gICAgICAgIHZhciBsZXZlbHMgPSBsZXZlbC5zcGxpdCgnOycpO1xuXG4gICAgICAgIGZvciAodmFyIGl4ID0gMDsgaXggPCBsZXZlbHMubGVuZ3RoOyArK2l4KSB7XG4gICAgICAgICAgICB2YXIgbGV2ZWxhID0gbGV2ZWxzW2l4XTtcblxuICAgICAgICAgICAgaWYgKGxldmVsYS5tYXRjaCgvOi8pKSB7XG4gICAgICAgICAgICAgICAgaWYgKGxldmVsc1tpeF0ubWF0Y2goLyguKik6KC4qKS8pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZ3JhbnVsYXJMZXZlbHNbUmVnRXhwLiQxXSA9IHRoaXMuZ3JhbnVsYXJMZXZlbHNbUmVnRXhwLiQxXSB8fCB7fTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ncmFudWxhckxldmVsc1tSZWdFeHAuJDFdID0gUmVnRXhwLiQyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sZXZlbCA9IGxldmVsc1tpeF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sZXZlbCA9IGxldmVsYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJlbW92ZSBhbnkgcHJvcGVydGllcyByZWNvcmRlZCBieSBzZXRDb250ZXh0XG4gICAgY2xlYXJDb250ZXh0UHJvcHMoY29udGV4dFRvQ2xlYXIpIHtcbiAgICAgICAgZm9yIChjb25zdCBwcm9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WU6IDF9KTtcblxuICAgICAgICByZXR1cm4gdGhpcy5mb3JtYXREYXRlVGltZShuZXcgRGF0ZShqc29uLnRpbWUpKSArICc6ICcgK1xuICAgICAgICAgICAgbGV2ZWwudG9VcHBlckNhc2UoKSArICc6ICcgK1xuICAgICAgICAgICAgYWRkQ29sb25JZlRva2VuKHNwbGl0WzFdLm5hbWUsICc6ICcpICtcbiAgICAgICAgICAgIGFkZENvbG9uSWZUb2tlbihzcGxpdFsxXS5tc2csICc6ICcpICtcbiAgICAgICAgICAgIHh5KHNwbGl0WzBdKTtcblxuICAgICAgICBmdW5jdGlvbiBhZGRDb2xvbklmVG9rZW4gKHRva2VuLCBjb2xvbkFuZFNwYWNlKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4gKyBjb2xvbkFuZFNwYWNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiB4eShqKSB7XG4gICAgICAgICAgICB2YXIgc3RyID0gJyc7XG4gICAgICAgICAgICB2YXIgc2VwID0gJyc7XG5cbiAgICAgICAgICAgIGZvciAodmFyIHByb3AgaW4gaikge1xuICAgICAgICAgICAgICAgIHN0ciArPSBzZXAgKyBwcm9wICsgJz0nICsgSlNPTi5zdHJpbmdpZnkoaltwcm9wXSk7XG4gICAgICAgICAgICAgICAgc2VwID0gJyAnO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc3RyLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJygnICsgc3RyICsgJyknO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gJyc7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwcml2YXRlIHNwbGl0KGpzb24sIHByb3BzKTogYW55W10ge1xuICAgICAgICBjb25zdCBhID0ge307XG4gICAgICAgIGNvbnN0IGIgPSB7fTtcblxuICAgICAgICBmb3IgKGNvbnN0IHByb3AgaW4ganNvbikge1xuICAgICAgICAgICAgKHByb3BzW3Byb3BdID8gYiA6IGEpW3Byb3BdID0ganNvbltwcm9wXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbYSwgYl07XG4gICAgfVxuXG4gICAgLy8gTG9nZ2luZyBpcyBlbmFibGVkIGlmIGVpdGhlciB0aGUgbGV2ZWwgdGhyZXNob2xkIGlzIG1ldCBvciB0aGUgZ3JhbnVsYXIgbGV2ZWwgbWF0Y2hlc1xuICAgIHByaXZhdGUgaXNFbmFibGVkKGxldmVsLCBvYmopIHtcbiAgICAgICAgbGV2ZWwgPSBzdHJUb0xldmVsW2xldmVsXTtcblxuICAgICAgICBpZiAobGV2ZWwgPj0gc3RyVG9MZXZlbFt0aGlzLmxldmVsXSkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5ncmFudWxhckxldmVscykge1xuICAgICAgICAgICAgZm9yIChsZXQgbGV2ZWxyIGluIHRoaXMuZ3JhbnVsYXJMZXZlbHMpIHtcbiAgICAgICAgICAgICAgICBpZiAob2JqW2xldmVscl0gJiYgb2JqW2xldmVscl0gPT0gdGhpcy5ncmFudWxhckxldmVsc1tsZXZlbHJdKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn0iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3VwZXJ0eXBlTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1N1cGVydHlwZUxvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxNQUFNLFVBQVUsR0FBRyxFQUFFLEVBQUUsRUFB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bW9ycGhpY0NvbnRleHQgPSB7fTtcbiAgICAgICAgLy8gQ29weSBhbW9ycGhpYyBjb250ZXh0IGludG8gdGhlIGRhdGFcbiAgICAgICAgZm9yIChjb25zdCBwcm9wIGluIHRoaXMuY29udGV4dCkge1xuICAgICAgICAgICAgb2JqW3Byb3BdID0gdGhpcy5jb250ZXh0W3Byb3BdO1xuICAgICAgICAgICAgYW1vcnBoaWNDb250ZXh0W3Byb3BdID0gdGhpcy5jb250ZXh0W3Byb3BdO1xuICAgICAgICB9XG5cbiAgICAgICAgb2JqLmxldmVsID0gbGV2ZWw7XG4gICAgICAgIG9iai5fX2Ftb3JwaGljQ29udGV4dCA9IGFtb3JwaGljQ29udGV4dDtcblxuICAgICAgICBkYXRhLmZvckVhY2goKGFyZywgaW5kZXgpID0+IHtcbiAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCAmJiBpc09iamVjdChhcmcpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBwcm9wZXIgaW4gYXJnKSB7XG4gICAgICAgICAgICAgICAgICAgIG9ialtwcm9wZXJdID0gYXJnW3Byb3Blcl07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbXNnICs9IGAke2FyZ30gYDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYgKG9iai5tc2cubGVuZ3RoKSB7XG4gICAgICAgICAgICBvYmoubXNnICs9ICcgJztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChtc2cubGVuZ3RoKSB7XG4gICAgICAgICAgICBpZiAob2JqLm1vZHVsZSAmJiBvYmouYWN0aXZpdHkpIHtcbiAgICAgICAgICAgICAgICBvYmoubXNnICs9IGAke29iai5tb2R1bGV9WyR7b2JqLmFjdGl2aXR5fV0gLSBgO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBvYmoubXNnICs9IG1zZztcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChvYmoubW9kdWxlICYmIG9iai5hY3Rpdml0eSkge1xuICAgICAgICAgICAgb2JqLm1zZyArPSBgJHtvYmoubW9kdWxlfVske29iai5hY3Rpdml0eX1dYDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmlzRW5hYmxlZChsZXZlbFRvU3RyW29iai5sZXZlbF0sIG9iaikpIHtcbiAgICAgICAgICAgIHRoaXMuc2VuZFRvTG9nKGxldmVsVG9TdHJbb2JqLmxldmVsXSwgb2JqLCAuLi5kYXRhKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHN0YXJ0Q29udGV4dChjb250ZXh0KSB7XG4gICAgICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gICAgfVxuXG4gICAgLy8gU2F2ZSB0aGUgcHJvcGVydGllcyBpbiB0aGUgY29udGV4dCBhbmQgcmV0dXJuIGEgbmV3IG9iamVjdCB0aGF0IGhhcyB0aGUgcHJvcGVydGllcyBvbmx5IHNvIHRoZXkgY2FuIGJlIGNsZWFyZWRcbiAgICBzZXRDb250ZXh0UHJvcHMoY29udGV4dCkge1xuICAgICAgICBjb25zdCByZXZlcnNlID0ge307XG5cbiAgICAgICAgZm9yIChjb25zdCBwcm9wIGluIGNvbnRleHQpIHtcbiAgICAgICAgICAgIHJldmVyc2VbcHJvcF0gPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5jb250ZXh0W3Byb3BdID0gY29udGV4dFtwcm9wXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiByZXZlcnNlO1xuICAgIH1cbiAgICAvLyBQYXJzZSBsb2cgbGV2ZWxzIHN1Y2ggYXMgd2Fybi5hY3Rpdml0eVxuICAgIHNldExldmVsKGxldmVsKSB7XG4gICAgICAgIHZhciBsZXZlbHMgPSBsZXZlbC5zcGxpdCgnOycpO1xuXG4gICAgICAgIGZvciAodmFyIGl4ID0gMDsgaXggPCBsZXZlbHMubGVuZ3RoOyArK2l4KSB7XG4gICAgICAgICAgICB2YXIgbGV2ZWxhID0gbGV2ZWxzW2l4XTtcblxuICAgICAgICAgICAgaWYgKGxldmVsYS5tYXRjaCgvOi8pKSB7XG4gICAgICAgICAgICAgICAgaWYgKGxldmVsc1tpeF0ubWF0Y2goLyguKik6KC4qKS8pKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZ3JhbnVsYXJMZXZlbHNbUmVnRXhwLiQxXSA9IHRoaXMuZ3JhbnVsYXJMZXZlbHNbUmVnRXhwLiQxXSB8fCB7fTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ncmFudWxhckxldmVsc1tSZWdFeHAuJDFdID0gUmVnRXhwLiQyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sZXZlbCA9IGxldmVsc1tpeF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sZXZlbCA9IGxldmVsYTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIFJlbW92ZSBhbnkgcHJvcGVydGllcyByZWNvcmRlZCBieSBzZXRDb250ZXh0XG4gICAgY2xlYXJDb250ZXh0UHJvcHMoY29udGV4dFRvQ2xlYXIpIHtcbiAgICAgICAgZm9yIChjb25zdCBwcm9wIGluIGNvbnRleHRUb0NsZWFyKSB7XG4gICAgICAgICAgICBkZWxldGUgdGhpcy5jb250ZXh0W3Byb3BdO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLy8gQ3JlYXRlIGEgbmV3IGxvZ2dlciBhbmQgY29weSBvdmVyIGl0J3MgY29udGV4dFxuICAgIGNyZWF0ZUNoaWxkTG9nZ2VyKGNvbnRleHQpOiBTdXBlcnR5cGVMb2dnZXIge1xuICAgICAgICBsZXQgY2hpbGQgPSBuZXcgU3VwZXJ0eXBlTG9nZ2VyKCk7XG4gICAgICAgIFxuICAgICAgICBjaGlsZC5jb250ZXh0ID0gY29udGV4dCB8fCB7fTtcblxuICAgICAgICBmb3IgKGxldCBwcm9wZXIgaW4gdGhpcy5jb250ZXh0KSB7XG4gICAgICAgICAgICBjaGlsZC5jb250ZXh0W3Byb3Blcl0gPSB0aGlzLmNvbnRleHRbcHJvcGVyXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBjaGlsZCBhcyBTdXBlcnR5cGVMb2dnZXI7IC8vIGJhZCBwcmFjdGljZSBidXQgc2hvdWxkIGZpeFxuICAgIH1cblxuICAgIGZvcm1hdERhdGVUaW1lKGRhdGUpOiBzdHJpbmcge1xuICAgICAgICByZXR1cm4gZigyLCAoZGF0ZS5nZXRNb250aCgpICsgMSksICcvJykgKyBmKDIsIGRhdGUuZ2V0RGF0ZSgpLCAnLycpICsgZig0LCBkYXRlLmdldEZ1bGxZZWFyKCksICcgJykgK1xuICAgICAgICAgICAgZigyLCBkYXRlLmdldEhvdXJzKCksICc6JykgKyBmKDIsIGRhdGUuZ2V0TWludXRlcygpLCAnOicpICsgZigyLCBkYXRlLmdldFNlY29uZHMoKSwgJzonKSArXG4gICAgICAgICAgICBmKDMsIGRhdGUuZ2V0TWlsbGlzZWNvbmRzKCkpICsgJyBHTVQnICsgKDAgLSBkYXRlLmdldFRpbWV6b25lT2Zmc2V0KCkgLyA2MCk7XG5cbiAgICAgICAgZnVuY3Rpb24gZih6LCBkLCBzPykge1xuICAgICAgICAgICAgd2hpbGUgKFN0cmluZyhkKS5sZW5ndGggPCB6KSB7XG4gICAgICAgICAgICAgICAgZCA9ICcwJyArIGQ7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBkICsgKHMgfHwgJycpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogdGhpcyBmdW5jdGlvbiBpcyBkZXNpZ25lZCB0byBiZSByZXBsYWNlZCBieSB0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gICAgICAgICAgaWYgKHRva2VuKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuICsgY29sb25BbmRTcGFjZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24geHkoaikge1xuICAgICAgICAgICAgdmFyIHN0ciA9ICcnO1xuICAgICAgICAgICAgdmFyIHNlcCA9ICcnO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBwcm9wIGluIGopIHtcbiAgICAgICAgICAgICAgICBzdHIgKz0gc2VwICsgcHJvcCArICc9JyArIEpTT04uc3RyaW5naWZ5KGpbcHJvcF0pO1xuICAgICAgICAgICAgICAgIHNlcCA9ICcgJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHN0ci5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICcoJyArIHN0ciArICcpJztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcHJpdmF0ZSBzcGxpdChqc29uLCBwcm9wcyk6IGFueVtdIHtcbiAgICAgICAgY29uc3QgYSA9IHt9O1xuICAgICAgICBjb25zdCBiID0ge307XG5cbiAgICAgICAgZm9yIChjb25zdCBwcm9wIGluIGpzb24pIHtcbiAgICAgICAgICAgIChwcm9wc1twcm9wXSA/IGIgOiBhKVtwcm9wXSA9IGpzb25bcHJvcF07XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gW2EsIGJdO1xuICAgIH1cblxuICAgIC8vIExvZ2dpbmcgaXMgZW5hYmxlZCBpZiBlaXRoZXIgdGhlIGxldmVsIHRocmVzaG9sZCBpcyBtZXQgb3IgdGhlIGdyYW51bGFyIGxldmVsIG1hdGNoZXNcbiAgICBwcml2YXRlIGlzRW5hYmxlZChsZXZlbCwgb2JqKSB7XG4gICAgICAgIGxldmVsID0gc3RyVG9MZXZlbFtsZXZlbF07XG5cbiAgICAgICAgaWYgKGxldmVsID49IHN0clRvTGV2ZWxbdGhpcy5sZXZlbF0pIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuZ3JhbnVsYXJMZXZlbHMpIHtcbiAgICAgICAgICAgIGZvciAobGV0IGxldmVsciBpbiB0aGlzLmdyYW51bGFyTGV2ZWxzKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9ialtsZXZlbHJdICYmIG9ialtsZXZlbHJdID09IHRoaXMuZ3JhbnVsYXJMZXZlbHNbbGV2ZWxyXSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59Il19
{
"name": "@haventech/supertype",
"description": "A type system for classical inheritence, mix-ins and composition.",
"version": "5.1.0-beta.0",
"version": "6.0.0-beta.0",
"main": "dist/index.js",

@@ -10,3 +10,3 @@ "types": "dist/index.d.ts",

"@haventech/amorphic-contracts": "^0.2.0",
"nconf": "^0.11.0",
"nconf": "^0.12.0",
"reflect-metadata": "^0.1.12"

@@ -30,4 +30,3 @@ },

"lint": "eslint .",
"debug:tests": "mocha --inspect-brk test/animals.js",
"debug:tstests": "mocha --inspect-brk test/typescript/*.js",
"test:ts:debug": "mocha --inspect-brk --require ts-node/register test/typescript/*",
"test:ts": "mocha --require ts-node/register test/typescript/*",

@@ -34,0 +33,0 @@ "clean": "rm -rf dist/",

export { Supertype } from './Supertype';
import { ObjectTemplate } from './ObjectTemplate';
import 'reflect-metadata';
/**

@@ -125,3 +123,3 @@ *

function getName() {
return target.toString().match(/function ([^(]*)/)[1];
return ObjectTemplate.getName(target);
}

@@ -148,14 +146,4 @@ function getDictionary() {

target.__amorphicprops__ = target.hasOwnProperty('__amorphicprops__') ? target.__amorphicprops__ : {};
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') {
let type = props.type;
if (typeof props.getType === 'function') {
target.__deferredType__ = target.hasOwnProperty('__deferredType__') ? target.__deferredType__ : {};

@@ -174,9 +162,2 @@ target.__deferredType__[targetKey] = props.getType;

}
if (reflectionType === Array) {
props.type = Array;
props.of = type;
}
else {
props.type = type;
}
target.__amorphicprops__[targetKey] = props;

@@ -183,0 +164,0 @@ };

@@ -418,3 +418,3 @@ import * as serializer from './serializer';

*/
static createIfNeeded(template?, thisObj?) {
static createIfNeeded(template?, thisObj?) {
if (template.__createParameters__) {

@@ -453,4 +453,4 @@ const createParameters = template.__createParameters__;

var template = this.__templates__[ix];
this.__dictionary__[constructorName(template)] = template;
this.__templatesToInject__[constructorName(template)] = template;
this.__dictionary__[ObjectTemplateStatic._getName(template)] = template;
this.__templatesToInject__[ObjectTemplateStatic._getName(template)] = template;
processDeferredTypes(template);

@@ -461,3 +461,3 @@ }

var template = this.__dictionary__[templateName1];
const parentTemplateName = constructorName(Object.getPrototypeOf(template.prototype).constructor);
const parentTemplateName = ObjectTemplateStatic._getName(Object.getPrototypeOf(template.prototype).constructor);
template.__shadowParent__ = this.__dictionary__[parentTemplateName];

@@ -500,8 +500,6 @@ if (template.__shadowParent__) {

return this.__dictionary__;
}
function constructorName(constructor) {
const namedFunction = constructor.toString().match(/function ([^(]*)/);
return namedFunction ? namedFunction[1] : null;
}
static getName(object) {
return ObjectTemplateStatic._getName(object);
}

@@ -544,82 +542,2 @@

/**
* Used by template setup to create an property descriptor for use by the constructor
*
* @param {unknown} propertyName is the name of the property
* @param {unknown} defineProperty is the property descriptor passed to the template
* @param {unknown} objectProperties is all properties that will be processed manually. A new property is
* added to this if the property needs to be initialized by value
* @param {unknown} defineProperties is all properties that will be passed to Object.defineProperties
* A new property will be added to this object
*
* @private
*/
static _setupProperty(propertyName, defineProperty, objectProperties, defineProperties) {
// Determine whether value needs to be re-initialized in constructor
const value = defineProperty.value;
const byValue = value && typeof (value) !== 'number' && typeof (value) !== 'string';
if (byValue || !Object.defineProperties || defineProperty.get || defineProperty.set) {
objectProperties[propertyName] = {
init: defineProperty.value,
type: defineProperty.type,
of: defineProperty.of,
byValue
};
delete defineProperty.value;
}
// When a super class based on objectTemplate don't transport properties
defineProperty.toServer = false;
defineProperty.toClient = false;
defineProperties[propertyName] = defineProperty;
// Add getters and setters
if (defineProperty.get || defineProperty.set) {
const userSetter = defineProperty.set;
defineProperty.set = (function d() {
// Use a closure to record the property name which is not passed to the setter
const prop = propertyName;
return function c(value) {
if (userSetter) {
value = userSetter.call(this, value);
}
if (!defineProperty.isVirtual) {
this[`__${prop}`] = value;
}
};
})();
const userGetter = defineProperty.get;
defineProperty.get = (function get() {
// Use closure to record property name which is not passed to the getter
const prop = propertyName;
return function b() {
if (userGetter) {
if (defineProperty.isVirtual) {
return userGetter.call(this, undefined);
}
return userGetter.call(this, this[`__${prop}`]);
}
return this[`__${prop}`];
};
})();
if (!defineProperty.isVirtual) {
defineProperties[`__${propertyName}`] = { enumerable: false, writable: true };
}
delete defineProperty.value;
delete defineProperty.writable;
}
}
/**
* Clone an object created from an ObjectTemplate

@@ -754,67 +672,3 @@ * Used only within supertype (see copyObject for general copy)

/**
/**
* Find the right subclass to instantiate by either looking at the
* declared list in the subClasses define property or walking through
* the subclasses of the declared template
*
* @param {unknown} template unknown
* @param {unknown} objId unknown
* @param {unknown} defineProperty unknown
* @returns {*}
* @private
*/
static _resolveSubClass(template, objId, defineProperty) {
let templateName = '';
if (objId.match(/-([A-Za-z0-9_:]*)-/)) {
templateName = RegExp.$1;
}
// Resolve template subclass for polymorphic instantiation
if (defineProperty && defineProperty.subClasses && objId != 'anonymous)') {
if (templateName) {
for (let ix = 0; ix < defineProperty.subClasses.length; ++ix) {
if (templateName == defineProperty.subClasses[ix].__name__) {
template = defineProperty.subClasses[ix];
}
}
}
}
else {
const subClass = this._findSubClass(template, templateName);
if (subClass) {
template = subClass;
}
}
return template;
}
/**
* Walk recursively through extensions of template via __children__
* looking for a name match
*
* @param {unknown} template unknown
* @param {unknown} templateName unknown
* @returns {*}
* @private
*/
static _findSubClass(template, templateName) {
if (template.__name__ == templateName) {
return template;
}
for (let ix = 0; ix < template.__children__.length; ++ix) {
const subClass = this._findSubClass(template.__children__[ix], templateName);
if (subClass) {
return subClass;
}
}
return null;
}
/**
* Return the highest level template

@@ -828,3 +682,3 @@ *

*/
static _getBaseClass(template) {
static _getBaseClass(template) {
while (template.__parent__) {

@@ -837,15 +691,15 @@ template = template.__parent__;

/**
* An overridable function used to create an object from a template and optionally
* manage the caching of that object (used by derivative type systems). It
* preserves the original id of an object
*
* @param {unknown} template of object
* @param {unknown} objId and id (if present)
* @param {unknown} defineProperty unknown
* @returns {*}
* @private
*/
/**
* An overridable function used to create an object from a template and optionally
* manage the caching of that object (used by derivative type systems). It
* preserves the original id of an object
*
* @param {unknown} template of object
* @param {unknown} objId and id (if present)
* @param {unknown} defineProperty unknown
* @returns {*}
* @private
*/
static _createEmptyObject(template, objId, defineProperty) {
template = this._resolveSubClass(template, objId, defineProperty);
template = ObjectTemplateStatic._resolveSubClass(template, objId, defineProperty);

@@ -1232,3 +1086,3 @@ const oldStashObject = this._stashObject;

objectTemplate._setupProperty(propertyName, defineProperty, objectProperties, defineProperties, parentTemplate, createProperties);
ObjectTemplateStatic._setupProperty(propertyName, defineProperty, objectProperties, defineProperties);
defineProperty.sourceTemplate = templateName;

@@ -1239,2 +1093,160 @@ }

class ObjectTemplateStatic {
/**
* Getting the name of the object
*
* @param {unknown} object object we are getting the name for
* @returns a string of the name of the object or null
*/
static _getName(object) {
if (typeof object === 'function') {
return object.name;
}
if (object.constructor) {
return object.constructor.name;
}
return null;
}
/**
* Used by template setup to create an property descriptor for use by the constructor
*
* @param {unknown} propertyName is the name of the property
* @param {unknown} defineProperty is the property descriptor passed to the template
* @param {unknown} objectProperties is all properties that will be processed manually. A new property is
* added to this if the property needs to be initialized by value
* @param {unknown} defineProperties is all properties that will be passed to Object.defineProperties
* A new property will be added to this object
*
*/
static _setupProperty(propertyName, defineProperty, objectProperties, defineProperties) {
// Determine whether value needs to be re-initialized in constructor
const value = defineProperty.value;
const byValue = value && typeof (value) !== 'number' && typeof (value) !== 'string';
if (byValue || !Object.defineProperties || defineProperty.get || defineProperty.set) {
objectProperties[propertyName] = {
init: defineProperty.value,
type: defineProperty.type,
of: defineProperty.of,
byValue
};
delete defineProperty.value;
}
// When a super class based on objectTemplate don't transport properties
defineProperty.toServer = false;
defineProperty.toClient = false;
defineProperties[propertyName] = defineProperty;
// Add getters and setters
if (defineProperty.get || defineProperty.set) {
const userSetter = defineProperty.set;
defineProperty.set = (function d() {
// Use a closure to record the property name which is not passed to the setter
const prop = propertyName;
return function c(value) {
if (userSetter) {
value = userSetter.call(this, value);
}
if (!defineProperty.isVirtual) {
this[`__${prop}`] = value;
}
};
})();
const userGetter = defineProperty.get;
defineProperty.get = (function get() {
// Use closure to record property name which is not passed to the getter
const prop = propertyName;
return function b() {
if (userGetter) {
if (defineProperty.isVirtual) {
return userGetter.call(this, undefined);
}
return userGetter.call(this, this[`__${prop}`]);
}
return this[`__${prop}`];
};
})();
if (!defineProperty.isVirtual) {
defineProperties[`__${propertyName}`] = { enumerable: false, writable: true };
}
delete defineProperty.value;
delete defineProperty.writable;
}
}
/**
* Find the right subclass to instantiate by either looking at the
* declared list in the subClasses define property or walking through
* the subclasses of the declared template
*
* @param {unknown} template unknown
* @param {unknown} objId unknown
* @param {unknown} defineProperty unknown
* @returns {*}
*/
static _resolveSubClass(template, objId, defineProperty) {
let templateName = '';
if (objId.match(/-([A-Za-z0-9_:]*)-/)) {
templateName = RegExp.$1;
}
// Resolve template subclass for polymorphic instantiation
if (defineProperty && defineProperty.subClasses && objId != 'anonymous)') {
if (templateName) {
for (let ix = 0; ix < defineProperty.subClasses.length; ++ix) {
if (templateName == defineProperty.subClasses[ix].__name__) {
template = defineProperty.subClasses[ix];
}
}
}
}
else {
const subClass = this._findSubClass(template, templateName);
if (subClass) {
template = subClass;
}
}
return template;
}
/**
* Walk recursively through extensions of template via __children__
* looking for a name match
*
* @param {unknown} template unknown
* @param {unknown} templateName unknown
* @returns {*}
*/
static _findSubClass(template, templateName) {
if (template.__name__ == templateName) {
return template;
}
for (let ix = 0; ix < template.__children__.length; ++ix) {
const subClass = this._findSubClass(template.__children__[ix], templateName);
if (subClass) {
return subClass;
}
}
return null;
}
}
function bindParams(templateName, objectTemplate, functionProperties,

@@ -1241,0 +1253,0 @@ defineProperties, parentTemplate, propertiesOrTemplate,

@@ -69,3 +69,3 @@ /**

var obj;
let obj;

@@ -72,0 +72,0 @@ if (creator) {

import {ObjectTemplate} from './ObjectTemplate';
import * as serializer from './serializer';
function constructorName(constructor) {
var namedFunction = constructor.toString().match(/function ([^(]*)/);
return namedFunction ? namedFunction[1] : null;
}
export type Constructable = new (...args: any[]) => {};

@@ -70,3 +65,3 @@

if (!template) {
throw new Error(constructorName(Object.getPrototypeOf(this).constructor) + ' missing @supertypeClass');
throw new Error(ObjectTemplate.getName(Object.getPrototypeOf(this).constructor) + ' missing @supertypeClass');
}

@@ -123,3 +118,3 @@

createCopy(creator) {
var obj = this;
const obj = this;
return ObjectTemplate.fromPOJO(obj, obj.__template__, null, null, undefined, null, null, creator);

@@ -126,0 +121,0 @@ }

@@ -166,8 +166,4 @@ const levelToStr = { 60: 'fatal', 50: 'error', 40: 'warn', 30: 'info', 20: 'debug', 10: 'trace' };

createChildLogger(context): SupertypeLogger {
let child: { [key: string]: any } = {};
for (let prop in this) {
child[prop] = this[prop];
}
let child = new SupertypeLogger();
child.context = context || {};

@@ -174,0 +170,0 @@

Sorry, the diff of this file is too big to display

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