+1
-1
@@ -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 |
+1
-1
@@ -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
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2800677
0.05%62531
0.06%