const BUTTERCUP_FORMAT = "buttercup/b" ; const BUTTERCUP_SIGNATURE = "b~>" + BUTTERCUP_FORMAT ; returns export function getSignature ( ) { return BUTTERCUP_SIGNATURE ; } param text returns export function hasValidSignature ( text ) { return text . indexOf ( BUTTERCUP_SIGNATURE ) === 0 ; } param text returns export function sign ( text ) { return hasValidSignature ( text ) ? text : BUTTERCUP_SIGNATURE + text ; } param text returns export function stripSignature ( text ) { const sigLen = BUTTERCUP_SIGNATURE . length ; return text . substr ( sigLen , text . length - sigLen ) ; } param contents returns export function vaultContentsEncrypted ( contents ) { if ( typeof contents === "string" && hasValidSignature ( contents ) ) { const exSig = stripSignature ( contents ) ; return /["\s\t\n~]/ . test ( exSig ) === false ; } return false ; }