From 34c6d6e67b247df2984c75c98261a153bad5b4d3 Mon Sep 17 00:00:00 2001 From: Ric3cir121 Date: Fri, 12 Sep 2025 20:25:50 +0200 Subject: [PATCH] defintion -> definition --- packages/core/src/plugins/index.ts | 8 ++++---- packages/core/src/plugins/loader.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/core/src/plugins/index.ts b/packages/core/src/plugins/index.ts index 8ff6bd1..d591444 100644 --- a/packages/core/src/plugins/index.ts +++ b/packages/core/src/plugins/index.ts @@ -27,8 +27,8 @@ export const validatePatch = (patch: Patch) => { if (typeof patch.replace !== 'object') throw new Error('patch.replace isnt an object'); }; -export const validatePluginDefintion = (definition: PluginDefinition) => { - if (typeof definition !== 'object') throw new Error('defintion isnt an object'); +export const validatePluginDefinition = (definition: PluginDefinition) => { + if (typeof definition !== 'object') throw new Error('definition isnt an object'); if (!Array.isArray(definition.patches)) throw new Error('definition.patches isnt an array'); for (let i = 0; i < definition.patches.length; i++) { const patch = definition.patches[i]; @@ -38,8 +38,8 @@ export const validatePluginDefintion = (definition: PluginDefinition) => { throw new Error('failed to validate definition.patches[' + i + ']' + '\n' + error.toString()); } } - if (definition.init && typeof definition.init !== 'function') throw new Error('defintion.init isnt a function'); - if (definition.load && typeof definition.load !== 'function') throw new Error('defintion.load isnt a function'); + if (definition.init && typeof definition.init !== 'function') throw new Error('definition.init isnt a function'); + if (definition.load && typeof definition.load !== 'function') throw new Error('definition.load isnt a function'); }; export const fetchManifest = async (url: string) => { diff --git a/packages/core/src/plugins/loader.ts b/packages/core/src/plugins/loader.ts index 97cac52..b6260ef 100644 --- a/packages/core/src/plugins/loader.ts +++ b/packages/core/src/plugins/loader.ts @@ -1,4 +1,4 @@ -import { fetchManifest, PluginState, validatePluginDefintion } from '.'; +import { fetchManifest, PluginState, validatePluginDefinition } from '.'; import { fetchWithoutCors, getUtils, getValue, setValue } from '../utils/gm'; import { PluginManifest, Plugin, PluginDefinition } from '@placecharity/framework-types'; @@ -29,7 +29,7 @@ export const loadPlugin = async (url: string, manifest: PluginManifest) => { const module = URL.createObjectURL(new Blob([await res.text()], { type: 'text/javascript' })); const def: PluginDefinition = (await import(module)).default; - validatePluginDefintion(def); + validatePluginDefinition(def); const utils = getUtils(manifest.id);