diff --git a/pkg/npm/api/groups/lib.ts b/pkg/npm/api/groups/lib.ts index f66b3386d..7e93ad3a4 100644 --- a/pkg/npm/api/groups/lib.ts +++ b/pkg/npm/api/groups/lib.ts @@ -198,7 +198,7 @@ export const isWriter = (group: Group, resource: string, ship: string) => { if (typeof writers === 'undefined') { return true; } else { - return writers.includes(ship) || admins.includes(ship); + return [...writers].includes(ship) || admins.includes(ship); } }; diff --git a/pkg/npm/api/lib/lib.ts b/pkg/npm/api/lib/lib.ts index c1d88a6f5..c57d0a259 100644 --- a/pkg/npm/api/lib/lib.ts +++ b/pkg/npm/api/lib/lib.ts @@ -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; diff --git a/pkg/npm/api/package.json b/pkg/npm/api/package.json index b6b376123..e5dc09718 100644 --- a/pkg/npm/api/package.json +++ b/pkg/npm/api/package.json @@ -1,6 +1,6 @@ { "name": "@urbit/api", - "version": "2.1.0", + "version": "2.1.1", "description": "A library that provides bindings and types for Urbit's various userspace desks", "repository": { "type": "git",