Skip to content

Commit

Permalink
[Fix] Breaking Changes
Browse files Browse the repository at this point in the history
- package will now have a traditional CommonJS import style
- changes made to test files for the import
- all tests are passing
- also tested the updates made with 'npm link'
- updates made to ReadME file as well
  • Loading branch information
sricharankrishnan committed Feb 4, 2024
1 parent efa2393 commit 8dd3a66
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 25 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


### About
A JavaScript library for efficient manipulation of vowels within strings. Count, transform case, extract positions, and perform various operations on vowels with ease.
A JavaScript library for efficient manipulation of vowels within strings. Count, transform case, extract positions, and perform various operations on vowels with ease.
<br/><br/>

### Getting Started
Expand All @@ -20,16 +20,16 @@ import Vowelz from "vowelz";
- Create a class instance of the imported package and then you can, directly use a method. More details about the method APIS in the following section
```javascript
/* node module imports */
import Vowelz from "vowelz";
const Vowelz = require("vowelz");

/* create an instance and use methods... */
const vowelz = new Vowelz();
console.log("How many vowels are there in the word: ", vowelz.getCount("hello world"));
const myVowelz = new Vowelz();
console.log("How many vowels are there in the word: ", myVowelz.getTotalCount("hello world"));
```
<br/>

### Usage (Methods/API)
- ```getCount(arg: string):``` returns the number of vowels that are present in a string value. Takes in one argument which must be a string only.
- ```getTotalCount(arg: string):``` returns the number of vowels that are present in a string value. Takes in one argument which must be a string only.
- ```getPositionsOfVowels(arg: string):``` returns the index values of the vowels that are present in a string value. Takes in one argument which must be a string only.
- ```extractAllVowelsFromString(arg: string):``` returns all of the vowels that are present in a string. Takes in one argument which must be a string only.
- ```getCountOfUniqueVowels(arg: string):``` returns the number of vowels in a string (non repeating). Takes in one argument which must be a string only.
Expand Down
6 changes: 1 addition & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
Expand Down Expand Up @@ -176,4 +172,4 @@ var Vowelz = /*#__PURE__*/function () {
}]);
return Vowelz;
}();
var _default = exports["default"] = Vowelz;
module.exports = Vowelz;
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const Vowelz = require("./dist").default;
const Vowelz = require("./dist");
module.exports = Vowelz;
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "vowelz",
"version": "1.2.4",
"version": "2.0.0",
"description": "A JavaScript library for efficient manipulation of vowels within strings. Count, transform case, extract positions, and perform various operations on vowels with ease. Enhance your text processing and string transformations using Vowelz.",
"main": "index.js",
"homepage": "https://github.com/sricharankrishnan/vowelz",
"type": "module",
"scripts": {
"build": "babel ./src -d ./dist",
"test" : "jest --verbose"
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,4 @@ class Vowelz {
return arg.replace(/[aeiou]/gi, '');
}
}
export default Vowelz;
module.exports = Vowelz;
2 changes: 1 addition & 1 deletion tests/accepts-only-string-arg.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - Methods Accepts Only String Args", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/count-all-vowels.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - countAllVowels method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/extract-all-vowels-from-string.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - extractAllVowelsFromString method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/get-count-of-unique-vowels.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - getCountOfUniqueVowels method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/get-position-of-vowels.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - getPositionsOfVowels method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/get-total-count-of-vowels.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - getTotalCount method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/remove-all-vowels-from-string.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - removeAllVowelsFromString method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/replace-vowels-with-character.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - replaceVowelsWithCharacter method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/set-vowels-to-lowercase.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - setAllVowelsToLowerCase method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/set-vowels-to-uppercase.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - setAllVowelsToUpperCase method", () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/vowel-encryption.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* app imports */
import Vowelz from "../src/index.js";
const Vowelz = require("../src/index.js");

/* t-suite */
describe("Vowelz - vowelEncryption method", () => {
Expand Down

0 comments on commit 8dd3a66

Please sign in to comment.