@numero-dee/numerology
Advanced tools
Comparing version 0.2.0 to 0.2.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var letterToNumber = { | ||
@@ -36,3 +39,3 @@ a: 1, | ||
var numerify = function numerify(str) { | ||
var numerify = exports.numerify = function numerify(str) { | ||
var asciiStr = removeAccents(str).toLowerCase().replace(/\s/g, ""); | ||
@@ -47,3 +50,3 @@ | ||
var numerologicalSum = function numerologicalSum(a, b) { | ||
var numerologicalSum = exports.numerologicalSum = function numerologicalSum(a, b) { | ||
var sum = a + b; | ||
@@ -53,10 +56,4 @@ return Math.floor(sum / 10) + sum % 10; | ||
var numerologicalKey = function numerologicalKey(a, b) { | ||
var numerologicalKey = exports.numerologicalKey = function numerologicalKey(a, b) { | ||
return a < b ? a * 100 + b * 10 + numerologicalSum(a, b) : b * 100 + a * 10 + numerologicalSum(a, b); | ||
}; | ||
module.exports = { | ||
numerify: numerify, | ||
numerologicalSum: numerologicalSum, | ||
numerologicalKey: numerologicalKey | ||
}; |
"use strict"; | ||
var _require = require("./helper"), | ||
numerify = _require.numerify, | ||
numerologicalSum = _require.numerologicalSum, | ||
numerologicalKey = _require.numerologicalKey; | ||
var _helper = require("./helper"); | ||
describe("numerify", function () { | ||
it("converts a string to an array of numbers", function () { | ||
expect(numerify("John")).toEqual([1, 7, 5, 5]); | ||
expect((0, _helper.numerify)("John")).toEqual([1, 7, 5, 5]); | ||
}); | ||
it("converts an accented string to an array of numbers", function () { | ||
expect(numerify("André")).toEqual([1, 5, 4, 2, 5]); | ||
expect((0, _helper.numerify)("André")).toEqual([1, 5, 4, 2, 5]); | ||
}); | ||
it("converts a full name to an array of numbers", function () { | ||
expect(numerify("John Oliver")).toEqual([1, 7, 5, 5, 7, 3, 1, 6, 5, 2]); | ||
expect((0, _helper.numerify)("John Oliver")).toEqual([1, 7, 5, 5, 7, 3, 1, 6, 5, 2]); | ||
}); | ||
it("ommits unknown characters during the conversion", function () { | ||
expect(numerify("André!")).toEqual([1, 5, 4, 2, 5]); | ||
expect((0, _helper.numerify)("André!")).toEqual([1, 5, 4, 2, 5]); | ||
}); | ||
@@ -28,4 +25,4 @@ }); | ||
it("returns the numerological sum of two numbers {1..9}", function () { | ||
expect(numerologicalSum(1, 2)).toEqual(3); | ||
expect(numerologicalSum(3, 9)).toEqual(3); | ||
expect((0, _helper.numerologicalSum)(1, 2)).toEqual(3); | ||
expect((0, _helper.numerologicalSum)(3, 9)).toEqual(3); | ||
}); | ||
@@ -36,7 +33,7 @@ }); | ||
it("returns the numerological key of two number {1..9}", function () { | ||
expect(numerologicalKey(1, 2)).toEqual(123); | ||
expect(numerologicalKey(2, 1)).toEqual(123); | ||
expect(numerologicalKey(3, 9)).toEqual(393); | ||
expect(numerologicalKey(9, 3)).toEqual(393); | ||
expect((0, _helper.numerologicalKey)(1, 2)).toEqual(123); | ||
expect((0, _helper.numerologicalKey)(2, 1)).toEqual(123); | ||
expect((0, _helper.numerologicalKey)(3, 9)).toEqual(393); | ||
expect((0, _helper.numerologicalKey)(9, 3)).toEqual(393); | ||
}); | ||
}); |
@@ -9,3 +9,3 @@ { | ||
"bugs": "https://github.com/vecerek/numerology/issues", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "lib/index.js", | ||
@@ -12,0 +12,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28063
16
502
1