@fileverse-dev/formulajs 4.4.11-mod-19-patch-4 → 4.4.11-mod-18-patch-20
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/lib/browser/formula.js +206 -134
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +128 -150
- package/lib/esm/crypto-constants.mjs +34 -17
- package/lib/esm/index.mjs +126 -146
- package/package.json +1 -1
- package/types/cjs/index.d.cts +9 -35
- package/types/esm/index.d.mts +9 -35
package/lib/esm/index.mjs
CHANGED
|
@@ -71,17 +71,9 @@ function dateToSerial(date) {
|
|
|
71
71
|
return Math.ceil((date - d1900) / 86400000) + addOn
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function formatDate(date) {
|
|
75
|
-
const day = String(date.getDate()).padStart(2, '0');
|
|
76
|
-
const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-indexed
|
|
77
|
-
const year = date.getFullYear();
|
|
78
|
-
return `${day}/${month}/${year}`
|
|
79
|
-
}
|
|
80
|
-
|
|
81
74
|
var date = /*#__PURE__*/Object.freeze({
|
|
82
75
|
__proto__: null,
|
|
83
76
|
dateToSerial: dateToSerial,
|
|
84
|
-
formatDate: formatDate,
|
|
85
77
|
get returnSerial () { return returnSerial; },
|
|
86
78
|
serialToDate: serialToDate,
|
|
87
79
|
useDate: useDate,
|
|
@@ -555,54 +547,16 @@ function parseDate(date) {
|
|
|
555
547
|
}
|
|
556
548
|
|
|
557
549
|
if (typeof date === 'string') {
|
|
558
|
-
|
|
559
|
-
if (/^\d{4}-\d{1,2}-\d{1,2}$/.test(date)) {
|
|
560
|
-
return new Date(date + 'T00:00:00.000')
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
// Check for DD/MM/YYYY
|
|
564
|
-
const match = /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(date);
|
|
565
|
-
if (match) {
|
|
566
|
-
const [, day, month, year] = match.map(Number);
|
|
567
|
-
const d = new Date(year, month - 1, day);
|
|
568
|
-
if (!isNaN(d)) {
|
|
569
|
-
return d
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
// Handle time-only string (HH:MM[:SS])
|
|
574
|
-
if (/^\d{1,2}:\d{2}(:\d{2})?$/.test(date)) {
|
|
575
|
-
const [h, m, s = '0'] = date.split(':').map(Number);
|
|
576
|
-
const now = new Date();
|
|
577
|
-
now.setHours(h, m, s, 0);
|
|
578
|
-
return now
|
|
579
|
-
}
|
|
550
|
+
date = /(\d{4})-(\d\d?)-(\d\d?)$/.test(date) ? new Date(date + 'T00:00:00.000') : new Date(date);
|
|
580
551
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
if (ampmMatch) {
|
|
584
|
-
let [, hour, minute, meridian] = ampmMatch;
|
|
585
|
-
hour = parseInt(hour);
|
|
586
|
-
minute = parseInt(minute);
|
|
587
|
-
if (meridian.toUpperCase() === 'PM' && hour !== 12) hour += 12;
|
|
588
|
-
if (meridian.toUpperCase() === 'AM' && hour === 12) hour = 0;
|
|
589
|
-
const now = new Date();
|
|
590
|
-
now.setHours(hour, minute, 0, 0);
|
|
591
|
-
return now
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
// Fallback for other date strings
|
|
595
|
-
const parsed = new Date(date);
|
|
596
|
-
if (!isNaN(parsed)) {
|
|
597
|
-
return parsed
|
|
552
|
+
if (!isNaN(date)) {
|
|
553
|
+
return date
|
|
598
554
|
}
|
|
599
555
|
}
|
|
600
556
|
|
|
601
557
|
return value
|
|
602
558
|
}
|
|
603
559
|
|
|
604
|
-
|
|
605
|
-
|
|
606
560
|
function parseDateArray(arr) {
|
|
607
561
|
let len = arr.length;
|
|
608
562
|
let parsed;
|
|
@@ -5226,6 +5180,76 @@ Z.TEST = (array, x, sigma) => {
|
|
|
5226
5180
|
return 1 - NORM.S.DIST((AVERAGE(array) - x) / (sigma / Math.sqrt(n)), true)
|
|
5227
5181
|
};
|
|
5228
5182
|
|
|
5183
|
+
function PNL() {
|
|
5184
|
+
const [A, B] = argsToArray(arguments);
|
|
5185
|
+
|
|
5186
|
+
const toNumberOrThrow = (val) => {
|
|
5187
|
+
const num = Number(val);
|
|
5188
|
+
if (isNaN(num)) throw new Error(`Invalid number value: ${val}`);
|
|
5189
|
+
return num;
|
|
5190
|
+
};
|
|
5191
|
+
|
|
5192
|
+
// Single numbers
|
|
5193
|
+
if (typeof A === "number" && typeof B === "number") {
|
|
5194
|
+
return A - B;
|
|
5195
|
+
}
|
|
5196
|
+
|
|
5197
|
+
// 1D arrays
|
|
5198
|
+
if (Array.isArray(A) && Array.isArray(B) && typeof A[0] !== "object") {
|
|
5199
|
+
const maxLen = Math.max(A.length, B.length);
|
|
5200
|
+
let total = 0;
|
|
5201
|
+
for (let i = 0; i < maxLen; i++) {
|
|
5202
|
+
const aVal = i < A.length ? toNumberOrThrow(A[i]) : 0;
|
|
5203
|
+
const bVal = i < B.length ? toNumberOrThrow(B[i]) : 0;
|
|
5204
|
+
total += aVal - bVal;
|
|
5205
|
+
}
|
|
5206
|
+
return total;
|
|
5207
|
+
}
|
|
5208
|
+
|
|
5209
|
+
// 2D arrays
|
|
5210
|
+
if (Array.isArray(A[0]) && typeof A[0][0] !== "object") {
|
|
5211
|
+
let total = 0;
|
|
5212
|
+
const maxRows = Math.max(A.length, B.length);
|
|
5213
|
+
for (let i = 0; i < maxRows; i++) {
|
|
5214
|
+
const rowA = A[i] || [];
|
|
5215
|
+
const rowB = B[i] || [];
|
|
5216
|
+
const maxCols = Math.max(rowA.length, rowB.length);
|
|
5217
|
+
for (let j = 0; j < maxCols; j++) {
|
|
5218
|
+
const aVal = j < rowA.length ? toNumberOrThrow(rowA[j]) : 0;
|
|
5219
|
+
const bVal = j < rowB.length ? toNumberOrThrow(rowB[j]) : 0;
|
|
5220
|
+
total += aVal - bVal;
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
return total;
|
|
5224
|
+
}
|
|
5225
|
+
|
|
5226
|
+
// 3D arrays
|
|
5227
|
+
if (Array.isArray(A[0][0])) {
|
|
5228
|
+
let total = 0;
|
|
5229
|
+
const maxX = Math.max(A.length, B.length);
|
|
5230
|
+
for (let i = 0; i < maxX; i++) {
|
|
5231
|
+
const matA = A[i] || [];
|
|
5232
|
+
const matB = B[i] || [];
|
|
5233
|
+
const maxY = Math.max(matA.length, matB.length);
|
|
5234
|
+
for (let j = 0; j < maxY; j++) {
|
|
5235
|
+
const rowA = matA[j] || [];
|
|
5236
|
+
const rowB = matB[j] || [];
|
|
5237
|
+
const maxZ = Math.max(rowA.length, rowB.length);
|
|
5238
|
+
for (let k = 0; k < maxZ; k++) {
|
|
5239
|
+
const aVal = k < rowA.length ? toNumberOrThrow(rowA[k]) : 0;
|
|
5240
|
+
const bVal = k < rowB.length ? toNumberOrThrow(rowB[k]) : 0;
|
|
5241
|
+
total += aVal - bVal;
|
|
5242
|
+
}
|
|
5243
|
+
}
|
|
5244
|
+
}
|
|
5245
|
+
return total;
|
|
5246
|
+
}
|
|
5247
|
+
|
|
5248
|
+
throw new Error("Unsupported or mismatched structure");
|
|
5249
|
+
}
|
|
5250
|
+
|
|
5251
|
+
|
|
5252
|
+
|
|
5229
5253
|
/**
|
|
5230
5254
|
* Returns the absolute value of a number.
|
|
5231
5255
|
*
|
|
@@ -7800,9 +7824,8 @@ function DAYS(end_date, start_date) {
|
|
|
7800
7824
|
if (start_date instanceof Error) {
|
|
7801
7825
|
return start_date
|
|
7802
7826
|
}
|
|
7803
|
-
console.log({x: formatDate(startOfDay(end_date)), y: formatDate(startOfDay(start_date)) });
|
|
7804
7827
|
|
|
7805
|
-
return
|
|
7828
|
+
return dateToSerial(startOfDay(end_date)) - dateToSerial(startOfDay(start_date))
|
|
7806
7829
|
}
|
|
7807
7830
|
|
|
7808
7831
|
/**
|
|
@@ -8117,8 +8140,6 @@ NETWORKDAYS.INTL = (start_date, end_date, weekend, holidays) => {
|
|
|
8117
8140
|
return total
|
|
8118
8141
|
};
|
|
8119
8142
|
|
|
8120
|
-
const NETWORKDAYS_INTL = NETWORKDAYS.INTL;
|
|
8121
|
-
|
|
8122
8143
|
/**
|
|
8123
8144
|
* Returns the serial number of the current date and time.
|
|
8124
8145
|
*
|
|
@@ -8171,14 +8192,9 @@ function TIME(hour, minute, second) {
|
|
|
8171
8192
|
return num
|
|
8172
8193
|
}
|
|
8173
8194
|
|
|
8174
|
-
|
|
8175
|
-
const mm = String(minute).padStart(2, '0');
|
|
8176
|
-
const ss = String(second).padStart(2, '0');
|
|
8177
|
-
|
|
8178
|
-
return `${hh}:${mm}:${ss}`
|
|
8195
|
+
return (3600 * hour + 60 * minute + second) / 86400
|
|
8179
8196
|
}
|
|
8180
8197
|
|
|
8181
|
-
|
|
8182
8198
|
/**
|
|
8183
8199
|
* Converts a time in the form of text to a serial number.
|
|
8184
8200
|
*
|
|
@@ -8206,7 +8222,7 @@ function TIMEVALUE(time_text) {
|
|
|
8206
8222
|
*/
|
|
8207
8223
|
function TODAY() {
|
|
8208
8224
|
const today = startOfDay(new Date());
|
|
8209
|
-
return
|
|
8225
|
+
return returnSerial ? dateToSerial(today) : today
|
|
8210
8226
|
}
|
|
8211
8227
|
|
|
8212
8228
|
/**
|
|
@@ -8280,11 +8296,6 @@ function WORKDAY(start_date, days, holidays) {
|
|
|
8280
8296
|
return WORKDAY.INTL(start_date, days, 1, holidays)
|
|
8281
8297
|
}
|
|
8282
8298
|
|
|
8283
|
-
function ISDATE(value) {
|
|
8284
|
-
const parsed = parseDate(value);
|
|
8285
|
-
return !(parsed instanceof Error)
|
|
8286
|
-
}
|
|
8287
|
-
|
|
8288
8299
|
/**
|
|
8289
8300
|
* Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.
|
|
8290
8301
|
*
|
|
@@ -8369,11 +8380,9 @@ WORKDAY.INTL = (start_date, days, weekend, holidays) => {
|
|
|
8369
8380
|
return value
|
|
8370
8381
|
}
|
|
8371
8382
|
|
|
8372
|
-
return
|
|
8383
|
+
return start_date
|
|
8373
8384
|
};
|
|
8374
8385
|
|
|
8375
|
-
const WORKDAY_INTL = WORKDAY.INTL;
|
|
8376
|
-
|
|
8377
8386
|
/**
|
|
8378
8387
|
* Converts a serial number to a year.
|
|
8379
8388
|
*
|
|
@@ -13013,13 +13022,19 @@ function SWITCH() {
|
|
|
13013
13022
|
const SERVICE_API_KEY = {
|
|
13014
13023
|
Etherscan: "ETHERSCAN_API_KEY",
|
|
13015
13024
|
Coingecko: "COINGECKO_API_KEY",
|
|
13025
|
+
Safe: "SAFE_API_KEY",
|
|
13016
13026
|
};
|
|
13017
13027
|
|
|
13018
13028
|
const CHAIN_ID_MAP = {
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13029
|
+
ethereum: 1,
|
|
13030
|
+
gnosis: 100,
|
|
13031
|
+
base: 8453,
|
|
13032
|
+
};
|
|
13033
|
+
|
|
13034
|
+
const SAFE_CHAIN_MAP = {
|
|
13035
|
+
ethereum: 'eth',
|
|
13036
|
+
gnosis: 'gno',
|
|
13037
|
+
};
|
|
13023
13038
|
|
|
13024
13039
|
const fromTimeStampToBlock = async (timestamp, chain, apiKey) => {
|
|
13025
13040
|
if(!timestamp || !chain || !apiKey) return
|
|
@@ -13090,7 +13105,7 @@ async function GETPRICE(token, vs_currencies) {
|
|
|
13090
13105
|
}
|
|
13091
13106
|
}
|
|
13092
13107
|
|
|
13093
|
-
async function
|
|
13108
|
+
async function OX(address, categories, chain, startTime, endTime) {
|
|
13094
13109
|
const API_KEYS = {
|
|
13095
13110
|
ethereum: window.localStorage.getItem(SERVICE_API_KEY.Etherscan),
|
|
13096
13111
|
gnosis: window.localStorage.getItem(SERVICE_API_KEY.Gnosisscan),
|
|
@@ -13102,12 +13117,12 @@ async function EOA(address, categories, chain, startTime, endTime) {
|
|
|
13102
13117
|
|
|
13103
13118
|
let action = '';
|
|
13104
13119
|
if (categories === 'txns') action = 'account.txlist';
|
|
13105
|
-
else {action = 'account.balance';} let timeQuery = '';
|
|
13106
|
-
if(!isNaN(startTime) && !isNaN(endTime)){
|
|
13107
|
-
|
|
13108
|
-
|
|
13120
|
+
else { action = 'account.balance'; } let timeQuery = '';
|
|
13121
|
+
if (!isNaN(startTime) && !isNaN(endTime)) {
|
|
13122
|
+
const startBlock = await fromTimeStampToBlock(startTime, chain, apiKey);
|
|
13123
|
+
const endBlock = await fromTimeStampToBlock(endTime, chain, apiKey);
|
|
13109
13124
|
timeQuery = `&startblock=${startBlock}&endblock=${endBlock}`;
|
|
13110
|
-
} else if(categories === 'balance') {
|
|
13125
|
+
} else if (categories === 'balance') {
|
|
13111
13126
|
timeQuery = `&tag=latest`;
|
|
13112
13127
|
} else {
|
|
13113
13128
|
throw new Error('Start and End Time is required for querying transaction list ')
|
|
@@ -13128,83 +13143,48 @@ async function EOA(address, categories, chain, startTime, endTime) {
|
|
|
13128
13143
|
}
|
|
13129
13144
|
|
|
13130
13145
|
|
|
13131
|
-
function
|
|
13132
|
-
|
|
13146
|
+
async function FLVURL(token, vs_currencies) {
|
|
13147
|
+
return new Promise((resolve) => {
|
|
13148
|
+
setTimeout(() => {
|
|
13149
|
+
resolve([{ "Yoo": "gotcha" }]);
|
|
13150
|
+
}, 10000);
|
|
13151
|
+
});
|
|
13152
|
+
}
|
|
13133
13153
|
|
|
13134
|
-
|
|
13135
|
-
const num = Number(val);
|
|
13136
|
-
if (isNaN(num)) throw new Error(`Invalid number value: ${val}`);
|
|
13137
|
-
return num;
|
|
13138
|
-
};
|
|
13154
|
+
async function SAFE(address, utility, chain, limit, offset) {
|
|
13139
13155
|
|
|
13140
|
-
|
|
13141
|
-
if (typeof
|
|
13142
|
-
|
|
13143
|
-
}
|
|
13156
|
+
if (typeof limit !== 'number' || limit < 0) return 'INVALID_LIMIT';
|
|
13157
|
+
if (typeof offset !== 'number' || offset < 0) return 'INVALID_OFFSET';
|
|
13158
|
+
if (utility !== 'txns') return 'UTILITY IS NOT SUPPORTED';
|
|
13144
13159
|
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
const maxLen = Math.max(A.length, B.length);
|
|
13148
|
-
let total = 0;
|
|
13149
|
-
for (let i = 0; i < maxLen; i++) {
|
|
13150
|
-
const aVal = i < A.length ? toNumberOrThrow(A[i]) : 0;
|
|
13151
|
-
const bVal = i < B.length ? toNumberOrThrow(B[i]) : 0;
|
|
13152
|
-
total += aVal - bVal;
|
|
13153
|
-
}
|
|
13154
|
-
return total;
|
|
13155
|
-
}
|
|
13160
|
+
const apiKey = window.localStorage.getItem(SERVICE_API_KEY.Safe);
|
|
13161
|
+
const chainIdentifier = SAFE_CHAIN_MAP[chain];
|
|
13156
13162
|
|
|
13157
|
-
|
|
13158
|
-
if (
|
|
13159
|
-
let total = 0;
|
|
13160
|
-
const maxRows = Math.max(A.length, B.length);
|
|
13161
|
-
for (let i = 0; i < maxRows; i++) {
|
|
13162
|
-
const rowA = A[i] || [];
|
|
13163
|
-
const rowB = B[i] || [];
|
|
13164
|
-
const maxCols = Math.max(rowA.length, rowB.length);
|
|
13165
|
-
for (let j = 0; j < maxCols; j++) {
|
|
13166
|
-
const aVal = j < rowA.length ? toNumberOrThrow(rowA[j]) : 0;
|
|
13167
|
-
const bVal = j < rowB.length ? toNumberOrThrow(rowB[j]) : 0;
|
|
13168
|
-
total += aVal - bVal;
|
|
13169
|
-
}
|
|
13170
|
-
}
|
|
13171
|
-
return total;
|
|
13172
|
-
}
|
|
13163
|
+
if (!apiKey) return `${SERVICE_API_KEY.Safe}_MISSING`;
|
|
13164
|
+
if (!chainIdentifier) return 'CHAIN IS NOT SUPPORTED';
|
|
13173
13165
|
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
const maxY = Math.max(matA.length, matB.length);
|
|
13182
|
-
for (let j = 0; j < maxY; j++) {
|
|
13183
|
-
const rowA = matA[j] || [];
|
|
13184
|
-
const rowB = matB[j] || [];
|
|
13185
|
-
const maxZ = Math.max(rowA.length, rowB.length);
|
|
13186
|
-
for (let k = 0; k < maxZ; k++) {
|
|
13187
|
-
const aVal = k < rowA.length ? toNumberOrThrow(rowA[k]) : 0;
|
|
13188
|
-
const bVal = k < rowB.length ? toNumberOrThrow(rowB[k]) : 0;
|
|
13189
|
-
total += aVal - bVal;
|
|
13190
|
-
}
|
|
13166
|
+
const url = `https://api.safe.global/tx-service/${chainIdentifier}/api/v2/safes/${address}/multisig-transactions?limit=${limit}&offset=${offset}`;
|
|
13167
|
+
try {
|
|
13168
|
+
const response = await fetch(url,
|
|
13169
|
+
{
|
|
13170
|
+
headers: {
|
|
13171
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
13172
|
+
},
|
|
13191
13173
|
}
|
|
13174
|
+
);
|
|
13175
|
+
if (!response.ok) throw new Error(`HTTP error! Status: ${response.status}`);
|
|
13176
|
+
const json = await response.json();
|
|
13177
|
+
if (!Array.isArray(json.results)) {
|
|
13178
|
+
return "INVALID API RESPONSE";
|
|
13192
13179
|
}
|
|
13193
|
-
|
|
13180
|
+
// remove nested structure from the response
|
|
13181
|
+
return json.results.map(({ confirmations, dataDecoded, ...rest }) => rest);
|
|
13182
|
+
} catch (e) {
|
|
13183
|
+
console.log(e);
|
|
13184
|
+
return "ERROR IN FETCHING";
|
|
13194
13185
|
}
|
|
13195
|
-
|
|
13196
|
-
throw new Error("Unsupported or mismatched structure");
|
|
13197
|
-
}
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
async function FLVURL(token, vs_currencies) {
|
|
13201
|
-
return new Promise((resolve) => {
|
|
13202
|
-
setTimeout(() => {
|
|
13203
|
-
resolve([{"Yoo": "gotcha"}]);
|
|
13204
|
-
}, 10000);
|
|
13205
|
-
});
|
|
13206
13186
|
}
|
|
13207
13187
|
|
|
13208
13188
|
const utils = { errors, symbols, date };
|
|
13209
13189
|
|
|
13210
|
-
export { ABS, ACCRINT, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AND, ARABIC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CEILING, CEILINGMATH, CEILINGPRECISE, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYS, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP, EDATE, EFFECT,
|
|
13190
|
+
export { ABS, ACCRINT, ACOS, ACOSH, ACOT, ACOTH, AGGREGATE, AND, ARABIC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE, AVERAGEA, AVERAGEIF, AVERAGEIFS, BASE, BESSELI, BESSELJ, BESSELK, BESSELY, BETA, BETADIST, BETAINV, BIN2DEC, BIN2HEX, BIN2OCT, BINOM, BINOMDIST, BITAND, BITLSHIFT, BITOR, BITRSHIFT, BITXOR, CEILING, CEILINGMATH, CEILINGPRECISE, CHAR, CHIDIST, CHIDISTRT, CHIINV, CHIINVRT, CHISQ, CHITEST, CHOOSE, CLEAN, CODE, COLUMN, COLUMNS, COMBIN, COMBINA, COMPLEX, CONCAT, CONCATENATE, CONFIDENCE, CONVERT, CORREL, COS, COSH, COT, COTH, COUNT, COUNTA, COUNTBLANK, COUNTIF, COUNTIFS, COUPDAYS, COVAR, COVARIANCE, COVARIANCEP, COVARIANCES, CRITBINOM, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEDIF, DATEVALUE, DAVERAGE, DAY, DAYS, DAYS360, DB, DCOUNT, DCOUNTA, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DECIMAL, DEGREES, DELTA, DEVSQ, DGET, DISC, DMAX, DMIN, DOLLAR, DOLLARDE, DOLLARFR, DPRODUCT, DSTDEV, DSTDEVP, DSUM, DVAR, DVARP, EDATE, EFFECT, EOMONTH, ERF, ERFC, ERFCPRECISE, ERFPRECISE, ERROR, ETHERSCAN, EVEN, EXACT, EXP, EXPON, EXPONDIST, F, FACT, FACTDOUBLE, FALSE, FDIST, FDISTRT, FIND, FINV, FINVRT, FISHER, FISHERINV, FIXED, FLOOR, FLOORMATH, FLOORPRECISE, FLVURL, FORECAST, FREQUENCY, FTEST, FV, FVSCHEDULE, GAMMA, GAMMADIST, GAMMAINV, GAMMALN, GAMMALNPRECISE, GAUSS, GCD, GEOMEAN, GESTEP, GETPRICE, GROWTH, HARMEAN, HEX2BIN, HEX2DEC, HEX2OCT, HLOOKUP, HOUR, HYPGEOM, HYPGEOMDIST, IF, IFERROR, IFNA, IFS, IMABS, IMAGINARY, IMARGUMENT, IMCONJUGATE, IMCOS, IMCOSH, IMCOT, IMCSC, IMCSCH, IMDIV, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER, IMPRODUCT, IMREAL, IMSEC, IMSECH, IMSIN, IMSINH, IMSQRT, IMSUB, IMSUM, IMTAN, INDEX, INT, INTERCEPT, IPMT, IRR, ISBLANK, ISERR, ISERROR, ISEVEN, ISLOGICAL, ISNA, ISNONTEXT, ISNUMBER, ISO, ISODD, ISOWEEKNUM, ISPMT, ISTEXT, KURT, LARGE, LCM, LEFT, LEN, LINEST, LN, LOG, LOG10, LOGEST, LOGINV, LOGNORM, LOGNORMDIST, LOGNORMINV, LOOKUP, LOWER, MATCH, MAX, MAXA, MAXIFS, MEDIAN, MID, MIN, MINA, MINIFS, MINUTE, MIRR, MMULT, MOD, MODE, MODEMULT, MODESNGL, MONTH, MROUND, MULTINOMIAL, MUNIT, N, NA, NEGBINOM, NEGBINOMDIST, NETWORKDAYS, NETWORKDAYSINTL, NOMINAL, NORM, NORMDIST, NORMINV, NORMSDIST, NORMSINV, NOT, NOW, NPER, NPV, NUMBERVALUE, OCT2BIN, OCT2DEC, OCT2HEX, ODD, OR, OX, PDURATION, PEARSON, PERCENTILE, PERCENTILEEXC, PERCENTILEINC, PERCENTRANK, PERCENTRANKEXC, PERCENTRANKINC, PERMUT, PERMUTATIONA, PHI, PI, PMT, PNL, POISSON, POISSONDIST, POWER, PPMT, PRICEDISC, PROB, PRODUCT, PROPER, PV, QUARTILE, QUARTILEEXC, QUARTILEINC, QUOTIENT, RADIANS, RAND, RANDBETWEEN, RANK, RANKAVG, RANKEQ, RATE, REPLACE, REPT, RIGHT, ROMAN, ROUND, ROUNDDOWN, ROUNDUP, ROW, ROWS, RRI, RSQ, SAFE, SEARCH, SEC, SECH, SECOND, SERIESSUM, SIGN, SIN, SINH, SKEW, SKEWP, SLN, SLOPE, SMALL, SORT, SQRT, SQRTPI, STANDARDIZE, STDEV, STDEVA, STDEVP, STDEVPA, STDEVS, STEYX, SUBSTITUTE, SUBTOTAL, SUM, SUMIF, SUMIFS, SUMPRODUCT, SUMSQ, SUMX2MY2, SUMX2PY2, SUMXMY2, SWITCH, SYD, T, TAN, TANH, TBILLEQ, TBILLPRICE, TBILLYIELD, TDIST, TDISTRT, TEXT, TEXTJOIN, TIME, TIMEVALUE, TINV, TODAY, TRANSPOSE, TREND, TRIM, TRIMMEAN, TRUE, TRUNC, TTEST, TYPE, UNICHAR, UNICODE, UNIQUE, UPPER, VALUE, VAR, VARA, VARP, VARPA, VARS, VLOOKUP, WEEKDAY, WEEKNUM, WEIBULL, WEIBULLDIST, WORKDAY, WORKDAYINTL, XIRR, XNPV, XOR, YEAR, YEARFRAC, Z, ZTEST, utils };
|
package/package.json
CHANGED
package/types/cjs/index.d.cts
CHANGED
|
@@ -993,7 +993,7 @@ export function DAVERAGE(database: any, field: any, criteria: any): number | Err
|
|
|
993
993
|
* @param {*} serial_number The date of the day you are trying to find.
|
|
994
994
|
* @returns
|
|
995
995
|
*/
|
|
996
|
-
export function DAY(serial_number: any):
|
|
996
|
+
export function DAY(serial_number: any): any;
|
|
997
997
|
/**
|
|
998
998
|
* Returns the number of days between two dates.
|
|
999
999
|
*
|
|
@@ -1293,7 +1293,6 @@ export function EDATE(start_date: any, months: any): any;
|
|
|
1293
1293
|
* @returns
|
|
1294
1294
|
*/
|
|
1295
1295
|
export function EFFECT(nominal_rate: any, npery: any): number | Error;
|
|
1296
|
-
export function EOA(address: any, categories: any, chain: any, startTime: any, endTime: any): Promise<any>;
|
|
1297
1296
|
/**
|
|
1298
1297
|
* Returns the serial number of the last day of the month before or after a specified number of months.
|
|
1299
1298
|
*
|
|
@@ -2234,7 +2233,6 @@ export function IRR(values: any, guess: any): any;
|
|
|
2234
2233
|
* @returns
|
|
2235
2234
|
*/
|
|
2236
2235
|
export function ISBLANK(value: any): boolean;
|
|
2237
|
-
export function ISDATE(value: any): boolean;
|
|
2238
2236
|
/**
|
|
2239
2237
|
* Returns TRUE if the value is any error value except #N/A.
|
|
2240
2238
|
*
|
|
@@ -2805,18 +2803,6 @@ export namespace NETWORKDAYS {
|
|
|
2805
2803
|
* @returns
|
|
2806
2804
|
*/
|
|
2807
2805
|
export function NETWORKDAYSINTL(start_date: any, end_date: any, weekend: any, holidays: any): number | Error;
|
|
2808
|
-
/**
|
|
2809
|
-
* Returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days.
|
|
2810
|
-
*
|
|
2811
|
-
* Category: Date and time
|
|
2812
|
-
*
|
|
2813
|
-
* @param {*} start_date The date for from which the difference is to be computed. The start_date can be earlier than, the same as, or later than the end_date.
|
|
2814
|
-
* @param {*} end_date The date for to which the difference is to be computed.
|
|
2815
|
-
* @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not included in the number of whole working days between start_date and end_date. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:
|
|
2816
|
-
* @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.
|
|
2817
|
-
* @returns
|
|
2818
|
-
*/
|
|
2819
|
-
export function NETWORKDAYS_INTL(start_date: any, end_date: any, weekend: any, holidays: any): number | Error;
|
|
2820
2806
|
/**
|
|
2821
2807
|
* Returns the annual nominal interest rate.
|
|
2822
2808
|
*
|
|
@@ -3015,6 +3001,7 @@ export function ODD(number: any): number | Error;
|
|
|
3015
3001
|
* @returns
|
|
3016
3002
|
*/
|
|
3017
3003
|
export function OR(...args: any[]): any;
|
|
3004
|
+
export function OX(address: any, categories: any, chain: any, startTime: any, endTime: any): Promise<any>;
|
|
3018
3005
|
/**
|
|
3019
3006
|
* Returns the number of periods required by an investment to reach a specified value.
|
|
3020
3007
|
*
|
|
@@ -3170,6 +3157,7 @@ export function PI(): number;
|
|
|
3170
3157
|
* @returns
|
|
3171
3158
|
*/
|
|
3172
3159
|
export function PMT(rate: any, nper: any, pv: any, fv: any, type: any): number | Error;
|
|
3160
|
+
export function PNL(...args: any[]): number;
|
|
3173
3161
|
export namespace POISSON {
|
|
3174
3162
|
/**
|
|
3175
3163
|
* Returns the Poisson distribution.
|
|
@@ -3275,7 +3263,6 @@ export function PROPER(text: any): any;
|
|
|
3275
3263
|
* @returns
|
|
3276
3264
|
*/
|
|
3277
3265
|
export function PV(rate: any, per: any, pmt: any, fv: any, type: any): number | Error;
|
|
3278
|
-
export function PnL(...args: any[]): number;
|
|
3279
3266
|
export namespace QUARTILE {
|
|
3280
3267
|
/**
|
|
3281
3268
|
* Returns the quartile of the data set, based on percentile values from 0..1, exclusive.
|
|
@@ -3528,6 +3515,7 @@ export function RRI(nper: any, pv: any, fv: any): number | Error;
|
|
|
3528
3515
|
* @returns
|
|
3529
3516
|
*/
|
|
3530
3517
|
export function RSQ(known_y: any, known_x: any): number | Error;
|
|
3518
|
+
export function SAFE(address: any, utility: any, chain: any, limit: any, offset: any): Promise<any>;
|
|
3531
3519
|
/**
|
|
3532
3520
|
* Finds one text value within another (not case-sensitive)
|
|
3533
3521
|
*
|
|
@@ -4054,7 +4042,7 @@ export function TEXTJOIN(delimiter: any, ignore_empty: any, ...args: any): any;
|
|
|
4054
4042
|
* @param {*} second A number from 0 to 32767 representing the second. Any value greater than 59 will be converted to hours, minutes, and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148 or 12:33:20 AM
|
|
4055
4043
|
* @returns
|
|
4056
4044
|
*/
|
|
4057
|
-
export function TIME(hour: any, minute: any, second: any):
|
|
4045
|
+
export function TIME(hour: any, minute: any, second: any): number | Error;
|
|
4058
4046
|
/**
|
|
4059
4047
|
* Converts a time in the form of text to a serial number.
|
|
4060
4048
|
*
|
|
@@ -4093,7 +4081,7 @@ export namespace TINV {
|
|
|
4093
4081
|
*
|
|
4094
4082
|
* @returns
|
|
4095
4083
|
*/
|
|
4096
|
-
export function TODAY():
|
|
4084
|
+
export function TODAY(): number | Date;
|
|
4097
4085
|
/**
|
|
4098
4086
|
* Returns the transpose of an array.
|
|
4099
4087
|
*
|
|
@@ -4338,7 +4326,7 @@ export function WEIBULLDIST(x: any, alpha: any, beta: any, cumulative: any): num
|
|
|
4338
4326
|
* @param {*} holidays Optional. An optional list of one or more dates to exclude from the working calendar, such as state and federal holidays and floating holidays. The list can be either a range of values that contain the dates or an array constant of the serial numbers that represent the dates.
|
|
4339
4327
|
* @returns
|
|
4340
4328
|
*/
|
|
4341
|
-
export function WORKDAY(start_date: any, days: any, holidays: any):
|
|
4329
|
+
export function WORKDAY(start_date: any, days: any, holidays: any): any;
|
|
4342
4330
|
export namespace WORKDAY {
|
|
4343
4331
|
/**
|
|
4344
4332
|
* Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.
|
|
@@ -4351,7 +4339,7 @@ export namespace WORKDAY {
|
|
|
4351
4339
|
* @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.
|
|
4352
4340
|
* @returns
|
|
4353
4341
|
*/
|
|
4354
|
-
function INTL(start_date: any, days: any, weekend: any, holidays: any):
|
|
4342
|
+
function INTL(start_date: any, days: any, weekend: any, holidays: any): any;
|
|
4355
4343
|
}
|
|
4356
4344
|
/**
|
|
4357
4345
|
* Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.
|
|
@@ -4364,19 +4352,7 @@ export namespace WORKDAY {
|
|
|
4364
4352
|
* @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.
|
|
4365
4353
|
* @returns
|
|
4366
4354
|
*/
|
|
4367
|
-
export function WORKDAYINTL(start_date: any, days: any, weekend: any, holidays: any):
|
|
4368
|
-
/**
|
|
4369
|
-
* Returns the serial number of the date before or after a specified number of workdays using parameters to indicate which and how many days are weekend days.
|
|
4370
|
-
*
|
|
4371
|
-
* Category: Date and time
|
|
4372
|
-
*
|
|
4373
|
-
* @param {*} start_date The start date, truncated to integer.
|
|
4374
|
-
* @param {*} days The number of workdays before or after the start_date. A positive value yields a future date; a negative value yields a past date; a zero value yields the start_date. Day-offset is truncated to an integer.
|
|
4375
|
-
* @param {*} weekend Optional. Indicates the days of the week that are weekend days and are not considered working days. Weekend is a weekend number or string that specifies when weekends occur. Weekend number values indicate the following weekend days:
|
|
4376
|
-
* @param {*} holidays Optional. An optional set of one or more dates that are to be excluded from the working day calendar. Holidays shall be a range of values that contain the dates, or an array constant of the serial values that represent those dates. The ordering of dates or serial values in holidays can be arbitrary.
|
|
4377
|
-
* @returns
|
|
4378
|
-
*/
|
|
4379
|
-
export function WORKDAY_INTL(start_date: any, days: any, weekend: any, holidays: any): string | Error;
|
|
4355
|
+
export function WORKDAYINTL(start_date: any, days: any, weekend: any, holidays: any): any;
|
|
4380
4356
|
/**
|
|
4381
4357
|
* Returns the internal rate of return for a schedule of cash flows that is not necessarily periodic.
|
|
4382
4358
|
*
|
|
@@ -4486,7 +4462,6 @@ declare var symbols: Readonly<{
|
|
|
4486
4462
|
declare var date: Readonly<{
|
|
4487
4463
|
__proto__: any;
|
|
4488
4464
|
dateToSerial: typeof dateToSerial;
|
|
4489
|
-
formatDate: typeof formatDate;
|
|
4490
4465
|
readonly returnSerial: boolean;
|
|
4491
4466
|
serialToDate: typeof serialToDate;
|
|
4492
4467
|
useDate: typeof useDate;
|
|
@@ -4585,7 +4560,6 @@ declare function NE(value1: any, value2: any, ...args: any[]): boolean | Error;
|
|
|
4585
4560
|
*/
|
|
4586
4561
|
declare function POW(base: any, exponent: any, ...args: any[]): any;
|
|
4587
4562
|
declare function dateToSerial(date: any): number;
|
|
4588
|
-
declare function formatDate(date: any): string;
|
|
4589
4563
|
declare function serialToDate(serial: any): Date;
|
|
4590
4564
|
declare function useDate(): void;
|
|
4591
4565
|
declare function useSerial(): void;
|