PageSourceSearch

https://goodhoodstore.com/cdn/shop/t/324/assets/bao-utils.js?v=170448646201373183301763977641

js goodhoodstore.com collected 2026-10-03 19:24:22 UTC 3,120 bytes, 2 lines download raw bytes

1window.BAO||={},window.BAO.utils={};function getElement(selector,{context=document}={}){return context.querySelector(selector)}function getElements(selector,{context=document,asArray=!0}={}){const items=context.querySelectorAll(selector);return asArray?Array.from(items):items}function doesStringContainAny(str,items=[]){return items.some(i=>str.includes(i))}function createElement(tag,options={}){const el=document.createElement(tag);return Object.entries(options).forEach(([key,value])=>{el.setAttribute(key,value)}),el}function range(amount){return[...Array(amount).keys()]}function camelize(str){return str.replace(/(?:^\w|[A-Z]|\b\w)/g,(word,index)=>index===0?word.toLowerCase():word.toUpperCase()).replace(/\s+/g,"")}function resizeImage({src,size,crop=null,scale=null}={}){if(size==null)return src;if(size==="master")return src.replace(/http(s)?:/,"");const match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?/i);if(match!=null){const prefix=src.split(match[0]),suffix=match[0],scaleString=scale?`@${scale}x`:"",cropString=crop?`_crop_${crop}`:"";return`${prefix[0]}_${size}${cropString}${scaleString}${suffix}`.replace(/http(s)?:/,"")}else return null}function getDefaultRequestConfig(){return{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"}}}function fetchJSON(url,config={}){return fetch(url,Object.assign({},getDefaultRequestConfig(),config)).then(response=>{if(!response.ok)throw response;return response.json()})}function fetchProductData(handle){try{return fetchJSON(`/products/${handle}.js`)}catch(e){console.error(e)}}function getOffsetTop(el,parent=document.body,offsetTop=0){return isNaN(el.offsetTop)||(offsetTop+=el.offsetTop),el.offsetParent===parent?offsetTop:getOffsetTop(el.offsetParent,parent,offsetTop)}function formatMoney(cents,format=window.theme.moneyFormat){typeof cents=="string"&&(cents=cents.replace(".",""));let value="";const placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format;function formatWithDelimiters(number,precision=2,thousands=",",decimal="."){if(isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);const parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1${thousands}`),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break}return formatString.replace(placeholderRegex,value)}function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}Object.assign(window.BAO.utils,{camelize,createElement,doesStringContainAny,fetchJSON,fetchProductData,formatMoney,getDefaultRequestConfig,getElement,getElements,getOffsetTop,range,resizeImage,debounce});
2//# sourceMappingURL=/cdn/shop/t/324/assets/bao-utils.js.map?v=170448646201373183301763977641

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.