@ellipticltd/aml-utils 0.15.1 → 0.15.2

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.
Files changed (45) hide show
  1. package/.nyc_output/cd455ec6-4d73-4c5e-871e-7f0609bd11b8.json +1 -0
  2. package/.nyc_output/d6cd0f05-9810-4f97-8faa-8753f10b9d2d.json +1 -0
  3. package/.nyc_output/processinfo/3974a52e-3acc-45e4-a312-2dae8e2da051.json +1 -0
  4. package/.nyc_output/processinfo/3bbc21ec-7576-45f9-bc87-b6a79588c265.json +1 -0
  5. package/.nyc_output/processinfo/cd455ec6-4d73-4c5e-871e-7f0609bd11b8.json +1 -0
  6. package/.nyc_output/processinfo/d6cd0f05-9810-4f97-8faa-8753f10b9d2d.json +1 -0
  7. package/.nyc_output/processinfo/index.json +1 -1
  8. package/coverage/errors/errors.js.html +1 -1
  9. package/coverage/errors/errors.spec.js.html +15 -15
  10. package/coverage/errors/index.html +12 -12
  11. package/coverage/file-parser/__tests/file-parser.spec.js.html +96 -96
  12. package/coverage/file-parser/__tests/index.html +32 -32
  13. package/coverage/file-parser/__tests/parse-row.spec.js.html +36 -36
  14. package/coverage/file-parser/__tests/sanitize-rows.spec.js.html +49 -49
  15. package/coverage/formatting/formatting.js.html +21 -21
  16. package/coverage/formatting/formatting.spec.js.html +30 -30
  17. package/coverage/formatting/index.html +28 -28
  18. package/coverage/index.html +54 -54
  19. package/coverage/middleware/index.html +1 -1
  20. package/coverage/middleware/middleware.js.html +1 -1
  21. package/coverage/orm-helpers/index.html +26 -26
  22. package/coverage/orm-helpers/ormHelpers.js.html +24 -24
  23. package/coverage/orm-helpers/ormHelpers.spec.js.html +9 -9
  24. package/coverage/types/index.html +1 -1
  25. package/coverage/types/types.js.html +1 -1
  26. package/coverage/validations/index.html +30 -30
  27. package/coverage/validations/validations.js.html +545 -236
  28. package/coverage/validations/validations.spec.js.html +525 -159
  29. package/dist/validations/validations.js +1 -1
  30. package/dist/validations/validations.spec.js +14 -0
  31. package/lib/validations/validations.js +1 -1
  32. package/lib/validations/validations.spec.js +19 -0
  33. package/package.json +1 -1
  34. package/.idea/aml-utils.iml +0 -12
  35. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  36. package/.idea/modules.xml +0 -8
  37. package/.idea/vcs.xml +0 -6
  38. package/.nyc_output/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +0 -1
  39. package/.nyc_output/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +0 -1
  40. package/.nyc_output/processinfo/1aa97f38-9e09-4229-9e02-5f7fa02f213b.json +0 -1
  41. package/.nyc_output/processinfo/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +0 -1
  42. package/.nyc_output/processinfo/b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json +0 -1
  43. package/.nyc_output/processinfo/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +0 -1
  44. /package/.nyc_output/{1aa97f38-9e09-4229-9e02-5f7fa02f213b.json → 3974a52e-3acc-45e4-a312-2dae8e2da051.json} +0 -0
  45. /package/.nyc_output/{b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json → 3bbc21ec-7576-45f9-bc87-b6a79588c265.json} +0 -0
@@ -348,7 +348,7 @@ const validations = {
348
348
  },
349
349
  doge: {
350
350
  isAddress(str) {
351
- return /^D{1}[a-zA-Z\d]{33}$/.test(str);
351
+ return /^[a-zA-Z\d]{34}$/.test(str);
352
352
  },
353
353
  isTxHash(str) {
354
354
  return str.length === 64;
@@ -342,6 +342,20 @@ describe('Validations', () => {
342
342
  it('should correctly validate an incorrect BSC hash', () => validations_1.default.binanceSmartChain.isTxHash('0x1a17145af3bec32f653d8ebd4c2c1b800214b17').should.be.false);
343
343
  });
344
344
  });
