Repository: plexis-js/plexis (js)

Issue:
Feature request: `isString`
Checks whether the input is a string primitive type.

**Example usage**

```javascript
import isString from '@plexis/is-string';
isString('Foo');
// => true

isString(1);
// => false

isString(null);
// => false
```

Pull request:
feat: 🎸 isString
Checks whether the input is a string primitive type.

closes #7

Patch:
diff --git a/docs/pages/api.md b/docs/pages/api.md
index f72ac19..bba1eb4 100644
--- a/docs/pages/api.md
+++ b/docs/pages/api.md
@@ -10,3 +10,4 @@
 - [toSucc](/packages/toSucc)
 - [toTitle](/packages/toTitle)
 - [withoutDiacritics](/packages/withoutDiacritics)
+- [isString](/packages/isString)
diff --git a/packages/isString/README.md b/packages/isString/README.md
new file mode 100644
index 0000000..c09233b
--- /dev/null
+++ b/packages/isString/README.md
@@ -0,0 +1,21 @@
+## `isString`
+
+Checks whether the input is a string primitive type.
+
+`npm i @plexis/is-string`
+
+**Usage**
+
+```javascript
+import isString from '@plexis/is-string';
+
+isString('Foo'); // returns 'true'
+isString(1); // returns 'false'
+isString(null); // returns 'false'
+```
+
+**Aliases**
+
+```javascript
+import {isString} from 'plexis';
+```
diff --git a/packages/isString/package.json b/packages/isString/package.json
new file mode 100644
index 0000000..cbd922b
--- /dev/null
+++ b/packages/isString/package.json
@@ -0,0 +1,26 @@
+{
+  "name": "@plexis/is-string",
+  "version": "0.0.14",
+  "main": "dist/index.js",
+  "module": "dist/index.esm.js",
+  "jsnext:main": "./src/index.js",
+  "files": [
+    "dist",
+    "src"
+  ],
+  "license": "MIT",
+  "keywords": [
+    "utility",
+    "string",
+    "parse",
+    "format",
+    "validate"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/plexis-js/plexis.git"
+  },
+  "publishConfig": {
+    "access": "public"
+  }
+}
diff --git a/packages/isString/src/index.js b/packages/isString/src/index.js
new file mode 100644
index 0000000..b8d3485
--- /dev/null
+++ b/packages/isString/src/index.js
@@ -0,0 +1,12 @@
+/**
+ * @description Checks whether the input is a string primitive type.
+ * @param {String} param
+ * @returns {Boolean}
+ * @example
+ * isString('Foo') // returns 'true'
+ * isString(1) // returns 'false'
+ * isString(null) // returns 'false'
+ */
+const isString = param => typeof param === 'string';
+
+export default isString;
diff --git a/packages/plexis/package.json b/packages/plexis/package.json
index bc38600..7e55d13 100644
--- a/packages/plexis/package.json
+++ b/packages/plexis/package.json
@@ -22,7 +22,8 @@
     "@plexis/to-pred": "^0.0.14",
     "@plexis/to-succ": "^0.0.14",
     "@plexis/to-title": "^0.0.14",
-    "@plexis/without-diacritics": "^0.0.14"
+    "@plexis/without-diacritics": "^0.0.14",
+    "@plexis/is-string": "^0.0.14"
   },
   "keywords": [
     "utility",
diff --git a/packages/plexis/src/index.js b/packages/plexis/src/index.js
index 899d511..cd5f0ee 100644
--- a/packages/plexis/src/index.js
+++ b/packages/plexis/src/index.js
@@ -21,3 +21,4 @@ export {
   default as toChicagoTitle
 } from '@plexis/to-chicago';
 export {default as startsWith} from '@plexis/starts-with';
+export {default as isString} from '@plexis/is-string';


Test patch:
diff --git a/packages/isString/test/index.js b/packages/isString/test/index.js
new file mode 100644
index 0000000..f3e50cd
--- /dev/null
+++ b/packages/isString/test/index.js
@@ -0,0 +1,24 @@
+import isString from '../src';
+
+it('returns false for non-string types', () => {
+  const nonStrings = [5, false, true, null, undefined, {}, [1, 2], []];
+
+  nonStrings.forEach(param => {
+    expect(isString(param)).toBe(false);
+  });
+});
+
+it('returns true for string type', () => {
+  const strings = [
+    'Foo',
+    '',
+    false.toString(),
+    (1).toString(),
+    {foo: 'bar'}.toString(),
+    [1, 2, 3, 4].toString()
+  ];
+
+  strings.forEach(param => {
+    expect(isString(param)).toBe(true);
+  });
+});
diff --git a/packages/plexis/test/__snapshots__/index.js.snap b/packages/plexis/test/__snapshots__/index.js.snap
index b848be0..d971372 100644
--- a/packages/plexis/test/__snapshots__/index.js.snap
+++ b/packages/plexis/test/__snapshots__/index.js.snap
@@ -26,5 +26,6 @@ Array [
   "toChicagoStyle",
   "toChicagoTitle",
   "startsWith",
+  "isString",
 ]
 `;