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