UNPKG

@todo-esta-bien/numerodon

Version:

Library to calculate numeric values from names or dates

44 lines (43 loc) 1.86 kB
import { NumberReducer, ReduceNumberDigitsAttrs } from "../utils"; export interface IEvolutiveProfileConstructor { day: number; month: number; year: number; names: string; fatherLastNames: string; motherLastNames: string; } export type EvolutiveNumbers = [number, number, number, number, number, number, number, number, number]; export declare class EvolutiveProfile { readonly day: number; readonly month: number; readonly year: number; readonly names: string; readonly fatherLastNames: string; readonly motherLastNames: string; readonly completeName: string; readonly completeNameChars: number; readonly residents: EvolutiveNumbers; readonly personalYears: EvolutiveNumbers; readonly evolutiveSumOptions: ReduceNumberDigitsAttrs; readonly numberReducer: NumberReducer; constructor({ day, month, year, names, fatherLastNames, motherLastNames }: IEvolutiveProfileConstructor); /** * Generates the residents (repeated times of a letter value) starting from the 1 to the 9 * * @param {string} cleanCompleteNameWithoutSpaces - The complete name without spaces or accents * @returns {EvolutiveNumbers} The 9 length array from values from 1 to 9 of the repeated values */ private getResidents; /** * Generates the personal years, but considering the "master numbers". This starts based on the birthYear, * and should be matched manually with the residents. * * @param {number} day - The day of birth of the user * @param {number} month - The month of birth of the user * @param {number} year - The year of birth of the user * @returns {EvolutiveNumbers} The 9 length array from values from 1 to 9 (may include 11 or 22), * starting with the personal year of the user */ private getPersonalYears; }