npm: add preSig func to npm lib
@@ -141,6 +141,18 @@ export function dateToDa(d: Date, mil: boolean = false): string {
);
}
+export function preSig(ship: string): string {
+ if (!ship) {
+ return '';
+ }
+
+ if (ship.trim().startsWith('~')) {
+ return ship.trim();
+ }
+
+ return '~'.concat(ship.trim());
+}
+
export function deSig(ship: string): string | null {
if (!ship) {
return null;
