@threlte/gltf 1.0.0-next.5 → 1.0.0-next.6
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/CHANGELOG.md +6 -0
- package/cli.js +18 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/cli.js
CHANGED
|
@@ -65,13 +65,24 @@ const cli = meow(
|
|
|
65
65
|
|
|
66
66
|
const { packageJson } = readPackageUpSync({ cwd: __dirname, normalize: false })
|
|
67
67
|
|
|
68
|
-
function toPascalCase(
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
function toPascalCase(str) {
|
|
69
|
+
return (
|
|
70
|
+
str
|
|
71
|
+
.replace(/(\w)(\w*)/g, function (g0, g1, g2) {
|
|
72
|
+
// capitalize first letter of g1, leave the reset as-is and return the result
|
|
73
|
+
return g1.toUpperCase() + g2
|
|
74
|
+
})
|
|
75
|
+
// replace every non-word character with an empty string and capitalize the first following letter
|
|
76
|
+
.replace(/\W+(.)/g, function (g0, g1) {
|
|
77
|
+
return g1.toUpperCase()
|
|
78
|
+
})
|
|
79
|
+
// replace every non-word character with an empty string
|
|
80
|
+
.replace(/\s+/g, '')
|
|
81
|
+
// make first letter uppercase
|
|
82
|
+
.replace(/^\w/, function (g0) {
|
|
83
|
+
return g0.toUpperCase()
|
|
84
|
+
})
|
|
85
|
+
)
|
|
75
86
|
}
|
|
76
87
|
|
|
77
88
|
if (cli.input.length === 0) {
|