{"_id":"@benjymoses/helpers","_rev":"4-b150ddfc858b05ff8f164a98874a2510","name":"@benjymoses/helpers","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"name":"@benjymoses/helpers","version":"0.0.1","keywords":["helper","helpers","typescript"],"author":{"name":"Ben Moses"},"license":"MIT","_id":"@benjymoses/helpers@0.0.1","maintainers":[{"name":"benjymoses","email":"benmoses@webfront.co.uk"}],"homepage":"https://github.com/benjymoses/helpers#readme","bugs":{"url":"https://github.com/benjymoses/helpers/issues"},"//":"~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".","dist":{"shasum":"314f75878fac0477c2dab658573ac70a97937f97","tarball":"https://registry.npmjs.org/@benjymoses/helpers/-/helpers-0.0.1.tgz","fileCount":5,"integrity":"sha512-3vdbhlg3Ub1jg63bcLxZzv2kPDsh/YkrFCRhev2d9nUgznJ0LD9r6qE843MpkpKljuBVVTo+mYOeXy42w/fHRg==","signatures":[{"sig":"MEUCIQDzy+K16elAcWmDGECXo4h+j00qbH7KJWeC2NdmNrJWKwIgRoe9qARbNJ/bbWZmjL5nxtx1HHKcUq7zG7xkAvolgdk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@benjymoses%2fhelpers@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4534},"jest":{"reporters":["default",["jest-junit",{"outputDirectory":"test-reports"}]],"testMatch":["<rootDir>/@(src|test)/**/*(*.)@(spec|test).ts?(x)","<rootDir>/@(src|test)/**/__tests__/**/*.ts?(x)","<rootDir>/@(projenrc)/**/*(*.)@(spec|test).ts?(x)","<rootDir>/@(projenrc)/**/__tests__/**/*.ts?(x)"],"transform":{"^.+\\.[t]sx?$":["ts-jest",{"tsconfig":"tsconfig.dev.json"}]},"clearMocks":true,"collectCoverage":true,"coverageProvider":"v8","coverageDirectory":"coverage","coverageReporters":["json","lcov","clover","cobertura","text"],"testPathIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":["/node_modules/"],"coveragePathIgnorePatterns":["/node_modules/"]},"main":"lib/index.js","_from":"file:dist/js/benjymoses-helpers-0.0.1.tgz","types":"lib/index.d.ts","scripts":{"bump":"npx projen bump","test":"npx projen test","build":"npx projen build","eject":"npx projen eject","watch":"npx projen watch","eslint":"npx projen eslint","projen":"npx projen","unbump":"npx projen unbump","clobber":"npx projen clobber","compile":"npx projen compile","default":"npx projen default","package":"npx projen package","release":"npx projen release","upgrade":"npx projen upgrade","test:watch":"npx projen test:watch","pre-compile":"npx projen pre-compile","post-compile":"npx projen post-compile","post-upgrade":"npx projen post-upgrade"},"_npmUser":{"name":"benjymoses","email":"benmoses@webfront.co.uk"},"_resolved":"/home/runner/work/helpers/helpers/dist/js/benjymoses-helpers-0.0.1.tgz","_integrity":"sha512-3vdbhlg3Ub1jg63bcLxZzv2kPDsh/YkrFCRhev2d9nUgznJ0LD9r6qE843MpkpKljuBVVTo+mYOeXy42w/fHRg==","repository":{"url":"git+https://github.com/benjymoses/helpers.git","type":"git"},"_npmVersion":"10.9.2","description":"Helper libraries for TypeScript","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9","projen":"^0.91.20","ts-jest":"^29.3.1","ts-node":"^10.9.2","constructs":"^10.0.0","jest-junit":"^16","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.0","eslint-plugin-import":"^2.31.0","commit-and-tag-version":"^12","@stylistic/eslint-plugin":"^2","@typescript-eslint/parser":"^8","@typescript-eslint/eslint-plugin":"^8","eslint-import-resolver-typescript":"^4.3.2"},"_npmOperationalInternal":{"tmp":"tmp/helpers_0.0.1_1744153972435_0.6361551413151523","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@benjymoses/helpers","version":"0.0.2","keywords":["helper","helpers","typescript"],"author":{"name":"Ben Moses"},"license":"MIT","_id":"@benjymoses/helpers@0.0.2","maintainers":[{"name":"benjymoses","email":"benmoses@webfront.co.uk"}],"homepage":"https://github.com/benjymoses/helpers#readme","bugs":{"url":"https://github.com/benjymoses/helpers/issues"},"//":"~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".","dist":{"shasum":"e559227f0526afb84642f413abdc75cba721e893","tarball":"https://registry.npmjs.org/@benjymoses/helpers/-/helpers-0.0.2.tgz","fileCount":32,"integrity":"sha512-2LBpOLVQ0ACpA5xFM9em/bz2fVAS5j3mpbBiLxB36srFIOWAswEvYqqDoyjycKrS3mdFdqemFu8khGAXOIVT1Q==","signatures":[{"sig":"MEYCIQCSoDD9AiiKdgnON6qAi5yyCYkc/YIVYl1kCm2Gdk/zeAIhAN6JwrrmOVA3jEKioo7/fjVtrXDcL32GOKQ9O0ueEPwf","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@benjymoses%2fhelpers@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":50798},"main":"lib/index.js","_from":"file:dist/js/benjymoses-helpers-0.0.2.tgz","types":"lib/index.d.ts","scripts":{"bump":"npx projen bump","test":"npx projen test","build":"npx projen build","eject":"npx projen eject","watch":"npx projen watch","eslint":"npx projen eslint","projen":"npx projen","unbump":"npx projen unbump","clobber":"npx projen clobber","compile":"npx projen compile","default":"npx projen default","package":"npx projen package","release":"npx projen release","upgrade":"npx projen upgrade","pre-compile":"npx projen pre-compile","post-compile":"npx projen post-compile","post-upgrade":"npx projen post-upgrade","test:coverage":"npx projen test:coverage"},"_npmUser":{"name":"benjymoses","email":"benmoses@webfront.co.uk"},"_resolved":"/home/runner/work/helpers/helpers/dist/js/benjymoses-helpers-0.0.2.tgz","_integrity":"sha512-2LBpOLVQ0ACpA5xFM9em/bz2fVAS5j3mpbBiLxB36srFIOWAswEvYqqDoyjycKrS3mdFdqemFu8khGAXOIVT1Q==","repository":{"url":"git+https://github.com/benjymoses/helpers.git","type":"git"},"_npmVersion":"10.9.2","description":"Helper libraries for TypeScript","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9","projen":"^0.91.20","ts-jest":"^29.3.2","ts-node":"^10.9.2","constructs":"^10.0.0","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.1","eslint-plugin-import":"^2.31.0","commit-and-tag-version":"^12","@stylistic/eslint-plugin":"^2","@typescript-eslint/parser":"^8","@typescript-eslint/eslint-plugin":"^8","eslint-import-resolver-typescript":"^4.3.2"},"_npmOperationalInternal":{"tmp":"tmp/helpers_0.0.2_1744758536235_0.9334775533728332","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@benjymoses/helpers","version":"0.0.3","keywords":["helper","helpers","typescript"],"author":{"name":"Ben Moses"},"license":"MIT","_id":"@benjymoses/helpers@0.0.3","maintainers":[{"name":"benjymoses","email":"benmoses@webfront.co.uk"}],"homepage":"https://github.com/benjymoses/helpers#readme","bugs":{"url":"https://github.com/benjymoses/helpers/issues"},"//":"~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".","dist":{"shasum":"013acfc3b51a2359dad60cbbf978fdb5a557e9ba","tarball":"https://registry.npmjs.org/@benjymoses/helpers/-/helpers-0.0.3.tgz","fileCount":32,"integrity":"sha512-HPadBf66mCaHrBWo/ntQxQlnQd/6PcYIwIDwTtxDJDs6mb0qWNZmo5ICKJTb9Exjs6eSorgV6uhrkulQUDpFaA==","signatures":[{"sig":"MEUCIHLCnxvCXYPDgVKMpAic17oOrcc870xKtt+a6kX0TGiVAiEA/dMwA9S8bvAG85soz1qK0le4K5ne0aoaYXysMjty1BY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@benjymoses%2fhelpers@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58971},"main":"lib/index.js","_from":"file:dist/js/benjymoses-helpers-0.0.3.tgz","types":"lib/index.d.ts","scripts":{"bump":"npx projen bump","test":"npx projen test","build":"npx projen build","eject":"npx projen eject","watch":"npx projen watch","eslint":"npx projen eslint","projen":"npx projen","unbump":"npx projen unbump","clobber":"npx projen clobber","compile":"npx projen compile","default":"npx projen default","package":"npx projen package","release":"npx projen release","upgrade":"npx projen upgrade","pre-compile":"npx projen pre-compile","post-compile":"npx projen post-compile","post-upgrade":"npx projen post-upgrade","test:coverage":"npx projen test:coverage"},"_npmUser":{"name":"benjymoses","email":"benmoses@webfront.co.uk"},"_resolved":"/home/runner/work/helpers/helpers/dist/js/benjymoses-helpers-0.0.3.tgz","_integrity":"sha512-HPadBf66mCaHrBWo/ntQxQlnQd/6PcYIwIDwTtxDJDs6mb0qWNZmo5ICKJTb9Exjs6eSorgV6uhrkulQUDpFaA==","repository":{"url":"git+https://github.com/benjymoses/helpers.git","type":"git"},"_npmVersion":"10.9.2","description":"Helper libraries for TypeScript","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^9","projen":"^0.91.20","ts-jest":"^29.3.2","ts-node":"^10.9.2","constructs":"^10.0.0","typescript":"^5.8.3","@types/jest":"^29.5.14","@types/node":"^22.14.1","eslint-plugin-import":"^2.31.0","commit-and-tag-version":"^12","@stylistic/eslint-plugin":"^2","@typescript-eslint/parser":"^8","@typescript-eslint/eslint-plugin":"^8","eslint-import-resolver-typescript":"^4.3.2"},"_npmOperationalInternal":{"tmp":"tmp/helpers_0.0.3_1744797452523_0.2358585133782165","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@benjymoses/helpers","description":"Helper libraries for TypeScript","repository":{"type":"git","url":"git+https://github.com/benjymoses/helpers.git"},"scripts":{"build":"npx projen build","bump":"npx projen bump","clobber":"npx projen clobber","compile":"npx projen compile","default":"npx projen default","eject":"npx projen eject","eslint":"npx projen eslint","package":"npx projen package","post-compile":"npx projen post-compile","post-upgrade":"npx projen post-upgrade","pre-compile":"npx projen pre-compile","release":"npx projen release","test":"npx projen test","test:coverage":"npx projen test:coverage","unbump":"npx projen unbump","upgrade":"npx projen upgrade","watch":"npx projen watch","projen":"npx projen"},"author":{"name":"Ben Moses"},"devDependencies":{"@stylistic/eslint-plugin":"^2","@types/jest":"^29.5.14","@types/node":"^22.15.2","@typescript-eslint/eslint-plugin":"^8","@typescript-eslint/parser":"^8","commit-and-tag-version":"^12","constructs":"^10.0.0","eslint":"^9","eslint-import-resolver-typescript":"^4.3.4","eslint-plugin-import":"^2.31.0","jest":"^29.7.0","projen":"^0.91.26","ts-jest":"^29.3.2","ts-node":"^10.9.2","typescript":"^5.8.3"},"keywords":["helper","helpers","typescript"],"main":"lib/index.js","license":"MIT","publishConfig":{"access":"public"},"version":"0.0.4","types":"lib/index.d.ts","exports":{".":{"import":"./lib/index.js","require":"./lib/index.js"},"./strings":{"import":"./lib/strings/index.js","require":"./lib/strings/index.js"},"./objects":{"import":"./lib/objects/index.js","require":"./lib/objects/index.js"}},"//":"~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\".","_id":"@benjymoses/helpers@0.0.4","bugs":{"url":"https://github.com/benjymoses/helpers/issues"},"homepage":"https://github.com/benjymoses/helpers#readme","_integrity":"sha512-4L8mv2JKE9AVV2h9SbnDNO9XdZzwSyqArCtViEREdGXqNmW0QYI2DnMpaCxc8gQwtisN7jE998gU3AwfoOK0wA==","_resolved":"/home/runner/work/helpers/helpers/dist/js/benjymoses-helpers-0.0.4.tgz","_from":"file:dist/js/benjymoses-helpers-0.0.4.tgz","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4L8mv2JKE9AVV2h9SbnDNO9XdZzwSyqArCtViEREdGXqNmW0QYI2DnMpaCxc8gQwtisN7jE998gU3AwfoOK0wA==","shasum":"39b970a28a6126df59940baf423e20145cc14e02","tarball":"https://registry.npmjs.org/@benjymoses/helpers/-/helpers-0.0.4.tgz","fileCount":17,"unpackedSize":29330,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@benjymoses%2fhelpers@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFLjMrOxzFSr9bg0MlyaNx5h9B469qgkV8x7ZsiA4nIIAiBiyvDC/UF42s68aaNa5No/WXcvvwC2vQu30cU2qiQCYQ=="}]},"_npmUser":{"name":"benjymoses","email":"benmoses@webfront.co.uk"},"directories":{},"maintainers":[{"name":"benjymoses","email":"benmoses@webfront.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/helpers_0.0.4_1745708752602_0.7682507210009006"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-08T23:12:52.355Z","modified":"2025-04-26T23:05:53.259Z","0.0.1":"2025-04-08T23:12:52.644Z","0.0.2":"2025-04-15T23:08:56.432Z","0.0.3":"2025-04-16T09:57:32.694Z","0.0.4":"2025-04-26T23:05:52.788Z"},"bugs":{"url":"https://github.com/benjymoses/helpers/issues"},"author":{"name":"Ben Moses"},"license":"MIT","homepage":"https://github.com/benjymoses/helpers#readme","keywords":["helper","helpers","typescript"],"repository":{"type":"git","url":"git+https://github.com/benjymoses/helpers.git"},"description":"Helper libraries for TypeScript","maintainers":[{"name":"benjymoses","email":"benmoses@webfront.co.uk"}],"readme":"<div align=\"center\">\n\n# Helpers\n\n<img src=\"https://img.shields.io/github/license/benjymoses/helpers\"/>\n<img src=\"https://img.shields.io/github/actions/workflow/status/benjymoses/helpers/build.yml\" />\n<img src=\"https://img.shields.io/github/commit-activity/m/benjymoses/helpers\" />\n\n<!-- ![GitHub Actions 'upgrade-main' Workflow Status](https://img.shields.io/github/actions/workflow/status/benjymoses/helpers/upgrade-main.yml) -->\n<!--![GitHub branch check runs](https://img.shields.io/github/check-runs/benjymoses/helpers/main) -->\n<!-- ![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/benjymoses/helpers) -->\n<!-- ![GitHub Open Pull Requests](https://img.shields.io/github/issues-pr/benjymoses/helpers) -->\n</div>\n</br>\n\n### An open source library of code helpers for TypeScript projects\nIt's common when writing TypeScript projects to re-use common helper functions, types, and utilities to turbo-charge your development. This collection of helper utilities is designed to be easy to import in to your project and give you quick access to meaingful helpers. The objective is to reduce re-creating or copy/pasting these types of helper for each project you work on.\n\n---\n\n## Helpers\nThis is a new project and helpers will be added iteratively over time. Check the list below for what's already there today, and some upcoming roadmap items. If you have ideas for useful helpers you'd like to see here, feel free to submit a PR, or open a feature request issue.\n\nEach helper is self-documented with TSDoc for usage instructions and example implementations.\n\n<!-- // TODO: links to PR and feature-request issue -->\n\n### ✏️ String\n#### **camelToKebab**\nFunction that takes a camelCase string and returns as a kebab string. \n```ts\ncamelToKebab(\"myString\") // returns \"my-string\"\n```\n\n#### **capital**\nFunction that takes a string and returns the string with the first letter capitalised.\n```ts\ncapital(\"hello\") // returns \"Hello\"\n```\n\n#### **kebabToCamel**\nFunction that takes a kebab-case string and returns as a camelCase string.\n```ts\nkebabToCamel(\"my-string\") // returns \"myString\"\n```\n\n### 🔧 Object\n#### **discoverArguments**\nPassed as a callback function where you may be unclear on what arguments the callback can receive, and console.logs a JSON object with the number of arguments received, and the key and type of each argument passed at runtime. Can be used to understand Map, Array, Replace callbacks and more. By default, the function returns the first element passed to it, but this can be overriden.\n```ts\n\"helloWorld\".replace(/[a-zA-Z]/g, discoverArguments()) \n\n// console.log for each match in the RegEx:\n```json\ncallback received:  {\n  \"numberOfArgs\": 3,\n  \"arguments\": [\n    \"h: string\",\n    \"0: number\",\n    \"helloWorld: string\"\n  ]\n}\n```\n\nOptionally you can pass an `options` object to `discoverArguments()` with 2 optional properties to customise the behaviour.\n\n- **label?** \\[string\\]: a label to prefix the console.log entries with\n- **returnValue?** \\[any\\]: a value that you want the function to return instead of the default (first element received by the function)\n\n<details>\n\n<summary>Example:</summary>\n\n```ts\n\"helloWorld\".replace(/[eo]/g, discoverArguments({\n    label: \"helloWorld replace\",\n    returnValue: \"X\"\n}))\n\n// result of .replace() function is \"hXllXWXrld\"\n\n// console.log for each match in the RegEx:\n```json\nhelloWorld replace callback received:  {\n  \"numberOfArgs\": 3,\n  \"arguments\": [\n    \"h: string\",\n    \"0: number\",\n    \"helloWorld: string\"\n  ]\n}\n```\n</details>\n  \n### Validators\n\nZod validator helpers coming soon.\n\n---\n\n## Getting started\n1. Install the package in your project `npm install -D @benjymoses/helpers`\n2. Import in to your code-base\n\nImport whole package\n```ts\nimport * as helpers from \"@benjymoses/helpers\"\n\nhelpers.capital(\"hello\")\n```\n\nImport specific modules\n```ts\nimport { capital } from \"@benjymoses/helpers\";\n\ncapital(\"hello\")\n```\n  \n---\n\n## Contributing\nOpen to contribution. If you have ideas for useful helpers you'd like to see here, feel free to submit a PR, or open a feature request issue.\n\n<!-- // TODO: links to PR and feature-request issue -->\n\n### Guidance\nThis project uses [Projen](https://projen.io/) to scaffold and provide automation. Please familiarise yourself with the docs before contributing as there are some common \"gotchas\".\n\n#### Development\nYou should have TypeScript and ts-node installed globally `npm install -g typescript ts-node` and then:\n\n1. Fork the repo\n2. Clone your fork\n3. Run `npx projen` - this will cause Projen to use the *.projenrc.ts* to ensure all scaffolding is in place, and that npm packages are installed. You're welcome to then run `npm install` to be satisfied that all packages are installed.\n4. Create a new branch `git checkout -b my-new-feature`\n\nDevelop your features / fixes. Please update the relevant \\#\\#Helpers section in *README.md* if this is a new feature / helper.\n  \n\n#### Testing\nTests of core functinoality are required, and testing edge cases is preferable. Take a look at existing tests for inspiration.\n\nTests live alongside the code. For example if you're writing a new string function `alternatingCase()` the code would reside in *src/string/alternatingCase.ts* and the tests would live in *src/string/\\_\\_tests\\_\\_/alternatingCase.test.ts*.\n\nYour tests should be wrapped in a function, for example:\n\n```ts\n// alternatingCase.test.ts\n\nexport function alternatingCaseTests() {\n  describe(\"alternatingCase\", () => {\n    it(\"should do a thing\", () => {\n      // your test code here\n    })\n  })\n}\n```\n\nand then added to the test suite at *src/string/\\_\\_tests\\_\\_/string-suite.test.ts*, for example:\n\n```ts\nimport { camelToKebabTests } from \"./camelToKebab.test\";\nimport { capitalTests } from \"./capital.test\";\nimport { kebabToCamelTests } from \"./kebabToCamel.test\";\nimport { alternatingCaseTests } from \"./alternatingCase.test\"; // <-- import your tests here\n\ndescribe(\"String helpers\", () => {\n  camelToKebabTests();\n  capitalTests();\n  kebabToCamelTests();\n  alternatingCaseTests(); // <-- flag your tests for execution\n});\n```\n\nyou can now run your tests with `npx projen test` or `npx projen test:coverage`\n\n#### Submission\n\n1. Run `npx projen`\n2. Ensure tests pass (see above)\n3. Push back to your forked repo's feature branch using [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), for example `git commit -m \"feat(alternatingCase): added string utility for alternatingCase\"`\n4. Ensure the Github action for *build* succeeds\n5. Open a PR and complete the template\n\n<!-- // TODO: add link for new PR -->\n\n---\n\n## License\nMIT [view](https://github.com/benjymoses/helpers?tab=MIT-1-ov-file#readme)","readmeFilename":"README.md"}