@micromag/cli 0.4.71 → 0.4.75
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.
- package/bin/export.js +7 -10
- package/package.json +11 -11
package/bin/export.js
CHANGED
|
@@ -54,8 +54,7 @@ function splitSeparateNumbers(value) {
|
|
|
54
54
|
const word = words[i];
|
|
55
55
|
const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
|
|
56
56
|
if (match) {
|
|
57
|
-
|
|
58
|
-
const offset = match.index + ((_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : match[2]).length;
|
|
57
|
+
const offset = match.index + (match[1] ?? match[2]).length;
|
|
59
58
|
words.splice(i, 1, word.slice(0, offset), word.slice(offset));
|
|
60
59
|
}
|
|
61
60
|
}
|
|
@@ -65,15 +64,14 @@ function splitSeparateNumbers(value) {
|
|
|
65
64
|
* Convert a string to camel case (`fooBar`).
|
|
66
65
|
*/
|
|
67
66
|
function camelCase(input, options) {
|
|
68
|
-
var _options$delimiter2;
|
|
69
67
|
const [prefix, words, suffix] = splitPrefixSuffix(input, options);
|
|
70
|
-
const lower = lowerFactory(
|
|
71
|
-
const upper = upperFactory(
|
|
68
|
+
const lower = lowerFactory(options?.locale);
|
|
69
|
+
const upper = upperFactory(options?.locale);
|
|
72
70
|
const transform = pascalCaseTransformFactory(lower, upper);
|
|
73
71
|
return prefix + words.map((word, index) => {
|
|
74
72
|
if (index === 0) return lower(word);
|
|
75
73
|
return transform(word, index);
|
|
76
|
-
}).join(
|
|
74
|
+
}).join("") + suffix;
|
|
77
75
|
}
|
|
78
76
|
function lowerFactory(locale) {
|
|
79
77
|
return input => input.toLocaleLowerCase(locale);
|
|
@@ -89,10 +87,9 @@ function pascalCaseTransformFactory(lower, upper) {
|
|
|
89
87
|
};
|
|
90
88
|
}
|
|
91
89
|
function splitPrefixSuffix(input, options = {}) {
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
const suffixCharacters = (_options$suffixCharac = options.suffixCharacters) !== null && _options$suffixCharac !== void 0 ? _options$suffixCharac : DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
90
|
+
const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);
|
|
91
|
+
const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
92
|
+
const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
|
|
96
93
|
let prefixIndex = 0;
|
|
97
94
|
let suffixIndex = input.length;
|
|
98
95
|
while (prefixIndex < input.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.75",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@babel/runtime": "^7.28.6",
|
|
49
|
-
"@micromag/core": "^0.4.
|
|
50
|
-
"@micromag/elements": "^0.4.
|
|
51
|
-
"@micromag/fields": "^0.4.
|
|
52
|
-
"@micromag/screens": "^0.4.
|
|
53
|
-
"@micromag/transforms": "^0.4.
|
|
54
|
-
"@micromag/viewer": "^0.4.
|
|
55
|
-
"@micromag/viewer-build": "^0.4.
|
|
49
|
+
"@micromag/core": "^0.4.74",
|
|
50
|
+
"@micromag/elements": "^0.4.74",
|
|
51
|
+
"@micromag/fields": "^0.4.74",
|
|
52
|
+
"@micromag/screens": "^0.4.74",
|
|
53
|
+
"@micromag/transforms": "^0.4.74",
|
|
54
|
+
"@micromag/viewer": "^0.4.75",
|
|
55
|
+
"@micromag/viewer-build": "^0.4.75",
|
|
56
56
|
"change-case": "^5.4.4",
|
|
57
57
|
"classnames": "^2.2.6",
|
|
58
58
|
"commander": "^12.0.0",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
"lodash": "^4.17.23",
|
|
63
63
|
"node-fetch": "^3.3.2",
|
|
64
64
|
"puppeteer": "^24.33.0",
|
|
65
|
-
"react": "^
|
|
66
|
-
"react-dom": "^
|
|
65
|
+
"react": "^19.0.0",
|
|
66
|
+
"react-dom": "^19.0.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public",
|
|
70
70
|
"registry": "https://registry.npmjs.org/"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "31d8537fa44b14e612d2b297ab4224a0dee4f9c4"
|
|
73
73
|
}
|