JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 60
  • Score
    100M100P100Q66363F
  • 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

is-empty-function npmjs.com The MIT License

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

code climate standard code style travis build status coverage status dependency status

Install

npm i is-empty-function --save
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
  • cleanup-coverage-code: Cleanup ugly code added by code coverage tools during the test process. Like this one __cov_Ejgcx$XN18CSfmeWn$f7vQ.f['2']++;.
  • coverage-code-regex: Regular expression (regex) for matching ugly code that coverage tools add during the test process. Like this one __cov_Ejgcx$XN18CSfmeWn$f7vQ.f['2']++;
  • function-regex: Function regex. Regular expression for matching function parts. Expose match groups for function name, arguments and function body.
  • hybridify: Building hybrid APIs. You can use both callback and promise in same time. Like asyncFn(name, cb).then().catch()
  • parse-function: Parse a given function or string (fn.toString()) to object with name, params, parameters, args, arguments and body properties.

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github