JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 60
  • Score
    100M100P100Q67214F
  • License

Checks the given function (or fn.toString()) is with empty body - dont have body.

Package Exports

  • is-empty-function

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-empty-function) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm mit license build status coverage status deps status

Checks the given function (or fn.toString()) is with empty body - dont have body.

Install

npm install is-empty-function
npm test

API

For more use-cases see the tests

isEmptyFunction

Check given function have empty body or not, and returns true or false.

Example:

var isEmptyFunction = require('is-empty-function');

var fixture = 'function() {};';
isEmptyFunction(fixture);
//=> true

var fixture = function named() {};
isEmptyFunction(fixture);
//=> true

var fixture = function() { return true; };
isEmptyFunction(fixture);
//=> false

var fixture = function named() { return true; };
isEmptyFunction(fixture);
//=> false

var fixture = "function codeCov() {__cov_Ejgcx$XN18CSfmeWn$f7vQ.f['2']++;};";
isEmptyFunction(fixture);
//=> true

Author

Charlike Mike Reagent

License MIT license

Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
Released under the MIT license.


Powered and automated by kdf, January 28, 2015