react-code-dataset / wp-calypso /client /my-sites /patterns /lib /extract-pattern-id-from-hash.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
export const extractPatternIdFromHash = () => {
const pattern = /^#pattern-(\d+)$/;
const match = window.location.hash.match( pattern );
if ( match ) {
return parseInt( match[ 1 ], 10 );
}
return undefined;
};