Use an object with default options to create preset with.

node v10.14.1
version: 1.0.0
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:'\w+?'}, 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