File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 11# Git Json Resolver <img src =" https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png " style =" height : 40px " />
22
3+ ![ Git JSON Resolver Banner] ( ./banner.jpg )
4+
35[ ![ test] ( https://github.com/react18-tools/git-json-resolver/actions/workflows/test.yml/badge.svg )] ( https://github.com/react18-tools/git-json-resolver/actions/workflows/test.yml )
46[ ![ Maintainability] ( https://qlty.sh/gh/react18-tools/projects/git-json-resolver/maintainability.svg )] ( https://qlty.sh/gh/react18-tools/projects/git-json-resolver )
57[ ![ codecov] ( https://codecov.io/gh/react18-tools/git-json-resolver/graph/badge.svg )] ( https://codecov.io/gh/react18-tools/git-json-resolver )
@@ -349,7 +351,7 @@ export const strategies = {
349351 " timestamp-latest" : timestampLatest ,
350352};
351353
352- // Plugin interface for dynamic loading
354+ // Plugin interface for dynamic loading (object-based)
353355const plugin: StrategyPlugin = {
354356 strategies ,
355357 init : async config => {
@@ -358,6 +360,19 @@ const plugin: StrategyPlugin = {
358360};
359361
360362export default plugin ;
363+
364+ // Alternative: Function-based plugin (NEW)
365+ export default async function createPlugin(config ? : any ): Promise <StrategyPlugin > {
366+ // Initialize with config if needed
367+ console .log (" Plugin initialized with:" , config );
368+
369+ return {
370+ strategies ,
371+ init : async initConfig => {
372+ // Additional initialization if needed
373+ },
374+ };
375+ }
361376```
362377
363378### Custom Strategies (Inline)
You can’t perform that action at this time.
0 commit comments