{"id":13520467,"url":"https://github.com/trapcodeio/abolish","last_synced_at":"2025-04-23T20:22:20.219Z","repository":{"id":43199891,"uuid":"247893531","full_name":"trapcodeio/abolish","owner":"trapcodeio","description":"A smart blazing fast javascript  variable validator.","archived":false,"fork":false,"pushed_at":"2025-02-16T09:18:21.000Z","size":446,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T13:08:44.471Z","etag":null,"topics":["abolish"],"latest_commit_sha":null,"homepage":"https://abolish.trapcode.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trapcodeio.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-03-17T06:13:38.000Z","updated_at":"2024-09-19T01:20:09.000Z","dependencies_parsed_at":"2024-06-08T00:43:35.310Z","dependency_job_id":"6ee7fe95-3d06-4d96-b4c0-53e4c2ba0bbe","html_url":"https://github.com/trapcodeio/abolish","commit_stats":{"total_commits":381,"total_committers":2,"mean_commits":190.5,"dds":"0.28608923884514437","last_synced_commit":"aa16513e8a808cc8f6f8051bfa65998e9eea149a"},"previous_names":[],"tags_count":142,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapcodeio%2Fabolish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapcodeio%2Fabolish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapcodeio%2Fabolish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trapcodeio%2Fabolish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trapcodeio","download_url":"https://codeload.github.com/trapcodeio/abolish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250506571,"owners_count":21441801,"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":["abolish"],"created_at":"2024-08-01T05:02:21.711Z","updated_at":"2025-04-23T20:22:20.198Z","avatar_url":"https://github.com/trapcodeio.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Abolish\n\nA Javascript object validator for custom validations\n\n\nDocumentation: [Abolish Documentation](https://abolish.trapcode.io)\n\u003cbr\u003e\nPlayground: [Abolish Playground](https://abolish-playground.trapcode.io)\n\n### Basic Example\n```javascript\nconst {Abolish} = require('abolish');\n\nconst abolish = new Abolish();\n\n// Use abolish email validator\nconst EmailValidator = require('abolish/validators/string/email');\nabolish.addValidator(EmailValidator);\n\n// Add Custom Validtor\nabolish.addValidator({\n  name: 'addProtocol',\n  validator: (url, option, {modifier}) =\u003e {\n    // Check if url does not have required protocol\n    if (url.substring(0, option.length) !== option) {\n      // Add protocol\n      modifier.setThis(`${option}://${url}`)\n    }\n    return true\n  }\n});\n\n// Object to validate\nconst form = {\n  email: 'appdeveloper@sky.com',\n  username: 'john_doe',\n  age: 18,\n  url: 'wildstream.ng'\n};\n\nconst [error, validated] = abolish.validate(form, {\n  $: 'required|typeOf:string', // $ or '*' is considered as wildcard\n  email: 'isEmail',\n  username: '*',\n  age: 'typeOf:number|max:20',\n  url: 'addProtocol:http'\n});\n\nconsole.log({form, validation: {error, validated}});\n```\n\n#### Result\n\n```\n{\n  form: {\n    email: 'appdeveloper@sky.com',\n    username: 'john_doe',\n    age: 18,\n    url: 'wildstream.ng'\n  },\n  validation: {\n    error: null,\n    validated: {\n      email: 'appdeveloper@sky.com',\n      username: 'john_doe',\n      age: 18,\n      url: 'http://wildstream.ng'\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrapcodeio%2Fabolish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrapcodeio%2Fabolish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrapcodeio%2Fabolish/lists"}