#Whats the difference between the different imports?

1 messages · Page 1 of 1 (latest)

languid nexus
#

Some packages reexport things from djs for example.
What is the best practise to use?
And whats the difference?

iron fogBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

tender hare
#

discord.js' is type Snowflake = string;, the other is a class pre-instantiated as DiscordSnowflake and TwitterSnowflake, which serves snowflake utilities to read data from it. Discord.js re-exports the former as SnowflakeUtil.

kind hound
#

discord.js only exports a type which is an alias for string. @sapphire/snowflake is a TS implementation of the snowflake system. They are 2 completely different things.

(also you could've found this out by checking the djs and sapphire docs)

iron fogBOT
#

Thank you for marking this question as solved!

Question Message ID

1093553848104255488

Solution Message ID

1093558576557084824

languid nexus
#

codeBlock would be a good example for example.
(if its the same)
is it better to use the djs or the djs utilities one?

kind hound
#

IMHO sapphire because we do additional parsing

#

With djs if you import a nested codeblocks you get garbled text but with sapphire we escape that.

#

So you're really just gonna have to check the source code for these things

#

It's really a case by case thing