New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@brave-js/inscriber

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brave-js/inscriber

Class with property dependencies

  • 0.1.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

@brave-js/inscriber

A Simple Javascript Class which is carved out with some features to offer the property bindings for the instances

NPM version gzip size

Design

  • @brave-js/inscriber distinct javascript class

API

The scope of the API works only within the current object / instance of the class

compute

Enables the usage of computed property within the current object / instance of the class

Parameters

  • name name of the computed property

  • properties array of properties that exists in the current object

  • method callback function which to calculate the value of the computed property

Usage

import Inscriber from '@brave-js/inscriber';

// Create the `Person` Class extending the `Inscriber` Class
class Person extends Inscriber {
    constructor(obj) {
        super();
        this.firstName = obj.firstName;
        this.lastName = obj.lastName;
        return this;
    }
}

// Instantiate the `Person` Object
var person = new Person({
    firstName: 'John',
    lastName: 'Doe'
});

// Add Computed Property `fullName` to the person object
person.compute('fullName', ['firstName', 'lastName'], function() {
    return `${this.firstName} ${this.lastName}`;
});

// Access Computed Property `fullName` from the person object
person.fullName // => Prints `John Doe`

// Now any change to the properties `firstName` & `lastName` will be derived in `fullName`
person.firstName = 'Mr';
person.lastName = 'Rob';

person.fullName // => Prints `Mr Rob`

Keywords

FAQs

Package last updated on 27 Apr 2020

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