New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jewish-date

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jewish-date - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

2

dist/index.js

@@ -1,1 +0,1 @@

var q=Object.create;var b=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var n in r)b(e,n,{get:r[n],enumerable:!0})},x=(e,r,n,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of L(r))!Y.call(e,o)&&o!==n&&b(e,o,{get:()=>r[o],enumerable:!(a=G(r,o))||a.enumerable});return e};var k=(e,r,n)=>(n=e!=null?q(R(e)):{},x(r||!e||!e.__esModule?b(n,"default",{value:e,enumerable:!0}):n,e)),F=e=>x(b({},"__esModule",{value:!0}),e);var ne={};P(ne,{JewishMonth:()=>t,convertNumberToHebrew:()=>J,formatJewishDate:()=>X,formatJewishDateInHebrew:()=>te,getIndexByJewishMonth:()=>j,getJewishMonthByIndex:()=>E,getJewishMonthInHebrew:()=>z,getJewishMonthsInOrder:()=>$,isLeapYear:()=>M,toGregorianDate:()=>ee,toHebrewJewishDate:()=>K,toJewishDate:()=>Z});module.exports=F(ne);var t={None:"None",Tishri:"Tishri",Cheshvan:"Cheshvan",Kislev:"Kislev",Tevet:"Tevet",Shevat:"Shevat",Adar:"Adar",Nisan:"Nisan",Iyyar:"Iyyar",Sivan:"Sivan",Tammuz:"Tammuz",Av:"Av",Elul:"Elul",AdarI:"AdarI",AdarII:"AdarII"};function u(e,r){return e-r*Math.floor(e/r)}function _(e){return e%4==0&&!(e%100==0&&e%400!=0)}var T=17214255e-1;function w(e,r,n){return T-1+365*(e-1)+Math.floor((e-1)/4)+-Math.floor((e-1)/100)+Math.floor((e-1)/400)+Math.floor((367*r-362)/12+(r<=2?0:_(e)?-1:-2)+n)}function D(e){var r,n,a,o,s,i,c,d,f,p,I;r=Math.floor(e-.5)+.5,n=r-T,a=Math.floor(n/146097),o=u(n,146097),s=Math.floor(o/36524),i=u(o,36524),c=Math.floor(i/1461),d=u(i,1461),f=Math.floor(d/365);let m=a*400+s*100+c*4+f;s==4||f==4||m++,p=r-w(m,1,1),I=r<w(m,3,1)?0:_(m)?1:2;let g=Math.floor(((p+I)*12+373)/367),O=r-w(m,g,1)+1;return[m,g,O]}var N=347995.5;function H(e){return u(e*7+1,19)<7}function W(e){return H(e)?13:12}function l(e){var r,n;r=Math.floor((235*e-234)/19),n=12084+13753*r;let a=r*29+Math.floor(n/25920);return u(3*(a+1),7)<3&&a++,a}function Q(e){var r,n,a;return r=l(e-1),n=l(e),a=l(e+1),a-n==356?2:n-r==382?1:0}function A(e){return h(e+1,7,1)-h(e,7,1)}function y(e,r){return r===2||r===4||r===6||r===10||r===13||r===12&&!H(e)||r===8&&u(A(e),10)!==5||r===9&&u(A(e),10)===3?29:30}function h(e,r,n){var a,o,s;if(s=W(e),a=N+l(e)+Q(e)+n+1,r<7){for(o=7;o<=s;o++)a+=y(e,o);for(o=1;o<r;o++)a+=y(e,o)}else for(o=7;o<r;o++)a+=y(e,o);return a}function S(e){var r,n,a,o,s,i;for(e=Math.floor(e)+.5,s=Math.floor((e-N)*98496/35975351),r=s-1,o=s;e>=h(o,7,1);o++)r++;for(i=e<h(r,1,1)?7:1,n=i,o=i;e>h(r,o,y(r,o));o++)n++;return a=e-h(r,n,1)+1,[r,n,a]}var v=(e,r)=>e.toString().padStart(r,"0");var U={[t.None]:0,[t.Tishri]:7,[t.Cheshvan]:8,[t.Kislev]:9,[t.Tevet]:10,[t.Shevat]:11,[t.Adar]:12,[t.AdarI]:12,[t.AdarII]:13,[t.Nisan]:1,[t.Iyyar]:2,[t.Sivan]:3,[t.Tammuz]:4,[t.Av]:5,[t.Elul]:6},j=e=>U[e]||0,V=[t.None,t.Nisan,t.Iyyar,t.Sivan,t.Tammuz,t.Av,t.Elul,t.Tishri,t.Cheshvan,t.Kislev,t.Tevet,t.Shevat,t.Adar,t.AdarII],E=(e,r)=>{let n=V[e]||t.None;return n==t.Adar&&M(r)?t.AdarI:n},B=[t.None,t.Tishri,t.Cheshvan,t.Kislev,t.Tevet,t.Shevat,t.AdarI,t.AdarII,t.Nisan,t.Iyyar,t.Sivan,t.Tammuz,t.Av,t.Elul],M=e=>{let r=e%19;return r===0||r===3||r===6||r===8||r===11||r===14||r===17},$=e=>M(e)?B:B.filter(r=>r!=="AdarII").map(r=>r=="AdarI"?"Adar":r),X=e=>`${e.day} ${e.monthName} ${e.year}`,Z=e=>{let r=e.getFullYear(),n=e.getMonth()+1,a=e.getDate(),o=w(r,n,a),s=S(o),i=s[0],c=E(s[1],i),d=$(i).findIndex(p=>p===c);return{year:i,monthName:c,month:d,day:s[2]}},ee=e=>{let r=j(e.monthName),n=h(e.year,r,e.day),a=D(n),o=`${v(a[0],4)}-${v(a[1],2)}-${v(a[2],2)}`,s=new Date(o);return s.getHours()>0&&s.setHours(0,0,0,0),s};var C=k(require("gematriya"));var re={[t.None]:"\u05DC\u05DC\u05D0",[t.Tishri]:"\u05EA\u05E9\u05E8\u05D9",[t.Cheshvan]:"\u05D7\u05E9\u05D5\u05DF",[t.Kislev]:"\u05DB\u05E1\u05DC\u05D5",[t.Tevet]:"\u05D8\u05D1\u05EA",[t.Shevat]:"\u05E9\u05D1\u05D8",[t.Adar]:"\u05D0\u05D3\u05E8",[t.AdarI]:"\u05D0\u05D3\u05E8 \u05D0",[t.AdarII]:"\u05D0\u05D3\u05E8 \u05D1",[t.Nisan]:"\u05E0\u05D9\u05E1\u05DF",[t.Iyyar]:"\u05D0\u05D9\u05D9\u05E8",[t.Sivan]:"\u05E1\u05D9\u05D5\u05DF",[t.Tammuz]:"\u05EA\u05DE\u05D5\u05D6",[t.Av]:"\u05D0\u05D1",[t.Elul]:"\u05D0\u05DC\u05D5\u05DC"},z=e=>re[e],J=(e,r=!0,n=!0)=>(0,C.default)(e,{geresh:r,punctuate:n}),K=e=>({day:J(e.day),monthName:z(e.monthName),year:J(e.year)}),te=e=>{let r=K(e);return`${r.day} ${r.monthName} ${r.year}`};
var G=Object.create;var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},x=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of O(t))!F.call(e,o)&&o!==n&&p(e,o,{get:()=>t[o],enumerable:!(a=L(t,o))||a.enumerable});return e};var Q=(e,t,n)=>(n=e!=null?G(k(e)):{},x(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),R=e=>x(p({},"__esModule",{value:!0}),e);var ne={};P(ne,{JewishMonth:()=>r,convertNumberToHebrew:()=>v,formatJewishDate:()=>Z,formatJewishDateInHebrew:()=>re,getIndexByJewishMonth:()=>E,getJewishMonthByIndex:()=>j,getJewishMonthInHebrew:()=>K,getJewishMonthsInOrder:()=>z,isLeapYear:()=>M,toGregorianDate:()=>ee,toHebrewJewishDate:()=>Y,toJewishDate:()=>_});module.exports=R(ne);var r={None:"None",Tishri:"Tishri",Cheshvan:"Cheshvan",Kislev:"Kislev",Tevet:"Tevet",Shevat:"Shevat",Adar:"Adar",Nisan:"Nisan",Iyyar:"Iyyar",Sivan:"Sivan",Tammuz:"Tammuz",Av:"Av",Elul:"Elul",AdarI:"AdarI",AdarII:"AdarII"};var D=17214255e-1,A=347995.5;function u(e,t){return e-t*Math.floor(e/t)}function N(e){return e%4===0&&!(e%100===0&&e%400!==0)}function l(e,t,n){return D-1+365*(e-1)+Math.floor((e-1)/4)+-Math.floor((e-1)/100)+Math.floor((e-1)/400)+Math.floor((367*t-362)/12+(t<=2?0:N(e)?-1:-2)+n)}function S(e){let t,n,a,o,s,i,c,w,f,d,I;t=Math.floor(e-.5)+.5,n=t-D,a=Math.floor(n/146097),o=u(n,146097),s=Math.floor(o/36524),i=u(o,36524),c=Math.floor(i/1461),w=u(i,1461),f=Math.floor(w/365);let m=a*400+s*100+c*4+f;s===4||f===4||m++,d=t-l(m,1,1),I=t<l(m,3,1)?0:N(m)?1:2;let T=Math.floor(((d+I)*12+373)/367),q=t-l(m,T,1)+1;return[m,T,q]}function H(e){return u(e*7+1,19)<7}function U(e){return H(e)?13:12}function b(e){let t,n;t=Math.floor((235*e-234)/19),n=12084+13753*t;let a=t*29+Math.floor(n/25920);return u(3*(a+1),7)<3&&a++,a}function V(e){let t,n,a;return t=b(e-1),n=b(e),a=b(e+1),a-n===356?2:n-t===382?1:0}function g(e){return h(e+1,7,1)-h(e,7,1)}function J(e,t){return t===2||t===4||t===6||t===10||t===13||t===12&&!H(e)||t===8&&u(g(e),10)!==5||t===9&&u(g(e),10)===3?29:30}function h(e,t,n){let a,o,s;if(s=U(e),a=A+b(e)+V(e)+n+1,t<7){for(o=7;o<=s;o++)a+=J(e,o);for(o=1;o<t;o++)a+=J(e,o)}else for(o=7;o<t;o++)a+=J(e,o);return a}function B(e){let t,n,a,o,s,i;for(e=Math.floor(e)+.5,s=Math.floor((e-A)*98496/35975351),t=s-1,o=s;e>=h(o,7,1);o++)t++;for(i=e<h(t,1,1)?7:1,n=i,o=i;e>h(t,o,J(t,o));o++)n++;return a=e-h(t,n,1)+1,[t,n,a]}var y=(e,t)=>e.toString().padStart(t,"0");var W={[r.None]:0,[r.Tishri]:7,[r.Cheshvan]:8,[r.Kislev]:9,[r.Tevet]:10,[r.Shevat]:11,[r.Adar]:12,[r.AdarI]:12,[r.AdarII]:13,[r.Nisan]:1,[r.Iyyar]:2,[r.Sivan]:3,[r.Tammuz]:4,[r.Av]:5,[r.Elul]:6},E=e=>W[e]||0,X=[r.None,r.Nisan,r.Iyyar,r.Sivan,r.Tammuz,r.Av,r.Elul,r.Tishri,r.Cheshvan,r.Kislev,r.Tevet,r.Shevat,r.Adar,r.AdarII],j=(e,t)=>{let n=X[e]||r.None;return n===r.Adar&&M(t)?r.AdarI:n},$=[r.None,r.Tishri,r.Cheshvan,r.Kislev,r.Tevet,r.Shevat,r.AdarI,r.AdarII,r.Nisan,r.Iyyar,r.Sivan,r.Tammuz,r.Av,r.Elul],M=e=>{let t=e%19;return t===0||t===3||t===6||t===8||t===11||t===14||t===17},z=e=>M(e)?$:$.filter(t=>t!=="AdarII").map(t=>t==="AdarI"?"Adar":t),Z=e=>`${e.day} ${e.monthName} ${e.year}`,_=e=>{let t=e.getFullYear(),n=e.getMonth()+1,a=e.getDate(),o=l(t,n,a),s=B(o),i=s[0],c=j(s[1],i),w=z(i).findIndex(d=>d===c);return{year:i,monthName:c,month:w,day:s[2]}},ee=e=>{let t=E(e.monthName),n=h(e.year,t,e.day),a=S(n),o=`${y(a[0],4)}-${y(a[1],2)}-${y(a[2],2)}`,s=new Date(o);return s.getHours()>0&&s.setHours(0,0,0,0),s};var C=Q(require("gematriya"));var te={[r.None]:"\u05DC\u05DC\u05D0",[r.Tishri]:"\u05EA\u05E9\u05E8\u05D9",[r.Cheshvan]:"\u05D7\u05E9\u05D5\u05DF",[r.Kislev]:"\u05DB\u05E1\u05DC\u05D5",[r.Tevet]:"\u05D8\u05D1\u05EA",[r.Shevat]:"\u05E9\u05D1\u05D8",[r.Adar]:"\u05D0\u05D3\u05E8",[r.AdarI]:"\u05D0\u05D3\u05E8 \u05D0",[r.AdarII]:"\u05D0\u05D3\u05E8 \u05D1",[r.Nisan]:"\u05E0\u05D9\u05E1\u05DF",[r.Iyyar]:"\u05D0\u05D9\u05D9\u05E8",[r.Sivan]:"\u05E1\u05D9\u05D5\u05DF",[r.Tammuz]:"\u05EA\u05DE\u05D5\u05D6",[r.Av]:"\u05D0\u05D1",[r.Elul]:"\u05D0\u05DC\u05D5\u05DC"},K=e=>te[e],v=(e,t=!0,n=!0)=>(0,C.default)(e,{geresh:t,punctuate:n}),Y=e=>({day:v(e.day),monthName:K(e.monthName),year:v(e.year)}),re=e=>{let t=Y(e);return`${t.day} ${t.monthName} ${t.year}`};

@@ -1,3 +0,3 @@

export * from './interfaces';
export * from './jewishDate';
export * from './jewishDateHebrew';
export * from "./interfaces";
export * from "./jewishDate";
export * from "./jewishDateHebrew";
export declare function mod(a: number, b: number): number;
export declare function gregorian_to_jd(year: number, month: number, day: number): number;
export declare function jd_to_gregorian(jd: number): any[];
export declare function hebrew_to_jd(year: number, month: number, day: number): any;
export declare function jd_to_hebrew(jd: number): any[];
export declare function gregorianToJd(year: number, month: number, day: number): number;
export declare function jdToGregorian(jd: number): any[];
export declare function hebrewToJd(year: number, month: number, day: number): any;
export declare function jdToHebrew(jd: number): any[];

@@ -1,1 +0,1 @@

export * from './dateConverterUtils';
export * from "./dateConverterUtils";

@@ -1,1 +0,1 @@

export * from './numberUtils';
export * from "./numberUtils";
{
"name": "jewish-date",
"description": "Hebrew Date to Gregorian Date and vice versa converter",
"version": "1.0.9",
"version": "1.0.10",
"license": "MIT",

@@ -14,3 +14,4 @@ "main": "dist/index.js",

"start": "esr ./config/start.ts",
"build": "yarn clean && esr ./config/build.ts",
"build": "yarn lint && yarn clean && esr ./config/build.ts",
"lint": "yarn rome format src && yarn rome check src",
"clean": "rimraf dist",

@@ -35,2 +36,3 @@ "test": "vitest --config ./config/vitest.config.ts --coverage",

"rimraf": "^3.0.2",
"rome": "^11.0.0",
"tsc-prog": "^2.2.1",

@@ -37,0 +39,0 @@ "typescript": "^4.8.4",

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