UNPKG

@hebcal/hdate

Version:

converts between Hebrew and Gregorian dates using Rata Die (R.D.) algorithm by Dershowitz and Reingold

19 lines (17 loc) 622 B
/*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */ /** * Removes niqqud from Hebrew string * @example * hebrewStripNikkud('אֱלוּל'); // 'אלול' * hebrewStripNikkud('חֶשְׁוָן'); // 'חשון' */ function hebrewStripNikkud(str) { if (typeof str !== 'string') { throw new TypeError(`bad nikkud str: ${str}`); } const a = str.normalize(); // now strip out niqqud and trope return a.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, ''); } export { hebrewStripNikkud }; //# sourceMappingURL=hebrewStripNikkud.js.map