🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

svelte

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte - npm Package Compare versions

Comparing version

to
5.26.3

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

"license": "MIT",
"version": "5.26.2",
"version": "5.26.3",
"type": "module",

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

@@ -176,3 +176,4 @@ /** @import { AST } from '#compiler' */

!is_void(node_name) &&
!is_svg(node_name)
!is_svg(node_name) &&
!is_mathml(node_name)
) {

@@ -179,0 +180,0 @@ w.element_invalid_self_closing_tag(node, node.name);

@@ -34,9 +34,10 @@ /** @typedef {{ file: string, line: number, column: number }} Location */

let value = props[name];
/** @type {any} */
let value = props;
for (let i = 1; i < path.length - 1; i++) {
for (let i = 0; i < path.length - 1; i++) {
value = value[path[i]];
if (!value?.[STATE_SYMBOL]) {
return result;
}
value = value[path[i]];
}

@@ -43,0 +44,0 @@

@@ -9,3 +9,3 @@ /** @import { Component } from '#server' */

import { invalid_snippet_arguments } from '../shared/errors.js';
import { Payload } from './payload.js';
import { HeadPayload, Payload } from './payload.js';

@@ -109,5 +109,9 @@ /**

export function validate_snippet_args(payload) {
if (typeof payload !== 'object' || !(payload instanceof Payload)) {
if (
typeof payload !== 'object' ||
// for some reason typescript consider the type of payload as never after the first instanceof
!(payload instanceof Payload || /** @type {any} */ (payload) instanceof HeadPayload)
) {
invalid_snippet_arguments();
}
}

@@ -0,1 +1,16 @@

export class HeadPayload {
/** @type {Set<{ hash: string; code: string }>} */
css = new Set();
out = '';
uid = () => '';
title = '';
constructor(css = new Set(), out = '', title = '', uid = () => '') {
this.css = css;
this.out = out;
this.title = title;
this.uid = uid;
}
}
export class Payload {

@@ -7,9 +22,3 @@ /** @type {Set<{ hash: string; code: string }>} */

head = {
/** @type {Set<{ hash: string; code: string }>} */
css: new Set(),
title: '',
out: '',
uid: () => ''
};
head = new HeadPayload();

@@ -34,8 +43,7 @@ constructor(id_prefix = '') {

payload.head = {
title: head.title,
out: head.out,
css: new Set(head.css),
uid: head.uid
};
payload.head = new HeadPayload();
payload.head.out = head.out;
payload.head.css = new Set(head.css);
payload.head.title = head.title;
payload.head.uid = head.uid;

@@ -42,0 +50,0 @@ return payload;

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

*/
export const VERSION = '5.26.2';
export const VERSION = '5.26.3';
export const PUBLIC_VERSION = '5';

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