New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@-0/browser

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@-0/browser - npm Package Compare versions

Comparing version 0.3.60 to 0.3.61

2

lib/commands/routing.d.ts

@@ -23,3 +23,3 @@ import { ICommand, Command } from "@-0/keys";

};
export declare const _RESTORE_SCROLL: Partial<{
export declare const _RESTORE_SCROLL_IF_POPSTATE: Partial<{
work: (args: any) => any;

@@ -26,0 +26,0 @@ src$: import("@thi.ng/rstream").ISubscriber<any> | import("@thi.ng/rstream").ISubscribable<any>;

import { URL2obj, Err_missing_props } from "@-0/utils";
import { DOM_NODE, URL_FULL, URL_PATH, CMD_SUB$, CMD_ARGS, CMD_WORK, SCROLL_Y, SCROLL_X, POP_STATE, } from "@-0/keys";
import { DOM_NODE, URL_FULL, URL_PATH, CMD_SUB$, CMD_ARGS, CMD_WORK, SCROLL_Y, SCROLL_X, POP_STATE, PUSH_STATE, } from "@-0/keys";
import { DOMnavigated$ } from "../core/stream$";

@@ -68,3 +68,3 @@ import { registerCMD } from "@-0/spool";

scrollodex.set(href, state);
return window.history.pushState({ click_referral: window.location.href }, document.title, url);
return window.history.pushState({ [PUSH_STATE]: window.location.href }, document.title, url);
}

@@ -76,3 +76,3 @@ },

}
export const _RESTORE_SCROLL = registerCMD({
export const _RESTORE_SCROLL_IF_POPSTATE = registerCMD({
[CMD_SUB$]: "_RESTORE_SCROLL",

@@ -79,0 +79,0 @@ [CMD_ARGS]: ({ [POP_STATE]: pop, [URL_FULL]: url }) => ({

import { fromDOMEvent, merge } from "@thi.ng/rstream";
import { map } from "@thi.ng/transducers";
import { URL_FULL, DOM_NODE, POP_STATE } from "@-0/keys";
import { URL_FULL, DOM_NODE, POP_STATE, PUSH_STATE } from "@-0/keys";
export const popstate$ = fromDOMEvent(window, "popstate");

@@ -13,3 +13,3 @@ export const DOMContentLoaded$ = fromDOMEvent(window, "DOMContentLoaded");

[DOM_NODE]: e.currentTarget,
[POP_STATE]: e.state || null,
[POP_STATE]: e.state || { [PUSH_STATE]: document.referrer },
};

@@ -16,0 +16,0 @@ if (e.target.location.href && e.currentTarget) {

import { isPlainObject } from "@thi.ng/checks";
import { _PUSHSTATE_IF_HREF, _RESTORE_SCROLL, _NOTIFY_PRERENDER_DOM, _SET_LINK_ATTRS_DOM, } from "../commands";
import { _PUSHSTATE_IF_HREF, _RESTORE_SCROLL_IF_POPSTATE, _NOTIFY_PRERENDER_DOM, _SET_LINK_ATTRS_DOM, } from "../commands";
import { _, $$_VIEW, $$_LOAD, $$_PATH, URL_FULL, URL_DATA, URL_PATH, URL_PAGE, RTR_PREP, RTR_POST, RTR_PRFX, CFG_RUTR, CMD_ARGS, CMD_RESO, CMD_ERRO, DOM_BODY, STATE_DATA, STATE_PATH, } from "@-0/keys";

@@ -14,10 +14,10 @@ import { URL2obj } from "@-0/utils";

const escaped = string => string.replace(escRGX, "\\$&");
const RUTR = rtr || CFG;
const urlToPageState = rtr || CFG;
const PREP = (pre && isPlainObject(pre) ? [pre] : pre) || [];
const POST = (pst && isPlainObject(pst) ? [pst] : pst) || [];
const prefix = pfx ? new RegExp(escaped(pfx), "g") : null;
return { RUTR, PREP, POST, prefix };
return { urlToPageState, PREP, POST, prefix };
};
export const __URL__ROUTE = (CFG, SET_STATE) => {
const { RUTR, POST, PREP, prefix } = router_opts(CFG);
const { urlToPageState, POST, PREP, prefix } = router_opts(CFG);
const _SET_ROUTE_PATH = Object.assign(Object.assign({}, SET_STATE), { [CMD_ARGS]: _acc => ({

@@ -30,3 +30,3 @@ [STATE_DATA]: _acc[URL_PATH],

{
[CMD_ARGS]: FURL ? RUTR(FURL.replace(prefix, "")) : new Error(e_s),
[CMD_ARGS]: FURL ? urlToPageState(FURL.replace(prefix, "")) : new Error(e_s),
[CMD_RESO]: (_acc, _res) => (Object.assign(Object.assign({}, (_res && _res[URL_PAGE] && { [URL_PAGE]: _res[URL_PAGE] })), (_res && _res[URL_DATA] && { [URL_DATA]: _res[URL_DATA] }))),

@@ -45,5 +45,5 @@ [CMD_ERRO]: route_error,

export const __DOM_URL__ROUTE = (CFG, SET_STATE) => {
const { RUTR, POST, PREP } = router_opts(CFG);
const { urlToPageState, POST, PREP } = router_opts(CFG);
const UNIVERSAL_ROUTING_SUBTASK = __URL__ROUTE({
[CFG_RUTR]: RUTR,
[CFG_RUTR]: urlToPageState,
[RTR_PRFX]: CFG[RTR_PRFX] || null,

@@ -66,4 +66,4 @@ }, SET_STATE);

const ROUTE_HOT = (args) => [
_SET_ROUTE_LOADING_TRUE,
{ [CMD_ARGS]: args },
_SET_ROUTE_LOADING_TRUE,
...PREP,

@@ -76,3 +76,3 @@ _PUSHSTATE_IF_HREF,

_SET_ROUTE_LOADING_FALSE,
_RESTORE_SCROLL,
_RESTORE_SCROLL_IF_POPSTATE,
_NOTIFY_PRERENDER_DOM,

@@ -79,0 +79,0 @@ ...POST,

@@ -5,3 +5,3 @@ {

"license": "MIT",
"version": "0.3.60",
"version": "0.3.61",
"description": "Browser helpers for -0 state management, routing and the interaction between",

@@ -8,0 +8,0 @@ "main": "./lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc