'use strict';vartoRegex=require('to-regex');varregexNot=require('regex-not');varcached;/** * Get the last element from `array` * @param {Array} `array` * @return {*} */exports.last=function(arr){returnarr[arr.length-1];};/** * Create and cache regex to use for text nodes */exports.createRegex=function(pattern,include){if(cached)returncached;varopts={contains:true,strictClose:false};varnot=regexNot.create(pattern,opts);varre;if(typeofinclude==='string'){re=toRegex('^(?:'+include+'|'+not+')',opts);}else{re=toRegex(not,opts);}return(cached=re);};