{"id":19777509,"url":"https://github.com/ilib-js/ilib-ctype","last_synced_at":"2026-06-12T00:31:12.342Z","repository":{"id":52499067,"uuid":"361276009","full_name":"iLib-js/ilib-ctype","owner":"iLib-js","description":"CType (character type) functions based on the Unicode Character Database ","archived":false,"fork":false,"pushed_at":"2024-01-25T16:19:55.000Z","size":175,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-25T09:02:24.043Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iLib-js.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":"2021-04-24T22:03:47.000Z","updated_at":"2022-09-13T02:22:57.000Z","dependencies_parsed_at":"2024-01-25T03:25:48.150Z","dependency_job_id":"f352ff5f-a4e1-4712-bebe-43729dfa185e","html_url":"https://github.com/iLib-js/ilib-ctype","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-ctype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-ctype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-ctype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iLib-js%2Filib-ctype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iLib-js","download_url":"https://codeload.github.com/iLib-js/ilib-ctype/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241107734,"owners_count":19910975,"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-11-12T05:25:20.262Z","updated_at":"2026-06-12T00:31:12.322Z","avatar_url":"https://github.com/iLib-js.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003e :warning: **Deprecation Notice** :warning:\n\u003e This repository has been deprecated. Please use the corresponding package from the [iLib-js monorepo](https://github.com/iLib-js/ilib-mono) instead.\n\n# ilib-common\n\nVarious utility classes for the ilib packages.\n\n## Installation\n\n```\nnpm install ilib-ctype\n\nor\n\nyarn add ilib-ctype\n```\n\n## CType Functions\n\nThe CType functions are modeled after the posix ctype functions for C/C++.\nThe data for all of the CType functions are derived from the Unicode\nCharacter Database so that they can be called with any character in\nUnicode. (Many posix implementations do not support Unicode!)\n\nBecause Javascript does not have an intrinsic character type, the arguments\nfor these functions are strings. Only the very first character in the\nstring is examined to determine the output of the function. The rest of\nthe string is ignored.\n\nThe functions are as follows:\n\n- isAlnum - is the character alpha numeric?\n- isAlpha - is the character alphabetic?\n- isAscii - is the character part of the ASCII subset?\n- isBlank - is the character blank?\n- isCntrl - is the character a control character?\n- isDigit - is the character a digit?\n- isGraph - is the character a graphic character?\n- isIdeo - is the character an ideographic (Asian) character?\n- isLower - is the character lower-case? For scripts that do not have\n  the concept of cases, this always returns true.\n- isPrint - is the character printable on the screen?\n- isPunct - is the character a punctuation character?\n- isScript - does the given character belong to the named script?\n- isSpace - is the character a whitespace character?\n- isUpper - is the character upper-case? For scripts that do not have\n  the concept of case, this always returns true.\n- isXdigit - is this character a hexadecimal digit?\n\nAdditionally, there is a `withinRange()` function which returns \ntrue if the given character is within the named Unicode range. \n\n```javascript\nimport { withinRange } from 'ilib-ctype';\n\nconsole.log(withinRange(\"\\uFE2A\", \"HalfMarks\")); // prints true\n```\n\n## Using the CType Functions\n\nAll of the functions are exported from the package in general. Here is\nan example of how you would use the `isAlpha` function.\n\n```javascript\nimport { isAlpha } from \"ilib-ctype\";\n\nconsole.log(isAlpha(\"a\"));   // prints true\nconsole.log(isAlpha(\"3\"));   // prints false\n```\n\nIf you are using this package in a webpack bundle, make sure to\nonly import the ctype functions you need in order to minimize\nthe final size of your bundle. That is, do not `import *` as that\nwill bring in a bunch of data that you probably don't need. Tree\nshaking in the latest webpack will ensure that only the data needed\nfor the functions you are using will be included in your bundle.\n\n## License\n\nCopyright © 2021-2024, JEDLSoft\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n## Release Notes\n\n### v1.2.1\n\n- updated dependencies\n- converted all unit tests from nodeunit to jest\n\n### v1.2.0\n\n- update to UCD 15.1.0\n\n### v1.1.0\n\n- made this package into a true hybrid package that supports both\n  commonjs and ESM\n\n### v1.0.0\n\n- initial version\n- copied from ilib 14.8.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib-ctype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filib-js%2Filib-ctype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filib-js%2Filib-ctype/lists"}