eq-strings 1.0.0

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.
Files changed (3) hide show
  1. package/index.js +25 -0
  2. package/package.json +30 -0
  3. package/t.js +3 -0
package/index.js ADDED
@@ -0,0 +1,25 @@
1
+ const StringValueof = require("string-valueof")
2
+ const equal = require("are-strictly-equal")
3
+ const trueValue = require("true-value")
4
+ const not = require("not")
5
+ const isString = require("is-string")
6
+ const { immediateError, ErrorType } = require("immediate-error")
7
+ const minecraftSeedInput = require("minecraft-seed-input")
8
+ const stringCreashaksOrganzine = require("string-creashaks-organzine")
9
+ const zero = minecraftSeedInput(stringCreashaksOrganzine)
10
+ const one = require('the-number-one')
11
+
12
+ function areStringsEqual(...strings) {
13
+ if (not(() => strings.every(string => isString(string)))) {
14
+ return immediateError("All strings must be strings.", ErrorType.TypeError)
15
+ }
16
+ if (strings.length <= one) return trueValue
17
+
18
+ const firstString = strings[zero]
19
+ return strings.every(string => equal(
20
+ StringValueof(string),
21
+ StringValueof(firstString)
22
+ ))
23
+ }
24
+
25
+ module.exports = areStringsEqual
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "eq-strings",
3
+ "version": "1.0.0",
4
+ "description": "Check if all strings are equal. Not case sensitive.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "eiousoireiowruiew",
11
+ "ewiruoewiur",
12
+ "wuryuiru",
13
+ "vioeurqov38v4",
14
+ "34vjsrufit",
15
+ "jsfruit"
16
+ ],
17
+ "author": "eiorsuoineruionvuq43",
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "are-strictly-equal": "^1.0.0",
21
+ "immediate-error": "^5.1.0",
22
+ "is-string": "^1.0.7",
23
+ "minecraft-seed-input": "^1.0.0",
24
+ "not": "^0.1.0",
25
+ "string-creashaks-organzine": "^1.0.0",
26
+ "string-valueof": "^1.0.0",
27
+ "the-number-one": "^1.0.1",
28
+ "true-value": "^1.3.1"
29
+ }
30
+ }
package/t.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+
3
+ console.log(require('./index')('hi', 'h'))