Closed qfox closed 8 years ago
Ref: #6
Methods:
parse(data: {version: ?string, blocks: ?object[], decl: ?object[]): BEMEntityParts[]
The method should determine the format of the file content.
BEMDECL 1.0
exports.blocks = [ { name: 'block' } ];
or
exports.version = '1.0'; exports.decl = [ { name: 'block' } ];
BEMDECL 2.0
exports.version = '2.0'; exports.decl = [ { block: 'block' } ];
BEMDECL next
exports.version = 'next'; exports.decl = [ { block: 'block' } ];
The method should translate any format to normalized BEMDECL 2.0.
var parse = require('bem-decl').parse; // bemdecl-1.0.js // exports.blocks = [ // { name: 'block' } // ]; parse(fs.readFileSync('bemdecl-1.0.js')); // [{ block: 'block' }]
Prbbly parse isn't the best name for this method. Any other suggestions?
parse
Ref: #6
Methods:
parse(data: {version: ?string, blocks: ?object[], decl: ?object[]): BEMEntityParts[]
The method should determine the format of the file content.
BEMDECL 1.0
or
BEMDECL 2.0
BEMDECL next
The method should translate any format to normalized BEMDECL 2.0.