{"id":20932897,"url":"https://github.com/jferrl/string-calculator-kata","last_synced_at":"2026-04-26T19:32:21.452Z","repository":{"id":96746326,"uuid":"317251534","full_name":"jferrl/String-Calculator-Kata","owner":"jferrl","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-03T15:23:43.000Z","size":329,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T08:34:41.775Z","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/jferrl.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-11-30T14:38:10.000Z","updated_at":"2020-12-03T15:23:45.000Z","dependencies_parsed_at":"2023-06-28T21:10:31.927Z","dependency_job_id":null,"html_url":"https://github.com/jferrl/String-Calculator-Kata","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"jferrl/ts-kata-bootstrap","purl":"pkg:github/jferrl/String-Calculator-Kata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2FString-Calculator-Kata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2FString-Calculator-Kata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2FString-Calculator-Kata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2FString-Calculator-Kata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jferrl","download_url":"https://codeload.github.com/jferrl/String-Calculator-Kata/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jferrl%2FString-Calculator-Kata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32310804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: 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":[],"created_at":"2024-11-18T21:53:42.593Z","updated_at":"2026-04-26T19:32:21.434Z","avatar_url":"https://github.com/jferrl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# String Calculator Kata\n\n## Incremental kata\n\nhttps://kata-log.rocks/string-calculator-kata\n\nIt’s an incremental kata to simulate a real business situation: start of by reading the section 1 and completing it, then go onto section 2, and when you have finished that, look at section 3, etc.\n\n- Try not to read ahead.\n- Do one task at a time. The trick is to learn to work incrementally.\n- Make sure you only test for correct inputs. there is no need to test for invalid inputs for\nthis kata\n- Test First!\n\n### Learn TDD\n\n![alt text](https://github.com/jferrl/String-Calculator-Kata/blob/master/resources/TDDStatesMoves.001.jpg)\n\n### TDD in terms of States and Moves\n\nhttp://coding-is-like-cooking.info/2011/05/tdd-in-terms-of-states-and-moves/\n\n## Commands\n\nAll the different build steps are orchestrated via [npm scripts](https://docs.npmjs.com/misc/scripts).\n\n| Npm Script   | Description                                                         |\n| ------------ | ------------------------------------------------------------------- |\n| `start`      | Runs node on `dist/index.js` which is the apps entry point          |\n| `build`      | Full build. Runs ALL build tasks (`build-ts`)                       |\n| `test`       | Runs tests using Jest test runner                                   |\n| `watch-test` | Runs tests in watch mode                                            |\n| `build-ts`   | Compiles all source `.ts` files to `.js` files in the `dist` folder |\n\n## Step 1\n\nCreate a simple String calculator with a method signature:\n\n    int Add(string numbers)\n\nThe method can take up to two numbers, separated by commas, and will return their sum.\n\nFor example “” or “1” or “1,2” as inputs.\n\nFor an empty string it will return 0.\n\n## Step 2\n\nAllow the Add method to handle an unknown amount of numbers.\n\n## Step 3\n\nAllow the Add method to handle new lines between numbers (instead of commas):\n\nThe following input is ok: “1\\n2,3” (will equal 6)\n\nThe following input is NOT ok: “1,\\n” (not need to prove it - just clarifying)\n\n## Step 4\n\nSupport different delimiters:\n\nTo change a delimiter, the beginning of the string will contain a separate line that looks like this: “//[delimiter]\\n[numbers…]” for example “//;\\n1;2” should return three where the default delimiter is ‘;’.\n\nThe first line is optional. All existing scenarios should still be supported.\n\n## Step 5\n\nCalling Add with a negative number will throw an exception “negatives not allowed” - and the negative that was passed.\n\nIf there are multiple negatives, show all of them in the exception message.\n\n## Step 6\n\nNumbers bigger than 1000 should be ignored, so adding 2 + 1001 = 2\n\n## Step 7\n\nDelimiters can be of any length with the following format: “//[delimiter]\\n” for example: “//[***]\\n1**_2_**3” should return 6.\n\n## Step 8\n\nAllow multiple delimiters like this: “//[delim1][delim2]\\n” for example “//[\\*][%]\\n1\\*2%3” should return 6.\n\n## Step 9\n\nMake sure you can also handle multiple delimiters with length longer than one char.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrl%2Fstring-calculator-kata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjferrl%2Fstring-calculator-kata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjferrl%2Fstring-calculator-kata/lists"}