{"id":19042064,"url":"https://github.com/writetome51/typescript-base-class","last_synced_at":"2026-04-29T10:01:53.133Z","repository":{"id":122062478,"uuid":"161982396","full_name":"writetome51/typescript-base-class","owner":"writetome51","description":"An abstract Typescript/Javascript class with properties and methods that maybe every class should have","archived":false,"fork":false,"pushed_at":"2020-08-07T17:17:13.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T01:00:43.954Z","etag":null,"topics":["abstract","base-class","class","javascript","typescript"],"latest_commit_sha":null,"homepage":null,"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/writetome51.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":"2018-12-16T08:35:08.000Z","updated_at":"2020-08-07T17:17:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"b246135e-0825-4a18-b9cd-aba97d2f0f46","html_url":"https://github.com/writetome51/typescript-base-class","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/writetome51/typescript-base-class","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Ftypescript-base-class","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Ftypescript-base-class/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Ftypescript-base-class/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Ftypescript-base-class/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/typescript-base-class/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Ftypescript-base-class/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32420356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["abstract","base-class","class","javascript","typescript"],"created_at":"2024-11-08T22:34:29.718Z","updated_at":"2026-04-29T10:01:53.118Z","avatar_url":"https://github.com/writetome51.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BaseClass\n\nAn abstract Typescript/Javascript class with properties and methods that maybe   \nevery class should have.\n\n\n## Properties\n\n#### className: string (read-only)\n\n\n## Methods\n\n```\nprotected   _createGetterAndOrSetterForEach(\n\t\tpropertyNames: string[],\n\t\tconfiguration: IGetterSetterConfiguration\n\t   ) : void\n    /*********************\n    Use this method when you have a bunch of properties that need getter and/or \n    setter functions that all do the same thing. You pass in an array of string \n    names of those properties, and the method attaches the same getter and/or \n    setter function to each property.\n    IGetterSetterConfiguration is this object:\n    {\n        get_setterFunction?: (\n             propertyName: string, index?: number, propertyNames?: string[]\n        ) =\u003e Function,\n\t    // get_setterFunction takes the property name as first argument and \n\t    // returns the setter function.  The setter function must take one \n\t    // parameter and return void.\n\t    \n        get_getterFunction?: (\n             propertyName: string, index?: number, propertyNames?: string[]\n        ) =\u003e Function\n\t    // get_getterFunction takes the property name as first argument and \n\t    // returns the getter function.  The getter function must return something.\n    }\n    *********************/ \n\t   \n\t   \nprotected   _returnThis_after(voidExpression: any) : this\n    // voidExpression is executed, then function returns this.\n    // Even if voidExpression returns something, the returned data isn't used.\n\n\nprotected   _errorIfPropertyHasNoValue(\n                property: string, // can contain dot-notation, i.e., 'property.subproperty'\n                propertyNameInError? = ''\n            ) : void\n    // If value of this[property] is undefined or null, it triggers fatal error:\n    // `The property \"${propertyNameInError}\" has no value.`\n```\n\n## Explanation of syntax in above code examples\n \nVariable declaration: \u0026nbsp; `varName: type`  \nFunction declaration: \u0026nbsp; `functionName(...parameters): type_returned`  \n\nWhen specifying a variable type must be a specific function:  \n`varName: (...parameters) =\u003e type_returned`  \n\nOptional parameter in a function:  \n`parameterName? = (default_value)` \u0026nbsp; or \u0026nbsp; `parameterName?: type`  \n\nOptional property in an object:  \u0026nbsp; `propertyName?: type`  \n\nVariable parsed inside a literal string:  \n```\n`This is a string containing the value of ${varName}`\n```\n\n## Installation\n`npm i  @writetome51/base-class`\n\n\n## Loading\n```js\nimport { BaseClass } from '@writetome51/base-class';\n```\n\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Ftypescript-base-class","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Ftypescript-base-class","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Ftypescript-base-class/lists"}