{"id":21414871,"url":"https://github.com/magic/types","last_synced_at":"2025-09-11T06:37:44.109Z","repository":{"id":57127295,"uuid":"53727903","full_name":"magic/types","owner":"magic","description":"typechecking","archived":false,"fork":false,"pushed_at":"2025-07-09T19:16:10.000Z","size":1529,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-08T19:08:43.042Z","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":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magic.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":"2016-03-12T11:24:05.000Z","updated_at":"2025-07-09T19:16:13.000Z","dependencies_parsed_at":"2024-06-21T04:17:16.587Z","dependency_job_id":"0a42f194-4003-48aa-827d-0b3c5e008ef6","html_url":"https://github.com/magic/types","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/magic/types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magic","download_url":"https://codeload.github.com/magic/types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Ftypes/sbom","scorecard":{"id":611588,"data":{"date":"2025-08-11","repo":{"name":"github.com/magic/types","commit":"6f8978ee8b7dee2f01d3e1850660322a59c2942e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"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":"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":"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":"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: GNU Affero General Public License v3.0: 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"}},{"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"}}]},"last_synced_at":"2025-08-21T02:47:44.779Z","repository_id":57127295,"created_at":"2025-08-21T02:47:44.780Z","updated_at":"2025-08-21T02:47:44.780Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274589627,"owners_count":25312971,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"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":[],"created_at":"2024-11-22T18:34:09.554Z","updated_at":"2025-09-11T06:37:44.096Z","avatar_url":"https://github.com/magic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @magic/types\n\ntypechecking utilities\n\n[![NPM version][npm-image]][npm-url]\n[![Linux Build Status][travis-image]][travis-url]\n[![Windows Build Status][appveyor-image]][appveyor-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Greenkeeper badge][greenkeeper-image]][greenkeeper-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n\n[npm-image]: https://img.shields.io/npm/v/@magic/types.svg\n[npm-url]: https://www.npmjs.com/package/@magic/types\n[travis-image]: https://img.shields.io/travis/com/magic/types/master\n[travis-url]: https://travis-ci.com/magic/types\n[appveyor-image]: https://img.shields.io/appveyor/ci/magic/types/master.svg\n[appveyor-url]: https://ci.appveyor.com/project/magic/types/branch/master\n[coveralls-image]: https://coveralls.io/repos/github/magic/types/badge.svg\n[coveralls-url]: https://coveralls.io/github/magic/types\n[greenkeeper-image]: https://badges.greenkeeper.io/magic/types.svg\n[greenkeeper-url]: https://badges.greenkeeper.io/magic/types.svg\n[snyk-image]: https://snyk.io/test/github/magic/types/badge.svg\n[snyk-url]: https://snyk.io/test/github/magic/types\n\n##### install\n\n```javascript\nnpm install @magic/types\n```\n\n##### import single function\n\n```js\n// single function import\nimport { isArray } from '@magic/types'\n\nisArray([]) // true\n```\n\n##### import all functions\n\n```javascript\nimport is from '@magic/types'\n\nis.array([]) // true\n```\n\n##### functions\n\n```javascript\n\n// comparisons\n\n// test a value for multiple types\nis(ele, ...types)\n// alias is.eq, isEq, test\n\n// test if a value is not of a type\nnot(ele, ...types)\n// alias is.neq, isNeq, isNot\n\nisSameType('string', 'string')\n// alias isSame, is.same, is.sameType\n\n\n// type comparisons:\n\nisArray([]) // true\n// alias isArr, is.array, is.arr\n\nisBoolean(true) // true\n// alias isBool, is.boolean, is.bool\n\nisDefined(undefined) //false\n// alias isDef, is.defined, is.def\n\nisUndefined(undefined) //false\n// alias isUndef, is.undefined, is.undef\n\nisFunction(() =\u003e {}) // true\n// alias isFunc, isFn, is.function, is.func, is.fn\n\nisAsyncFunction(async () =\u003e {}) // true\n// alias isAsyncFunc, isAsyncFn, is.asyncFunction, is.asyncFunc, is.asyncFn\n\nisGeneratorFunction(* () =\u003e {}) // true\n// alias isGeneratorFunc, isGeneratorFunc, is.generatorFunction, is.generatorFunc, is.generatorFn\n\nisNumber(1) // true\n// alias isNum, is.number, is.num\n\nisInteger(1) // true\n// alias isInt, is.integer, is.int\n\nisFloat(1.1) // true\n// alias is.float\n\nisObject({}) // true\n// alias isObj, is.object, is.obj\n\nisString('') // true\n// alias isStr, is.string, is.str\n\nisRGBAObject({ r: 1, g: 1, b: 1, a: 1 }) // true\n// alias isRGBA, is.rgbaObject, is.rgba\n\nisRGBObject\n// alias isRGB, is.rgbObject, is.rgb\n\nisHexColor('#333') // true\n// alias isHex, is.hex, is.hexColor\n\nisHexAlphaColor('#3333') // true\n// alias isHexa, is.hexa, is.hexAlphaColor\n\nisColor('#444') // true\n// alias isCol, is.color, is.col\n\nisDate(new Date()) // true\n// alias isTime, is.date, is.time\n\nisRegExp(/regexp/) // true\n// alias isRegex, is.regexp, is.regExp, is.regex\n\nisTruthy('true') // true\n// alias is.truthy\n\nisFalsy(0) // true\n// alias is.falsy\n\nisEmpty('') // true\n// alias is.empty\n\nisError(new Error('')) // true\n// alias isErr, is.error, is.err\n\nisIterable([]) // true\n// alias is.iterable\n\nisEmail('a@b.c') // true\n// alias isMail, is.email, is.mail\n\nisNull(null) // true\n// alias isNil, is.nil, is.null\n\nisUndefinedOrNull(undefined || null) // true\n// alias is.undefinedOrNull, is.undefinedOrNil, is.undefOrNull, is.undefOrNil\n\nisBuffer(new Buffer('test')) // true\n// alias isBuff, is.buffer, is.buff\n\nisPromise(new Promise()) // true\n// alias is.promise, isThenable, isThen, is.thenable, is.then\n\n// removed (for now?)!\nisArguments(() =\u003e return arguments) // true\n// alias isArgs, is.arguments, is.args\n\nisUUID(uuid) // true\n// alias is.uuid\n\ntestType(42, 'number') // true\n// alias is.type\n\ntest(42, ['string', 'object']) // false\n// alias is.types\n\nisEq(42, 'number') // true\n// alias is.eq\n\nisNot = isNeq = is.not(42, 'number') // true\n// alias is.neq\n\nisDeepEqual([1, 2, 3], [1, 2, 3]) // true\n// alias is.deep.eq, is.deep.equal\nisDeepDifferent([1, 2, 3], [1, 2, 3]) // false\n// alias is.deep.diff, is.deep.different\n\nisEvery([1, 2, 3], 'number') // true\nisEvery([1, 2, 3], is.number) // true\n// alias is.every, is.all\n\nisSome([1, 'str', {}], 'number') // true\nisSome([1, 'str', {}], is.number) // true\n// alias is.some\n\nisNone([1, 2, 3], 'string') // true\nisNone([1, 2, 3], is.number) // false\n// alias is.none\n\nisInstanceOf(new Date(), Date) // true\n// alias is.instance, is.instanceof, is.instanceOf\n\nisCase('UPPERCASE', 'up') // true\nisCase('lowercase', 'low') // true\n// alias is.case\n\nisUpperCase('UPPERCASE') // true\n// alias is.case.upper, is.isCase.upper\n\nisLowerCase('lowercase') // true\n// alias is.case.lower, is.isCase.lower\n\nisMergeableObject({}) // true\n// alias is.mergeable, is.mergeableObject, isMergeable\n\nconst mod = await import('path/to/file')\nisModule(mod) // true\n// alias is.module\n\nisOwnProp({ test: undefined }, 'test') // true\n// alias isOwnProperty, is.ownProperty, is.ownProp, is.prop\n```\n\n#### Changelog\n\n##### 0.0.5\n\nadded Map, WeakMap, Set and WeakSet\n\n##### 0.1.0\n\nuse es6 modules\n\n##### 0.1.1\n\nFIX: add module field to package.json\n\n##### 0.1.2\n\nFIX: is.number no longer errors on node es6 modules and other weird objects\n\n##### 0.1.3\n\nuse @magic/deep for is.deep.equal and is.deep.different\n\n##### 0.1.4\n\nis.deep uses @magic/deep now.\n\nthis means that is.deep.equal(null, undefined) is returning a function now,\nbecause it expects currying.\n\n##### 0.1.5\n\nminimum node version is 13.5.0\n\n##### 0.1.6\n\nremove @magic/deep dependency\n\n##### 0.1.7\n\nfix erroneous '@magic/types' import in src/deep/equal.mjs\n\n##### 0.1.8\n\nadd\n\n- is.every\n- is.some\n- is.none\n\n##### 0.1.9\n\nadd is.instanceOf\n\n##### 0.1.10\n\nadd isCase, isUpperCase, isLowerCase\n\n##### 0.1.11\n\nadd isObjectNative\n\n##### 0.1.12\n\nbump required node version to 14.2.0\n\n##### 0.1.13\n\n- add isAsyncFunction\n- add isGeneratorFunction\n\n##### 0.1.14\n\n- bump required node version to 14.15.4\n- update dependencies\n\n##### 0.1.15\n\ndeep.equal now does return true for objects that have undefined property values\n\n##### 0.1.16\n\n- remove circular dependencies\n\n##### 0.1.17\n\n- add isSameType, isSame, same, sameType\n- update dev dependencies\n\n##### 0.1.18\n\n- add isModule and isOwnProperty\n- update dependencies\n\n##### 0.1.19\n\nupdate dependencies\n\n##### 0.1.20\n\nupdate dependencies\n\n##### 0.1.21\n\n- isBuffer uses Buffer.isBuffer.\n- update dependencies\n- getLength does not use .length or .size property for unknown types. instead we test for is.array, is.string, is.map etc.\n\n##### 0.1.22\n\n- update getLength to correctly return the length of buffers (regressed in 0.1.21).\n- add a test case for buffer length\n\n##### 0.1.23\n\n- update dev dependencies\n- update docs\n\n##### 0.1.24\n\n- update dependencies\n\n##### 0.1.25 - unreleased\n\n...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Ftypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagic%2Ftypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Ftypes/lists"}