PageSourceSearch

https://amitd.co/_next/static/chunks/pages/code/[category]/[slug]-0ad056db2ffc8ad6.js

js amitd.co collected 2026-10-03 19:43:32 UTC 6,086 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[731],{9119:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/code/[category]/[slug]",function(){return e(5415)}])},3749:function(t,n,e){"use strict";e.d(n,{Z:function(){return O}});var i=e(1799),r=e(9396),o=e(5893),s=e(9417),c=e(7814),a=e(9008),l=e.n(a),u=e(1664),d=e.n(u),f=e(3305),h=e(1249),_=e.n(h),p=function(t){var n=t.title,e=t.children,i=t.type,r=void 0===i?"info":i;return(0,o.jsxs)("div",{className:"".concat(_().Alert," ").concat(_()["".concat(r)]),children:[!!n&&(0,o.jsx)("h4",{children:n}),e]})},x=function(){return(0,o.jsx)(o.Fragment,{children:"\xaf\\_(\u30c4)_/\xaf"})},m={Logo:e(4608).Z,Shrug:x,Alert:p},v=e(7294),g=e(9734),j=e(9331),w=e(8442),k=e.n(w),A=function(t){var n=t.path,e=t.summary,i=(0,v.useState)(!1),r=i[0],a=i[1],l=(0,v.useState)(0),u=l[0],d=l[1],f=(0,v.useState)(!1),h=f[0],_=f[1];(0,g.ZP)(h?"/.netlify/functions/setPage?path=".concat(n,"&action=likes"):null,(function(t){return(0,j.m)().get(t).then((function(t){d(t.data.likes)})).finally((function(){_(!1)}))}),{revalidateOnFocus:!1}),(0,g.ZP)("/.netlify/functions/getPage?path=".concat(n),(function(t){return(0,j.m)().get(t).then((function(t){var e,i;d(null!==(i=null===(e=t.data.find((function(t){return t.path===n})))||void 0===e?void 0:e.likes)&&void 0!==i?i:0)}))}),{revalidateOnFocus:!1});var p=function(){a(window.scrollY>50)};return(0,v.useEffect)((function(){return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}),[]),r?(0,o.jsxs)("div",{className:k().actions,children:[(0,o.jsxs)("button",{className:k().like,"aria-label":"Like",title:"Like",onClick:function(){_(!0)},children:[(0,o.jsx)(c.G,{size:"lg",icon:s.m6i,fixedWidth:!0})," ",u>0&&(0,o.jsx)("small",{children:(0,o.jsx)("sup",{children:Intl.NumberFormat("en",{notation:"compact"}).format(Number(u))})})]}),"function"===typeof window.navigator.share&&(0,o.jsx)("button",{className:k().share,"aria-label":"Share",title:"Share",onClick:function(){navigator.share({title:"Amit Dhamu \u2014 Staff Engineer",text:e,url:n}).then((function(t){return t})).catch((function(t){return t}))},children:(0,o.jsx)(c.G,{size:"lg",icon:s.zBy,fixedWidth:!0})}),(0,o.jsx)("button",{className:k().top,"aria-label":"Back to top",title:"Back to top",onClick:function(){window.scrollTo({top:0,behavior:"smooth"}),window.history.replaceState(null,""," ")},children:(0,o.jsx)(c.G,{size:"lg",icon:s.FPD,fixedWidth:!0})})]}):null},y=e(3210),E=e(4155),N=function(t){return"".concat(t).padStart(5,"0")},P=function(t){var n=t.path,e=(0,g.ZP)("/.netlify/functions/setPage?path=".concat(n,"&action=hits"),(function(t){return(0,j.m)().get(t).then((function(t){return t.data}))}),{revalidateOnFocus:!1}),i=e.data,r=e.error;return"true"===E.env.NEXT_PUBLIC_IS_LOCAL||r||!i?(0,o.jsxs)(o.Fragment,{children:[N(0)," views"]}):(0,o.jsxs)(o.Fragment,{children:[N(i.hits)," view",1!==i.hits?"s":""]})},S=e(3245),b=e.n(S),C=function(){var t=(0,v.useState)(""),n=t[0],e=t[1],i=function(){var t=document.documentElement.scrollHeight-window.innerHeight;e("".concat(Math.min(Math.max(document.documentElement.scrollTop/t*100,0),100),"%"))};return(0,v.useEffect)((function(){return window.addEventListener("scroll",i),function(){return window.removeEventListener("scroll",i)}}),[]),(0,o.jsx)("div",{className:b().progressBar,children:(0,o.jsx)("div",{"aria-label":"Page Progress",style:{width:n},children:"\xa0"})})},L=e(8398),Z=e(1149),F=e.n(Z),O=function(t){var n=t.post,e=n.metadata,a=e.title,u=e.type,h=e.tags,_=e.readTime,p=e.path,x=e.originalContent,v=e.category,g=n.content;return(0,o.jsxs)(y.Z,{children:[(0,o.jsxs)(l(),{children:[(0,o.jsxs)("title",{children:[a," \u2014"," ",v?"".concat(v.charAt(0).toUpperCase()+v.slice(1).toLowerCase()," \u2014 "):""," ","Amit Dhamu \u2014 Staff Engineer"]}),(0,o.jsx)("meta",{name:"description",content:null===x||void 0===x?void 0:x.replace(/([#`*_[\]()])/g,"").split(".").slice(0,1).join(".").trim()})]}),(0,o.jsx)(C,{}),(0,o.jsxs)("div",{className:F().post,children:[(0,o.jsx)("h1",{children:a}),(0,o.jsxs)("summary",{children:[(0,o.jsxs)("span",{children:[(0,o.jsx)(c.G,{icon:s.cnt,size:"1x",fixedWidth:!0})," ","".concat(_," minute read")]}),(0,o.jsxs)("span",{children:[(0,o.jsx)(c.G,{icon:s.Mdf,size:"1x",fixedWidth:!0})," ",(0,o.jsx)(P,{path:p})]}),!!v&&(0,o.jsxs)("span",{children:[(0,o.jsx)(c.G,{icon:s.w49,size:"1x",fixedWidth:!0})," ",(0,o.jsx)(d(),{href:"/code?q=".concat(v),style:{color:(0,L.D)(v)},children:v})]})]}),!!g&&(0,o.jsx)(f.R,(0,r.Z)((0,i.Z)({},g),{components:m})),(0,o.jsxs)("div",{className:F().tags,children:[0!==h.length&&(0,o.jsx)(c.G,{icon:s.tho,fixedWidth:!0}),(0,o.jsx)("ul",{children:h.map((function(t){return(0,o.jsx)("li",{children:(0,o.jsx)(d(),{href:"".concat("snippet"===u?"/code?q=":"/blog?q=").concat(t.toLowerCase()),children:t},t)},t)}))})]})]}),(0,o.jsx)(A,{path:p,summary:a})]})}},8398:function(t,n,e){"use strict";e.d(n,{D:function(){return i}});var i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"#".concat(t.split("").join("asdf").split("").reduce((function(t,n){return(31*t+n.charCodeAt(0))%16777215}),0).toString(16).padStart(6,"0"))}},9331:function(t,n,e){"use strict";e.d(n,{D:function(){return s},m:function(){return c}});var i=e(9669),r=e.n(i),o=e(5974),s=function(t){return(0,o.setupCache)({maxAge:1e3*t})},c=function(t){return r().create(t)}},5415:function(t,n,e){"use strict";e.r(n),e.d(n,{__N_SSG:function(){return r}});var i=e(3749),r=!0;n.default=i.Z},8442:function(t){t.exports={actions:"Actions_actions__OFP6u",share:"Actions_share__iEvEK",like:"Actions_like__kVJpK",top:"Actions_top__SPWy_"}},1249:function(t){t.exports={Alert:"Alert_Alert__mZkdV",info:"Alert_info__Ftz34",success:"Alert_success__ByO_1",error:"Alert_error__Mk1lb",warn:"Alert_warn___ZT6s"}},1149:function(t){t.exports={post:"Post_post__3qwOp",tags:"Post_tags__gbZsQ"}},3245:function(t){t.exports={progressBar:"ProgressBar_progressBar__Y91O0"}}},function(t){t.O(0,[84,669,202,774,888,179],(function(){return n=9119,t(t.s=n);var n}));var n=t.O();_N_E=n}]);

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.