Pārlūkot izejas kodu

contact addr uh

user 6 gadi atpakaļ
vecāks
revīzija
1906761ef4

+ 1 - 0
lib/contact-address.d.ts

@@ -2,6 +2,7 @@ export declare class ContactAddress {
     static fromPrefixedString(prefixed: string): ContactAddress;
     static fromPrefixedString(prefixed: string): ContactAddress;
     static parsePhoneNumber(search: string): string | undefined;
     static parsePhoneNumber(search: string): string | undefined;
     static isValidPhoneNumber(search: string): boolean;
     static isValidPhoneNumber(search: string): boolean;
+    static isValidUserHash(search: string): true | undefined;
     static isValidEmailAddress(search: string): boolean;
     static isValidEmailAddress(search: string): boolean;
     static parseEmail(search: string): string | undefined;
     static parseEmail(search: string): string | undefined;
     static formatAddress(type: string, address: string): string;
     static formatAddress(type: string, address: string): string;

+ 5 - 0
lib/contact-address.js

@@ -35,6 +35,11 @@ class ContactAddress {
         }
         }
         return true;
         return true;
     }
     }
+    static isValidUserHash(search) {
+        if (search.match(/Qm[A-HJ-NP-Za-km-z1-9]{44,45}/)) {
+            return true;
+        }
+    }
     static isValidEmailAddress(search) {
     static isValidEmailAddress(search) {
         const ats = search.replace(/[^@]/g, '');
         const ats = search.replace(/[^@]/g, '');
         return ats.length === 1;
         return ats.length === 1;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
lib/contact-address.js.map


+ 6 - 0
src/contact-address.ts

@@ -39,6 +39,12 @@ export class ContactAddress {
     return true;
     return true;
   }
   }
 
 
+  public static isValidUserHash(search: string) {
+    if (search.match(/Qm[A-HJ-NP-Za-km-z1-9]{44,45}/)) {
+      return true;
+    }
+  }
+
   public static isValidEmailAddress(search: string) {
   public static isValidEmailAddress(search: string) {
     const ats = search.replace(/[^@]/g, '');
     const ats = search.replace(/[^@]/g, '');
     return ats.length === 1;
     return ats.length === 1;