(target, prop)
| 1915 | }); |
| 1916 | } |
| 1917 | get(target, prop) { |
| 1918 | if (prop === "then") { |
| 1919 | return null; |
| 1920 | } else if (prop === "length") { |
| 1921 | return this.#parseCookies().length; |
| 1922 | } else if (prop === "clear") { |
| 1923 | return (name) => { |
| 1924 | document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; |
| 1925 | }; |
| 1926 | } else if (prop === "clearAll") { |
| 1927 | return () => { |
| 1928 | for (const cookie of this.#parseCookies()) { |
| 1929 | document.cookie = cookie.name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; |
| 1930 | } |
| 1931 | }; |
| 1932 | } else if (prop === Symbol.iterator) { |
| 1933 | var cookies2 = this.#parseCookies(); |
| 1934 | return cookies2[Symbol.iterator].bind(cookies2); |
| 1935 | } else if (typeof prop === "string") { |
| 1936 | if (!isNaN(prop)) { |
| 1937 | return this.#parseCookies()[parseInt(prop)]; |
| 1938 | } |
| 1939 | var match = this.#parseCookies().find((c) => c.name === prop); |
| 1940 | return match ? match.value : void 0; |
| 1941 | } |
| 1942 | } |
| 1943 | set(target, prop, value) { |
| 1944 | var parts = []; |
| 1945 | if (typeof value === "string") { |
no test coverage detected