Issue with the createIdentifier function and how validate function is accessed
Noticed the activeID object is empty in console.log, so the state can't be validated and will always return falsy i.e. error message "Invalid state parameter"
Tried exporting the createIdentifier function to its own module, learned that when you require it in different modules, a new instance of createIdentifier is created each time essentially resetting activeID
ChatGPT explanation: When you declare const activeID = {}; inside the createIdentifier function, activeID becomes a local variable, and its scope is limited to that specific invocation of the function. This means that every time you require the module and call createIdentifier, a new version of activeID is created because it's part of the function's local scope.
activeID is declared at the module level, shared across all instances of the module.
Modifications to activeID in one module are visible in other modules.
Notes