{"id":51061234,"url":"https://github.com/ognjenjevremovic/pretty-easy-data-types","last_synced_at":"2026-06-23T02:03:11.539Z","repository":{"id":57330131,"uuid":"85098368","full_name":"ognjenjevremovic/pretty-easy-data-types","owner":"ognjenjevremovic","description":"Utility library for getting the data type of a supplied value or checking if the supplied value is of certain data type","archived":false,"fork":false,"pushed_at":"2017-04-07T12:39:44.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T12:21:36.703Z","etag":null,"topics":["check-data-type","check-data-types","data-type","data-types","node-module","nodejs-modules","npm-module","npm-package","pretty-easy"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ognjenjevremovic.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":"2017-03-15T16:54:17.000Z","updated_at":"2021-02-20T11:59:17.000Z","dependencies_parsed_at":"2022-09-10T10:38:02.747Z","dependency_job_id":null,"html_url":"https://github.com/ognjenjevremovic/pretty-easy-data-types","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ognjenjevremovic/pretty-easy-data-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ognjenjevremovic%2Fpretty-easy-data-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ognjenjevremovic%2Fpretty-easy-data-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ognjenjevremovic%2Fpretty-easy-data-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ognjenjevremovic%2Fpretty-easy-data-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ognjenjevremovic","download_url":"https://codeload.github.com/ognjenjevremovic/pretty-easy-data-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ognjenjevremovic%2Fpretty-easy-data-types/sbom","scorecard":{"id":703252,"data":{"date":"2025-08-11","repo":{"name":"github.com/ognjenjevremovic/pretty-easy-data-types","commit":"fa87382245b2d9f2d599359cd9313016e48bb090"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T05:44:40.360Z","repository_id":57330131,"created_at":"2025-08-22T05:44:40.360Z","updated_at":"2025-08-22T05:44:40.360Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34672250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["check-data-type","check-data-types","data-type","data-types","node-module","nodejs-modules","npm-module","npm-package","pretty-easy"],"created_at":"2026-06-23T02:03:10.881Z","updated_at":"2026-06-23T02:03:11.530Z","avatar_url":"https://github.com/ognjenjevremovic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pretty-easy-data-types\n\n\u0026nbsp;\n\n[![NPM Version][npm-image]][npm-url]\n[![Build Status - Travis CI][travis-image]][travis-url]\n[![Build Status - Appveyor][appveyor-image]][appveyor-url]\n[![Tests][tests-image]][travis-url]\n[![Dependancies][dependancy-image]][dependancy-url]\n\n### *What is pretty-easy-data-types?*\n***pretty-easy-data-types*** *is a small utility NodeJS library for checking the data type values*.\n\n\u0026nbsp;\n\n# Install\nThis is a [NodeJS](http://www.node.js) module available through the [npm](http://npmjs.org) registry. Installation is done using the **npm install** command:\n```sh\n$ npm install pretty-easy-data-types --save\n```\n***--save*** *flag is used to save the module as a project dependancy in your package.json file.*\n\n\u0026nbsp;\n\n# Usage\nAfter installing the module (localy in your project directory), in order to use it in your file you first need to require it.\n\u0026nbsp;\n\nYou can:\n * import the whole library\n```javascript\nconst dataTypes = require('pretty-easy-data-types');\n```\n * or only the components you need (recommended way)\n```javascript\nconst { geType, isString, isArray, isNull } = require('pretty-easy-data-types');\n```\n\u0026nbsp;\n\nIf you use TypeScript:\n * import the whole library\n```javascript\nimport * as dataTypes from 'pretty-easy-data-types';\n```\n * import the components you need (recommended way)\n```javascript\nimport { getType, isBoolean, isNumber } from 'pretty-easy-data-types';\n```\n\u0026nbsp;\n\nThe library exposes a few utility functions for you to call and supply with a value for which you'd like to get a data type or you'd like to check if it is of certain data type value.\n\n\u0026nbsp;\n\n## Examples\n\n### Get data type of value\n```javascript\n/**\n*   We're going to import only the data type checker here,\n*   but you're free to import the whole library and then\n*   use the methods on the returned object; it's up to you\n*/\nconst { getType } = require('pretty-easy-data-types');\n\n//  Perform the checks\ngetType(['f00', false, 2])      //  'array'\ngetType(false)                  //  'boolean'\ngetType(new Date())             //  'date'\ngetType(new Error())            //  'error'\ngetType(() =\u003e {})               //  'function'\ngetType(null)                   //  'null'\ngetType(25)                     //  'number'\ngetType({bar: 'baz'})           //  'object'\ngetType('foo')                  //  'string'\ngetType()                       //  'undefined'\n```\n\n\u0026nbsp;\n\n### Do NOT use built-in constructors for primitive values! (JavaScript 101)\nIf for some reason you do use built in constructor classes for constructing your primitive values, such as :\n * Strings,\n * Numbers and\n * Booleans\n\n**You should stop doing it asap, before your hurt somebody!**\nConsider the following example.\n\n```javascript\n/*\n*   It has no impact on string values\n*/\nconst myString = new String('f00');\nconsole.log(myString);      //  'f00'\ngetType(myString);          //  'string'\n\n/*\n*   But do note that using the Number constructor\n*   can produce some unwanted results and introduce\n*   hard to trace bugs due to the quirky nature of JavaScript.\n*   \n*   Consider the following :\n*/\nconst myNum = new Number('This is not a number');\nconsole.log(myNum);         //  NaN\nisNumber(myNum);            //  true\n```\n\nThis is due how JavaScript language works as NaN value is treated as an instance of Number class!\nThat's why you should AVOID using built-in constructor classes for primitive values and just use the simpler, shorter and more conviniant way of just declaring them instead.\n\n\u0026nbsp;\n\n### Check for certain data type\n\n```javascript\n//  Import the checks\nconst {\n    isArray, isBoolean, isDate,\n    isError, isFunction ,isNull,\n    isNumber, isObject,\n    isString, isUndefined\n} = require('pretty-easy-data-types');\n\nisArray([ 'f00' ])      //  true\nisBoolean(false)        //  true\nisDate(new Date())      //  true\nisError(new Error())    //  true\nisFunction(() =\u003e {})    //  true\nisNull(null)            //  true\nisNumber(25)            //  true\nisObject({val: false})  //  true\nisString('')            //  true\nisUndefined()           //  true\n```\n\n\u0026nbsp;\n\n### Gotchas!\nThere are a few gotchas that you should be aware of. One of which, that objects and arrays are of different data types. This is exteremely important!\nInstances of classes that derive from an Object class, such as Array, Error and Date data type values, have their own constructors - meaning, they're not instances of Object classes, but rather instances of their respective classes.\n\n```javascript\nconst array = [ 'f00', 12, null ]; \n\nisObject(array)     //  false\nisArray(array)      //  true\n```\n\n\u0026nbsp;\n\n## Releases\nThe module follows the Semantic Versioning standard to communicate what kinds of changes are introduced in the new releases.\n\n### Versioning\n*Patch releases* : n.n.**X** -\u003e Bug fixes, documentation updates, code cleanups, new test cases, optimization stuff and other minor changes that you should probably not be aware of;\n\u0026nbsp;\n\n*Minor releases* : n.**X**.n -\u003e New feature(s) which don't break the existing ones. These ofter refer to minor TypeScript API changes (mainly due to declarations; JavaScript code will not be affected by these changes), code refactoring, some under the sheet changes that you should not worry about too much;\n\u0026nbsp;\n\n*Major releases* : **X**.n.n -\u003e Changes that could *possibly* introduce the backwards compatibility issues. These are however very ***rare*** and could be relevant to you only in the case of an endpoint API change and the way you communicate with the module.\n\n\u0026nbsp;\n\n## Changelogs\n\n\u0026nbsp;\n**04/06** - *v1.1.1*\n * Code refactor\n * Documentation typos corrected\n\n**04/05** - *v1.1.0*\n * Update to unit test approach\n * New test cases\n * Minor improvements to the code\n\n**03/20** - *v1.0.3*\n * Documentation updates\n\n**03/19** - *v1.0.2*\n * Support for Node \u003c 1.8 abbandoned\n * Modular approach to unit tests\n * New test cases\n * Documentation updates to reflect the changes\n\n**03/16** - *v1.0.1*\n * Documentation updates\n\n**03/15** - *v1.0.0*\n * Initial release\n\n\n\u0026nbsp;\n\n### Want to contribute?\n**Great!**\nAnyone can help make this project better - check out the [github](https://github.com/ognjenjevremovic/pretty-easy-data-types) repository and make a pull request!\n\n### Found a bug?\nPlease open a an [issue](https://github.com/ognjenjevremovic/pretty-easy-data-types/issues).\n\n### License\nCopyright (c) 2017 [Ognjen Jevremović](https://github.com/ognjenjevremovic)\n\nLicensed under the [MIT](https://github.com/ognjenjevremovic/pretty-easy-data-types/blob/master/LICENSE) License.\n\n[npm-image]: https://img.shields.io/npm/v/pretty-easy-data-types.svg\n[npm-url]: https://npmjs.org/package/pretty-easy-data-types\n[travis-image]: https://img.shields.io/travis/ognjenjevremovic/pretty-easy-data-types/master.svg\n[travis-url]: https://travis-ci.org/ognjenjevremovic/pretty-easy-data-types\n[appveyor-image]: https://ci.appveyor.com/api/projects/status/y2hrdv2v9otm07f7?svg=true\n[appveyor-url]: https://ci.appveyor.com/project/ognjenjevremovic/pretty-easy-data-types\n[tests-image]: https://img.shields.io/badge/tests-passing-green.svg\n[dependancy-image]: https://david-dm.org/ognjenjevremovic/pretty-easy-data-types/status.svg\n[dependancy-url]: https://david-dm.org/ognjenjevremovic/pretty-easy-data-types","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fognjenjevremovic%2Fpretty-easy-data-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fognjenjevremovic%2Fpretty-easy-data-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fognjenjevremovic%2Fpretty-easy-data-types/lists"}