chore: remove stuff identified by knip as unused (#12815)

* chore: remove stuff identified by knip as unused

* need to continue exporting Parser, it is referenced as a type
pull/12816/head
Rich Harris 1 month ago committed by GitHub
parent dfb6755514
commit b13d331f78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -150,7 +150,9 @@
"src/*/index.js",
"src/index-client.ts",
"src/index-server.ts",
"src/index.d.ts"
"src/index.d.ts",
"tests/**/*.js",
"tests/**/*.ts"
],
"project": [
"src/**"

@ -2,7 +2,7 @@ import { CompileDiagnostic } from './utils/compile_diagnostic.js';
/** @typedef {{ start?: number, end?: number }} NodeLike */
export class InternalCompileError extends CompileDiagnostic {
class InternalCompileError extends CompileDiagnostic {
name = 'CompileError';
/**

@ -3,7 +3,7 @@ import { CompileDiagnostic } from './utils/compile_diagnostic.js';
/** @typedef {{ start?: number, end?: number }} NodeLike */
export class InternalCompileWarning extends CompileDiagnostic {
class InternalCompileWarning extends CompileDiagnostic {
name = 'CompileWarning';
/**

@ -3,7 +3,7 @@
import { CompileDiagnostic } from './utils/compile_diagnostic.js';
/** @typedef {{ start?: number, end?: number }} NodeLike */
export class InternalCompileError extends CompileDiagnostic {
class InternalCompileError extends CompileDiagnostic {
name = 'CompileError';
/**

@ -21,7 +21,7 @@ export function AssignmentExpression(node, context) {
* @param {Context} context
* @returns {Expression | null}
*/
export function build_assignment(operator, left, right, context) {
function build_assignment(operator, left, right, context) {
// Handle class private/public state assignment cases
if (
context.state.analysis.runes &&

@ -1,12 +1,3 @@
/**
* @template T
* @param {T} value
* @returns {asserts value is NonNullable<T>}
*/
export function ok(value) {
if (!value) throw new Error('Assertion failed');
}
/**
* @template T
* @param {any} actual

@ -10,7 +10,7 @@ import {
import { CompileDiagnostic } from './utils/compile_diagnostic.js';
/** @typedef {{ start?: number, end?: number }} NodeLike */
export class InternalCompileWarning extends CompileDiagnostic {
class InternalCompileWarning extends CompileDiagnostic {
name = 'CompileWarning';
/**

@ -14,8 +14,6 @@ import {
import { equals, safe_equals } from './equality.js';
import * as e from '../errors.js';
export let updating_derived = false;
/**
* @template V
* @param {() => V} fn
@ -101,11 +99,8 @@ export function update_derived(derived) {
stack.push(derived);
}
var previous_updating_derived = updating_derived;
updating_derived = true;
destroy_derived_children(derived);
var value = update_reaction(derived);
updating_derived = previous_updating_derived;
if (DEV) {
stack.pop();
@ -128,7 +123,7 @@ export function update_derived(derived) {
* @param {Derived} signal
* @returns {void}
*/
export function destroy_derived(signal) {
function destroy_derived(signal) {
destroy_derived_children(signal);
remove_reactions(signal, 0);
set_signal_status(signal, DESTROYED);

@ -61,7 +61,7 @@ export function validate_effect(rune) {
* @param {Effect} effect
* @param {Reaction} parent_effect
*/
export function push_effect(effect, parent_effect) {
function push_effect(effect, parent_effect) {
var parent_last = parent_effect.last;
if (parent_last === null) {
parent_effect.last = parent_effect.first = effect;

@ -3,9 +3,7 @@
export var is_array = Array.isArray;
export var array_from = Array.from;
export var object_keys = Object.keys;
export var object_assign = Object.assign;
export var is_frozen = Object.isFrozen;
export var object_freeze = Object.freeze;
export var define_property = Object.defineProperty;
export var get_descriptor = Object.getOwnPropertyDescriptor;
export var get_descriptors = Object.getOwnPropertyDescriptors;

@ -1,36 +1,6 @@
/** @import { Source } from '#client' */
import { set } from '../internal/client/reactivity/sources.js';
/**
* @template T
* @template U
* @param {Iterable<T>} iterable
* @param {(value: T) => U} fn
* @param {string} name
* @returns {IterableIterator<U>}
*/
export function map(iterable, fn, name) {
return {
[Symbol.iterator]: get_this,
next() {
for (const value of iterable) {
return { done: false, value: fn(value) };
}
return { done: true, value: undefined };
},
// @ts-expect-error
get [Symbol.toStringTag]() {
return name;
}
};
}
/** @this {any} */
function get_this() {
return this;
}
/** @param {Source<number>} source */
export function increment(source) {
set(source, source.v + 1);

@ -107,7 +107,7 @@ export function is_capture_event(name) {
}
/** List of Element events that will be delegated */
export const DELEGATED_EVENTS = [
const DELEGATED_EVENTS = [
'beforeinput',
'click',
'change',
@ -144,7 +144,7 @@ export function is_delegated(event_name) {
/**
* Attributes that are boolean, i.e. they are present or not present.
*/
export const DOM_BOOLEAN_ATTRIBUTES = [
const DOM_BOOLEAN_ATTRIBUTES = [
'allowfullscreen',
'async',
'autofocus',

Loading…
Cancel
Save