@designsystemsinternational/email 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,7 +212,8 @@ const preparePackageFactory =
212
212
  /data:image\/([a-zA-Z]*);base64,(.*)/,
213
213
  );
214
214
 
215
- const hash = Math.random().toString(36).substring(2, 7);
215
+ const hash = hashFromString(`${data}`);
216
+ console.log(hash);
216
217
 
217
218
  const filename = alt
218
219
  ? `${formatFilename(alt)}-text-${hash}.${ext}`
@@ -215,7 +215,7 @@ const preparePackageFactory =
215
215
  /data:image\/([a-zA-Z]*);base64,(.*)/,
216
216
  );
217
217
 
218
- const hash = Math.random().toString(36).substring(2, 7);
218
+ const hash = hashFromString(`${data}`);
219
219
 
220
220
  const filename = alt
221
221
  ? `${formatFilename(alt)}-text-${hash}.${ext}`
@@ -210,7 +210,8 @@ const preparePackageFactory =
210
210
  /data:image\/([a-zA-Z]*);base64,(.*)/,
211
211
  );
212
212
 
213
- const hash = Math.random().toString(36).substring(2, 7);
213
+ const hash = hashFromString(`${data}`);
214
+ console.log(hash);
214
215
 
215
216
  const filename = alt
216
217
  ? `${formatFilename(alt)}-text-${hash}.${ext}`
package/dist/esm/index.js CHANGED
@@ -213,7 +213,7 @@ const preparePackageFactory =
213
213
  /data:image\/([a-zA-Z]*);base64,(.*)/,
214
214
  );
215
215
 
216
- const hash = Math.random().toString(36).substring(2, 7);
216
+ const hash = hashFromString(`${data}`);
217
217
 
218
218
  const filename = alt
219
219
  ? `${formatFilename(alt)}-text-${hash}.${ext}`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designsystemsinternational/email",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "Make working with email more enjoyable (if possible)",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -3,7 +3,7 @@
3
3
  import posthtml from 'posthtml';
4
4
 
5
5
  import { BASE64_REGEX } from './constants.js';
6
- import { formatFilename } from './util/string.js';
6
+ import { formatFilename, hashFromString } from './util/string.js';
7
7
 
8
8
  /**
9
9
  * Turns base64 inlined images into image buffers and updates their src
@@ -30,7 +30,8 @@ export const preparePackageFactory =
30
30
  /data:image\/([a-zA-Z]*);base64,(.*)/,
31
31
  );
32
32
 
33
- const hash = Math.random().toString(36).substring(2, 7);
33
+ const hash = hashFromString(`${data}`);
34
+ console.log(hash);
34
35
 
35
36
  const filename = alt
36
37
  ? `${formatFilename(alt)}-text-${hash}.${ext}`
@@ -2,7 +2,7 @@
2
2
  import posthtml from 'posthtml';
3
3
 
4
4
  import { BASE64_REGEX } from './constants.js';
5
- import { formatFilename } from './util/string.js';
5
+ import { formatFilename, hashFromString } from './util/string.js';
6
6
 
7
7
  /**
8
8
  * Turns base64 inlined images into image buffers and updates their src
@@ -29,7 +29,7 @@ export const preparePackageFactory =
29
29
  /data:image\/([a-zA-Z]*);base64,(.*)/,
30
30
  );
31
31
 
32
- const hash = Math.random().toString(36).substring(2, 7);
32
+ const hash = hashFromString(`${data}`);
33
33
 
34
34
  const filename = alt
35
35
  ? `${formatFilename(alt)}-text-${hash}.${ext}`