@kubb/core 5.15.1 → 5.15.3

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/dist/mocks.d.ts DELETED
@@ -1,105 +0,0 @@
1
- import { C as NormalizedPlugin, M as PluginType, Ut as KubbDriver, Z as Generator, i as AdapterFactoryOptions, ln as Parser, pt as Config, t as Adapter, x as KubbPluginSetupContext } from "./createAdapter-CCe-Oddm.js";
2
- import { FileNode, InputMeta, Macro, OperationNode, SchemaNode } from "@kubb/ast";
3
- /**
4
- * Creates a minimal `KubbDriver` mock for unit tests.
5
- */
6
- export declare function createMockedPluginDriver(options?: {
7
- name?: string;
8
- plugin?: NormalizedPlugin;
9
- config?: Config;
10
- }): KubbDriver;
11
- /** Creates a `kubb:plugin:setup` context for unit tests. `requirePlugin` fails for names `plugins` does not list. */
12
- export declare function createMockedSetupContext<TFactory extends PluginType = PluginType>({ plugins, options }?: {
13
- plugins?: Array<string>;
14
- options?: TFactory['options'];
15
- }): KubbPluginSetupContext<TFactory>;
16
- /**
17
- * Creates a minimal `Adapter` mock for unit tests.
18
- * `parse` returns an empty `InputNode` by default. Override via `options.parse`.
19
- */
20
- export declare function createMockedAdapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions>(options?: {
21
- name?: TOptions['name'];
22
- resolvedOptions?: TOptions['resolvedOptions'];
23
- parse?: Adapter<TOptions>['parse'];
24
- }): Adapter<TOptions>;
25
- /**
26
- * Creates a minimal plugin mock for unit tests.
27
- *
28
- * @example
29
- * `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`
30
- */
31
- export declare function createMockedPlugin<TOptions extends PluginType = PluginType>(params: {
32
- name: TOptions['name'];
33
- options: TOptions['resolvedOptions'];
34
- resolver?: TOptions['resolver'];
35
- macros?: Array<Macro>;
36
- dependencies?: Array<string>;
37
- }): NormalizedPlugin<TOptions>;
38
- type RenderGeneratorOptions<TOptions extends PluginType> = {
39
- config: Config;
40
- adapter: Adapter;
41
- meta?: InputMeta;
42
- driver: KubbDriver;
43
- plugin: NormalizedPlugin<TOptions>;
44
- options: TOptions['resolvedOptions'];
45
- resolver: TOptions['resolver'];
46
- };
47
- /**
48
- * Renders a generator's `schema` method in a test context.
49
- *
50
- * @example
51
- * ```ts
52
- * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
53
- * await matchFiles(driver.fileManager.files)
54
- * ```
55
- */
56
- export declare function renderGeneratorSchema<TOptions extends PluginType>(generator: Generator<TOptions>, node: SchemaNode, opts: RenderGeneratorOptions<TOptions>): Promise<void>;
57
- /**
58
- * Renders a generator's `operation` method in a test context.
59
- *
60
- * @example
61
- * ```ts
62
- * await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
63
- * await matchFiles(driver.fileManager.files)
64
- * ```
65
- */
66
- export declare function renderGeneratorOperation<TOptions extends PluginType>(generator: Generator<TOptions>, node: OperationNode, opts: RenderGeneratorOptions<TOptions>): Promise<void>;
67
- /**
68
- * Renders a generator's `operations` method in a test context.
69
- *
70
- * @example
71
- * ```ts
72
- * await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })
73
- * await matchFiles(driver.fileManager.files)
74
- * ```
75
- */
76
- export declare function renderGeneratorOperations<TOptions extends PluginType>(generator: Generator<TOptions>, nodes: Array<OperationNode>, opts: RenderGeneratorOptions<TOptions>): Promise<void>;
77
- type MatchFilesOptions = {
78
- /**
79
- * Parsers indexed by file extension, used to render each `FileNode` to source.
80
- * Without a matching parser the file's raw content is used.
81
- */
82
- parsers?: Map<FileNode['extname'], Parser>;
83
- /**
84
- * Formatter applied to non-JSON output before snapshotting, e.g. prettier. When
85
- * omitted the parsed source is snapshotted as-is.
86
- */
87
- format?: (source?: string) => string | Promise<string>;
88
- /**
89
- * Subfolder under `__snapshots__`, camelCased. Useful to keep variant snapshots apart.
90
- */
91
- pre?: string;
92
- };
93
- /**
94
- * Renders the driver's collected `FileNode`s to source and asserts each against a file snapshot.
95
- * Pair it with the `renderGenerator*` helpers to snapshot a generator's output.
96
- *
97
- * @example
98
- * ```ts
99
- * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
100
- * await matchFiles(driver.fileManager.files, { parsers, format })
101
- * ```
102
- */
103
- export declare function matchFiles(files: Array<FileNode> | undefined, options?: MatchFilesOptions): Promise<Map<string, string> | undefined>;
104
- export {};
105
- //# sourceMappingURL=mocks.d.ts.map
package/dist/mocks.js DELETED
@@ -1,204 +0,0 @@
1
- import { W as camelCase, a as FileManager, f as memoize, i as createNodeCache, r as pluginNotFoundError, t as Hookable } from "./Hookable-C9bM5HsI.js";
2
- import path, { resolve } from "node:path";
3
- import { applyMacros, ast } from "@kubb/ast";
4
- import { expect, vi } from "vitest";
5
- // src/mocks.ts
6
- /**
7
- * Creates a minimal `KubbDriver` mock for unit tests.
8
- */
9
- function createMockedPluginDriver(options = {}) {
10
- const fileManager = new FileManager();
11
- const memo = /* @__PURE__ */ new Map();
12
- return {
13
- config: options?.config ?? {
14
- root: ".",
15
- output: { path: "./path" }
16
- },
17
- getPlugin(_pluginName) {
18
- return options?.plugin;
19
- },
20
- getResolver: (_pluginName) => options?.plugin?.resolver,
21
- memo: ((key, compute) => memoize(memo, key, compute)),
22
- fileManager
23
- };
24
- }
25
- /** Creates a `kubb:plugin:setup` context for unit tests. `requirePlugin` fails for names `plugins` does not list. */
26
- function createMockedSetupContext({ plugins = [], options = {} } = {}) {
27
- const registered = plugins.map((name) => ({ name }));
28
- const memo = /* @__PURE__ */ new Map();
29
- return {
30
- config: { plugins: registered },
31
- options,
32
- addGenerator: vi.fn(),
33
- setResolver: vi.fn(),
34
- addMacro: vi.fn(),
35
- setMacros: vi.fn(),
36
- setOptions: vi.fn(),
37
- injectFile: vi.fn(),
38
- requirePlugin: vi.fn((pluginName) => {
39
- const plugin = registered.find((entry) => entry.name === pluginName);
40
- if (!plugin) throw pluginNotFoundError({ pluginName });
41
- return plugin;
42
- }),
43
- memo: ((key, compute) => memoize(memo, key, compute))
44
- };
45
- }
46
- /**
47
- * Creates a minimal `Adapter` mock for unit tests.
48
- * `parse` returns an empty `InputNode` by default. Override via `options.parse`.
49
- */
50
- function createMockedAdapter(options = {}) {
51
- return {
52
- name: options.name ?? "oas",
53
- options: options.resolvedOptions ?? {},
54
- document: null,
55
- parse: options.parse ?? (async () => ast.factory.createInput()),
56
- validate: async () => {}
57
- };
58
- }
59
- /**
60
- * Creates a minimal plugin mock for unit tests.
61
- *
62
- * @example
63
- * `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`
64
- */
65
- function createMockedPlugin(params) {
66
- return {
67
- name: params.name,
68
- options: params.options,
69
- resolver: params.resolver,
70
- macros: params.macros,
71
- dependencies: params.dependencies,
72
- hooks: {}
73
- };
74
- }
75
- function createMockedPluginContext(opts) {
76
- const root = resolve(opts.config.root, opts.config.output.path);
77
- return {
78
- config: opts.config,
79
- root,
80
- adapter: opts.adapter,
81
- resolver: opts.resolver,
82
- plugin: opts.plugin,
83
- driver: opts.driver,
84
- getResolver: (name) => opts.driver.getResolver(name),
85
- requirePlugin: (pluginName) => {
86
- const plugin = opts.driver.getPlugin(pluginName);
87
- if (!plugin) throw pluginNotFoundError({
88
- pluginName,
89
- requiredBy: opts.plugin.name
90
- });
91
- return plugin;
92
- },
93
- meta: opts.meta ?? {
94
- circularNames: /* @__PURE__ */ new Set(),
95
- enumNames: /* @__PURE__ */ new Set()
96
- },
97
- cache: createNodeCache(),
98
- memo: opts.driver.memo.bind(opts.driver),
99
- addFile: async (...files) => opts.driver.fileManager.add(...files),
100
- upsertFile: async (...files) => opts.driver.fileManager.upsert(...files),
101
- hooks: opts.driver.hooks ?? new Hookable(),
102
- warn: (msg) => console.warn(msg),
103
- error: (msg) => console.error(msg),
104
- info: (msg) => console.info(msg)
105
- };
106
- }
107
- async function renderNode({ generator, node, opts, generate }) {
108
- const ctx = {
109
- ...createMockedPluginContext(opts),
110
- options: opts.options
111
- };
112
- const transformedNode = opts.plugin.macros?.length ? applyMacros(node, opts.plugin.macros) : node;
113
- if (!(generator.match ? await generator.match(transformedNode, ctx) : true)) return;
114
- await opts.driver.fileManager.dispatch({
115
- result: await generate(transformedNode, ctx),
116
- renderer: generator.renderer
117
- });
118
- }
119
- /**
120
- * Renders a generator's `schema` method in a test context.
121
- *
122
- * @example
123
- * ```ts
124
- * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
125
- * await matchFiles(driver.fileManager.files)
126
- * ```
127
- */
128
- async function renderGeneratorSchema(generator, node, opts) {
129
- if (!generator.schema) return;
130
- await renderNode({
131
- generator,
132
- node,
133
- opts,
134
- generate: (transformedNode, ctx) => generator.schema(transformedNode, ctx)
135
- });
136
- }
137
- /**
138
- * Renders a generator's `operation` method in a test context.
139
- *
140
- * @example
141
- * ```ts
142
- * await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
143
- * await matchFiles(driver.fileManager.files)
144
- * ```
145
- */
146
- async function renderGeneratorOperation(generator, node, opts) {
147
- if (!generator.operation) return;
148
- await renderNode({
149
- generator,
150
- node,
151
- opts,
152
- generate: (transformedNode, ctx) => generator.operation(transformedNode, ctx)
153
- });
154
- }
155
- /**
156
- * Renders a generator's `operations` method in a test context.
157
- *
158
- * @example
159
- * ```ts
160
- * await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })
161
- * await matchFiles(driver.fileManager.files)
162
- * ```
163
- */
164
- async function renderGeneratorOperations(generator, nodes, opts) {
165
- if (!generator.operations) return;
166
- const context = createMockedPluginContext(opts);
167
- const transformedNodes = opts.plugin.macros?.length ? nodes.map((n) => applyMacros(n, opts.plugin.macros)) : nodes;
168
- const result = await generator.operations(transformedNodes, {
169
- ...context,
170
- options: opts.options
171
- });
172
- await opts.driver.fileManager.dispatch({
173
- result,
174
- renderer: generator.renderer
175
- });
176
- }
177
- /**
178
- * Renders the driver's collected `FileNode`s to source and asserts each against a file snapshot.
179
- * Pair it with the `renderGenerator*` helpers to snapshot a generator's output.
180
- *
181
- * @example
182
- * ```ts
183
- * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })
184
- * await matchFiles(driver.fileManager.files, { parsers, format })
185
- * ```
186
- */
187
- async function matchFiles(files, options = {}) {
188
- if (!files?.length) return;
189
- const { parsers = /* @__PURE__ */ new Map(), format, pre } = options;
190
- const fileManager = new FileManager();
191
- const processed = /* @__PURE__ */ new Map();
192
- for (const file of files) {
193
- if (!file?.path || processed.has(file.path)) continue;
194
- const parsed = await fileManager.parse(file, { parsers });
195
- const code = file.baseName.endsWith(".json") || !format ? parsed : await format(parsed);
196
- processed.set(file.path, code);
197
- const snapshotPath = path.join("__snapshots__", ...pre ? [camelCase(pre)] : [], file.baseName);
198
- await expect(code).toMatchFileSnapshot(snapshotPath);
199
- }
200
- return processed;
201
- }
202
- export { createMockedAdapter, createMockedPlugin, createMockedPluginDriver, createMockedSetupContext, matchFiles, renderGeneratorOperation, renderGeneratorOperations, renderGeneratorSchema };
203
-
204
- //# sourceMappingURL=mocks.js.map
package/dist/mocks.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"mocks.js","names":[],"sources":["../src/mocks.ts"],"sourcesContent":["import path, { resolve } from 'node:path'\nimport { camelCase } from '@internals/utils'\nimport type { FileNode, InputMeta, Macro, OperationNode, SchemaNode } from '@kubb/ast'\nimport { applyMacros, ast } from '@kubb/ast'\nimport { expect, vi } from 'vitest'\nimport type { Parser } from './defineParser.ts'\nimport { FileManager } from './FileManager.ts'\nimport { Hookable } from './Hookable.ts'\nimport { type Memo, memoize } from './memo.ts'\nimport { createNodeCache } from './nodeCache.ts'\nimport { type KubbDriver, pluginNotFoundError } from './KubbDriver.ts'\nimport type { Config, KubbHooks } from './types.ts'\nimport type { Adapter, AdapterFactoryOptions } from './createAdapter.ts'\nimport type { Generator, GeneratorContext } from './defineGenerator.ts'\nimport type { KubbPluginSetupContext, NormalizedPlugin, Plugin, PluginType } from './definePlugin.ts'\n\n/**\n * Creates a minimal `KubbDriver` mock for unit tests.\n */\nexport function createMockedPluginDriver(options: { name?: string; plugin?: NormalizedPlugin; config?: Config } = {}): KubbDriver {\n const fileManager = new FileManager()\n const memo = new Map<string, unknown>()\n\n return {\n config: options?.config ?? {\n root: '.',\n output: {\n path: './path',\n },\n },\n getPlugin(_pluginName: string): NormalizedPlugin | undefined {\n return options?.plugin\n },\n getResolver: (_pluginName: string) => options?.plugin?.resolver,\n memo: ((key: string, compute: () => unknown) => memoize(memo, key, compute)) as Memo,\n fileManager,\n } as unknown as KubbDriver\n}\n\n/** Creates a `kubb:plugin:setup` context for unit tests. `requirePlugin` fails for names `plugins` does not list. */\nexport function createMockedSetupContext<TFactory extends PluginType = PluginType>({\n plugins = [],\n options = {} as TFactory['options'],\n}: { plugins?: Array<string>; options?: TFactory['options'] } = {}): KubbPluginSetupContext<TFactory> {\n const registered = plugins.map((name) => ({ name }) as unknown as Plugin)\n const memo = new Map<string, unknown>()\n\n return {\n config: { plugins: registered } as unknown as Config,\n options,\n addGenerator: vi.fn(),\n setResolver: vi.fn(),\n addMacro: vi.fn(),\n setMacros: vi.fn(),\n setOptions: vi.fn(),\n injectFile: vi.fn(),\n requirePlugin: vi.fn((pluginName: string) => {\n const plugin = registered.find((entry) => entry.name === pluginName)\n if (!plugin) throw pluginNotFoundError({ pluginName })\n return plugin\n }) as KubbPluginSetupContext<TFactory>['requirePlugin'],\n memo: ((key: string, compute: () => unknown) => memoize(memo, key, compute)) as Memo,\n }\n}\n\n/**\n * Creates a minimal `Adapter` mock for unit tests.\n * `parse` returns an empty `InputNode` by default. Override via `options.parse`.\n */\nexport function createMockedAdapter<TOptions extends AdapterFactoryOptions = AdapterFactoryOptions>(\n options: {\n name?: TOptions['name']\n resolvedOptions?: TOptions['resolvedOptions']\n parse?: Adapter<TOptions>['parse']\n } = {},\n): Adapter<TOptions> {\n const adapter: Adapter<TOptions> = {\n name: (options.name ?? 'oas') as TOptions['name'],\n options: (options.resolvedOptions ?? {}) as TOptions['resolvedOptions'],\n document: null,\n parse: options.parse ?? (async () => ast.factory.createInput()),\n validate: async () => {},\n }\n return adapter\n}\n\n/**\n * Creates a minimal plugin mock for unit tests.\n *\n * @example\n * `const plugin = createMockedPlugin<PluginTs>({ name: '@kubb/plugin-ts', options })`\n */\nexport function createMockedPlugin<TOptions extends PluginType = PluginType>(params: {\n name: TOptions['name']\n options: TOptions['resolvedOptions']\n resolver?: TOptions['resolver']\n macros?: Array<Macro>\n dependencies?: Array<string>\n}): NormalizedPlugin<TOptions> {\n return {\n name: params.name,\n options: params.options,\n resolver: params.resolver,\n macros: params.macros,\n dependencies: params.dependencies,\n hooks: {},\n } as unknown as NormalizedPlugin<TOptions>\n}\n\ntype RenderGeneratorOptions<TOptions extends PluginType> = {\n config: Config\n adapter: Adapter\n meta?: InputMeta\n driver: KubbDriver\n plugin: NormalizedPlugin<TOptions>\n options: TOptions['resolvedOptions']\n resolver: TOptions['resolver']\n}\n\nfunction createMockedPluginContext<TOptions extends PluginType>(opts: RenderGeneratorOptions<TOptions>): Omit<GeneratorContext<TOptions>, 'options'> {\n const root = resolve(opts.config.root, opts.config.output.path)\n\n return {\n config: opts.config,\n root,\n adapter: opts.adapter,\n resolver: opts.resolver,\n plugin: opts.plugin,\n driver: opts.driver,\n getResolver: (name: string) => opts.driver.getResolver(name),\n requirePlugin: (pluginName: string) => {\n const plugin = opts.driver.getPlugin(pluginName)\n if (!plugin) throw pluginNotFoundError({ pluginName, requiredBy: opts.plugin.name })\n return plugin\n },\n meta: opts.meta ?? { circularNames: new Set(), enumNames: new Set() },\n cache: createNodeCache(),\n memo: opts.driver.memo.bind(opts.driver),\n addFile: async (...files: Array<FileNode>) => opts.driver.fileManager.add(...files),\n upsertFile: async (...files: Array<FileNode>) => opts.driver.fileManager.upsert(...files),\n hooks: opts.driver.hooks ?? new Hookable<KubbHooks>(),\n warn: (msg: string) => console.warn(msg),\n error: (msg: string) => console.error(msg),\n info: (msg: string) => console.info(msg),\n } as unknown as Omit<GeneratorContext<TOptions>, 'options'>\n}\n\nasync function renderNode<TOptions extends PluginType, TNode extends SchemaNode | OperationNode>({\n generator,\n node,\n opts,\n generate,\n}: {\n generator: Generator<TOptions>\n node: TNode\n opts: RenderGeneratorOptions<TOptions>\n generate: (node: TNode, ctx: GeneratorContext<TOptions>) => ReturnType<NonNullable<Generator<TOptions>['schema']>>\n}): Promise<void> {\n const ctx = { ...createMockedPluginContext(opts), options: opts.options }\n const transformedNode = opts.plugin.macros?.length ? applyMacros(node, opts.plugin.macros) : node\n const matches = generator.match ? await generator.match(transformedNode, ctx) : true\n if (!matches) return\n await opts.driver.fileManager.dispatch({ result: await generate(transformedNode, ctx), renderer: generator.renderer })\n}\n\n/**\n * Renders a generator's `schema` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorSchema<TOptions extends PluginType>(\n generator: Generator<TOptions>,\n node: SchemaNode,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.schema) return\n await renderNode({ generator, node, opts, generate: (transformedNode, ctx) => generator.schema!(transformedNode, ctx) })\n}\n\n/**\n * Renders a generator's `operation` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorOperation(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorOperation<TOptions extends PluginType>(\n generator: Generator<TOptions>,\n node: OperationNode,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.operation) return\n await renderNode({ generator, node, opts, generate: (transformedNode, ctx) => generator.operation!(transformedNode, ctx) })\n}\n\n/**\n * Renders a generator's `operations` method in a test context.\n *\n * @example\n * ```ts\n * await renderGeneratorOperations(classClientGenerator, nodes, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files)\n * ```\n */\nexport async function renderGeneratorOperations<TOptions extends PluginType>(\n generator: Generator<TOptions>,\n nodes: Array<OperationNode>,\n opts: RenderGeneratorOptions<TOptions>,\n): Promise<void> {\n if (!generator.operations) return\n const context = createMockedPluginContext(opts)\n const transformedNodes = opts.plugin.macros?.length ? nodes.map((n) => applyMacros(n, opts.plugin.macros!)) : nodes\n const result = await generator.operations(transformedNodes, {\n ...context,\n options: opts.options,\n })\n await opts.driver.fileManager.dispatch({ result, renderer: generator.renderer })\n}\n\ntype MatchFilesOptions = {\n /**\n * Parsers indexed by file extension, used to render each `FileNode` to source.\n * Without a matching parser the file's raw content is used.\n */\n parsers?: Map<FileNode['extname'], Parser>\n /**\n * Formatter applied to non-JSON output before snapshotting, e.g. prettier. When\n * omitted the parsed source is snapshotted as-is.\n */\n format?: (source?: string) => string | Promise<string>\n /**\n * Subfolder under `__snapshots__`, camelCased. Useful to keep variant snapshots apart.\n */\n pre?: string\n}\n\n/**\n * Renders the driver's collected `FileNode`s to source and asserts each against a file snapshot.\n * Pair it with the `renderGenerator*` helpers to snapshot a generator's output.\n *\n * @example\n * ```ts\n * await renderGeneratorSchema(typeGenerator, node, { config, adapter, driver, plugin, options, resolver })\n * await matchFiles(driver.fileManager.files, { parsers, format })\n * ```\n */\nexport async function matchFiles(files: Array<FileNode> | undefined, options: MatchFilesOptions = {}): Promise<Map<string, string> | undefined> {\n if (!files?.length) return\n\n const { parsers = new Map(), format, pre } = options\n const fileManager = new FileManager()\n const processed = new Map<string, string>()\n\n for (const file of files) {\n if (!file?.path || processed.has(file.path)) {\n continue\n }\n\n const parsed = await fileManager.parse(file, { parsers })\n const code = file.baseName.endsWith('.json') || !format ? parsed : await format(parsed)\n\n processed.set(file.path, code)\n\n const snapshotPath = path.join('__snapshots__', ...(pre ? [camelCase(pre)] : []), file.baseName)\n await expect(code).toMatchFileSnapshot(snapshotPath)\n }\n\n return processed\n}\n"],"mappings":";;;;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