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

Method get

www/js/_hyperscript.esm.js:1916–1941  ·  view source on GitHub ↗
(target, prop)

Source from the content-addressed store, hash-verified

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") {

Callers 15

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
_unsubscribeEffectMethod · 0.45

Calls 2

#parseCookiesMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected