{"id":15561851,"url":"https://github.com/doodzik/hydraulik-types","last_synced_at":"2025-06-25T08:07:36.994Z","repository":{"id":32837160,"uuid":"36430479","full_name":"doodzik/hydraulik-types","owner":"doodzik","description":null,"archived":false,"fork":false,"pushed_at":"2015-08-10T13:44:38.000Z","size":152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-02T04:48:04.518Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doodzik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-28T10:12:17.000Z","updated_at":"2016-11-08T09:21:29.000Z","dependencies_parsed_at":"2022-06-27T01:32:36.523Z","dependency_job_id":null,"html_url":"https://github.com/doodzik/hydraulik-types","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/doodzik/hydraulik-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fhydraulik-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fhydraulik-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fhydraulik-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fhydraulik-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doodzik","download_url":"https://codeload.github.com/doodzik/hydraulik-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doodzik%2Fhydraulik-types/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261832678,"owners_count":23216497,"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-10-02T16:10:24.648Z","updated_at":"2025-06-25T08:07:36.967Z","avatar_url":"https://github.com/doodzik.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydraulik-types\n\n`$ npm i hydraulik-types --save`\n\n```es6\nimport Str from 'hydraulik-types/lib/str'\n\n// Type values shouldn't be reasigned.\nnew Str('hello world').validate\n=\u003e ''\nnew Str('hello world').isValid\n=\u003e true\n\n```\n\n## API\n\n\\#new value, [options]\n\n\\#isValid: bool\n\n\\#validate: string\n\nreturns the error message\n\n\\#validation: string/null\n\nOnly relevant if you use your \nholds the tests.\n\n## Types\n\n### Type\n\nany value is accepted\n\n### String - Str\n\nanything that listens to toString is accepted\n@min and @max decorators available for defining custom Types.\nThis is used to validate the string length.\n\n### Boolean - Bool\n\nJust True and False\n\n### Error\n\nempty strinsg is accepted\n\n## Custom Types\n\n```es6\nimport Str, { max } from 'hydraulik-types/lib/str'\n\n@max(140)\nclass Tweet extends Str {\n  constructor(...args){\n    super(...args) // mandatory\n    // access to options object through this.options\n    // access to value through this.value\n  }\n\n  validation(){\n    // The validation of the parent type is done before hand. no need to call super\n    // Check out src/type.jsx to see how it is done\n    // name is the name of the type, which can also be set througth options.name\n    if (this.value.indexOf('i am being censored') \u003e -1)\n        return `${this.name} arn't censored` // return the error msg.\n    // you don't have to specify a return value\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoodzik%2Fhydraulik-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoodzik%2Fhydraulik-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoodzik%2Fhydraulik-types/lists"}