corebasic 1.0.220 → 1.0.221

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.
@@ -36,13 +36,13 @@ export function formatDate(value, format) {
36
36
  // years and months and dates are already deduplicated
37
37
  const separator = '|';
38
38
  const replacements = {
39
- YYYY: _ => years.join(separator),
40
- YY: _ => years.map(y => String(y).slice(-2)).join(separator),
41
- MMMM: _ => months.map(m => MONTH_LONG[m]).join(separator),
42
- MMM: _ => months.map(m => MONTH_SHORT[m]).join(separator),
43
- MM: _ => months.map(m => String(m + 1).padStart(2, "0")).join(separator),
44
- DD: _ => dates.map(d => String(d).padStart(2, "0")).join(separator),
45
- D: _ => dates.join(separator),
39
+ YYYY: () => years.join(separator),
40
+ YY: () => years.map(y => String(y).slice(-2)).join(separator),
41
+ MMMM: () => months.map(m => MONTH_LONG[m]).join(separator),
42
+ MMM: () => months.map(m => MONTH_SHORT[m]).join(separator),
43
+ MM: () => months.map(m => String(m + 1).padStart(2, "0")).join(separator),
44
+ DD: () => dates.map(d => String(d).padStart(2, "0")).join(separator),
45
+ D: () => dates.join(separator),
46
46
  };
47
47
  return format.replace(/YYYY|MMMM|MMM|YY|MM|DD|D/g, token => replacements[token]());
48
48
  }
@@ -466,7 +466,7 @@ let Essentials = {
466
466
  };
