UNPKG

earljs

Version:

Ergonomic, modern and type-safe assertion library

26 lines (25 loc) 852 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createPlugin = void 0; /** * Used to create a new EarlJS plugin and preserve its types for declaration merging. * * @example * ```ts * const plugin = createPlugin({ * // your matchers, validators, and smartEqRules * }) * * declare module 'earljs' { * interface Expect extends createPlugin.MatchersOf<typeof plugin> {} * interface Expectation<_> extends createPlugin.ValidatorsOf<typeof plugin> {} * interface SmartEqRules extends createPlugin.SmartEqRulesOf<typeof plugin> {} * } * ``` */ function createPlugin(config) { // There is currently no validation here, the only reason for this function // is to provide autocomplete while preserving the type for declaration merging. return config; } exports.createPlugin = createPlugin;