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

function-properties

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-properties

Add properties to functions using Proxies for API documenation and other stuffs

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

function-properties Build Status

Add properties to functions using Proxies for API documenation and other stuffs.

Useful for libraries w/ a need to deliver convenient API access.

Example

const functionProperties = require('function-properties');

var exampleFunc = function(obj, setting) {};

var api = {
  api: {
    param1: {
      type: 'Object',
      name: 'obj',
      description: 'src Object to wrap w/ interface.',
      required: true,
    },
    param2: {
      type: 'Boolean',
      name: 'setting',
      default: true,
      description: 'By default returns a new Object and does not modify the original.',
    },
    return: {
      type: 'Object',
      description: 'Returned Object is wrapped w/ the following properties and methods.',
      properties: {},
      methods: {
        forEach: {
          desciption: '',
        },
        map: {
          desciption: '',
        }
      }
    },
  }
};

var $exampleFunc = functionProperties(exampleFunc, api);

console.log($exampleFunc.api); // Logs the API Object from above.

var result = $exampleFunc({
  a: 1,
  b: 2,
}, true);

FAQs

Package last updated on 22 Feb 2018

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