bem-sdk-archive / bem-decl

:capital_abcd: Manage declaration of BEM entities. DEPRECATED →
https://github.com/bem/bem-sdk/tree/master/packages/decl
Other
11 stars 3 forks source link

Update stringify method #94

Open skad0 opened 7 years ago

skad0 commented 7 years ago

API:

/**
 * @param {BemCell[]} decl 
 * @param {Object} opts
 * @param {String} opts.exportType - can be one of 'cjs', 'json5', 'json', 'es6'
 * @param {String} opts.format - v1, v2, enb
 * @returns {String}
*/

Description:

opts.format defines how to format normalized declaration:

opts.exportType defines how to wrap stringified declaration:

Returned string is representation of object with fields format and formatted decaration (name is defined by opts.format.

Usage:

Use at save with opts.exportType = 'cjs' by default.

Yeti-or commented 7 years ago

no es6 right now