Skip to content

Handling Leap Year Issue and more#126

Closed
NavyStack wants to merge 4 commits intorendall:masterfrom
NavyStack:dev
Closed

Handling Leap Year Issue and more#126
NavyStack wants to merge 4 commits intorendall:masterfrom
NavyStack:dev

Conversation

@NavyStack
Copy link
Copy Markdown

  • Explicitly assigning types to variables and parameters in TypeScript.
  • Added a token testing process to account for leap years
  • Fix missing some node.js dependencies, including "saslprep"

Module not found: Error: Can't resolve '@aws-sdk/credential-providers' in ~
Module not found: Error: Can't resolve 'saslprep' in ~
Module not found: Error: Can't resolve 'aws4' in ~
Module not found: Error: Can't resolve 'mongodb-client-encryption' in ~

  • Fix debounce strings

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 1, 2024

👷 Deploy request for simple-comment pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1c5ffb9

Comment thread src/lib/crypt.ts Outdated
Comment on lines +9 to +17
const toSlug = (str: string): string => {
return str
.toLowerCase() // Convert to lower case
.trim() // Remove leading and trailing spaces
.replace(/_/g, "-") // Replace underscores with dashes
.replace(/\s+/g, "-") // Replace all spaces with dashes
.replace(/[^a-z0-9-]/g, "") // Remove characters that are not lowercase letters, numbers, or dashes
.replace(/-+/g, "-") // Merge consecutive dashes into a single dash
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

👍🏻

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I like the simplification and comments here. House style is to avoid a return statement when there are no local variables nor otherwise any need for a command block (curly brackets).

Comment thread src/simple-comment-icebreakers.ts Outdated
Comment thread src/tests/backend/crypt.test.ts Outdated
Comment thread src/tests/frontend/frontend-utilities.test.ts
Comment thread src/tests/backend/crypt.test.ts
Copy link
Copy Markdown
Owner

@rendall rendall left a comment

Choose a reason for hiding this comment

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

Hi @NavyStack

I really appreciate your effort here.

Could you read and acknowledge the Contributor License Agreement before I incorporate any of your code, please?

You don't have to "sign and return it" as indicated at the bottom. Just acknowledge in reply that you have read and agree to it. The idea is that I would like my company to retain complete ownership and autonomy over Simple Comment. Without explicit agreement, it seems sometimes a contribution can lead to misunderstandings about ownership.

Much appreciated!

@NavyStack
Copy link
Copy Markdown
Author

I agree with CLA

I noticed an error when I tested on January 1st KST, but it doesn't seem to occur now.
There was an error with the token.
It almost feels like I'm being haunted by these inconsistencies.

Considering this situation, it would be prudent to use the actual JavaScript Intl.DateTimeFormat API to generate the output for each locale and then compare it with the expected format.
This approach should ensure a more accurate verification of date formatting across different locales.

@rendall
Copy link
Copy Markdown
Owner

rendall commented Mar 27, 2026

Thank you very much for this PR. The codebase is undergoing a modernization effort now and I will use your idea to

    // Use a defined JWT_SECRET or a default for testing
    const jwtSecret = process.env.JWT_SECRET || "default_test_secret"

@rendall rendall closed this Mar 27, 2026
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.

2 participants