467
467
  function prepareResult(result) {
468
468
  let res = result.content?.length === 1 ? result.content[0].items : result.content; // For raw, this resolves to result.content which is ArrayBuffer
469
- res.metadata = _ => result.metadata;
469
+ res.metadata = () => result.metadata;
470
470
  if (result.metadata.executor === "raw")
471
471
  setRawBatchIterator(res);
472
472
  return res;
@@ -507,7 +507,7 @@ function parseBinaryResponse(result) {
507
507
  }
508
508
  function setRawBatchIterator(arrayBuffer) {
509
509
  arrayBuffer.metadata().items.forEach(batch => {
510
- batch.kv = _ => {
510
+ batch.kv = () => {
511
511
  const batchItem = {
512
512
  count: batch.count,
513
513
  slice: Essentials.sliceArrayBuffer(arrayBuffer, batch.offset, batch.size),
@@ -636,7 +636,7 @@ function getRawKeyValue(arrayBuffer, offset) {
636
636
  // Zero-copy view window bounded strictly to the key bytes
637
637
  let _id = masterView.subarray(offset, offset + keySize);
638
638
  let _id_string;
639
- _id.toText = _ => {
639
+ _id.toText = () => {
640
640
  // Fix: Pass the typed array view itself, NOT the underlying root buffer
641
641
  _id_string = _id_string === undefined ? _id.buffer.slice(_id.byteOffset, _id.byteOffset + _id.byteLength) : _id_string;
642
642
  return bufferToString(_id_string);
@@ -651,7 +651,7 @@ function getRawKeyValue(arrayBuffer, offset) {
651
651
  offset += dataSize;
652
652
  _val = Essentials.sliceArrayBuffer(arrayBuffer, _val.byteOffset, _val.byteLength);
653
653
  // _val = _val.buffer.slice(_val.byteOffset, _val.byteOffset + _val.byteLength);
654
- _val.toText = _ => bufferToString(_val);
654
+ _val.toText = () => bufferToString(_val);
655
655
  return { _id, _val, next: offset };
656
656
  }
657
657
  // Axios usage
@@ -22,7 +22,7 @@ const getFeatureUrl = api => api.split(' ')[1];
22
22
  const getFeature = name => features[name];
23
23
  const DEPLOY_TOKEN_SECRET = process.env.DEPLOY_TOKEN_SECRET || "MY_SECRET_DEPLOY_TOKEN";
24
24
  const SERVICE_ACCESS_TOKEN = jwt.sign({ app: process.env.APP_DEPLOYMENT_NAME }, DEPLOY_TOKEN_SECRET, { expiresIn: '365d' });
25
- const NDCURVE_DEVELOPER_LICENSE_ACCESS_TOKEN = await (async (_) => { if (process.env.NDCURVE_DEVELOPER_SERVICE)
25
+ const NDCURVE_DEVELOPER_LICENSE_ACCESS_TOKEN = await (async () => { if (process.env.NDCURVE_DEVELOPER_SERVICE)
26
26
  try {
27
27
  return (await Utils.fileToJson('file://', '/.ndcurve/developer.license.json')).accessToken?.trim();
28
28
  }
@@ -75,7 +75,7 @@ export const send = async (meta, feature, data, params) => {
75
75
  let response;
76
76
  let req = { meta, body: payload, params, method };
77
77
  req = JSON.parse(JSON.stringify(req));
78
- let res = { json: payload => response = payload, end: _ => true };
78
+ let res = { json: payload => response = payload, end: () => true };
79
79
  await apiHandler(req, res);
80
80
  return response;
81
81
  }
@@ -125,7 +125,7 @@ export async function hdel(key, subkey) {
125
125
  }
126
126
  // Hydrate
127
127
  export async function hydrate(callback) {
128
- setTimeout(async (_) => {
128
+ setTimeout(async () => {
129
129
  let { user, company, items } = await callback();
130
130
  await publish(user, { event: "RPC_hydrate", data: { company, items }, txn: Utils.uid() });
131
131
  }, 100);
@@ -184,18 +184,18 @@ export function validityToMillisecs(start, validity) {
184
184
  count = parseIntValue(count);
185
185
  period = period.toLowerCase();
186
186
  const timeline = {
187
- year: _ => addYears(now, count),
188
- years: _ => addYears(now, count),
189
- month: _ => addMonths(now, count),
190
- months: _ => addMonths(now, count),
191
- day: _ => now.setDate(now.getDate() + count),
192
- days: _ => now.setDate(now.getDate() + count),
193
- week: _ => now.setDate(now.getDate() + (count * 7)),
194
- weeks: _ => now.setDate(now.getDate() + (count * 7)),
195
- hour: _ => now.setHours(now.getHours() + count),
196
- hours: _ => now.setHours(now.getHours() + count),
197
- minute: _ => now.setMinutes(now.getMinutes() + count),
198
- minutes: _ => now.setMinutes(now.getMinutes() + count),
187
+ year: () => addYears(now, count),
188
+ years: () => addYears(now, count),
189
+ month: () => addMonths(now, count),
190
+ months: () => addMonths(now, count),
191
+ day: () => now.setDate(now.getDate() + count),
192
+ days: () => now.setDate(now.getDate() + count),
193
+ week: () => now.setDate(now.getDate() + (count * 7)),
194
+ weeks: () => now.setDate(now.getDate() + (count * 7)),
195
+ hour: () => now.setHours(now.getHours() + count),
196
+ hours: () => now.setHours(now.getHours() + count),
197
+ minute: () => now.setMinutes(now.getMinutes() + count),
198
+ minutes: () => now.setMinutes(now.getMinutes() + count),
199
199
  };
200
200
  timeline[period]();
201
201
  return now.getTime();
@@ -206,18 +206,18 @@ export function validityToUTCMillisecs(start, validity) {
206
206
  count = parseIntValue(count);
207
207
  period = period.toLowerCase();
208
208
  const timeline = {
209
- year: _ => addUTCYears(now, count),
210
- years: _ => addUTCYears(now, count),
211
- month: _ => addUTCMonths(now, count),
212
- months: _ => addUTCMonths(now, count),
213
- day: _ => now.setUTCDate(now.getUTCDate() + count),
214
- days: _ => now.setUTCDate(now.getUTCDate() + count),
215
- week: _ => now.setUTCDate(now.getUTCDate() + (count * 7)),
216
- weeks: _ => now.setUTCDate(now.getUTCDate() + (count * 7)),
217
- hour: _ => now.setUTCHours(now.getUTCHours() + count),
218
- hours: _ => now.setUTCHours(now.getUTCHours() + count),
219
- minute: _ => now.setUTCMinutes(now.getUTCMinutes() + count),
220
- minutes: _ => now.setUTCMinutes(now.getUTCMinutes() + count),
209
+ year: () => addUTCYears(now, count),
210
+ years: () => addUTCYears(now, count),
211
+ month: () => addUTCMonths(now, count),
212
+ months: () => addUTCMonths(now, count),
213
+ day: () => now.setUTCDate(now.getUTCDate() + count),
214
+ days: () => now.setUTCDate(now.getUTCDate() + count),
215
+ week: () => now.setUTCDate(now.getUTCDate() + (count * 7)),
216
+ weeks: () => now.setUTCDate(now.getUTCDate() + (count * 7)),
217
+ hour: () => now.setUTCHours(now.getUTCHours() + count),
218
+ hours: () => now.setUTCHours(now.getUTCHours() + count),
219
+ minute: () => now.setUTCMinutes(now.getUTCMinutes() + count),
220
+ minutes: () => now.setUTCMinutes(now.getUTCMinutes() + count),
221
221
  };
222
222
  timeline[period]();
223
223
  return now.getTime();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "corebasic",
3
3
  "type": "module",
4
- "version": "1.0.220",
4
+ "version": "1.0.221",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "./index.ts",