Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
chain-able-deps / src / regexp / matchNative.ts
Size: Mime:
import funcToString from '../native/functionToString'
import hasOwnProperty from '../native/objectHasOwnProperty'

export default RegExp(
  `^${funcToString
  // Take an example native function source for comparison
  .call(hasOwnProperty)
  // Strip regex characters so we can use it for regex
  .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
  // Remove hasOwnProperty from the template to make it generic
  .replace(
    /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
    '$1.*?'
  )}$`
)