shoonya-sdk 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shoonya-sdk.cjs +4 -3
- package/dist/shoonya-sdk.js +4 -3
- package/package.json +1 -1
package/dist/shoonya-sdk.cjs
CHANGED
|
@@ -510,10 +510,11 @@ var Shoonya = class extends import_events.EventEmitter {
|
|
|
510
510
|
continue;
|
|
511
511
|
const match = optionExpiry.match(/more-than-(\d+)-day/);
|
|
512
512
|
if (match) {
|
|
513
|
-
const dateNow = (/* @__PURE__ */ new Date()).
|
|
514
|
-
const optionExpiryDate = unformattedDate.
|
|
513
|
+
const dateNow = (/* @__PURE__ */ new Date()).getTime();
|
|
514
|
+
const optionExpiryDate = unformattedDate.getTime();
|
|
515
|
+
const diff = (optionExpiryDate - dateNow) / (1e3 * 60 * 60 * 24);
|
|
515
516
|
const check = parseInt(match[1], 10);
|
|
516
|
-
if (
|
|
517
|
+
if (diff < check)
|
|
517
518
|
continue;
|
|
518
519
|
}
|
|
519
520
|
for (const { tsym, token } of optionChain.values) {
|
package/dist/shoonya-sdk.js
CHANGED
|
@@ -484,10 +484,11 @@ var Shoonya = class extends EventEmitter {
|
|
|
484
484
|
continue;
|
|
485
485
|
const match = optionExpiry.match(/more-than-(\d+)-day/);
|
|
486
486
|
if (match) {
|
|
487
|
-
const dateNow = (/* @__PURE__ */ new Date()).
|
|
488
|
-
const optionExpiryDate = unformattedDate.
|
|
487
|
+
const dateNow = (/* @__PURE__ */ new Date()).getTime();
|
|
488
|
+
const optionExpiryDate = unformattedDate.getTime();
|
|
489
|
+
const diff = (optionExpiryDate - dateNow) / (1e3 * 60 * 60 * 24);
|
|
489
490
|
const check = parseInt(match[1], 10);
|
|
490
|
-
if (
|
|
491
|
+
if (diff < check)
|
|
491
492
|
continue;
|
|
492
493
|
}
|
|
493
494
|
for (const { tsym, token } of optionChain.values) {
|