{"id":16718782,"url":"https://github.com/kgryte/regex-native-function","last_synced_at":"2025-07-12T15:02:34.801Z","repository":{"id":36488933,"uuid":"40794542","full_name":"kgryte/regex-native-function","owner":"kgryte","description":"Regular expression to detect a native function.","archived":false,"fork":false,"pushed_at":"2015-08-16T01:26:19.000Z","size":120,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-30T05:39:21.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kgryte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-16T01:02:37.000Z","updated_at":"2019-08-18T16:49:57.000Z","dependencies_parsed_at":"2022-09-19T03:41:32.287Z","dependency_job_id":null,"html_url":"https://github.com/kgryte/regex-native-function","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kgryte/regex-native-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fregex-native-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fregex-native-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fregex-native-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fregex-native-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgryte","download_url":"https://codeload.github.com/kgryte/regex-native-function/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgryte%2Fregex-native-function/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265009195,"owners_count":23697154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T21:38:30.396Z","updated_at":"2025-07-12T15:02:34.713Z","avatar_url":"https://github.com/kgryte.png","language":"JavaScript","readme":"Native Function\n===\n[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependencies][dependencies-image]][dependencies-url]\n\n\u003e [Regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to detect a native function.\n\n\n## Installation\n\n``` bash\n$ npm install regex-native-function\n```\n\n\n## Usage\n\n``` javascript\nvar re = require( 'regex-native-function' );\n```\n\n#### re\n\n[Regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) to detect a native `function`.\n\n``` javascript\nvar bool = re.test( Math.sqrt.toString() );\n// returns true\n\nbool = re.test( (function(){}).toString() );\n// returns false\n```\n\n\n## Examples\n\n``` javascript\nvar re = require( 'regex-native-function' );\n\nfunction isNative( fcn ) {\n\treturn re.test( fcn.toString() );\n}\n\nconsole.log( isNative( Math.sqrt ) );\n// returns true\n\nconsole.log( isNative( String ) );\n// returns true\n\nconsole.log( isNative( Int8Array ) );\n// returns true\n\nconsole.log( isNative( Date ) );\n// returns true\n\nconsole.log( isNative( function(){} ) );\n// returns false\n```\n\nTo run the example code from the top-level application directory,\n\n``` bash\n$ node ./examples/index.js\n```\n\n\n## Tests\n\n### Unit\n\nUnit tests use the [Mocha](http://mochajs.org/) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:\n\n``` bash\n$ make test\n```\n\nAll new feature development should have corresponding unit tests to validate correct functionality.\n\n\n### Test Coverage\n\nThis repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:\n\n``` bash\n$ make test-cov\n```\n\nIstanbul creates a `./reports/coverage` directory. To access an HTML version of the report,\n\n``` bash\n$ make view-cov\n```\n\n\n---\n## License\n\n[MIT license](http://opensource.org/licenses/MIT).\n\n\n## Copyright\n\nCopyright \u0026copy; 2015. Athan Reines.\n\n\n[npm-image]: http://img.shields.io/npm/v/regex-native-function.svg\n[npm-url]: https://npmjs.org/package/regex-native-function\n\n[travis-image]: http://img.shields.io/travis/kgryte/regex-native-function/master.svg\n[travis-url]: https://travis-ci.org/kgryte/regex-native-function\n\n[codecov-image]: https://img.shields.io/codecov/c/github/kgryte/regex-native-function/master.svg\n[codecov-url]: https://codecov.io/github/kgryte/regex-native-function?branch=master\n\n[dependencies-image]: http://img.shields.io/david/kgryte/regex-native-function.svg\n[dependencies-url]: https://david-dm.org/kgryte/regex-native-function\n\n[dev-dependencies-image]: http://img.shields.io/david/dev/kgryte/regex-native-function.svg\n[dev-dependencies-url]: https://david-dm.org/dev/kgryte/regex-native-function\n\n[github-issues-image]: http://img.shields.io/github/issues/kgryte/regex-native-function.svg\n[github-issues-url]: https://github.com/kgryte/regex-native-function/issues\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgryte%2Fregex-native-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgryte%2Fregex-native-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgryte%2Fregex-native-function/lists"}