345
+ describe('Doge', () => {
346
+ describe('isAddress', () => {
347
+ it('should correctly validate valid Doge addresses', () => {
348
+ validations_1.default.doge.isAddress('9t3fCHSQz3j7XERcopTCUwMF3bZxJW99As').should.be.true;
349
+ validations_1.default.doge.isAddress('DQe2B39m3V68sXZPfUvdjv3QecYGAE2dBv').should.be.true;
350
+ });
351
+ it('should correctly validate an incorrect Doge address', () => validations_1.default.doge.isAddress('DQe2B39m3V68sXZPfUvdjv3QecYGAE2dB_').should.be.false);
352
+ it('should correctly validate an incorrect (too long) Doge address', () => validations_1.default.doge.isAddress('DQe2B39m3V68sXZPfUvdjv3QecYGAE2dBvQ').should.be.false);
353
+ });
354
+ describe('isTxHash', () => {
355
+ it('should correctly validate a valid Doge hash', () => validations_1.default.doge.isTxHash('ee3b8c45d4b84c07c7dc9e1c82752920ba6e7cda73354c0f399f81949513d418').should.be.true);
356
+ it('should correctly validate an incorrect Doge hash', () => validations_1.default.doge.isTxHash('ee3b8c45d4b84c07c7dc9e1c82752920ba6e7cda73354c0f399f81949513d41').should.be.false);
357
+ });
358
+ });
345
359
  describe('Polygon', () => {
346
360
  describe('isAddress', () => {
347
361
  it('should correctly validate valid Polygon addresses', () => validations_1.default.polygon.isAddress('0x286c2bd6e0585f396647cbfdbfe14b92600365bb').should.be.true);
@@ -353,7 +353,7 @@ const validations = {
353
353
  },
354
354
  doge: {
355
355
  isAddress(str) {
356
- return /^D{1}[a-zA-Z\d]{33}$/.test(str);
356
+ return /^[a-zA-Z\d]{34}$/.test(str);
357
357
  },
358
358
  isTxHash(str) {
359
359
  return str.length === 64;
@@ -449,6 +449,25 @@ describe('Validations', () => {
449
449
  });
450
450
  });
451
451
 
452
+ describe('Doge', () => {
453
+ describe('isAddress', () => {
454
+ it('should correctly validate valid Doge addresses', () => {
455
+ validations.doge.isAddress('9t3fCHSQz3j7XERcopTCUwMF3bZxJW99As').should.be.true;
456
+ validations.doge.isAddress('DQe2B39m3V68sXZPfUvdjv3QecYGAE2dBv').should.be.true;
457
+ });
458
+
459
+ it('should correctly validate an incorrect Doge address', () => validations.doge.isAddress('DQe2B39m3V68sXZPfUvdjv3QecYGAE2dB_').should.be.false);
460
+
461
+ it('should correctly validate an incorrect (too long) Doge address', () => validations.doge.isAddress('DQe2B39m3V68sXZPfUvdjv3QecYGAE2dBvQ').should.be.false);
462
+ });
463
+
464
+ describe('isTxHash', () => {
465
+ it('should correctly validate a valid Doge hash', () => validations.doge.isTxHash('ee3b8c45d4b84c07c7dc9e1c82752920ba6e7cda73354c0f399f81949513d418').should.be.true);
466
+
467
+ it('should correctly validate an incorrect Doge hash', () => validations.doge.isTxHash('ee3b8c45d4b84c07c7dc9e1c82752920ba6e7cda73354c0f399f81949513d41').should.be.false);
468
+ });
469
+ });
470
+
452
471
  describe('Polygon', () => {
453
472
  describe('isAddress', () => {
454
473
  it('should correctly validate valid Polygon addresses', () => validations.polygon.isAddress('0x286c2bd6e0585f396647cbfdbfe14b92600365bb').should.be.true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ellipticltd/aml-utils",
3
- "version": "0.15.1",
3
+ "version": "0.15.2",
4
4
  "description": "Utilities, helpers, validations, type-checking, etc",
5
5
  "engines": {
6
6
  "node": "10.1.0",
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/aml-utils.iml" filepath="$PROJECT_DIR$/.idea/aml-utils.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>