Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

svelte

Package Overview
Dependencies
Maintainers
3
Versions
1058
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte - npm Package Compare versions

Comparing version
5.53.1
to
5.53.2
+1
-1
package.json

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

"license": "MIT",
"version": "5.53.1",
"version": "5.53.2",
"type": "module",

@@ -8,0 +8,0 @@ "types": "./types/index.d.ts",

@@ -12,13 +12,22 @@ /** @import { UpdateExpression } from 'estree' */

if (
argument.type === 'Identifier' &&
context.state.scope.get(argument.name)?.kind === 'store_sub'
) {
return b.call(
node.prefix ? '$.update_store_pre' : '$.update_store',
b.assignment('??=', b.id('$$store_subs'), b.object([])),
b.literal(argument.name),
b.id(argument.name.slice(1)),
node.operator === '--' && b.literal(-1)
);
if (argument.type === 'Identifier') {
const binding = context.state.scope.get(argument.name);
if (binding?.kind === 'store_sub') {
return b.call(
node.prefix ? '$.update_store_pre' : '$.update_store',
b.assignment('??=', b.id('$$store_subs'), b.object([])),
b.literal(argument.name),
b.id(argument.name.slice(1)),
node.operator === '--' && b.literal(-1)
);
}
if (binding?.kind === 'derived') {
return b.call(
node.prefix ? '$.update_derived_pre' : '$.update_derived',
binding.node,
node.operator === '--' && b.literal(-1)
);
}
}

@@ -25,0 +34,0 @@

@@ -7,2 +7,5 @@ import { BROWSER } from 'esm-env';

/** @param {string} module_name */
const obfuscated_import = (module_name) => import(/* @vite-ignore */ module_name);
/** @param {string} data */

@@ -16,4 +19,4 @@ export async function sha256(data) {

: // @ts-ignore - we don't install node types in the prod build
// don't use 'node:crypto' because static analysers will think we rely on node when we don't
(await import(/* @vite-ignore */ 'node:' + 'crypto')).webcrypto;
// don't use import('node:crypto') directly because static analysers will think we rely on node when we don't
(await obfuscated_import('node:crypto')).webcrypto;

@@ -20,0 +23,0 @@ const hash_buffer = await crypto.subtle.digest('SHA-256', text_encoder.encode(data));

@@ -508,2 +508,31 @@ /** @import { ComponentType, SvelteComponent, Component } from 'svelte' */

/**
* @template {number | bigint} T
* @param {(value?: T) => T} derived
* @param {1 | -1} [d]
* @returns {T}
*/
export function update_derived(derived, d = 1) {
const value = derived();
let increase = typeof value === 'bigint' ? BigInt(d) : d;
// for some reason TS is mad even if T is always number or bigint
derived(value + /** @type {*} */ (increase));
return value;
}
/**
* @template {number | bigint} T
* @param {(value?: T) => T} derived
* @param {1 | -1} [d]
* @returns {T}
*/
export function update_derived_pre(derived, d = 1) {
const old_value = derived();
let increase = typeof old_value === 'bigint' ? BigInt(d) : d;
// for some reason TS is mad even if T is always number or bigint
const value = old_value + /** @type {*} */ (increase);
derived(value);
return value;
}
/**
* @template T

@@ -510,0 +539,0 @@ * @param {()=>T} fn

@@ -7,3 +7,3 @@ // generated during release, do not modify

*/
export const VERSION = '5.53.1';
export const VERSION = '5.53.2';
export const PUBLIC_VERSION = '5';

Sorry, the diff of this file is too big to display