Socket
Socket
Sign inDemoInstall

to-source-code

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

to-source-code

Converts function to its source code.


Version published
Weekly downloads
179K
decreased by-6.04%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 15 Apr 2016

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