Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function find_category_json( jsontext, category, once ) {
- // Handle Data namespace JSON content
- let jsonData;
- try {
- jsonData = JSON.parse( jsontext );
- } catch ( err ) {
- console.error( 'Invalid JSON in find_category_json:', err );
- return once ? null : [];
- }
- // Check if mediawikiCategories exists and if not then return
- if ( !Array.isArray( jsonData.mediawikiCategories ) ) {
- return once ? null : [];
- }
Advertisement
Add Comment
Please, Sign In to add comment