You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an error happening, all the others results missed.
constnpmName=require('npm-name');(async()=>{try{awaitnpmName.many(['sdhd','_ABC','chalk']);}catch(error){console.log(error.message);// Invalid package name: _ABC// - name cannot start with an underscore// - name can no longer contain capital letters}})();
One way I thought to fix it is return error instead of throw error when validating name, and then we check the result(true or false or instanceof Error) in other modules. @sindresorhus how do you think, is it reasonable for you ?
The text was updated successfully, but these errors were encountered:
Refs: sindresorhus/npm-name-cli#16
When an error happening, all the others results missed.
One way I thought to fix it is
return error
instead ofthrow error
when validating name, and then we check the result(true
orfalse
orinstanceof Error
) in other modules.@sindresorhus how do you think, is it reasonable for you ?
The text was updated successfully, but these errors were encountered: