Untitled

mail@pastecode.io avatar
unknown
javascript
3 years ago
398 B
2
Indexable
Never
const response = search_items.map( sitem => {
  	
  	const itemFolders = sitem.split("/")
	
	const finder = path_list.find( pl => {
		const folders = pl.split("/")
		const res = true
		for ( let i = 0; i < itemFolders.length; i++ ){
			if( ifol !== folders[i] || folders[i] !== "*" ){
				res = false
				break
			}	
		}
		return res
	})
  
  return {sitem, res: !!finder}
})
 console.log(response)