@bem-react/classname 1.5.12 → 1.5.13-dev.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,7 @@ function withNaming(preset) {
38
38
  }
39
39
  }
40
40
  if (mix !== undefined) {
41
+ mix = Array.isArray(mix) ? mix : [mix];
41
42
  for (var i = 0, len = mix.length; i < len; i++) {
42
43
  var value = mix[i];
43
44
  // Skipping non-string values and empty strings
@@ -57,7 +58,7 @@ function withNaming(preset) {
57
58
  return function cnGenerator(b, e) {
58
59
  return function (elemOrMods, elemModsOrBlockMix, elemMix) {
59
60
  if (typeof elemOrMods === 'string') {
60
- if (Array.isArray(elemModsOrBlockMix)) {
61
+ if (typeof elemModsOrBlockMix === 'string' || Array.isArray(elemModsOrBlockMix)) {
61
62
  return stringify(b, elemOrMods, undefined, elemModsOrBlockMix);
62
63
  }
63
64
  return stringify(b, elemOrMods, elemModsOrBlockMix, elemMix);
@@ -1 +1 @@
1
- 'use strict';function r(r){function e(e,i,a,o){var f=i?t+e+r.e+i:t+e,v=f;if(a){var u=' '+v+r.m;for(var s in a)if(a.hasOwnProperty(s)){var p=a[s];!0===p?v+=u+s:p&&(v+=u+s+n+p)}}if(void 0!==o)for(var c=0,l=o.length;c<l;c++){var y=o[c];if(y&&'string'==typeof y.valueOf())for(var g=y.valueOf().split(' '),d=0;d<g.length;d++){var h=g[d];h!==f&&(v+=' '+h)}}return v}var t=r.n||'',n=r.v||r.m;return function(r,t){return function(n,i,a){return'string'==typeof n?Array.isArray(i)?e(r,n,void 0,i):e(r,n,i,a):e(r,t,n,i)}}}Object.defineProperty(exports,'__esModule',{value:!0});var e=r({e:'-',m:'_'});exports.cn=e,exports.withNaming=r;
1
+ 'use strict';function r(r){function t(t,i,a,o){var f=i?e+t+r.e+i:e+t,v=f;if(a){var s=' '+v+r.m;for(var u in a)if(a.hasOwnProperty(u)){var p=a[u];!0===p?v+=s+u:p&&(v+=s+u+n+p)}}if(void 0!==o)for(var y=0,c=(o=Array.isArray(o)?o:[o]).length;y<c;y++){var l=o[y];if(l&&'string'==typeof l.valueOf())for(var g=l.valueOf().split(' '),d=0;d<g.length;d++){var h=g[d];h!==f&&(v+=' '+h)}}return v}var e=r.n||'',n=r.v||r.m;return function(r,e){return function(n,i,a){return'string'==typeof n?'string'==typeof i||Array.isArray(i)?t(r,n,void 0,i):t(r,n,i,a):t(r,e,n,i)}}}Object.defineProperty(exports,'__esModule',{value:!0});var t=r({e:'-',m:'_'});exports.cn=t,exports.withNaming=r;
package/classname.d.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * List of classname.
3
3
  */
4
- export declare type ClassNameList = Array<string | undefined>;
4
+ export type ClassNameList = string | Array<string | undefined>;
5
5
  /**
6
6
  * Allowed modifiers format.
7
7
  *
8
8
  * @see https://en.bem.info/methodology/key-concepts/#modifier
9
9
  */
10
- export declare type NoStrictEntityMods = Record<string, string | boolean | number | undefined>;
10
+ export type NoStrictEntityMods = Record<string, string | boolean | number | undefined>;
11
11
  /**
12
12
  * BEM Entity className initializer.
13
13
  */
14
- export declare type ClassNameInitilizer = (blockName: string, elemName?: string) => ClassNameFormatter;
14
+ export type ClassNameInitilizer = (blockName: string, elemName?: string) => ClassNameFormatter;
15
15
  /**
16
16
  * BEM Entity className formatter.
17
17
  */
@@ -24,7 +24,7 @@ export interface ClassNameFormatter {
24
24
  /**
25
25
  * Settings for the naming convention.
26
26
  */
27
- export declare type Preset = {
27
+ export type Preset = {
28
28
  /**
29
29
  * Global namespace.
30
30
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bem-react/classname",
3
- "version": "1.5.12",
3
+ "version": "1.5.13-dev.19+c1c9731",
4
4
  "description": "BEM React ClassName",
5
5
  "homepage": "https://github.com/bem/bem-react/tree/master/packages/classname",
6
6
  "repository": "https://github.com/bem/bem-react",
@@ -26,5 +26,5 @@
26
26
  "build": "node ../../scripts/rollup/build.js",
27
27
  "unit": "../../node_modules/.bin/jest --config ../../.config/jest/jest.config.js"
28
28
  },
29
- "gitHead": "95cb27909cc232d3676b4d010b5b9b8cf171e8e3"
29
+ "gitHead": "c1c97312b80d24da88eafffd8e7c235887d65bd6"
30
30
  }