Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@numero-dee/numerology

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@numero-dee/numerology - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

CHANGELOG.md

15

lib/utils/helper.js
"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
};

25

lib/utils/helper.spec.js
"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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc