diff --git a/CHANGELOG.md b/CHANGELOG.md index cbcdfc261..f6100bc23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,18 @@ # CHANGELOG +## 8.0.4 Nov 30, 2021 + +Changes: + +- Adjust `stringCamelCase` with leading `_` + + ## 8.0.3 Nov 30, 2021 Changes: - Remove `Buffer` usage in `x-randomvalues` -- Adjust `stringCaleCase` for all-caps parts +- Adjust `stringCamelCase` for all-caps parts ## 8.0.2 Nov 26, 2021 diff --git a/package.json b/package.json index ea411e2c0..468fd7196 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/polkadot-js/common.git" }, "sideEffects": false, - "version": "8.0.3", + "version": "8.0.4", "workspaces": [ "packages/*" ], diff --git a/packages/hw-ledger-transports/package.json b/packages/hw-ledger-transports/package.json index fe4a70de4..ffd82edbd 100644 --- a/packages/hw-ledger-transports/package.json +++ b/packages/hw-ledger-transports/package.json @@ -16,7 +16,7 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "browser": "browser.js", "main": "node.js", "react-native": "react-native.js", diff --git a/packages/hw-ledger/package.json b/packages/hw-ledger/package.json index b572efddd..e24fd08bb 100644 --- a/packages/hw-ledger/package.json +++ b/packages/hw-ledger/package.json @@ -19,12 +19,12 @@ "./detectPackage.cjs" ], "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/hw-ledger-transports": "8.0.3", - "@polkadot/util": "8.0.3", + "@polkadot/hw-ledger-transports": "8.0.4", + "@polkadot/util": "8.0.4", "@zondax/ledger-substrate": "^0.18.0" } } diff --git a/packages/keyring/package.json b/packages/keyring/package.json index f6cc66fd4..5a9e6bcd2 100644 --- a/packages/keyring/package.json +++ b/packages/keyring/package.json @@ -20,15 +20,15 @@ "./detectPackage.cjs" ], "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/util": "8.0.3", - "@polkadot/util-crypto": "8.0.3" + "@polkadot/util": "8.0.4", + "@polkadot/util-crypto": "8.0.4" }, "peerDependencies": { - "@polkadot/util": "8.0.3", - "@polkadot/util-crypto": "8.0.3" + "@polkadot/util": "8.0.4", + "@polkadot/util-crypto": "8.0.4" } } diff --git a/packages/networks/package.json b/packages/networks/package.json index a830fc182..00cc49500 100644 --- a/packages/networks/package.json +++ b/packages/networks/package.json @@ -17,13 +17,13 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3" }, "devDependencies": { - "@polkadot/util": "8.0.3", - "@polkadot/x-fetch": "8.0.3" + "@polkadot/util": "8.0.4", + "@polkadot/x-fetch": "8.0.4" } } diff --git a/packages/util-crypto/package.json b/packages/util-crypto/package.json index 22db150e7..65052e5ec 100644 --- a/packages/util-crypto/package.json +++ b/packages/util-crypto/package.json @@ -25,15 +25,15 @@ "./detectPackage.cjs" ], "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3", "@noble/hashes": "0.4.1", - "@polkadot/networks": "8.0.3", - "@polkadot/util": "8.0.3", + "@polkadot/networks": "8.0.4", + "@polkadot/util": "8.0.4", "@polkadot/wasm-crypto": "^4.4.1", - "@polkadot/x-randomvalues": "8.0.3", + "@polkadot/x-randomvalues": "8.0.4", "bn.js": "^4.12.0", "ed2curve": "^0.3.0", "elliptic": "^6.5.4", @@ -46,6 +46,6 @@ "@types/elliptic": "^6.4.14" }, "peerDependencies": { - "@polkadot/util": "8.0.3" + "@polkadot/util": "8.0.4" } } diff --git a/packages/util/package.json b/packages/util/package.json index 0cdd85727..f5234e4b4 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -34,12 +34,12 @@ "./detectPackage.cjs" ], "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/x-textdecoder": "8.0.3", - "@polkadot/x-textencoder": "8.0.3", + "@polkadot/x-textdecoder": "8.0.4", + "@polkadot/x-textencoder": "8.0.4", "@types/bn.js": "^4.11.6", "bn.js": "^4.12.0", "ip-regex": "^4.3.0" diff --git a/packages/util/src/string/camelCase.spec.ts b/packages/util/src/string/camelCase.spec.ts index 8a55abff4..783527599 100644 --- a/packages/util/src/string/camelCase.spec.ts +++ b/packages/util/src/string/camelCase.spec.ts @@ -49,5 +49,17 @@ describe('stringCamelCase', (): void => { ).toEqual('dedupKeyPrefix'); }); + it('adjusts with leading _', (): void => { + expect( + stringCamelCase('_reserved') + ).toEqual('reserved'); + }); + + it('adjusts with minimal chars per part', (): void => { + expect( + stringCamelCase('_a_b_c_def') + ).toEqual('aBCDef'); + }); + performance('stringCamelCase', 64000, randomWords, stringCamelCase); }); diff --git a/packages/util/src/string/camelCase.ts b/packages/util/src/string/camelCase.ts index 68479d710..8aa190e9c 100644 --- a/packages/util/src/string/camelCase.ts +++ b/packages/util/src/string/camelCase.ts @@ -18,6 +18,7 @@ function converter (fn: (w: string, i: number) => string): (value: AnyString) => value .toString() .replace(/[-_., ]+/g, ' ') + .trim() .split(' ') .map((w, i) => fn(w[0], i) + ( diff --git a/packages/x-bundle/package.json b/packages/x-bundle/package.json index 88b8b2bad..5282ebcfd 100644 --- a/packages/x-bundle/package.json +++ b/packages/x-bundle/package.json @@ -17,11 +17,11 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/util": "8.0.3", + "@polkadot/util": "8.0.4", "buffer-es6": "^4.9.3" } } diff --git a/packages/x-fetch/package.json b/packages/x-fetch/package.json index 8893a2d03..8c48ecfd9 100644 --- a/packages/x-fetch/package.json +++ b/packages/x-fetch/package.json @@ -17,13 +17,13 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "browser": "browser.js", "main": "node.js", "react-native": "react-native.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.0.3", + "@polkadot/x-global": "8.0.4", "@types/node-fetch": "^2.5.12", "node-fetch": "^2.6.6" } diff --git a/packages/x-global/package.json b/packages/x-global/package.json index 0d4215989..3449ff342 100644 --- a/packages/x-global/package.json +++ b/packages/x-global/package.json @@ -17,7 +17,7 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "main": "index.js", "dependencies": { "@babel/runtime": "^7.16.3" diff --git a/packages/x-randomvalues/package.json b/packages/x-randomvalues/package.json index c5bc1eeae..617a78c71 100644 --- a/packages/x-randomvalues/package.json +++ b/packages/x-randomvalues/package.json @@ -17,13 +17,13 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "browser": "browser.js", "main": "node.js", "react-native": "react-native.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.0.3" + "@polkadot/x-global": "8.0.4" }, "devDependencies": { "@types/react-native": "^0.66.5" diff --git a/packages/x-textdecoder/package.json b/packages/x-textdecoder/package.json index e369578cc..973cee6c7 100644 --- a/packages/x-textdecoder/package.json +++ b/packages/x-textdecoder/package.json @@ -17,12 +17,12 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "browser": "browser.js", "main": "node.js", "react-native": "react-native.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.0.3" + "@polkadot/x-global": "8.0.4" } } diff --git a/packages/x-textencoder/package.json b/packages/x-textencoder/package.json index 97015f5dd..aa6a881fc 100644 --- a/packages/x-textencoder/package.json +++ b/packages/x-textencoder/package.json @@ -17,12 +17,12 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "browser": "browser.js", "main": "node.js", "react-native": "react-native.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.0.3" + "@polkadot/x-global": "8.0.4" } } diff --git a/packages/x-ws/package.json b/packages/x-ws/package.json index 947687e92..b70f49fc5 100644 --- a/packages/x-ws/package.json +++ b/packages/x-ws/package.json @@ -17,13 +17,13 @@ }, "sideEffects": false, "type": "module", - "version": "8.0.3", + "version": "8.0.4", "browser": "browser.js", "main": "node.js", "react-native": "react-native.js", "dependencies": { "@babel/runtime": "^7.16.3", - "@polkadot/x-global": "8.0.3", + "@polkadot/x-global": "8.0.4", "@types/websocket": "^1.0.4", "websocket": "^1.0.34" } diff --git a/yarn.lock b/yarn.lock index 4558ad53f..2e87d3ebf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2028,7 +2028,7 @@ __metadata: languageName: node linkType: hard -"@polkadot/hw-ledger-transports@8.0.3, @polkadot/hw-ledger-transports@workspace:packages/hw-ledger-transports": +"@polkadot/hw-ledger-transports@8.0.4, @polkadot/hw-ledger-transports@workspace:packages/hw-ledger-transports": version: 0.0.0-use.local resolution: "@polkadot/hw-ledger-transports@workspace:packages/hw-ledger-transports" dependencies: @@ -2048,8 +2048,8 @@ __metadata: resolution: "@polkadot/hw-ledger@workspace:packages/hw-ledger" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/hw-ledger-transports": 8.0.3 - "@polkadot/util": 8.0.3 + "@polkadot/hw-ledger-transports": 8.0.4 + "@polkadot/util": 8.0.4 "@zondax/ledger-substrate": ^0.18.0 languageName: unknown linkType: soft @@ -2059,21 +2059,21 @@ __metadata: resolution: "@polkadot/keyring@workspace:packages/keyring" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/util": 8.0.3 - "@polkadot/util-crypto": 8.0.3 + "@polkadot/util": 8.0.4 + "@polkadot/util-crypto": 8.0.4 peerDependencies: - "@polkadot/util": 8.0.3 - "@polkadot/util-crypto": 8.0.3 + "@polkadot/util": 8.0.4 + "@polkadot/util-crypto": 8.0.4 languageName: unknown linkType: soft -"@polkadot/networks@8.0.3, @polkadot/networks@workspace:packages/networks": +"@polkadot/networks@8.0.4, @polkadot/networks@workspace:packages/networks": version: 0.0.0-use.local resolution: "@polkadot/networks@workspace:packages/networks" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/util": 8.0.3 - "@polkadot/x-fetch": 8.0.3 + "@polkadot/util": 8.0.4 + "@polkadot/x-fetch": 8.0.4 languageName: unknown linkType: soft @@ -2086,16 +2086,16 @@ __metadata: languageName: node linkType: hard -"@polkadot/util-crypto@8.0.3, @polkadot/util-crypto@workspace:packages/util-crypto": +"@polkadot/util-crypto@8.0.4, @polkadot/util-crypto@workspace:packages/util-crypto": version: 0.0.0-use.local resolution: "@polkadot/util-crypto@workspace:packages/util-crypto" dependencies: "@babel/runtime": ^7.16.3 "@noble/hashes": 0.4.1 - "@polkadot/networks": 8.0.3 - "@polkadot/util": 8.0.3 + "@polkadot/networks": 8.0.4 + "@polkadot/util": 8.0.4 "@polkadot/wasm-crypto": ^4.4.1 - "@polkadot/x-randomvalues": 8.0.3 + "@polkadot/x-randomvalues": 8.0.4 "@types/bn.js": ^4.11.6 "@types/ed2curve": ^0.2.2 "@types/elliptic": ^6.4.14 @@ -2105,17 +2105,17 @@ __metadata: micro-base: ^0.9.0 tweetnacl: ^1.0.3 peerDependencies: - "@polkadot/util": 8.0.3 + "@polkadot/util": 8.0.4 languageName: unknown linkType: soft -"@polkadot/util@8.0.3, @polkadot/util@workspace:packages/util": +"@polkadot/util@8.0.4, @polkadot/util@workspace:packages/util": version: 0.0.0-use.local resolution: "@polkadot/util@workspace:packages/util" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/x-textdecoder": 8.0.3 - "@polkadot/x-textencoder": 8.0.3 + "@polkadot/x-textdecoder": 8.0.4 + "@polkadot/x-textencoder": 8.0.4 "@types/bn.js": ^4.11.6 bn.js: ^4.12.0 ip-regex: ^4.3.0 @@ -2159,23 +2159,23 @@ __metadata: resolution: "@polkadot/x-bundle@workspace:packages/x-bundle" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/util": 8.0.3 + "@polkadot/util": 8.0.4 buffer-es6: ^4.9.3 languageName: unknown linkType: soft -"@polkadot/x-fetch@8.0.3, @polkadot/x-fetch@workspace:packages/x-fetch": +"@polkadot/x-fetch@8.0.4, @polkadot/x-fetch@workspace:packages/x-fetch": version: 0.0.0-use.local resolution: "@polkadot/x-fetch@workspace:packages/x-fetch" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/x-global": 8.0.3 + "@polkadot/x-global": 8.0.4 "@types/node-fetch": ^2.5.12 node-fetch: ^2.6.6 languageName: unknown linkType: soft -"@polkadot/x-global@8.0.3, @polkadot/x-global@workspace:packages/x-global": +"@polkadot/x-global@8.0.4, @polkadot/x-global@workspace:packages/x-global": version: 0.0.0-use.local resolution: "@polkadot/x-global@workspace:packages/x-global" dependencies: @@ -2183,31 +2183,31 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/x-randomvalues@8.0.3, @polkadot/x-randomvalues@workspace:packages/x-randomvalues": +"@polkadot/x-randomvalues@8.0.4, @polkadot/x-randomvalues@workspace:packages/x-randomvalues": version: 0.0.0-use.local resolution: "@polkadot/x-randomvalues@workspace:packages/x-randomvalues" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/x-global": 8.0.3 + "@polkadot/x-global": 8.0.4 "@types/react-native": ^0.66.5 languageName: unknown linkType: soft -"@polkadot/x-textdecoder@8.0.3, @polkadot/x-textdecoder@workspace:packages/x-textdecoder": +"@polkadot/x-textdecoder@8.0.4, @polkadot/x-textdecoder@workspace:packages/x-textdecoder": version: 0.0.0-use.local resolution: "@polkadot/x-textdecoder@workspace:packages/x-textdecoder" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/x-global": 8.0.3 + "@polkadot/x-global": 8.0.4 languageName: unknown linkType: soft -"@polkadot/x-textencoder@8.0.3, @polkadot/x-textencoder@workspace:packages/x-textencoder": +"@polkadot/x-textencoder@8.0.4, @polkadot/x-textencoder@workspace:packages/x-textencoder": version: 0.0.0-use.local resolution: "@polkadot/x-textencoder@workspace:packages/x-textencoder" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/x-global": 8.0.3 + "@polkadot/x-global": 8.0.4 languageName: unknown linkType: soft @@ -2216,7 +2216,7 @@ __metadata: resolution: "@polkadot/x-ws@workspace:packages/x-ws" dependencies: "@babel/runtime": ^7.16.3 - "@polkadot/x-global": 8.0.3 + "@polkadot/x-global": 8.0.4 "@types/websocket": ^1.0.4 websocket: ^1.0.34 languageName: unknown