aidbox-react 1.11.2 → 1.12.0

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.
Files changed (2) hide show
  1. package/dist/cjs/index.js +13 -8
  2. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -4,6 +4,11 @@ var remoteData = require('@beda.software/remote-data');
4
4
  var axios = require('axios');
5
5
  var moment = require('moment');
6
6
 
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var axios__default = /*#__PURE__*/_interopDefault(axios);
10
+ var moment__default = /*#__PURE__*/_interopDefault(moment);
11
+
7
12
  const flatten = (list) => list.reduce((a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []);
8
13
  const encodeEntry = (key, value) => encodeURIComponent(key) + '=' + encodeURIComponent(value);
9
14
  const packEntry = (accumulator, [key, value]) => {
@@ -25,7 +30,7 @@ function buildQueryParams(params) {
25
30
  .reduce(packEntry, [])
26
31
  .join('&');
27
32
  }
28
- const axiosInstance = axios.create({
33
+ const axiosInstance = axios__default.default.create({
29
34
  paramsSerializer: buildQueryParams,
30
35
  headers: {
31
36
  'Content-Type': 'application/json',
@@ -553,15 +558,15 @@ function applyFHIRServices(requests, type = 'transaction') {
553
558
  const FHIRDateFormat = 'YYYY-MM-DD';
554
559
  const FHIRTimeFormat = 'HH:mm:ss';
555
560
  const FHIRDateTimeFormat = 'YYYY-MM-DDTHH:mm:ss[Z]';
556
- const formatFHIRTime = (date) => moment(date).format(FHIRTimeFormat);
557
- const formatFHIRDate = (date) => moment(date).format(FHIRDateFormat);
558
- const formatFHIRDateTime = (date) => moment(date)
561
+ const formatFHIRTime = (date) => moment__default.default(date).format(FHIRTimeFormat);
562
+ const formatFHIRDate = (date) => moment__default.default(date).format(FHIRDateFormat);
563
+ const formatFHIRDateTime = (date) => moment__default.default(date)
559
564
  .utc()
560
565
  .format(FHIRDateTimeFormat);
561
- const parseFHIRTime = (date) => moment(date, FHIRTimeFormat);
562
- const parseFHIRDate = (date) => moment(date, FHIRDateFormat);
563
- const parseFHIRDateTime = (date) => moment.utc(date, FHIRDateTimeFormat).local();
564
- const makeFHIRDateTime = (date, time = '00:00:00') => formatFHIRDateTime(moment(`${date}T${time}`, `${FHIRDateFormat}T${FHIRTimeFormat}`));
566
+ const parseFHIRTime = (date) => moment__default.default(date, FHIRTimeFormat);
567
+ const parseFHIRDate = (date) => moment__default.default(date, FHIRDateFormat);
568
+ const parseFHIRDateTime = (date) => moment__default.default.utc(date, FHIRDateTimeFormat).local();
569
+ const makeFHIRDateTime = (date, time = '00:00:00') => formatFHIRDateTime(moment__default.default(`${date}T${time}`, `${FHIRDateFormat}T${FHIRTimeFormat}`));
565
570
  const extractFHIRDate = (date) => {
566
571
  if (date.length === FHIRDateFormat.length) {
567
572
  return date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidbox-react",
3
- "version": "1.11.2",
3
+ "version": "1.12.0",
4
4
  "scripts": {
5
5
  "build": "tsc & rollup -c",
6
6
  "prebuild": "rimraf lib/* & rimraf dist/*",