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

model-attributes

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

model-attributes - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

8

lib/attributes.js
/* jslint node: true, esnext: true */
'use strict';
const types = require('./types');

@@ -8,3 +9,2 @@ function setAttributes(dest, atts, src = {}, cb = (ca, path, value) => {}, prefix = '') {

const ca = atts[name];
//ca.name = name;

@@ -56,4 +56,8 @@ if (ca.attributes) {

module.exports.createAttributes = function (definitions) {
Object.keys(definitions).forEach(name => definitions[name].name = name);
Object.keys(definitions).forEach(name => {
const d = definitions[name];
d.name = name;
d.type = types.getType(d.type);
});
return definitions;
};

@@ -7,2 +7,3 @@ /* jslint node: true, esnext: true */

function DeclareType(name, options) {
options.name = name;
if (options.parent) {

@@ -25,14 +26,20 @@ options.parent = types[options.parent];

DeclareType('blob', {
parent: 'base',
description: 'raw bytes'
});
DeclareType('unsigned-integer', {
parent: 'base',
min: 0
minValue: 0
});
DeclareType('port', {
DeclareType('ip-port', {
parent: 'unsigned-integer',
description: 'ip port number',
max: 65535
maxValue: 65535
});
DeclareType('duration', {
parent: 'base',
description: 'time duration in seconds',

@@ -43,1 +50,5 @@ toString(value) {

});
module.exports.getType = function(name) {
return types[name];
}
{
"name": "model-attributes",
"version": "1.2.0",
"version": "1.3.0",
"description": "attribute meta description",

@@ -5,0 +5,0 @@ "keywords": [

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