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
Today I used patch-package to patch rgb2hex@0.2.5 for the project I'm working on.
With these simple steps you can add ES Modules support.
Here is the diff that solved my problem:
diff --git a/node_modules/rgb2hex/index.js b/node_modules/rgb2hex/index.js
index 3c0f6d7..b013adf 100644
--- a/node_modules/rgb2hex/index.js+++ b/node_modules/rgb2hex/index.js@@ -8,7 +8,7 @@
* @return {Object} object with hex and alpha value
*/
-var rgb2hex = module.exports = function rgb2hex(color) {+export default function rgb2hex(color) {
if(typeof color !== 'string') {
// throw error of input isn't typeof string
throw new Error('color has to be type of `string`');
If someone can provide a PR with necessary changes to use this package with CJS and ESM I would be happy to merge and release it. I currently don't have much time to look into this.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
rgb2hex@0.2.5
for the project I'm working on.With these simple steps you can add ES Modules support.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: