@cosmwasm/ts-codegen 0.16.2 → 0.16.4

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/README.md CHANGED
@@ -21,6 +21,7 @@ npm install -g @cosmwasm/ts-codegen
21
21
 
22
22
  The quickest and easiest way to interact with CosmWasm Contracts. `@cosmwasm/ts-codegen` converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.
23
23
 
24
+ 🎥 [Checkout our video playlist](https://www.youtube.com/watch?v=D_A5V2PfNLA&list=PL-lMkVv7GZwz1KO3jANwr5W4MoziruXwK) to learn how to use `ts-codegen`!
24
25
  ## Table of contents
25
26
 
26
27
  - [@cosmwasm/ts-codegen](#cosmwasmts-codegen)
@@ -477,3 +478,4 @@ Checkout these related projects:
477
478
  ## Credits
478
479
 
479
480
  🛠 Built by Cosmology — if you like our tools, please consider delegating to [our validator ⚛️](https://cosmology.tech/validator)
481
+
@@ -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.4",
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": "15ad71ea06140dc79f594b946c52f3efbcf3a295"
100
100
  }