MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / get

Method get

www/js/_hyperscript.js:1918–1943  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

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

Callers 15

vs-mock-sw.jsFile · 0.45
formatErrorsMethod · 0.45
getEventQueueForMethod · 0.45
getHyperTraceMethod · 0.45
registerHyperTraceMethod · 0.45
_getObjectStateMethod · 0.45
notifyGlobalSymbolMethod · 0.45
notifyElementSymbolMethod · 0.45
notifyPropertyMethod · 0.45
_handleDOMEventMethod · 0.45
_subscribeEffectMethod · 0.45

Calls 2

#parseCookiesMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected