Cheat activated


Original source

Golfed:

a=T=>~"THUGSARMOURY,PROFESSIONALSKIT,NUTTERSTOYS,INEEDSOMEHELP,TURNUPTHEHEAT,TURNDOWNTHEHEAT,PLEASANTLYWARM,TOODAMNHOT,DULLDULLDAY,STAYINANDWATCHTV,CANTSEEWHEREIMGOING,TIMEJUSTFLIESBY,SPEEDITUP,SLOWITDOWN,ROUGHNEIGHBOURHOOD,STOPPICKINGONME,SURROUNDEDBYNUTTERS,TIMETOKICKASS,OLDSPEEDDEMON,DOUGHNUTHANDICAP,NOTFORPUBLICROADS,JUSTTRYANDSTOPME,WHERESTHEFUNERAL,CELEBRITYSTATUS,TRUEGRIME,ALLCARSGOBOOM,WHEELSONLYPLEASE,STICKLIKEGLUE,GOODBYECRUELWORLD,DONTTRYANDSTOPME,ALLDRIVERSARECRIMINALS,PINKISTHENEWCOOL,SOLONGASITSBLACK,FLYINGFISH,WHOATEALLTHEPIES,BUFFMEUP,LEANANDMEAN,BLUESUEDESHOES,ATTACKOFTHEVILLAGEPEOPLE,LIFESABEACH,ONLYHOMIESALLOWED,BETTERSTAYINDOORS,NINJATOWN,LOVECONQUERSALL,EVERYONEISPOOR,EVERYONEISRICH,CHITTYCHITTYBANGBANG,CJPHONEHOME,JUMPJET,IWANTTOHOVER,TOUCHMYCARYOUDIE,SPEEDFREAK,BUBBLECARS,NIGHTPROWLER,DONTBRINGONTHENIGHT,SCOTTISHSUMMER,SANDINMYEARS,KANGAROO,NOONECANHURTME,MANFROMATLANTIS,LETSGOBASEJUMPING,ROCKETMAN,IDOASIPLEASE,BRINGITON,STINGLIKEABEE,IAMNEVERHUNGRY,STATEOFEMERGENCY,CRAZYTOWN,TAKEACHILLPILL,FULLCLIP,IWANNADRIVEBY,GHOSTTOWN,HICKSVILLE,WANNABEINMYGANG,NOONECANSTOPUS,ROCKETMAYHEM,WORSHIPME,HELLOLADIES,ICANGOALLNIGHT,PROFESSIONALKILLER,NATURALTALENT,OHDUDE,FOURWHEELFUN,HITTHEROADJACK,ITSALLBULL,FLYINGTOSTUNT,MONSTERMASH".split`,`.findIndex(E=>0<=T.indexOf(E)&T.indexOf(E)>=T.length-E.length)?"CHEAT ACTIVATED":""

Ungolfed:

let cheats = "THUGSARMOURY,PROFESSIONALSKIT,NUTTERSTOYS,INEEDSOMEHELP,TURNUPTHEHEAT,TURNDOWNTHEHEAT,PLEASANTLYWARM,TOODAMNHOT,DULLDULLDAY,STAYINANDWATCHTV,CANTSEEWHEREIMGOING,TIMEJUSTFLIESBY,SPEEDITUP,SLOWITDOWN,ROUGHNEIGHBOURHOOD,STOPPICKINGONME,SURROUNDEDBYNUTTERS,TIMETOKICKASS,OLDSPEEDDEMON,DOUGHNUTHANDICAP,NOTFORPUBLICROADS,JUSTTRYANDSTOPME,WHERESTHEFUNERAL,CELEBRITYSTATUS,TRUEGRIME,ALLCARSGOBOOM,WHEELSONLYPLEASE,STICKLIKEGLUE,GOODBYECRUELWORLD,DONTTRYANDSTOPME,ALLDRIVERSARECRIMINALS,PINKISTHENEWCOOL,SOLONGASITSBLACK,FLYINGFISH,WHOATEALLTHEPIES,BUFFMEUP,LEANANDMEAN,BLUESUEDESHOES,ATTACKOFTHEVILLAGEPEOPLE,LIFESABEACH,ONLYHOMIESALLOWED,BETTERSTAYINDOORS,NINJATOWN,LOVECONQUERSALL,EVERYONEISPOOR,EVERYONEISRICH,CHITTYCHITTYBANGBANG,CJPHONEHOME,JUMPJET,IWANTTOHOVER,TOUCHMYCARYOUDIE,SPEEDFREAK,BUBBLECARS,NIGHTPROWLER,DONTBRINGONTHENIGHT,SCOTTISHSUMMER,SANDINMYEARS,KANGAROO,NOONECANHURTME,MANFROMATLANTIS,LETSGOBASEJUMPING,ROCKETMAN,IDOASIPLEASE,BRINGITON,STINGLIKEABEE,IAMNEVERHUNGRY,STATEOFEMERGENCY,CRAZYTOWN,TAKEACHILLPILL,FULLCLIP,IWANNADRIVEBY,GHOSTTOWN,HICKSVILLE,WANNABEINMYGANG,NOONECANSTOPUS,ROCKETMAYHEM,WORSHIPME,HELLOLADIES,ICANGOALLNIGHT,PROFESSIONALKILLER,NATURALTALENT,OHDUDE,FOURWHEELFUN,HITTHEROADJACK,ITSALLBULL,FLYINGTOSTUNT,MONSTERMASH"

let fn = string => {
    let cheatArr = cheats.split(",")
    let indexOfCheat = cheatArr.findIndex(cheat=>{
        let indexOfMyCheat = cheat.indexOf(string)

        return indexOfMyCheat > -1
            && indexOfMyCheat < string.length-cheat.length
    })

    return indexOfCheat > -1 ? "CHEAT ACTIVATED" : ""
}