-
-
Notifications
You must be signed in to change notification settings - Fork 404
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What is the problem this feature would solve?
Like Number.parse this would be a nice addition.
What is the feature you are proposing to solve the problem?
const parseInt = (str: string, radix?: number): Option.Option<number> => {
const num = Number.parseInt(str, radix);
if (Number.isNaN(num)) {
return Option.none();
}
return Option.some(num);
};
Exists internally here:
const parseInteger = (str: string): Option.Option<number> => { |
What alternatives have you considered?
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]Number.parseInt :: Option<number>[/-][+]Number.parseInt[/+]giuliobracci commentedon Feb 20, 2025
@jessekelly881 you can define a simple
parseInt
from Effect'sSchema
library.Demo
Let me know if that works for you.