Repository: plexis-js/plexis
Pull request #24 (2019-10-20 18:43:53)

isLowerCase package
#10 


Patch:
diff --git a/packages/isLowerCase/.npmignore b/packages/isLowerCase/.npmignore
new file mode 100644
index 0000000..552cf85
--- /dev/null
+++ b/packages/isLowerCase/.npmignore
@@ -0,0 +1,17 @@
+.DS_Store
+*.test.js
+.prettierrc
+.github
+.template
+.package-template
+.nyc_output
+.circleci
+.commitlintrc.js
+coverage
+coverage.lcov
+docs
+babel.config.js
+test
+CONTRIBUTING.md
+CODE_OF_CONDUCT.md
+LICENCE
\ No newline at end of file
diff --git a/packages/isLowerCase/README.md b/packages/isLowerCase/README.md
new file mode 100644
index 0000000..4ae7472
--- /dev/null
+++ b/packages/isLowerCase/README.md
@@ -0,0 +1,22 @@
+## `isLowerCase`
+
+Checks whether the input is a string containing only lowercase characters
+
+`npm i @plexis/is-lowercase`
+
+**Usage**
+
+```javascript
+import isLowerCase from '@plexis/is-lowercase';
+
+isLowerCase('foo'); // returns true
+isLowerCase('Foo'); // returns false
+isLowerCase('BAR'); // returns false
+```
+
+**Aliases**
+
+```javascript
+import {isLowerCase} from 'plexis';
+import {isLower} from 'plexis';
+```
diff --git a/packages/isLowerCase/package.json b/packages/isLowerCase/package.json
new file mode 100644
index 0000000..6434952
--- /dev/null
+++ b/packages/isLowerCase/package.json
@@ -0,0 +1,22 @@
+{
+  "name": "@plexis/is-lowercase",
+  "version": "0.0.12",
+  "main": "dist/index.js",
+  "module": "dist/index.esm.js",
+  "jsnext:main": "./src/index.js",
+  "license": "MIT",
+  "keywords": [
+    "utility",
+    "string",
+    "parse",
+    "format",
+    "validate"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/plexis-js/plexis.git"
+  },
+  "publishConfig": {
+    "access": "public"
+  }
+}
\ No newline at end of file
diff --git a/packages/isLowerCase/src/index.js b/packages/isLowerCase/src/index.js
new file mode 100644
index 0000000..2860a99
--- /dev/null
+++ b/packages/isLowerCase/src/index.js
@@ -0,0 +1,11 @@
+/**
+ * @description Checks whether the input is a string containing only lowercase characters
+ * @param {String} text
+ * @example
+ * isLowerCase('foo') // returns true
+ * isLowerCase('Foo') // returns false
+ * isLowerCase('BAR') // returns false
+ */
+const isLowerCase = text => text === text.toLowerCase();
+
+export default isLowerCase;
diff --git a/packages/plexis/package.json b/packages/plexis/package.json
index e296200..5332826 100644
--- a/packages/plexis/package.json
+++ b/packages/plexis/package.json
@@ -13,7 +13,8 @@
     "@plexis/to-pred": "^0.0.12",
     "@plexis/to-succ": "^0.0.12",
     "@plexis/to-title": "^0.0.12",
-    "@plexis/without-diacritics": "^0.0.12"
+    "@plexis/without-diacritics": "^0.0.12",
+    "@plexis/is-lowercase": "^0.0.12"
   },
   "keywords": [
     "utility",
diff --git a/packages/plexis/src/index.js b/packages/plexis/src/index.js
index 29ea706..8bb84db 100644
--- a/packages/plexis/src/index.js
+++ b/packages/plexis/src/index.js
@@ -11,3 +11,4 @@ export {
   default as cleanDiacritics,
   default as removeDiacritics
 } from '@plexis/without-diacritics';
+export {default as isLowerCase, default as isLower} from '@plexis/is-lowercase';


Test patch:
diff --git a/packages/isLowerCase/test/index.js b/packages/isLowerCase/test/index.js
new file mode 100644
index 0000000..c214568
--- /dev/null
+++ b/packages/isLowerCase/test/index.js
@@ -0,0 +1,17 @@
+import isLowerCase from '../src';
+
+it('check a uppercase string', () => {
+  expect(isLowerCase('HELLO')).toBe(false);
+});
+
+it('check a lowercase with spaces string', () => {
+  expect(isLowerCase('foo bar')).toBe(true);
+});
+
+it('check a lowercase string', () => {
+  expect(isLowerCase('hello')).toBe(true);
+});
+
+it('check a lowercase string with an uppercase char in the middle', () => {
+  expect(isLowerCase('hello Foo bar')).toBe(false);
+});
diff --git a/packages/plexis/test/__snapshots__/index.js.snap b/packages/plexis/test/__snapshots__/index.js.snap
index fb20c83..139913b 100644
--- a/packages/plexis/test/__snapshots__/index.js.snap
+++ b/packages/plexis/test/__snapshots__/index.js.snap
@@ -15,5 +15,7 @@ Array [
   "withoutDiacritics",
   "cleanDiacritics",
   "removeDiacritics",
+  "isLowerCase",
+  "isLower",
 ]
 `;