diff --git a/src/compiler/parse/acorn.js b/src/compiler/parse/acorn.js index 4b5a6e5166..85d219d8c9 100644 --- a/src/compiler/parse/acorn.js +++ b/src/compiler/parse/acorn.js @@ -2,7 +2,6 @@ import * as code_red from 'code-red'; /** * @param {string} source - * @returns {any} */ export const parse = (source) => code_red.parse(source, { @@ -14,7 +13,6 @@ export const parse = (source) => /** * @param {string} source * @param {number} index - * @returns {any} */ export const parse_expression_at = (source, index) => code_red.parseExpressionAt(source, index, { diff --git a/src/runtime/internal/Component.js b/src/runtime/internal/Component.js index ad39801d35..63ed04a715 100644 --- a/src/runtime/internal/Component.js +++ b/src/runtime/internal/Component.js @@ -314,7 +314,6 @@ if (typeof HTMLElement === 'function') { * @param {any} value * @param {Record} props_definition * @param {'toAttribute' | 'toProp'} [transform] - * @returns {any} */ function get_custom_element_value(prop, value, props_definition, transform) { const type = props_definition[prop]?.type; @@ -431,7 +430,6 @@ export class SvelteComponent { this.$destroy = noop; } - /** @returns {any} */ $on(type, callback) { if (!is_function(callback)) { return noop; diff --git a/src/runtime/internal/animations.js b/src/runtime/internal/animations.js index a589413841..d2471f1260 100644 --- a/src/runtime/internal/animations.js +++ b/src/runtime/internal/animations.js @@ -7,7 +7,6 @@ import { create_rule, delete_rule } from './style_manager.js'; * @param {Element & ElementCSSInlineStyle} node * @param {import('./private.js').PositionRect} from * @param {import('./private.js').AnimationFn} fn - * @returns {any} */ export function create_animation(node, from, fn, params) { if (!from) return noop; diff --git a/src/runtime/internal/dev.js b/src/runtime/internal/dev.js index 135e0988ab..d788cbd62a 100644 --- a/src/runtime/internal/dev.js +++ b/src/runtime/internal/dev.js @@ -252,7 +252,6 @@ export function validate_void_dynamic_element(tag) { } } -/** @returns {any} */ export function construct_svelte_component_dev(component, props) { const error_message = 'this={...} of should specify a Svelte component.'; try { diff --git a/src/runtime/internal/dom.js b/src/runtime/internal/dom.js index 23c73b26d1..51fb5d6c08 100644 --- a/src/runtime/internal/dom.js +++ b/src/runtime/internal/dom.js @@ -552,8 +552,6 @@ export function init_binding_group_dynamic(group, indexes) { * @type {HTMLInputElement[]} */ let _inputs; - /** - * @returns {any} */ function get_binding_group(group) { for (let i = 0; i < indexes.length; i++) { group = group[indexes[i]] = group[indexes[i]] || []; @@ -779,8 +777,6 @@ export function claim_comment(nodes, data) { ); } -/** - * @returns {any} */ function find_comment(nodes, text, start) { for (let i = start; i < nodes.length; i += 1) { const node = nodes[i]; @@ -900,15 +896,11 @@ export function select_options(select, value) { } } -/** - * @returns {any} */ export function select_value(select) { const selected_option = select.querySelector(':checked'); return selected_option && selected_option.__value; } -/** - * @returns {any} */ export function select_multiple_value(select) { return [].map.call(select.querySelectorAll(':checked'), (option) => option.__value); } @@ -1203,8 +1195,6 @@ export function get_custom_elements_slots(element) { return result; } -/** - * @returns {any} */ export function construct_svelte_component(component, props) { return new component(props); } diff --git a/src/runtime/internal/lifecycle.js b/src/runtime/internal/lifecycle.js index 68c02eced9..2ee476122c 100644 --- a/src/runtime/internal/lifecycle.js +++ b/src/runtime/internal/lifecycle.js @@ -7,7 +7,6 @@ export function set_current_component(component) { current_component = component; } -/** @returns {any} */ export function get_current_component() { if (!current_component) throw new Error('Function called outside component initialization'); return current_component; diff --git a/src/runtime/internal/spread.js b/src/runtime/internal/spread.js index 12ec86626f..6a9c336b90 100644 --- a/src/runtime/internal/spread.js +++ b/src/runtime/internal/spread.js @@ -30,7 +30,6 @@ export function get_spread_update(levels, updates) { return update; } -/** @returns {any} */ export function get_spread_object(spread_props) { return typeof spread_props === 'object' && spread_props !== null ? spread_props : {}; } diff --git a/src/runtime/internal/ssr.js b/src/runtime/internal/ssr.js index 48818b392f..0bba8adfee 100644 --- a/src/runtime/internal/ssr.js +++ b/src/runtime/internal/ssr.js @@ -90,7 +90,6 @@ export function escape(value, is_attr = false) { return escaped + str.substring(last); } -/** @returns {any} */ export function escape_attribute_value(value) { // keep booleans, null, and undefined for the sake of `spread` const should_escape = typeof value === 'string' || (value && typeof value === 'object'); @@ -119,7 +118,6 @@ export const missing_component = { $$render: () => '' }; -/** @returns {any} */ export function validate_component(component, name) { if (!component || !component.$$render) { if (name === 'svelte:component') name += ' this={...}'; @@ -141,7 +139,6 @@ let on_destroy; /** @returns {{ render: (props?: {}, { $$slots, context }?: { $$slots?: {}; context?: Map; }) => { html: any; css: { code: string; map: any; }; head: string; }; $$render: (result: any, props: any, bindings: any, slots: any, context: any) => any; }} */ export function create_ssr_component(fn) { - /** @returns {any} */ function $$render(result, props, bindings, slots, context) { const parent_component = current_component; const $$ = { diff --git a/src/runtime/internal/utils.js b/src/runtime/internal/utils.js index 524b3218a2..e889b51511 100644 --- a/src/runtime/internal/utils.js +++ b/src/runtime/internal/utils.js @@ -1,7 +1,6 @@ /** @returns {void} */ export function noop() {} -/** @returns {any} */ export const identity = (x) => x; /** @@ -39,12 +38,10 @@ export function add_location(element, file, line, column, char) { }; } -/** @returns {any} */ export function run(fn) { return fn(); } -/** @returns {any} */ export function blank_object() { return Object.create(null); } @@ -98,7 +95,6 @@ export function validate_store(store, name) { } } -/** @returns {any} */ export function subscribe(store, ...callbacks) { if (store == null) { for (const callback of callbacks) { @@ -126,7 +122,6 @@ export function component_subscribe(component, store, callback) { component.$$.on_destroy.push(subscribe(store, callback)); } -/** @returns {any} */ export function create_slot(definition, ctx, $$scope, fn) { if (definition) { const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); @@ -134,12 +129,10 @@ export function create_slot(definition, ctx, $$scope, fn) { } } -/** @returns {any} */ function get_slot_context(definition, ctx, $$scope, fn) { return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx; } -/** @returns {any} */ export function get_slot_changes(definition, $$scope, dirty, fn) { if (definition[2] && fn) { const lets = definition[2](fn(dirty)); @@ -235,21 +228,17 @@ export function once(fn) { }; } -/** @returns {any} */ export function null_to_empty(value) { return value == null ? '' : value; } -/** @returns {any} */ export function set_store_value(store, ret, value) { store.set(value); return ret; } -/** @returns {any} */ export const has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop); -/** @returns {any} */ export function action_destroyer(action_result) { return action_result && is_function(action_result.destroy) ? action_result.destroy : noop; } diff --git a/src/runtime/motion/tweened.js b/src/runtime/motion/tweened.js index 30ecdddb07..bf031ffa88 100644 --- a/src/runtime/motion/tweened.js +++ b/src/runtime/motion/tweened.js @@ -58,7 +58,6 @@ export function tweened(value, defaults = {}) { /** * @param {T} new_value * @param {import('./private.js').TweenedOptions} opts - * @returns {any} */ function set(new_value, opts) { if (value == null) {