Use an object with default options to create preset with.

node v10.15.0
version: 1.0.1
endpointsharetweet
const userDefaults = { fs: { delims: { elem: '__', mod: '_' }, scheme: 'flat' } } // Use well-known presets with the flat scheme const reactFlatPreset = require('@bem/sdk.naming.presets/create')({ preset: 'react' }, userDefaults); const twoDashesFlatPreset = require('@bem/sdk.naming.presets/create')({ preset: 'two-dashes' }, userDefaults);
Create a custom preset with the flat scheme
const customPreset = require('@bem/sdk.naming.presets/create')({ wordPattern: '[a-z]+' }, userDefaults);
Create preset with overwritten delimiters
const presetOptions = { delims: { mod: { val: '='} }, fs: { delims: { mod: { val: '='} } } } const anotherPreset = require('@bem/sdk.naming.presets/create')(presetOptions, userDefaults);
Loading…

no comments

    sign in to comment