@mikezimm/npmfunctions
Version:
Functions used in my SPFx webparts
17 lines (10 loc) • 708 B
text/typescript
import { IMinCustomHelpProps, } from "../HelpPanelOnNPM/onNpm/BannerInterface";
import { _LinkIsValid } from './AllLinks';
export async function validateDocumentationUrl ( thisProps: IMinCustomHelpProps, propertyPath: string , newValue: any) {
if ( propertyPath === 'documentationLinkUrl' || propertyPath === 'fpsImportProps' ) {
thisProps.documentationIsValid = await _LinkIsValid( newValue ) === "" ? true : false;
console.log( `${ newValue ? newValue : 'Empty' } Docs Link ${ thisProps.documentationIsValid === true ? ' IS ' : ' IS NOT ' } Valid `);
} else {
if ( !thisProps.documentationIsValid ) { thisProps.documentationIsValid = false; }
}
}