{"id":23055322,"url":"https://github.com/stevenpersia/tinyboo","last_synced_at":"2025-08-15T05:32:01.350Z","repository":{"id":42902642,"uuid":"251662158","full_name":"stevenpersia/tinyboo","owner":"stevenpersia","description":"Utilities library for type checking and other useful things. Already more than 40 functions (TypeScript supported). 👻","archived":false,"fork":false,"pushed_at":"2023-03-04T09:33:30.000Z","size":761,"stargazers_count":9,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-31T11:18:38.251Z","etag":null,"topics":["check","functions","library","tinyboo","type","typescript","utilities","utils"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tinyboo","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/stevenpersia.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":"2020-03-31T16:22:57.000Z","updated_at":"2023-01-31T16:34:20.000Z","dependencies_parsed_at":"2023-02-04T09:31:32.025Z","dependency_job_id":null,"html_url":"https://github.com/stevenpersia/tinyboo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenpersia%2Ftinyboo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenpersia%2Ftinyboo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenpersia%2Ftinyboo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenpersia%2Ftinyboo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenpersia","download_url":"https://codeload.github.com/stevenpersia/tinyboo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229893998,"owners_count":18140620,"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":["check","functions","library","tinyboo","type","typescript","utilities","utils"],"created_at":"2024-12-16T01:11:41.437Z","updated_at":"2024-12-16T01:11:41.997Z","avatar_url":"https://github.com/stevenpersia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/stevenpersia/tinyboo/master/logo.png\" alt=\"tinyboo\" /\u003e\u003c/h1\u003e\n\n## Overview\n\nUtilities library for type checking and **other useful things**. Already more than **40 functions**. Each function returns **false** or **true**, that's it. Perfect for front and back ends. 👻\n\n- **0 dependencies** 🌱\n- **Super lightweight (~25 kB)** ⚡\n- **Easy to use** 🤘\n- **Tested** 🛠\n- **TypeScript supported** 🌞\n\n**Roadmap** : `isUrl`, `isAbsoluteUrl`, `isRelativeUrl`, `isGif`, `isJpg`, `isPng`, `isPdf`, `isSvg`, `isWebp`, `isHtml`, `isZip`, `isRar`, `isMatch`, ...\n\n## Installation\n\nInstall package :\n\n```sh\nyarn add tinyboo\n# or\nnpm install tinyboo\n```\n\nImport what you need :\n\n```js\nimport { isEmptyArray, isIP, isGreaterThan } from 'tinyboo';\n```\n\nAnd have fun !\n\n## Usage\n\n### Type checkers\n\n```js\nisArray([]); // → true\nisBlob(new Blob()); // → true\nisBoolean(false); // → true\nisDate(new Date()); // → true\nisError(new Error()); // → true\nisFile(new File()); // → true\nisFunction(() =\u003e {}); // → true\nisMap(new Map()); // → true\nisNull(null); // → true\nisNumber(1); // → true\nisObject({}); // → true\nisRegExp(/^foo(bar)?$/); // → true\nisSet(new Set()); // → true\nisString('foo'); // → true\nisSymbol(Symbol()); // → true\nisUndefined(undefined); // → true\nisWeakMap(new WeakMap()); // → true\nisWeakSet(new WeakSet()); // → true\nisPrimitive('foo'); // → true\n```\n\n### Arrays\n\n```js\nisArrayOfBooleans([true, false]); // → true\nisArrayOfDates([new Date(), new Date()]); // → true\nisArrayOfNumbers([1, 2, 3]); // → true\nisArrayOfObjects([{}, {}]); // → true\nisArrayOfPrimitives(['foo', 1]); // → true\nisArrayOfStrings(['bar', '1']); // → true\n```\n\n### Objects\n```js\nhasKey({ foo: 'bar' }, 'foo'); // → true\nhasValue({ foo: 'bar' }, 'bar'); // → true\n```\n\n### Numbers\n\n```js\nisFiniteNumber(2); // → true\nisGreaterThan(700, 500); // → true\nisInteger(21); // → true\nisLessThan(300, 500); // → true\nisBetween(2, 1, 3); // → true\n```\n\n### Others\n\n```js\nisEmptyArray([]); // → true\nisEmptyObject({}); // → true\nisEmptyString(' '); // → true\nisEqual('foo', 'foo'); // → true\nisHexadecimal('F1F1F1'); // → true\nisIP('210.23.51.230'); // → true\nisJSON('{ \"foo\": \"bar\" }'); // → true\n```\n\n## More examples\n\n### `isEqual` - works with array, boolean, null, number and string\n\n```js\n// Array\nisEqual([1, 'foo', 'bar'], [1, 'foo', 'bar']); // → true\nisEqual([1, 'foo', 'bar'], ['foo', 1, 'bar']); // → false\n\n// Boolean\nisEqual(false, false); // → true\nisEqual(true, false); // → false\n\n// Null\nisEqual(null, null); // → true\nisEqual(null, 'foo'); // → false\n\n// Number\nisEqual(1, 1); // → true\nisEqual(1, '1'); // → false\n\n// String\nisEqual('foo', 'foo'); // → true\nisEqual('foo', 'bar'); // → false\n```\n\n### `isIP` - only works with string\n\n```js\nisIP('127.0.0.0'); // → true\nisIP('0.0.0.0'); // → true\nisIP('255.255.255.255'); // → true\n\nisIP('192.168'); // → false\nisIP(19216801); // → false\nisIP('127.000.000.000'); // → false\n```\n\n### `isJSON` - only works with string or null\n\n```js\nisJSON('{}'); // → true\nisJSON('null'); // → true\nisJSON('{ \"foo\": \"bar\" }'); // → true\nisJSON(null); // → true\n\nisJSON({}); // → false\nisJSON({ foo: 'bar' }); // → false\nisJSON(''); // → false\n```\n\n## Star, Fork, Clone \u0026 Contribute\n\nFeel free to contribute on this repository. If my work helps you, please give me back with a star. This means a lot to me and keeps me going!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenpersia%2Ftinyboo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenpersia%2Ftinyboo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenpersia%2Ftinyboo/lists"}