{"id":30523641,"url":"https://github.com/chandru415/ngx-requisite","last_synced_at":"2025-08-26T20:43:39.570Z","repository":{"id":43828136,"uuid":"439579632","full_name":"chandru415/ngx-requisite","owner":"chandru415","description":"Angular custom validators \u0026 utility functions","archived":false,"fork":false,"pushed_at":"2022-12-18T08:24:10.000Z","size":1269,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T20:14:17.194Z","etag":null,"topics":["angular","ngx","reactiveform-validation","reactiveforms","require","validation"],"latest_commit_sha":null,"homepage":"","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/chandru415.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}},"created_at":"2021-12-18T09:51:35.000Z","updated_at":"2023-03-05T13:22:38.000Z","dependencies_parsed_at":"2023-01-29T18:45:55.345Z","dependency_job_id":null,"html_url":"https://github.com/chandru415/ngx-requisite","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chandru415/ngx-requisite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru415%2Fngx-requisite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru415%2Fngx-requisite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru415%2Fngx-requisite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru415%2Fngx-requisite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chandru415","download_url":"https://codeload.github.com/chandru415/ngx-requisite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandru415%2Fngx-requisite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272254426,"owners_count":24901039,"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-08-26T02:00:07.904Z","response_time":60,"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":["angular","ngx","reactiveform-validation","reactiveforms","require","validation"],"created_at":"2025-08-26T20:43:38.106Z","updated_at":"2025-08-26T20:43:39.493Z","avatar_url":"https://github.com/chandru415.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n \u003ch2 align=\"center\"\u003eNgxRequisite\u003c/h2\u003e\n \u003cp align=\"center\"\u003engx-requisite library - custom Validators, Utility functions for common development.\u003c/p\u003e\n \u003cbr/\u003e\n \u003cp align=\"center\"\u003e\n \u003cimg src=\"https://img.shields.io/github/issues/chandru415/ngx-requisite\" /\u003e\n \u003cimg src=\"https://img.shields.io/github/forks/chandru415/ngx-requisite\" /\u003e\n   \u003cimg src=\"https://img.shields.io/github/stars/chandru415/ngx-requisite\" /\u003e\n  \n\u003cimg alt=\"npm bundle size (scoped)\" src=\"https://img.shields.io/bundlephobia/min/@slck/ngx-requisite\"\u003e\n\n\u003cimg alt=\"npm (scoped)\" src=\"https://img.shields.io/npm/v/@slck/ngx-requisite\"\u003e\n\n\u003cimg alt=\"jsDelivr hits (npm scoped)\" src=\"https://img.shields.io/jsdelivr/npm/hw/@slck/ngx0requiste?color=green\u0026label=npm\u0026style=flat-square\"\u003e\n\u003cimg alt=\"node-current\" src=\"https://img.shields.io/node/v/@slck/ngx-requisite\"\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n# Installation\n\n```bash\nnpm i @slck/ngx-requisite --save\n```\n# Methods \n    - isNullOrUndefined\n    - isDate\n    - isObject\n    - leadZeroForMonthOrDay\n    - remainingDaysHoursFormTwoDates\n    - toCamelCaseKeys\n# Validators\n\n## Requisite validators\n\n- whitespace\n- isNegative\n- decimalPrecision\n\n# Usage\n\n## Model driven\n\nimport `ReactiveFormsModule` in *app.module.ts*\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { AppComponent } from './app.component';\n\n@NgModule({\n    imports: [BrowserModule, ReactiveFormsModule],\n    declarations: [AppComponent],\n    bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n```\nngx-requisite\nimport `CustomValidators` in *app.component.ts*\n\n```typescript\nimport { Component } from '@angular/core';\nimport { FormGroup, FormControl } from '@angular/forms';\nimport { requisiteValidators } from '@slck/ngx-requisite';\n\n@Component({\n    selector: 'app',\n    template: require('./app.html')\n})\nexport class AppComponent {\n  devForm = this.fb.group({\n    userName: ['', [requisiteValidators.whitespace]],\n  });\n\n  get controls(){\n    return this.devForm.controls;\n  }\n\n  constructor(private fb: FormBuilder) {}\n}\n```\n\n```html\n\u003cform [formGroup]=\"form\"\u003e\n  \u003cinput type=\"text\" name=\"\" id=\"\" formControlName=\"userName\" /\u003e\n  \u003cdiv class=\"\" *ngIf=\"controls.userName.hasError('whitespace')\"\u003ehaving space\u003c/div\u003e\n\u003c/form\u003e\n```\n\n### isNegative\n\n```typescript\nnew FormControl('', requisiteValidators.isNegative)\n```\n\n### decimalPrecision\n\n```typescript\nnew FormControl('',requisiteValidators.decimalPrecision)\n```\n\n\n### toCamelCaseKeys\n\n```typescript\nimport { toCamelCaseKeys } from '@slck/ngx-requisite';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.scss'],\n})\nexport class AppComponent implements OnInit  {\n  ngOnInit(): void {\n    const uncap = toCamelCaseKeys({\n      Name: '@slck/ngx-requisite',\n      Address: {\n        Home: 'uhi'\n      },\n      Urls: [\n        {Path: 'google', Location: 'us'}\n      ]\n    })\n  }\n}\n\n -- output: \n    {\n      name: '@slck/ngx-requisite',\n      address: {\n        home: 'uhi'\n      },\n      urls: [\n        {Path: 'google', Location: 'us'}\n      ]\n    }\n\n```\n\n# For developers\nTo run the project : `npm start`\nDon't forget to run `npm test` and `npm lint` before each pull request. Thanks !\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandru415%2Fngx-requisite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchandru415%2Fngx-requisite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandru415%2Fngx-requisite/lists"}