Socket
Socket
Sign inDemoInstall

to-source-code

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    to-source-code

Converts function to its source code.


Version published
Weekly downloads
156K
decreased by-37.25%
Maintainers
1
Install size
9.54 kB
Created
Weekly downloads
 

Readme

Source

to-source-code

Converts function to its source code.

MIT License

build:? coverage:?

Install

$ npm install --save to-source-code 

Usage

For more use-cases see the tests

var toSourceCode = require('to-source-code');

toSourceCode(Math.min);               
// => 'function min() { [native code] }'

toSourceCode(function () { console.log(123); });              
// => 'function () { console.log(123); }'

toSourceCode();      // => ''
toSourceCode(null);  // => ''
toSourceCode(1);     // => '1'
toSourceCode('1');   // => '1'
toSourceCode(true);  // => 'true'
toSourceCode({});    // => '[object Object]'
  • is-native - Checks if the given value is a native function.
  • to-num - Converts the given value to a number.
  • to-integer - Converts the given value to an integer.
  • to-length - Converts value to an integer suitable for use as the length of an array-like object.
  • to-str - Converts the given value to a string.
  • to-lower - Converts string, as a whole, to lower case.
  • to-upper - Converts string, as a whole, to upper case.
  • to-path - Converts value to a property path array.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Keywords

FAQs

Last updated on 15 Apr 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc