bun_plugins 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +142 -36
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/utils/pluginValidator.d.ts +0 -30
- package/dist/utils/pluginValidator.d.ts.map +1 -1
- package/dist/utils/pluginValidator.js +11 -13
- package/dist/utils/pluginValidator.js.map +1 -1
- package/package.json +3 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,81 +1,187 @@
|
|
|
1
|
-
# Bun Plugins
|
|
1
|
+
# 🔌 Bun Plugins
|
|
2
2
|
|
|
3
|
-
A powerful, secure, and isolated plugin system for Bun applications.
|
|
3
|
+
A powerful, secure, and isolated plugin system designed specifically for **Bun** applications. Build extensible applications with fine-grained control over security, resource management, and inter-plugin communication.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/bun_plugins)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://bun.sh)
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- **Permission System**: Fine-grained control over network, file system, and environment access.
|
|
9
|
-
- **Hook System**: Intercept and modify resource loading with `onResolve` and `onLoad` hooks (compatible with Bun's plugin API).
|
|
10
|
-
- **Type Safe**: Written in TypeScript with full type definitions and Zod validation.
|
|
11
|
-
- **Communication RPC**: Seamless communication between the host and plugins using a proxy-based RPC.
|
|
12
|
-
- **Automatic Cleanup**: Resources (timers, workers, event listeners) are automatically cleaned up when a plugin is unloaded.
|
|
9
|
+
## 🌟 Key Features
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
- 🛡️ **Isolation**: Run plugins in dedicated Bun Workers for crash protection and security boundaries.
|
|
12
|
+
- 🔐 **Permission System**: Fine-grained control over Network (with whitelist), Filesystem, and Environment access.
|
|
13
|
+
- 🔄 **Communication RPC**: Seamless, proxy-based async communication between host and plugins.
|
|
14
|
+
- 🧹 **Automatic Resource Cleanup**: Automatically stops workers, clears timers, and removes event listeners when a plugin unloads.
|
|
15
|
+
- ✅ **Type Safe**: Fully written in TypeScript with Zod validation for plugin configurations.
|
|
16
|
+
- 🏗️ **Plugin Hooks**: Intercept resource loading with `onResolve` and `onLoad` hooks, fully compatible with Bun's native plugin API.
|
|
17
|
+
- 🔋 **Persistence**: Built-in JSON-based KV storage for each plugin.
|
|
18
|
+
- 🔥 **Hot Reloading**: Watch plugin directories and automatically reload changed plugins.
|
|
19
|
+
- 📦 **Dependency Management**: Cross-plugin dependencies with semver version checking.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 🚀 Quick Start
|
|
24
|
+
|
|
25
|
+
### 1. Installation
|
|
15
26
|
|
|
16
27
|
```bash
|
|
17
28
|
bun add bun_plugins
|
|
18
29
|
```
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### 1. Define a Plugin
|
|
31
|
+
### 2. Create your first Plugin
|
|
23
32
|
|
|
24
33
|
```typescript
|
|
25
|
-
|
|
26
|
-
import type { IPlugin, PluginContext } from "bun_plugins";
|
|
34
|
+
import { type IPlugin, type PluginContext } from "bun_plugins";
|
|
27
35
|
|
|
28
36
|
export class MyPlugin implements IPlugin {
|
|
29
|
-
name = "
|
|
37
|
+
name = "hello-world";
|
|
30
38
|
version = "1.0.0";
|
|
31
39
|
|
|
32
40
|
async onLoad(context: PluginContext) {
|
|
33
|
-
context.log.info("Plugin
|
|
41
|
+
context.log.info("Hello World Plugin Loaded!");
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
// Listen to global app events
|
|
44
|
+
context.on("app:ready", () => {
|
|
45
|
+
context.log.info("The application is ready!");
|
|
37
46
|
});
|
|
47
|
+
|
|
48
|
+
// Expose functionality via events
|
|
49
|
+
context.emit("plugin:hello", { message: "Hello from plugin!" });
|
|
38
50
|
}
|
|
39
51
|
}
|
|
40
52
|
```
|
|
41
53
|
|
|
42
|
-
###
|
|
54
|
+
### 3. Initialize the Manager
|
|
43
55
|
|
|
44
56
|
```typescript
|
|
45
57
|
import { PluginManager } from "bun_plugins";
|
|
46
|
-
import {
|
|
58
|
+
import { MyPlugin } from "./plugins/MyPlugin";
|
|
47
59
|
|
|
48
60
|
const manager = new PluginManager();
|
|
49
61
|
|
|
50
|
-
// Register a
|
|
62
|
+
// Register a class instance
|
|
51
63
|
await manager.register(new MyPlugin());
|
|
52
64
|
|
|
53
|
-
//
|
|
65
|
+
// Emit an event to all plugins
|
|
66
|
+
manager.emit("app:ready", {});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 🛠️ Core Concepts
|
|
72
|
+
|
|
73
|
+
### 🧩 The Plugin Interface (`IPlugin`)
|
|
74
|
+
|
|
75
|
+
All plugins must implement the `IPlugin` interface.
|
|
76
|
+
|
|
77
|
+
| Property | Type | Description |
|
|
78
|
+
| :--------------- | :------------------- | :-------------------------------------------------------------- |
|
|
79
|
+
| `name` | `string` | Unique identifier for the plugin. |
|
|
80
|
+
| `version` | `string` | Semver compatible version. |
|
|
81
|
+
| `permissions` | `PluginPermission[]` | List of requested permissions (`network`, `filesystem`, `env`). |
|
|
82
|
+
| `allowedDomains` | `string[]` | Whitelist for network access. |
|
|
83
|
+
| `configSchema` | `ZodSchema` | Zod schema for configuration validation. |
|
|
84
|
+
| `onLoad` | `(ctx) => void` | Primary entry point for plugin logic. |
|
|
85
|
+
| `onUnload` | `() => void` | Cleanup logic when plugin is removed. |
|
|
86
|
+
|
|
87
|
+
### 🧪 Plugin Context (`PluginContext`)
|
|
88
|
+
|
|
89
|
+
The `context` provided to `onLoad` is the primary way plugins interact with the host.
|
|
90
|
+
|
|
91
|
+
- 📝 **`context.log`**: Scoped logging (`info`, `warn`, `error`).
|
|
92
|
+
- 📡 **`context.events`**: typed event bus (`emit`, `on`).
|
|
93
|
+
- 📦 **`context.storage`**: Persistent JSON storage (`get`, `set`, `delete`).
|
|
94
|
+
- 🌐 **`context.network`**: Safe `fetch` implementation (requires 'network' permission).
|
|
95
|
+
- 📂 **`context.file`**: Access Bun's `File` API (requires 'filesystem' permission).
|
|
96
|
+
- 🔐 **`context.env`**: Read-only access to environment variables (requires 'env' permission).
|
|
97
|
+
- ⏲️ **`context.setTimeout/Interval`**: Automatically cleaned up on unload.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 🔒 Security & Permissions
|
|
102
|
+
|
|
103
|
+
Plugins are restricted by default. To access sensitive APIs, you must explicitly declare permissions:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
export class NetworkPlugin implements IPlugin {
|
|
107
|
+
name = "weather-fetcher";
|
|
108
|
+
version = "1.0.0";
|
|
109
|
+
|
|
110
|
+
// Request network access
|
|
111
|
+
permissions = [PluginPermission.Network];
|
|
112
|
+
// Whitelist specific domains
|
|
113
|
+
allowedDomains = ["api.weather.com"];
|
|
114
|
+
|
|
115
|
+
async onLoad(context: PluginContext) {
|
|
116
|
+
// This works
|
|
117
|
+
const data = await context.network.fetch(
|
|
118
|
+
"https://api.weather.com/v1/forecast"
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// This throws AccessDeniedError (not in whitelist)
|
|
122
|
+
await context.network.fetch("https://malicious.com");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## 🧊 Isolated Worker Plugins
|
|
130
|
+
|
|
131
|
+
For maximum security and stability, you can load plugins into dedicated workers. These plugins run in a separate process and communicate via RPC.
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
// Load a plugin from a file into a worker
|
|
54
135
|
await manager.registerIsolated(
|
|
55
|
-
|
|
56
|
-
"
|
|
136
|
+
"./plugins/ExternalPlugin.ts",
|
|
137
|
+
"isolated-plugin"
|
|
57
138
|
);
|
|
139
|
+
```
|
|
58
140
|
|
|
59
|
-
|
|
60
|
-
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 🔌 Native Bun Integration
|
|
144
|
+
|
|
145
|
+
`bun_plugins` can act as a bridge to Bun's native plugin system, allowing your library plugins to handle your application's module resolution.
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// In your entry point
|
|
149
|
+
const manager = new PluginManager();
|
|
150
|
+
await manager.loadPluginsFromDirectory();
|
|
151
|
+
|
|
152
|
+
// Register as a native Bun plugin
|
|
153
|
+
Bun.plugin(manager.toBunPlugin());
|
|
61
154
|
```
|
|
62
155
|
|
|
63
|
-
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 🤝 Inter-Plugin Communication
|
|
64
159
|
|
|
65
|
-
Plugins
|
|
160
|
+
Plugins can share APIs with each other safely:
|
|
66
161
|
|
|
67
162
|
```typescript
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
163
|
+
// Plugin A: Exposes an API
|
|
164
|
+
export class ProviderPlugin implements IPlugin {
|
|
165
|
+
name = "db-provider";
|
|
166
|
+
getSharedApi() {
|
|
167
|
+
return {
|
|
168
|
+
query: (q: string) => `Result for ${q}`,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
72
172
|
|
|
173
|
+
// Plugin B: Consumes the API
|
|
174
|
+
export class ConsumerPlugin implements IPlugin {
|
|
175
|
+
name = "app-logic";
|
|
73
176
|
async onLoad(context: PluginContext) {
|
|
74
|
-
const
|
|
177
|
+
const db = context.getPlugin("db-provider");
|
|
178
|
+
const result = db.query("SELECT *");
|
|
75
179
|
}
|
|
76
180
|
}
|
|
77
181
|
```
|
|
78
182
|
|
|
79
|
-
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## 📜 License
|
|
80
186
|
|
|
81
|
-
MIT
|
|
187
|
+
MIT © [memelser](https://github.com/nglmercer)
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import type { IPlugin } from "../types";
|
|
3
|
-
export declare const PluginSchema: z.ZodObject<{
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
version: z.ZodDefault<z.ZodString>;
|
|
6
|
-
description: z.ZodOptional<z.ZodString>;
|
|
7
|
-
author: z.ZodOptional<z.ZodString>;
|
|
8
|
-
configSchema: z.ZodOptional<z.ZodAny>;
|
|
9
|
-
defaultConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
10
|
-
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
|
-
permissions: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
12
|
-
network: "network";
|
|
13
|
-
filesystem: "filesystem";
|
|
14
|
-
env: "env";
|
|
15
|
-
}>>>;
|
|
16
|
-
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
-
engines: z.ZodOptional<z.ZodObject<{
|
|
18
|
-
host: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$strip>>;
|
|
20
|
-
onLoad: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
|
|
21
|
-
onStarted: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
22
|
-
onUnload: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
23
|
-
getSharedApi: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
24
|
-
setup: z.ZodOptional<z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
export declare const StrictPluginSchema: z.ZodObject<{
|
|
27
|
-
name: z.ZodString;
|
|
28
|
-
version: z.ZodString;
|
|
29
|
-
onLoad: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
|
|
30
|
-
onUnload: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
2
|
export type ValidationResult = {
|
|
33
3
|
valid: true;
|
|
34
4
|
plugin: IPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginValidator.d.ts","sourceRoot":"","sources":["../../src/utils/pluginValidator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pluginValidator.d.ts","sourceRoot":"","sources":["../../src/utils/pluginValidator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AA4BxC,MAAM,MAAM,gBAAgB,GACxB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAChC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,OAAO,GAAG,gBAAgB,CAqBnE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { errorParser } from "../utils/errorParser";
|
|
3
|
-
|
|
3
|
+
// Internal schemas - NOT exported to avoid Zod type leakage
|
|
4
|
+
const pluginSchemaDefinition = z.object({
|
|
4
5
|
name: z.string().min(1, "Plugin name is required"),
|
|
5
6
|
version: z.string().min(1, "Plugin version is required").default("1.0.0"),
|
|
6
7
|
description: z.string().optional(),
|
|
@@ -19,13 +20,6 @@ export const PluginSchema = z.object({
|
|
|
19
20
|
getSharedApi: z.function().optional(),
|
|
20
21
|
setup: z.function().optional(),
|
|
21
22
|
});
|
|
22
|
-
// We can have a stricter schema for the full IPlugin
|
|
23
|
-
export const StrictPluginSchema = z.object({
|
|
24
|
-
name: z.string(),
|
|
25
|
-
version: z.string(),
|
|
26
|
-
onLoad: z.function(),
|
|
27
|
-
onUnload: z.function(),
|
|
28
|
-
});
|
|
29
23
|
/**
|
|
30
24
|
* Validates if an unknown object is a valid plugin.
|
|
31
25
|
* Handles:
|
|
@@ -57,17 +51,21 @@ export function validatePlugin(candidate) {
|
|
|
57
51
|
}
|
|
58
52
|
}
|
|
59
53
|
function validatePluginInstance(obj) {
|
|
60
|
-
const result =
|
|
54
|
+
const result = pluginSchemaDefinition.safeParse(obj);
|
|
61
55
|
if (!result.success) {
|
|
62
56
|
return {
|
|
63
57
|
valid: false,
|
|
64
58
|
error: result.error.issues.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ')
|
|
65
59
|
};
|
|
66
60
|
}
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
//
|
|
70
|
-
|
|
61
|
+
// Use the original object to preserve prototype and 'this' context,
|
|
62
|
+
// but we can use the parsed data to ensure defaults are applied if we want.
|
|
63
|
+
// For now, let's just return the original object casted to IPlugin.
|
|
64
|
+
const plugin = obj;
|
|
65
|
+
// Apply defaults/formatting from Zod if needed (optional)
|
|
66
|
+
if (!plugin.version && result.data.version)
|
|
67
|
+
plugin.version = result.data.version;
|
|
68
|
+
// Shim onUnload if missing
|
|
71
69
|
if (!plugin.onUnload) {
|
|
72
70
|
plugin.onUnload = () => { };
|
|
73
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pluginValidator.js","sourceRoot":"","sources":["../../src/utils/pluginValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,
|
|
1
|
+
{"version":3,"file":"pluginValidator.js","sourceRoot":"","sources":["../../src/utils/pluginValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,4DAA4D;AAC5D,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC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7F,CAAC;IACJ,CAAC;IAED,oEAAoE;IACpE,4EAA4E;IAC5E,oEAAoE;IACpE,MAAM,MAAM,GAAG,GAAc,CAAC;IAE9B,0DAA0D;IAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO;QAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;IAEjF,2BAA2B;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun_plugins",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A powerful and secure plugin system for Bun applications",
|
|
5
5
|
"author": "memelser <nglmercer@gmail.com>",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"build": "
|
|
28
|
+
"build": "bun tsc",
|
|
29
29
|
"test": "bun test ./tests",
|
|
30
30
|
"typecheck": "bun tsc --noEmit",
|
|
31
31
|
"prepublishOnly": "bun run build"
|
|
@@ -33,11 +33,10 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/bun": "latest",
|
|
35
35
|
"@types/semver": "^7.7.1",
|
|
36
|
-
"bun_plugins": "^1.0.4",
|
|
37
36
|
"typescript": "^5.0.0"
|
|
38
37
|
},
|
|
39
38
|
"dependencies": {
|
|
40
39
|
"semver": "^7.7.3",
|
|
41
|
-
"zod": "^
|
|
40
|
+
"zod": "^4.2.1"
|
|
42
41
|
}
|
|
43
42
|
}
|