From e185c6d91640d5e5fd80e8d04b98bb8c959a1ac8 Mon Sep 17 00:00:00 2001 From: Egor Manzhula Date: Mon, 11 Nov 2024 12:54:35 +0200 Subject: [PATCH] feat: Rewrite generateUID function to use native crypto module. --- README.md | 19 ++++--------------- index.js | 16 ++++++++++++---- package-lock.json | 15 +++++++-------- package.json | 16 +++++++--------- test/unit/serialize.js | 15 --------------- 5 files changed, 30 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index e6523ba..ca80382 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,9 @@ Serialize JavaScript ==================== - Serialize JavaScript to a _superset_ of JSON that includes regular expressions, dates and functions. - -[![npm Version][npm-badge]][npm] -[![Dependency Status][david-badge]][david] -![Test](https://github.com/yahoo/serialize-javascript/workflows/Test/badge.svg) +This library is a fork of the [serialize-javacript] library that addresses browser compatibility by using the native crypto module. ## Overview - -The code in this package began its life as an internal module to [express-state][]. To expand its usefulness, it now lives as `serialize-javascript` — an independent package on npm. - You're probably wondering: **What about `JSON.stringify()`!?** We've found that sometimes we need to serialize JavaScript **functions**, **regexps**, **dates**, **sets** or **maps**. A great example is a web app that uses client-side URL routing where the route definitions are regexps that need to be shared from the server to the client. But this module is also great for communicating between node processes. The string returned from this package's single export function is literal JavaScript which can be saved to a `.js` file, or be embedded into an HTML document by making the content of a `