mirror of https://github.com/sveltejs/svelte
chore: re-export shared errors (#16356)
parent
58baf80a70
commit
61f75651d6
@ -1,15 +1,16 @@
|
|||||||
import { invalid_snippet_arguments } from '../../shared/errors.js';
|
import * as e from '../errors.js';
|
||||||
/**
|
/**
|
||||||
* @param {Node} anchor
|
* @param {Node} anchor
|
||||||
* @param {...(()=>any)[]} args
|
* @param {...(()=>any)[]} args
|
||||||
*/
|
*/
|
||||||
export function validate_snippet_args(anchor, ...args) {
|
export function validate_snippet_args(anchor, ...args) {
|
||||||
if (typeof anchor !== 'object' || !(anchor instanceof Node)) {
|
if (typeof anchor !== 'object' || !(anchor instanceof Node)) {
|
||||||
invalid_snippet_arguments();
|
e.invalid_snippet_arguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let arg of args) {
|
for (let arg of args) {
|
||||||
if (typeof arg !== 'function') {
|
if (typeof arg !== 'function') {
|
||||||
invalid_snippet_arguments();
|
e.invalid_snippet_arguments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue