@bem/naming
Advanced tools
Comparing version 2.0.0-4 to 2.0.0-5
@@ -219,2 +219,28 @@ Changelog | ||
#### Delims field ([#167]). | ||
Added `delims` field instead of `elemDelim`, `modDelim` and `modValDelim` for consistency with [bemNaming](README.md#bemnaming-delims-elem-mod-wordpattern-) function. | ||
**API v1.x.x** | ||
```js | ||
const bemNaming = require('bem-naming'); | ||
bemNaming.elemDelim | ||
bemNaming.modDelim | ||
bemNaming.modValDelim | ||
``` | ||
**API v2.x.x** | ||
```js | ||
const bemNaming = require('@bem/naming'); | ||
bemNaming.delims.elem | ||
bemNaming.delims.mod.name | ||
bemNaming.delims.mod.val | ||
``` | ||
[#167]: https://github.com/bem-sdk/bem-naming/pull/167 | ||
### NPM | ||
@@ -221,0 +247,0 @@ |
@@ -5,12 +5,8 @@ 'use strict'; | ||
const api = [ | ||
'parse', 'stringify', | ||
'elemDelim', 'modDelim', 'modValDelim' | ||
]; | ||
const originalNaming = createNaming(); | ||
api.forEach(function (name) { | ||
createNaming[name] = originalNaming[name]; | ||
Object.keys(originalNaming).forEach(key => { | ||
createNaming[key] = originalNaming[key]; | ||
}); | ||
module.exports = createNaming; |
@@ -56,15 +56,3 @@ 'use strict'; | ||
*/ | ||
elemDelim: delims.elem, | ||
/** | ||
* String to separate modifiers from blocks and elements. | ||
* | ||
* @type {String} | ||
*/ | ||
modDelim: delims.mod.name, | ||
/** | ||
* String to separate value of modifier from name of modifier. | ||
* | ||
* @type {String} | ||
*/ | ||
modValDelim: delims.mod.val | ||
delims | ||
}; | ||
@@ -71,0 +59,0 @@ |
{ | ||
"name": "@bem/naming", | ||
"version": "2.0.0-4", | ||
"version": "2.0.0-5", | ||
"description": "Manage naming of BEM entities", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
@@ -58,5 +58,3 @@ bem-naming | ||
* [stringify(obj)](#stringifyobj) | ||
* [elemDelim](#elemdelim) | ||
* [modDelim](#moddelim) | ||
* [modValDelim](#modvaldelim) | ||
* [delims](#delims) | ||
@@ -256,8 +254,6 @@ BEM Entity representation | ||
* [bemNaming({ delims: {elem, mod}, wordPattern })](##bemnaming-delims-elem-mod-wordpattern-) | ||
* [bemNaming({ delims: {elem, mod}, wordPattern })](#bemnaming-delims-elem-mod-wordpattern-) | ||
* [parse(str)](#parsestr) | ||
* [stringify(obj)](#stringifyobj) | ||
* [elemDelim](#elemdelim) | ||
* [modDelim](#moddelim) | ||
* [modValDelim](#modvaldelim) | ||
* [delims](#delims) | ||
@@ -320,14 +316,32 @@ ### bemNaming({ delims: {elem, mod}, wordPattern }) | ||
### elemDelim | ||
### delims | ||
Strings to separate names of bem entities. | ||
Type: `Object` | ||
#### delims.elem | ||
String to separate an element from a block. | ||
### modDelim | ||
Type: `String` | ||
Default: `__` | ||
#### delims.mod.name | ||
String to separate a modifier name from a block or element. | ||
### modValDelim | ||
Type: `String` | ||
Default: `_` | ||
#### delims.mod.val | ||
String to separate a modifier value from the name of the modifier. | ||
Type: `String` | ||
Default: `_` | ||
License | ||
@@ -334,0 +348,0 @@ ------- |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
57928
348
0
212