{"id":20713675,"url":"https://github.com/mcstreetguy/isset-helper","last_synced_at":"2026-04-28T05:31:41.850Z","repository":{"id":45474223,"uuid":"121113668","full_name":"MCStreetguy/isset-helper","owner":"MCStreetguy","description":"Get rid of weak typing and improve your assertions: A tiny helper method for Javascript","archived":false,"fork":false,"pushed_at":"2023-07-12T02:39:16.000Z","size":262,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T07:40:09.292Z","etag":null,"topics":["algorithm","helper-functions","helper-methods","isset-helper","javascript","javascript-library","javascript-tools","node-module","nodejs","tiny-helper","type","typecast","typification","validation"],"latest_commit_sha":null,"homepage":"","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/MCStreetguy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-11T10:49:24.000Z","updated_at":"2022-01-02T21:00:20.000Z","dependencies_parsed_at":"2024-10-20T18:02:57.687Z","dependency_job_id":null,"html_url":"https://github.com/MCStreetguy/isset-helper","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.02083333333333337,"last_synced_commit":"194c481ab363cd212ca1df73a744439b0504d88d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCStreetguy%2Fisset-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCStreetguy%2Fisset-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCStreetguy%2Fisset-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MCStreetguy%2Fisset-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MCStreetguy","download_url":"https://codeload.github.com/MCStreetguy/isset-helper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242988037,"owners_count":20217534,"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":["algorithm","helper-functions","helper-methods","isset-helper","javascript","javascript-library","javascript-tools","node-module","nodejs","tiny-helper","type","typecast","typification","validation"],"created_at":"2024-11-17T02:26:41.060Z","updated_at":"2025-12-24T05:31:39.722Z","avatar_url":"https://github.com/MCStreetguy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IsSet Helper\n\n[![GitHub open issues](https://img.shields.io/github/issues/MCStreetguy/isset-helper)](https://github.com/MCStreetguy/isset-helper/issues)\n[![GitHub license](https://img.shields.io/github/license/MCStreetguy/isset-helper)](https://github.com/MCStreetguy/isset-helper/blob/master/LICENSE)\n![npm total downloads](https://img.shields.io/npm/dt/isset-helper)\n![latest version](https://img.shields.io/npm/v/isset-helper?label=latest)\n![module size in bytes](https://img.shields.io/github/size/MCStreetguy/isset-helper/dist/module.umd.js?label=module%20size)\n![minified size in bytes](https://img.shields.io/github/size/MCStreetguy/isset-helper/dist/isset.min.js?label=minified%20size)\n\n**Get rid of weak typing and improve your assertions: A tiny helper method for Javascript**\n\nSince checking variable types and existence always has been painful in Javascript, validation assertions normally are exhausting to write.\nThis module solves this definitely.\n\n- [IsSet Helper](#isset-helper)\n  - [Browser Compatibility](#browser-compatibility)\n  - [Installation](#installation)\n    - [as a module](#as-a-module)\n    - [in the browser](#in-the-browser)\n  - [Usage](#usage)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n---\n\n## Browser Compatibility\n\n| IE | Edge | Firefox | Chrome | Safari | Opera | Node.js |\n|:-:|:-:|:-:|:-:|:-:|:-:|:-:|\n| 9+ | 12+ | 4+ | 5+ | 5+ | 11.5+ | all |\n\n## Installation\n\n### as a module\n\nInstall the library through your preferred package manager:\n\n```bash\n$ npm install --save isset-helper\n# or\n$ yarn add isset-helper\n```\n\nThen you can require the module as usual:\n\n```js\nconst isset = require('isset-helper');\n```\n\n### in the browser\n\nInclude _one_ of the following script tags in your pages head:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/isset-helper@3.1/dist/isset.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/mcstreetguy/isset-helper@3.1/dist/isset.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://bundle.run/isset-helper@3.1/dist/isset.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/isset-helper@3.1/dist/isset.min.js\"\u003e\u003c/script\u003e\n```\n\nThe library registers the `isset` function automatically on the `window` object.\n\n## Usage\n\n```js\nisset(variable, type);\n```\n\n`variable` can be anything, it's value is going to be checked.\n`type` can be a string, object constructor or even be omitted.\n\nThe algorithm follows the subsequent rules:\n\n1. `variable` is not `null`\n2. `variable` is not `undefined`\n3. If `type` is a string, `typeof variable` has to match `type`,\n   otherwise `variable` has to match `instanceof type`\n4. If `type` is `\"string\"`, the length of `variable` is greater than zero\n5. If `type` is `\"array\"`, `variable` has to pass the [`Array.isArray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) check\n6. If `type` is `\"integer\"`, `variable` has to pass the [`Number.isInteger()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger) check\n7. If `type` is `\"float\"` or `\"double\"`, the inverse of rule 6 applies ([`Number.isInteger()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger) has to return `false`)\n\n**Please notice:**\n\n- The algorithm doesn't check for the exact value (apart from the empty string case mentioned above), thus `false`, `0` and other \"falsy\" values will also be considered valid.\n\n## Contributing\n\nIf, contrary to expectations, you find an error in the function, please report it to the Issues page.\nFeel free to make changes to a fork yourself and propose a detailed pull request when finished.\n\n## License\n\nThis library is licensed under the MIT License.\nYou may find [a copy of the license](/LICENSE) at the root of the project source.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcstreetguy%2Fisset-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcstreetguy%2Fisset-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcstreetguy%2Fisset-helper/lists"}