Guest User

hotcat-code

a guest
Dec 3rd, 2025
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function find_category_json( jsontext, category, once ) {
  2.  
  3. // Handle Data namespace JSON content
  4. let jsonData;
  5. try {
  6. jsonData = JSON.parse( jsontext );
  7. } catch ( err ) {
  8. console.error( 'Invalid JSON in find_category_json:', err );
  9. return once ? null : [];
  10. }
  11.  
  12. // Check if mediawikiCategories exists and if not then return
  13. if ( !Array.isArray( jsonData.mediawikiCategories ) ) {
  14. return once ? null : [];
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment