Détail du package

@sapphire/snowflake

sapphiredev1.1mMIT3.5.5

Deconstructs and generates snowflake IDs using BigInts

@sapphire/snowflake, bot, typescript, ts

readme

Sapphire Logo # Sapphire Utilities Common NodeJS packages for Sapphire Repositories and others. GitHub Packages npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm npm

Buy us some doughnuts

Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance!

We accept donations through Open Collective, Ko-fi, Paypal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice.

Donate With Address
Open Collective Click Here
Ko-fi Click Here
Patreon Click Here
PayPal Click Here

Contributors

Please make sure to read the Contributing Guide before making a pull request.

Thank you to all the people who already contributed to Sapphire!

changelog

Changelog

All notable changes to this project will be documented in this file.

@sapphire/snowflake@3.5.4 - (2024-11-02)

🏃 Performance

  • snowflake: Optimize Snowflake.timestampFrom (b97b30c) (#792 by @advaith1)

🐛 Bug Fixes

  • Move browser imports (100ffb0) (#826 by @kyranet)
  • deps: Update all non-major dependencies (083376a) (#763 by @renovate[bot])
  • deps: Update all non-major dependencies (e7fdc5d) (#752 by @renovate[bot])

📝 Documentation

  • readme: Fix readme table of contents (c60e8bd)

@sapphire/snowflake@3.5.3 - (2024-01-19)

🐛 Bug Fixes

  • Fixed commonjs typings export mapping (#707) (216ff02)

@sapphire/snowflake@3.5.2 - (2023-12-04)

🐛 Bug Fixes

  • snowflake: Properly split CJS, ESM and IIFE (2a1fdde)
  • Update export mapping for proper ESM/CJS split (dd0cff8)
  • deps: Update all non-major dependencies (#607) (9cc8bd0)

🧪 Testing

  • Update vitest to coverage v8 (a4bc6e4)

@sapphire/snowflake@3.5.1 - (2023-05-12)

🏠 Refactor

  • snowflake: Handle out-of-bounds increment correctly (#596) (b5276d7)

@sapphire/snowflake@3.5.0 - (2023-05-10)

🚀 Features

  • snowflake: Expose processId and workerId (#595) (b873c1c)

@sapphire/snowflake@3.4.2 - (2023-04-12)

🏠 Refactor

  • Snowflake: Simplify compare logic (#578) (886254e)

@sapphire/snowflake@3.4.1 - (2023-04-10)

🐛 Bug Fixes

  • snowflake: Ensure strings are never compared with bigints (22199a5)
  • deps: Update all non-major dependencies (#577) (291dd67)
  • deps: Update all non-major dependencies (#545) (40ca040)
  • deps: Update all non-major dependencies (#544) (cc78f17)

🧪 Testing

@sapphire/snowflake@3.4.0 - (2022-12-27)

🐛 Bug Fixes

  • deps: Update all non-major dependencies (#532) (8033d1f)

📝 Documentation

  • Add @06000208 as a contributor (fa3349e)

🚀 Features

  • snowflake: Added Snowflake.compare (#531) (6accd6d)

@sapphire/snowflake@3.3.0 - (2022-12-03)

🏠 Refactor

  • Split @sapphire/time-utilities into 4 sub-packages (#462) (574299a)

🐛 Bug Fixes

  • snowflake: TwitterSnowflake using incorrect epoch (#522) (4ad4117)
  • deps: Update all non-major dependencies (#514) (21b07d5)
  • deps: Update all non-major dependencies (#505) (6178296)
  • deps: Update all non-major dependencies (#466) (dc08606)
  • deps: Update all non-major dependencies (e20f299)
  • deps: Update all non-major dependencies (2308bd7)
  • deps: Update all non-major dependencies (84af0db)
  • deps: Update all non-major dependencies (50cd8de)

📝 Documentation

  • Add @didinele as a contributor (42ef7b6)
  • Add @goestav as a contributor (0e56a92)
  • Add @CitTheDev as a contributor (34169ea)
  • Add @legendhimslef as a contributor (059b6f1)
  • Add @r-priyam as a contributor (fb278ba)
  • Change name of @kyranet (#451) (df4fdef)
  • Update @RealShadowNova as a contributor (a869ba0)
  • Add @muchnameless as a contributor (a1221fe)
  • Add @enxg as a contributor (d2382f0)
  • Add @EvolutionX-10 as a contributor (efc3a32)
  • Add @MajesticString as a contributor (295b3e9)
  • Add @Mzato0001 as a contributor (c790ef2)

🚀 Features

  • utilities: Add possibility to import single functions by appending them to the import path. (#454) (374c145)

🧪 Testing

  • Migrate to vitest (#380) (075ec73)

@sapphire/snowflake@3.2.2 - (2022-04-24)

Bug Fixes

Documentation

  • Add @NotKaskus as a contributor (00da8f1)
  • Add @imranbarbhuiya as a contributor (fb674c2)
  • Add @axisiscool as a contributor (ce1aa31)
  • Add @dhruv-kaushikk as a contributor (ebbf43f)
  • Add @Commandtechno as a contributor (f1d69fa)
  • Fix typedoc causing OOM crashes (63ba41c)

3.2.1 (2022-04-01)

Note: Version bump only for package @sapphire/snowflake

3.2.0 (2022-03-06)

Bug Fixes

  • snowflake: fixed the examples for DiscordSnowflake and TwitterSnowflake (#282) (2e5ed7f)

Features

3.1.0 (2022-01-28)

Features

3.0.1 (2022-01-10)

Note: Version bump only for package @sapphire/snowflake

3.0.0 (2021-12-08)

Bug Fixes

  • snowflake: remove env-based defaults (#232) (10408e4)

Features

BREAKING CHANGES

  • Snowflake: Renamed processID to processId
  • Snowflake: Renamed workerID to workerId
  • Snowflake: workerId now defaults to 0n instead of 1n
  • Snowflake: DiscordSnowflake is not longer a class, but a constructed Snowflake
  • Snowflake: TwitterSnowflake is not longer a class, but a constructed Snowflake

2.1.4 (2021-11-06)

Note: Version bump only for package @sapphire/snowflake

2.1.3 (2021-10-26)

Note: Version bump only for package @sapphire/snowflake

2.1.2 (2021-10-17)

Bug Fixes

  • allow more node & npm versions in engines field (5977d2a)

2.1.1 (2021-10-11)

Note: Version bump only for package @sapphire/snowflake

2.1.0 (2021-10-04)

Bug Fixes

  • snowflake: fixed snowflake generating duplicate IDs (#166) (f0cf4ad)

Features

  • snowflake: set minimum NodeJS to v14 (11a61c7)

2.0.0 (2021-07-17)

Code Refactoring

BREAKING CHANGES

  • rateLimits: Removed Bucket

1.3.6 (2021-07-11)

Note: Version bump only for package @sapphire/snowflake

1.3.5 (2021-06-27)

Note: Version bump only for package @sapphire/snowflake

1.3.4 (2021-06-19)

Bug Fixes

  • doc: change [@link](https://github.com/link) to [@linkplain](https://github.com/linkplain) for support in VSCode IntelliSense (703d460)
  • docs: update-tsdoc-for-vscode-may-2021 (#126) (f8581bf)

1.3.3 (2021-06-06)

Bug Fixes

  • remove peer deps, update dev deps, update READMEs (#124) (67256ed)
  • snowflake: fixed parsing for timestamps as Date objects (c17a515)

1.3.2 (2021-05-20)

Bug Fixes

  • snowflake: mark package as side effect free (6a9bafc)

1.3.1 (2021-05-02)

Bug Fixes

  • drop the www. from the SapphireJS URL (494d89f)
  • update all the SapphireJS URLs from .com to .dev (f59b46d)

1.3.0 (2021-04-21)

Features

1.2.8 (2021-04-19)

Bug Fixes

  • change all Sapphire URLs from "project"->"community" & use our domain where applicable 👨‍🌾🚜 (#102) (835b408)

1.2.7 (2021-04-03)

Note: Version bump only for package @sapphire/snowflake

1.2.6 (2021-03-16)

Bug Fixes

1.2.5 (2021-02-16)

Note: Version bump only for package @sapphire/snowflake

1.2.4 (2021-01-16)

Note: Version bump only for package @sapphire/snowflake

1.2.3 (2021-01-01)

Note: Version bump only for package @sapphire/snowflake

1.2.2 (2020-12-26)

Note: Version bump only for package @sapphire/snowflake

1.2.1 (2020-12-22)

Note: Version bump only for package @sapphire/snowflake

1.2.0 (2020-11-15)

Bug Fixes

  • snowflake: pass keep_classnames to terser (76ea062)
  • snowflake: pass keep_fnames to terser (b52aa76)

Features

1.1.0 (2020-11-04)

Bug Fixes

  • ratelimits,snowflake,utilities: fixed esm output target (9fdab3f)
  • snowflake: properly specify ESM and CommonJS exports (e3278e6)

Features

1.0.1 (2020-09-20)

Note: Version bump only for package @sapphire/snowflake

1.0.0 (2020-09-05)

Features

  • implement snowflake (5ba4e2d)
  • decorators: add decorators package (#4) (677b3e5)