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

starhs-models

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

starhs-models - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

36

dist/starh.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.StaRHType = exports.StaRH = undefined;
exports.PersonType = exports.StaRHType = exports.StaRH = undefined;

@@ -40,3 +40,3 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

/**
* @param {{from: string, to: string, amount: number, message: string}} fields
* @param {{from: PersonType, to: PersonType, amount: number, message: string}} fields
*/

@@ -53,4 +53,4 @@ function StaRH(fields) {

(0, _tcomb.String)(from);
(0, _tcomb.String)(to);
PersonType(from);
PersonType(to);
PositiveIntegerType(amount);

@@ -74,4 +74,10 @@ (0, _tcomb.String)(message);

return (0, _lodash.merge)(_get(StaRH.prototype.__proto__ || Object.getPrototypeOf(StaRH.prototype), 'toJSON', this).call(this), {
from: this.from,
to: this.to,
from: {
name: this.from.name,
avatar: this.from.avatar.toString()
},
to: {
name: this.to.name,
avatar: this.to.avatar.toString()
},
amount: this.amount,

@@ -83,3 +89,3 @@ message: this.message

/**
* @param {{from: string, to: string, amount: number, message: string}} data
* @param {{from: {name: string, avatar: string}, to: {name: string, avatar: string}, amount: number, message: string}} data
* @returns {StaRH}

@@ -91,3 +97,14 @@ */

value: function fromJSON(data) {
return new StaRH(data);
return new StaRH({
from: {
name: data.from.name,
avatar: new _uri2.default(data.from.avatar)
},
to: {
name: data.to.name,
avatar: new _uri2.default(data.to.avatar)
},
amount: data.amount,
message: data.message
});
}

@@ -111,2 +128,3 @@

return x instanceof StaRH;
});
});
var PersonType = exports.PersonType = (0, _tcomb.struct)({ name: _tcomb.String, avatar: _uri2.default.Type }, 'PersonType');
{
"name": "starhs-models",
"version": "4.0.0",
"version": "4.1.0",
"description": "Shared models for the staRHs API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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