SHARE
TWEET

Untitled

a guest Jun 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [1,2,3,4,5] (json file array)
  2. [1,2,3,4,5,6] (U.G array) //it must return false
  3.      
  4. var match;
  5.    fs.readFile('../tags.json', 'utf8', (err, data)=>{
  6.  
  7.      var JsonData = JSON.parse(data);
  8.      var tagsArray = JsonData.tags;
  9.      console.log(tagsArray)
  10.      console.log(tags)
  11.      if(tagsArray instanceof Array){
  12.        console.log('tagsArray is array')
  13.      }
  14.       if(!contains(tagsArray, tags)){
  15.         match = false
  16.       }  
  17.       else{
  18.         match = true
  19.       }
  20.      console.log(match + ' blah1')
  21.  
  22.    });
  23.  
  24.    console.log(match + ' blah2')
  25.  if(match == false){
  26.     return res.status(409).send({
  27.       message: 'Do not provide your own tags'
  28.     });
  29.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top