Skip to content

Conversation

@dom-baur
Copy link
Contributor

Add string utility function isValidSwissSocialSecurityNumber for issue #77

@dom-baur dom-baur requested a review from a team as a code owner August 27, 2025 08:52
@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 27, 2025

Open in StackBlitz

npm i https://pkg.pr.new/neolution-ch/javascript-utils/@neolution-ch/javascript-utils@78

commit: 933ef62

@dom-baur dom-baur requested a review from fwermelinger August 27, 2025 13:46
@dom-baur
Copy link
Contributor Author

This part of the code is probably not the best solution. Is there a better way to solve this?

// code is never undefined!
return (code! - 55).toString();

@neoscie neoscie requested a review from Copilot August 27, 2025 13:57

This comment was marked as outdated.

neoscie and others added 3 commits August 27, 2025 15:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@dom-baur dom-baur requested a review from drebrez August 28, 2025 07:05
@neoscie neoscie requested a review from Copilot August 29, 2025 12:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new string utility function isValidSwissSocialSecurityNumber that validates Swiss social security numbers (AHV numbers) with checksum verification according to the official Swiss format specification.

  • Adds validation function for Swiss social security numbers with checksum calculation
  • Supports both dotted format (756.XXXX.XXXX.XX) and compact format (756XXXXXXXXXX)
  • Includes comprehensive test coverage for various valid and invalid input scenarios

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/lib/string.ts Implements the Swiss social security number validation function with checksum verification
src/lib/string.spec.ts Adds test cases covering valid/invalid formats and edge cases
CHANGELOG.md Documents the new utility function in the unreleased section

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

neoscie and others added 2 commits August 29, 2025 14:40
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Sep 1, 2025

Package Line Rate Branch Rate Complexity Health
main 100% 100% 0
Summary 100% (174 / 174) 100% (91 / 91) 0

@drebrez drebrez merged commit 18d0936 into neolution-ch:main Sep 3, 2025
5 checks passed
@dom-baur dom-baur deleted the feature/ahvnumber-check branch September 3, 2025 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants