@ellipticltd/aml-utils 0.14.0 → 0.14.1-SCR-575-SCR-547

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 (48) hide show
  1. package/.idea/aml-utils.iml +12 -0
  2. package/.idea/aws.xml +17 -0
  3. package/.idea/codeStyles/Project.xml +94 -0
  4. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/dist/validations/validations.js +4 -2
  9. package/dist/validations/validations.spec.js +2 -0
  10. package/lib/validations/validations.js +4 -2
  11. package/lib/validations/validations.spec.js +4 -0
  12. package/package.json +2 -2
  13. package/.nyc_output/011c99ee-70e2-4785-ba07-3b5e1591b03b.json +0 -1
  14. package/.nyc_output/5c634f75-5165-4488-a978-0129fbe23567.json +0 -1
  15. package/.nyc_output/6c9af0f1-e7f5-4521-8926-50f6385c07cf.json +0 -1
  16. package/.nyc_output/a2931b0e-a917-4a52-a94d-88a1afc66ea7.json +0 -1
  17. package/.nyc_output/processinfo/011c99ee-70e2-4785-ba07-3b5e1591b03b.json +0 -1
  18. package/.nyc_output/processinfo/5c634f75-5165-4488-a978-0129fbe23567.json +0 -1
  19. package/.nyc_output/processinfo/6c9af0f1-e7f5-4521-8926-50f6385c07cf.json +0 -1
  20. package/.nyc_output/processinfo/a2931b0e-a917-4a52-a94d-88a1afc66ea7.json +0 -1
  21. package/.nyc_output/processinfo/index.json +0 -1
  22. package/coverage/base.css +0 -224
  23. package/coverage/block-navigation.js +0 -79
  24. package/coverage/errors/errors.js.html +0 -228
  25. package/coverage/errors/errors.spec.js.html +0 -180
  26. package/coverage/errors/index.html +0 -110
  27. package/coverage/file-parser/__tests/file-parser.spec.js.html +0 -390
  28. package/coverage/file-parser/__tests/index.html +0 -123
  29. package/coverage/file-parser/__tests/parse-row.spec.js.html +0 -174
  30. package/coverage/file-parser/__tests/sanitize-rows.spec.js.html +0 -333
  31. package/coverage/formatting/formatting.js.html +0 -123
  32. package/coverage/formatting/formatting.spec.js.html +0 -204
  33. package/coverage/formatting/index.html +0 -110
  34. package/coverage/index.html +0 -175
  35. package/coverage/middleware/index.html +0 -97
  36. package/coverage/middleware/middleware.js.html +0 -144
  37. package/coverage/orm-helpers/index.html +0 -110
  38. package/coverage/orm-helpers/ormHelpers.js.html +0 -123
  39. package/coverage/orm-helpers/ormHelpers.spec.js.html +0 -192
  40. package/coverage/prettify.css +0 -1
  41. package/coverage/prettify.js +0 -2
  42. package/coverage/sort-arrow-sprite.png +0 -0
  43. package/coverage/sorter.js +0 -170
  44. package/coverage/types/index.html +0 -97
  45. package/coverage/types/types.js.html +0 -708
  46. package/coverage/validations/index.html +0 -110
  47. package/coverage/validations/validations.js.html +0 -1179
  48. package/coverage/validations/validations.spec.js.html +0 -1266
@@ -0,0 +1,12 @@
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>
package/.idea/aws.xml ADDED
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="accountSettings">
4
+ <option name="activeProfile" value="profile:default" />
5
+ <option name="activeRegion" value="eu-west-1" />
6
+ <option name="recentlyUsedProfiles">
7
+ <list>
8
+ <option value="profile:default" />
9
+ </list>
10
+ </option>
11
+ <option name="recentlyUsedRegions">
12
+ <list>
13
+ <option value="eu-west-1" />
14
+ </list>
15
+ </option>
16
+ </component>
17
+ </project>
@@ -0,0 +1,94 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <option name="SOFT_MARGINS" value="80" />
4
+ <DBN-PSQL>
5
+ <case-options enabled="false">
6
+ <option name="KEYWORD_CASE" value="lower" />
7
+ <option name="FUNCTION_CASE" value="lower" />
8
+ <option name="PARAMETER_CASE" value="lower" />
9
+ <option name="DATATYPE_CASE" value="lower" />
10
+ <option name="OBJECT_CASE" value="preserve" />
11
+ </case-options>
12
+ <formatting-settings enabled="false" />
13
+ </DBN-PSQL>
14
+ <DBN-SQL>
15
+ <case-options enabled="false">
16
+ <option name="KEYWORD_CASE" value="lower" />
17
+ <option name="FUNCTION_CASE" value="lower" />
18
+ <option name="PARAMETER_CASE" value="lower" />
19
+ <option name="DATATYPE_CASE" value="lower" />
20
+ <option name="OBJECT_CASE" value="preserve" />
21
+ </case-options>
22
+ <formatting-settings enabled="false">
23
+ <option name="STATEMENT_SPACING" value="one_line" />
24
+ <option name="CLAUSE_CHOP_DOWN" value="chop_down_if_statement_long" />
25
+ <option name="ITERATION_ELEMENTS_WRAPPING" value="chop_down_if_not_single" />
26
+ </formatting-settings>
27
+ </DBN-SQL>
28
+ <HTMLCodeStyleSettings>
29
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
30
+ <option name="HTML_DO_NOT_INDENT_CHILDREN_OF" value="html,body" />
31
+ </HTMLCodeStyleSettings>
32
+ <JSCodeStyleSettings version="0">
33
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
34
+ <option name="USE_DOUBLE_QUOTES" value="false" />
35
+ <option name="FORCE_QUOTE_STYlE" value="true" />
36
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
37
+ <option name="JSX_ATTRIBUTE_VALUE" value="Based on type" />
38
+ <option name="VAR_DECLARATION_WRAP" value="2" />
39
+ <option name="OBJECT_LITERAL_WRAP" value="2" />
40
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
41
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
42
+ <option name="IMPORT_SORT_MODULE_NAME" value="true" />
43
+ </JSCodeStyleSettings>
44
+ <MarkdownNavigatorCodeStyleSettings>
45
+ <option name="RIGHT_MARGIN" value="72" />
46
+ </MarkdownNavigatorCodeStyleSettings>
47
+ <PostgresCodeStyleSettings version="2">
48
+ <option name="KEYWORD_CASE" value="0" />
49
+ </PostgresCodeStyleSettings>
50
+ <SqlCodeStyleSettings version="2">
51
+ <option name="KEYWORD_CASE" value="0" />
52
+ </SqlCodeStyleSettings>
53
+ <TypeScriptCodeStyleSettings version="0">
54
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
55
+ <option name="USE_DOUBLE_QUOTES" value="false" />
56
+ <option name="FORCE_QUOTE_STYlE" value="true" />
57
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
58
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
59
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
60
+ </TypeScriptCodeStyleSettings>
61
+ <codeStyleSettings language="JSON">
62
+ <indentOptions>
63
+ <option name="INDENT_SIZE" value="4" />
64
+ </indentOptions>
65
+ </codeStyleSettings>
66
+ <codeStyleSettings language="JavaScript">
67
+ <option name="RIGHT_MARGIN" value="100" />
68
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
69
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
70
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
71
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
72
+ <option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
73
+ <option name="METHOD_CALL_CHAIN_WRAP" value="2" />
74
+ <option name="IF_BRACE_FORCE" value="1" />
75
+ <option name="DOWHILE_BRACE_FORCE" value="1" />
76
+ <option name="WHILE_BRACE_FORCE" value="1" />
77
+ <option name="FOR_BRACE_FORCE" value="1" />
78
+ <indentOptions>
79
+ <option name="INDENT_SIZE" value="2" />
80
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
81
+ <option name="TAB_SIZE" value="2" />
82
+ </indentOptions>
83
+ </codeStyleSettings>
84
+ <codeStyleSettings language="TypeScript">
85
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
86
+ <option name="METHOD_PARAMETERS_WRAP" value="1" />
87
+ <indentOptions>
88
+ <option name="INDENT_SIZE" value="2" />
89
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
90
+ <option name="TAB_SIZE" value="2" />
91
+ </indentOptions>
92
+ </codeStyleSettings>
93
+ </code_scheme>
94
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
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>
@@ -0,0 +1,8 @@
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 ADDED
@@ -0,0 +1,6 @@
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>
@@ -241,7 +241,7 @@ const validations = {
241
241
  },
242
242
  litecoin: {
243
243
  isAddress(str) {
244
- return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}$|^ltc1[ac-hj-np-z02-9]{6,86}$|^LTC1[AC-HJ-NP-Z02-9]{6,86}$/.test(str);
244
+ return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}$|^ltc1[ac-hj-np-z02-9]{6,86}$|^LTC1[AC-HJ-NP-Z02-9]{6,86}$|^ltcmweb[a-zA-Z0-9]{114}$/.test(str);
245
245
  },
246
246
  isTxHash(str) {
247
247
  if (!V.isHexadecimal(str)) {
@@ -274,7 +274,9 @@ const validations = {
274
274
  },
275
275
  zcash: {
276
276
  isAddress(str) {
277
- return addressValidator.validate(str, 'zec');
277
+ return addressValidator.validate(str, 'zec')
278
+ // unified zcash addresses
279
+ || /^zu[a-zA-Z0-9]{33}$/.test(str);
278
280
  },
279
281
  isTxHash(str) {
280
282
  if (!V.isHexadecimal(str)) {
@@ -222,6 +222,7 @@ describe('Validations', () => {
222
222
  describe('LTC', () => {
223
223
  describe('isAddress', () => {
224
224
  it('should correctly validate valid LTC addresses', () => validations_1.default.litecoin.isAddress('LMR7przNNMS3GpaD6Ygq64NxbsJsZAqGgM').should.be.true);
225
+ it('should correctly validate valid LTC MimbleWimble addresses', () => validations_1.default.litecoin.isAddress('ltcmweb1qq2aejfd7svtnqk0uq0cfkd9mr9sszypmx2phdu5qwfhlujazv2nxjqstgy3r5gkxesu5vv2v0tmlwdwhat3se36pwzwtlqm8ypxq3d2fggc8d7nq').should.be.true);
225
226
  it('should correctly validate an incorrect LTC address', () => validations_1.default.litecoin.isAddress('t1t8BzkNb8d98o8kpbwrjtUjMX3GMF').should.be.false);
226
227
  });
227
228
  describe('isTxHash', () => {
@@ -255,6 +256,7 @@ describe('Validations', () => {
255
256
  describe('ZEC', () => {
256
257
  describe('isAddress', () => {
257
258
  it('should correctly validate valid ZEC addresses', () => validations_1.default.zcash.isAddress('t1Jxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf').should.be.true);
259
+ it('should correctly validate valid ZEC unified addresses', () => validations_1.default.zcash.isAddress('zuJxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf').should.be.true);
258
260
  it('should correctly validate an incorrect ZEC address', () => validations_1.default.zcash.isAddress('t1Jxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf1').should.be.false);
259
261
  });
260
262
  describe('isTxHash', () => {
@@ -246,7 +246,7 @@ const validations = {
246
246
  },
247
247
  litecoin: {
248
248
  isAddress(str) {
249
- return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}$|^ltc1[ac-hj-np-z02-9]{6,86}$|^LTC1[AC-HJ-NP-Z02-9]{6,86}$/.test(str);
249
+ return /^[3LM][a-km-zA-HJ-NP-Z1-9]{24,33}$|^ltc1[ac-hj-np-z02-9]{6,86}$|^LTC1[AC-HJ-NP-Z02-9]{6,86}$|^ltcmweb[a-zA-Z0-9]{114}$/.test(str);
250
250
  },
251
251
  isTxHash(str) {
252
252
  if (!V.isHexadecimal(str)) {
@@ -279,7 +279,9 @@ const validations = {
279
279
  },
280
280
  zcash: {
281
281
  isAddress(str) {
282
- return addressValidator.validate(str, 'zec');
282
+ return addressValidator.validate(str, 'zec')
283
+ // unified zcash addresses
284
+ || /^zu[a-zA-Z0-9]{33}$/.test(str);
283
285
  },
284
286
  isTxHash(str) {
285
287
  if (!V.isHexadecimal(str)) {
@@ -273,6 +273,8 @@ describe('Validations', () => {
273
273
  describe('isAddress', () => {
274
274
  it('should correctly validate valid LTC addresses', () => validations.litecoin.isAddress('LMR7przNNMS3GpaD6Ygq64NxbsJsZAqGgM').should.be.true);
275
275
 
276
+ it('should correctly validate valid LTC MimbleWimble addresses', () => validations.litecoin.isAddress('ltcmweb1qq2aejfd7svtnqk0uq0cfkd9mr9sszypmx2phdu5qwfhlujazv2nxjqstgy3r5gkxesu5vv2v0tmlwdwhat3se36pwzwtlqm8ypxq3d2fggc8d7nq').should.be.true);
277
+
276
278
  it('should correctly validate an incorrect LTC address', () => validations.litecoin.isAddress('t1t8BzkNb8d98o8kpbwrjtUjMX3GMF').should.be.false);
277
279
  });
278
280
 
@@ -321,6 +323,8 @@ describe('Validations', () => {
321
323
  describe('isAddress', () => {
322
324
  it('should correctly validate valid ZEC addresses', () => validations.zcash.isAddress('t1Jxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf').should.be.true);
323
325
 
326
+ it('should correctly validate valid ZEC unified addresses', () => validations.zcash.isAddress('zuJxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf').should.be.true);
327
+
324
328
  it('should correctly validate an incorrect ZEC address', () => validations.zcash.isAddress('t1Jxptj7GnXQRsLNH5wWnDrGwEipEB3aZtf1').should.be.false);
325
329
  });
326
330
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ellipticltd/aml-utils",
3
- "version": "0.14.0",
3
+ "version": "0.14.1-SCR-575-SCR-547",
4
4
  "description": "Utilities, helpers, validations, type-checking, etc",
5
5
  "engines": {
6
6
  "node": "10.1.0",
@@ -63,4 +63,4 @@
63
63
  "ts-node": "^9.0.0",
64
64
  "typescript": "^4.0.5"
65
65
  }
66
- }
66
+ }