{"version":3,"file":"index.cjs","sources":[""],"sourcesContent":["import { setCookie } from \"../setCookie/index.ts\";\r\n\r\nexport type TDeleteCookieArgs = Parameters<typeof deleteCookie>;\r\n\r\nexport type TDeleteCookieReturn = ReturnType<typeof deleteCookie>;\r\n\r\n/**\r\n * Deletes a cookie by setting its expiry to a past date.\r\n *\r\n * @param {string} name Cookie name\r\n * @returns {void}\r\n * @throws {TypeError} If name is not a non-empty string\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie\r\n * @example\r\n * // How to delete a Cookie?\r\n * deleteCookie(\"myCookieName\");\r\n */\r\nexport const deleteCookie = (name: string): void => {\r\n  if (typeof name !== \"string\" || name.length === 0) {\r\n    throw new TypeError(\"deleteCookie: name must be a non-empty string\");\r\n  }\r\n  setCookie(name, \"\", {\r\n    expires: new Date(\"Thu, 01 Jan 1970 00:00:01 GMT\"),\r\n  });\r\n};\r\n"],"names":["deleteCookie","name","length","TypeError","setCookie","expires","Date"],"mappings":";;;;;;;;;;;GAiBO,MAAMA,aAAgBC,OAC3B,UAAWA,OAAS,UAAYA,KAAKC,SAAW,EAC9C,MAAM,IAAIC,UAAU,iDAEtBC,MAAAA,UAAUH,KAAM,GAAI,CAClBI,QAAS,IAAIC,KAAK"}