@cosmwasm/ts-codegen 0.16.2 → 0.16.3

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.
@@ -9,17 +9,16 @@ exports.cleanse = void 0;
9
9
 
10
10
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
12
+ var _case = require("case");
13
+
12
14
  var cleanFor = function cleanFor(str) {
13
15
  /*
14
16
  1. look at first char after _for_
15
17
  2. ONLY if you find capitals after, modify it
16
18
  */
17
- if (/_for_[A-Z]/.test(str)) {
18
- return str.replace(/_for_/, 'For');
19
- }
20
-
21
- if (/_of_[A-Z]/.test(str)) {
22
- return str.replace(/_of_/, 'Of');
19
+ while (/_[a-z]+_[A-Z]/.test(str)) {
20
+ var m = str.match(/(_[a-z]+_)[A-Z]/);
21
+ str = str.replace(m[1], (0, _case.pascal)(m[1]));
23
22
  }
24
23
 
25
24
  return str;
@@ -1,14 +1,13 @@
1
+ import { pascal } from "case";
2
+
1
3
  const cleanFor = str => {
2
4
  /*
3
5
  1. look at first char after _for_
4
6
  2. ONLY if you find capitals after, modify it
5
7
  */
6
- if (/_for_[A-Z]/.test(str)) {
7
- return str.replace(/_for_/, 'For');
8
- }
9
-
10
- if (/_of_[A-Z]/.test(str)) {
11
- return str.replace(/_of_/, 'Of');
8
+ while (/_[a-z]+_[A-Z]/.test(str)) {
9
+ const m = str.match(/(_[a-z]+_)[A-Z]/);
10
+ str = str.replace(m[1], pascal(m[1]));
12
11
  }
13
12
 
14
13
  return str;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmwasm/ts-codegen",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/cosmwasm/ts-codegen",
@@ -94,7 +94,7 @@
94
94
  "parse-package-name": "1.0.0",
95
95
  "rimraf": "3.0.2",
96
96
  "shelljs": "0.8.5",
97
- "wasm-ast-types": "^0.11.2"
97
+ "wasm-ast-types": "^0.11.3"
98
98
  },
99
- "gitHead": "800c1113e152c70ff5f2e48628c5d98a9b28b51b"
99
+ "gitHead": "b7fc988703af9305db47b3259f7e2a95db4665ba"
100
100
  }