{"id":21085383,"url":"https://github.com/wachunei/rutcl","last_synced_at":"2025-10-11T01:01:55.346Z","repository":{"id":54705685,"uuid":"308371472","full_name":"wachunei/rutcl","owner":"wachunei","description":"A set of chilean RUT utility functions for Deno","archived":false,"fork":false,"pushed_at":"2021-02-03T00:43:33.000Z","size":27,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-09-16T09:00:17.038Z","etag":null,"topics":["chile","deno","rut"],"latest_commit_sha":null,"homepage":"https://deno.land/x/rutcl","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/wachunei.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-10-29T15:31:36.000Z","updated_at":"2021-03-07T01:50:06.000Z","dependencies_parsed_at":"2022-08-14T00:40:10.871Z","dependency_job_id":null,"html_url":"https://github.com/wachunei/rutcl","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/wachunei/rutcl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachunei%2Frutcl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachunei%2Frutcl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachunei%2Frutcl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachunei%2Frutcl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wachunei","download_url":"https://codeload.github.com/wachunei/rutcl/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wachunei%2Frutcl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005718,"owners_count":26083948,"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-10-10T02:00:06.843Z","response_time":62,"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":["chile","deno","rut"],"created_at":"2024-11-19T20:32:43.535Z","updated_at":"2025-10-11T01:01:55.324Z","avatar_url":"https://github.com/wachunei.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003erutcl\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003eA set of chilean RUT utility functions for Deno\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/wachunei/rutcl/workflows/ci/badge.svg\" / alt=\"ci\"\u003e\n\u003c/p\u003e\n\n```ts\nimport {\n  clean,\n  format,\n  getDigit,\n  isValid,\n  validate,\n} from \"https://deno.land/x/rutcl/mod.ts\";\n\ntry {\n  validate(\"123456789\");\n} catch (error) {\n  console.error(error.message); // \"RUT is not valid\"\n}\n\nisValid(\"123456785\"); // =\u003e true\ngetDigit(12345678); // =\u003e \"5\"\nclean(\"12.345.678-5\"); // =\u003e \"123456785\"\nformat(\"123456785\"); // =\u003e \"12.345.678-5\"\n```\n\n\u003chr /\u003e\n\n## Usage\n\nImport functions from `https://deno.land/x/rutcl/mod.ts`\n\n```ts\nimport { format, validate } from \"https://deno.land/x/rutcl/mod.ts\";\n```\n\nOr import a single function from `/lib/`\n\n```ts\nimport clean from \"https://deno.land/x/rutcl/lib/clean.ts\";\n```\n\n## Functions\n\n- [isValid](#functions-isvalid)\n- [validate](#functions-validate)\n- [getDigit](#functions-getdigit)\n- [format](#functions-format)\n- [clean](#functions-clean)\n\n\u003ca name=\"functions-isvalid\"\u003e\u003c/a\u003e\n\n### `isValid(dirtyRut: string | number): boolean`\n\nReturns a boolean, `true` if RUT is valid, `false` otherwise.\n\n```ts\nimport isValid from \"https://deno.land/x/rutcl/lib/isValid.ts\";\n\nisValid(123456789); // =\u003e false\nisValid(\"18591404-6\"); // =\u003e true\n```\n\n\u003ca name=\"functions-validate\"\u003e\u003c/a\u003e\n\n### `validate(dirtyRut: string | number): void`\n\nThrows an `InvalidRUTException` if RUT is not valid.\n\n```ts\nimport validate from \"https://deno.land/x/rutcl/lib/validate.ts\";\n\nvalidate(123456789); // =\u003e Throws InvalidRUTException\nvalidate(\"18591404-6\"); // =\u003e undefined\n```\n\n\u003ca name=\"functions-getdigit\"\u003e\u003c/a\u003e\n\n### `getDigit(partialDirtyRut: string | number): string`\n\nReturns a valid verification digit for given partial RUT\n\n```ts\nimport getDigit from \"https://deno.land/x/rutcl/lib/getDigit.ts\";\n\ngetDigit(\"18591404\"); // =\u003e \"6\"\n```\n\n\u003ca name=\"functions-format\"\u003e\u003c/a\u003e\n\n### `format(dirtyRut: string | number): string`\n\nReturns a formatted RUT\n\n```ts\nimport format from \"https://deno.land/x/rutcl/lib/format.ts\";\n\nformat(\"185914046\"); // =\u003e \"18.591.404-6\"\n```\n\n\u003ca name=\"functions-clean\"\u003e\u003c/a\u003e\n\n### `clean(dirtyRut: string | number): string`\n\nReturns a clean RUT, only digits.\n\n```ts\nimport clean from \"https://deno.land/x/rutcl/lib/clean.ts\";\n\nclean(\"0018*591.404*6\"); // =\u003e \"185914046\"\n```\n\n## CLI\n\n`TODO`\n\n### Install CLI\n\n`TODO`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwachunei%2Frutcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwachunei%2Frutcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwachunei%2Frutcl/lists"}