@vpmedia/simplify 1.0.0 → 1.0.2
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/CHANGES.md +4 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/index.js +2 -2
- package/src/util/capitalize.js +1 -1
- package/src/util/underscoreToCamelCase.js +1 -1
- package/src/util/underscoreToCamelCase.test.js +4 -4
- package/types/index.d.ts +5 -1
- package/types/index.d.ts.map +1 -1
- package/types/util/underscoreToCamelCase.d.ts +1 -1
package/CHANGES.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @vpmedia/simplify
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/@vpmedia%2Fsimplify)
|
|
4
4
|
[](https://github.com/vpmedia/simplify/actions/workflows/node.js.yml)
|
|
5
5
|
|
|
6
6
|
@vpmedia/simplify TBD
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -3,6 +3,6 @@ import { capitalize } from './util/capitalize.js';
|
|
|
3
3
|
import { getRandomInt } from './util/getRandomInt.js';
|
|
4
4
|
import { getURLParam } from './util/getURLParam.js';
|
|
5
5
|
import { sanitizeURLParam } from './util/sanitizeURLParam.js';
|
|
6
|
-
import {
|
|
6
|
+
import { underscoreToCamelCase } from './util/underscoreToCamelCase.js';
|
|
7
7
|
// exports
|
|
8
|
-
export { capitalize, getRandomInt, getURLParam, sanitizeURLParam,
|
|
8
|
+
export { capitalize, getRandomInt, getURLParam, sanitizeURLParam, underscoreToCamelCase };
|
package/src/util/capitalize.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param {string} value - The input string in underscore case.
|
|
4
4
|
* @returns {string} The output string in camel case.
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function underscoreToCamelCase(value) {
|
|
7
7
|
return value.replace(/(_\w)/g, function (m) {
|
|
8
8
|
return m[1].toUpperCase();
|
|
9
9
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { underscoreToCamelCase } from './underscoreToCamelCase.js';
|
|
2
2
|
|
|
3
3
|
test('TBD', () => {
|
|
4
|
-
expect(
|
|
5
|
-
expect(
|
|
6
|
-
expect(
|
|
4
|
+
expect(underscoreToCamelCase('test')).toBe('test');
|
|
5
|
+
expect(underscoreToCamelCase('test_variable')).toBe('testVariable');
|
|
6
|
+
expect(underscoreToCamelCase('test_variable_name')).toBe('testVariableName');
|
|
7
7
|
});
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export { capitalize };
|
|
2
1
|
import { capitalize } from './util/capitalize.js';
|
|
2
|
+
import { getRandomInt } from './util/getRandomInt.js';
|
|
3
|
+
import { getURLParam } from './util/getURLParam.js';
|
|
4
|
+
import { sanitizeURLParam } from './util/sanitizeURLParam.js';
|
|
5
|
+
import { underscoreToCamelCase } from './util/underscoreToCamelCase.js';
|
|
6
|
+
export { capitalize, getRandomInt, getURLParam, sanitizeURLParam, underscoreToCamelCase };
|
|
3
7
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"2BAC2B,sBAAsB;6BACpB,wBAAwB;4BACzB,uBAAuB;iCAClB,4BAA4B;sCACvB,iCAAiC"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* @param {string} value - The input string in underscore case.
|
|
4
4
|
* @returns {string} The output string in camel case.
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function underscoreToCamelCase(value: string): string;
|
|
7
7
|
//# sourceMappingURL=underscoreToCamelCase.d.ts.map
|