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 1
1
# Git Json Resolver <img src =" https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png " style =" height : 40px " />
2
2
3
+ ![ Git JSON Resolver Banner] ( ./banner.jpg )
4
+
3
5
[ ![ 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 )
4
6
[ ![ Maintainability] ( https://qlty.sh/gh/react18-tools/projects/git-json-resolver/maintainability.svg )] ( https://qlty.sh/gh/react18-tools/projects/git-json-resolver )
5
7
[ ![ 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 = {
349
351
" timestamp-latest" : timestampLatest ,
350
352
};
351
353
352
- // Plugin interface for dynamic loading
354
+ // Plugin interface for dynamic loading (object-based)
353
355
const plugin: StrategyPlugin = {
354
356
strategies ,
355
357
init : async config => {
@@ -358,6 +360,19 @@ const plugin: StrategyPlugin = {
358
360
};
359
361
360
362
export 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
+ }
361
376
```
362
377
363
378
### Custom Strategies (Inline)
You can’t perform that action at this time.
0 commit comments