mp-js-api 0.0.8 → 0.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mp-js-api",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Node MinistryPlatform API",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -43,7 +43,8 @@ export function escapeSql(str: string) {
43
43
 
44
44
  export function toCamelCase(str: string, { capitalIds = false }: { capitalIds?: boolean; }= {}) {
45
45
  str = str.replace('-', '')
46
- str = str.replace(/^_?[A-Z]{1,3}/, match => match.toLowerCase()); // Don't convert if start with ID, HS, SMS, etc
46
+ str = str.toLowerCase();
47
+ // str = str.replace(/^_?[A-Z]{1,3}/, match => match.toLowerCase()); // Don't convert if start with ID, HS, SMS, etc
47
48
  str = str.replace(/(?<=^_|^__)[^\W_]/g, match => match.at(-1)?.toLowerCase() || ''); // keep underscore if first char
48
49
  str = str.replace(/(?<!^_|^)_[^\W_]/g, match => match.charAt(1).toUpperCase()); // remove underscore if not first char
49
50
  return capitalIds ? str.replace(/id$/i, 'ID') : str;