refactor: extract npm and yarn processing from `latestVersion` in their own functions
refactor: extract npm and yarn processing from `latestVersion` in their own functions

Preparatory refactoring to simplify future compatibility with Yarn 2.

storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,kadirahq/react-storybook