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

attribute meta description

  • 4.1.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
increased by47.48%
Maintainers
1
Weekly downloads
 
Created
Source

npm License minified size downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

model-attributes

attribute meta description

const { createAttributes } from 'model-attributes';

const attributes = ma.createAttributes({
  att1: {},
  att2: { datault: 2}
});

const object = {};

ma.setAttributes(object, attributes, {
  att1: 'value1'
});

console.log(object.att1); // value1
console.log(object.att2); // 2

API

Table of Contents

setAttributes

Copies attribute values from a source object into a destination object.

Parameters

  • dest Object target object to be modified
  • atts Object attribute definitions to be used
  • src Object origin of the data to be copied
  • cb function callback to be executed for each copied value
  • prefix string name prefix used for all attributes

Returns void

getAttribute

Delivers a attribute value for a given attribute name

Parameters

  • object Object to query
  • atts Object attribute definitions to be used
  • path string attribute name

Returns Any attribute value

getAttributes

Retrive attribute values from an object.

Parameters

Returns Object values

createAttributes

Create attributes from its definition.

Parameters

Returns Object attributes

mergeAttributes

Merge attribute definitions.

Parameters

  • dest Object attribute definitions to be used also the merge target
  • atts Object attribute definitions to be used

Returns Object merged definitions (dest)

install

With npm do:

npm install model-attributes

license

BSD-2-Clause

Keywords

FAQs

Package last updated on 28 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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