Skip to content
View as Markdown
View as Markdown

@salesforce/b2c-tooling-sdk / operations/logs / discoverAndCreateNormalizer

Function: discoverAndCreateNormalizer()

discoverAndCreateNormalizer(directory?): (message) => string | undefined

Defined in: packages/b2c-tooling-sdk/src/operations/logs/path-normalizer.ts:198

Discovers cartridges and creates a path normalizer automatically.

This is a convenience function that combines findCartridges with createPathNormalizer for easy setup. Cartridge paths are converted to relative paths from the current project directory.

Parameters

directory?

string

Directory to search for cartridges (defaults to cwd)

Returns

(message) => string | undefined

Path normalizer function, or undefined if no cartridges found

Example

typescript
// Auto-discover cartridges from current directory
const normalize = discoverAndCreateNormalizer();

// Auto-discover from specific directory
const normalize = discoverAndCreateNormalizer('./my-project');

Released under the Apache-2.0 License.