pyrus-api 3.3.2 → 3.3.3

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.
@@ -100,10 +100,10 @@ function extractDates(key, value) {
100
100
  }
101
101
  function packDates(key, value) {
102
102
  if (dateRequestKeys.includes(key)) {
103
- return value && toDateString(value);
103
+ return this[key] && toDateString(this[key]);
104
104
  }
105
105
  if (dateTimeRequestKeys.includes(key)) {
106
- return value && toDateTimeString(value);
106
+ return this[key] && toDateTimeString(this[key]);
107
107
  }
108
108
  if (value instanceof Object && value.type && value.value) {
109
109
  if (dateTimeFieldTypes.includes(value.type)) {
@@ -129,16 +129,22 @@ function trimTrailingSlash(url) {
129
129
  function toDateTimeString(date) {
130
130
  if (typeof date === "string")
131
131
  return date;
132
+ if (date == null || typeof date.toISOString !== "function")
133
+ return String(date);
132
134
  return date.toISOString().split(".")[0] + "Z";
133
135
  }
134
136
  function toDateString(date) {
135
137
  if (typeof date === "string")
136
138
  return date;
139
+ if (date == null || typeof date.toISOString !== "function")
140
+ return String(date);
137
141
  return date.toISOString().split("T")[0];
138
142
  }
139
143
  function toTimeString(date) {
140
144
  if (typeof date === "string")
141
145
  return date;
146
+ if (date == null || typeof date.toISOString !== "function")
147
+ return String(date);
142
148
  return date.toISOString().split("T")[1].slice(0, 5);
143
149
  }
144
150
  function processFilters(filters) {
@@ -98,10 +98,10 @@ function extractDates(key, value) {
98
98
  }
99
99
  function packDates(key, value) {
100
100
  if (dateRequestKeys.includes(key)) {
101
- return value && toDateString(value);
101
+ return this[key] && toDateString(this[key]);
102
102
  }
103
103
  if (dateTimeRequestKeys.includes(key)) {
104
- return value && toDateTimeString(value);
104
+ return this[key] && toDateTimeString(this[key]);
105
105
  }
106
106
  if (value instanceof Object && value.type && value.value) {
107
107
  if (dateTimeFieldTypes.includes(value.type)) {
@@ -127,16 +127,22 @@ function trimTrailingSlash(url) {
127
127
  function toDateTimeString(date) {
128
128
  if (typeof date === "string")
129
129
  return date;
130
+ if (date == null || typeof date.toISOString !== "function")
131
+ return String(date);
130
132
  return date.toISOString().split(".")[0] + "Z";
131
133
  }
132
134
  function toDateString(date) {
133
135
  if (typeof date === "string")
134
136
  return date;
137
+ if (date == null || typeof date.toISOString !== "function")
138
+ return String(date);
135
139
  return date.toISOString().split("T")[0];
136
140
  }
137
141
  function toTimeString(date) {
138
142
  if (typeof date === "string")
139
143
  return date;
144
+ if (date == null || typeof date.toISOString !== "function")
145
+ return String(date);
140
146
  return date.toISOString().split("T")[1].slice(0, 5);
141
147
  }
142
148
  function processFilters(filters) {
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "pyrus-api",
3
- "version": "3.3.2",
4
3
  "description": "Pyrus API client for TypeScript",
4
+ "version": "3.3.3",
5
+ "author": {
6
+ "name": "Pyrus",
7
+ "email": "contact@pyrus.com"
8
+ },
9
+ "license": "MIT",
5
10
  "repository": {
6
11
  "type": "git",
7
12
  "url": "git+https://github.com/simplygoodsoftware/pyrusapi-typescript.git"
@@ -23,13 +28,10 @@
23
28
  },
24
29
  "scripts": {
25
30
  "build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript && dts-bundle-generator --project tsconfig.types.json --no-banner -o ./build/types/index.d.ts index.ts && node ./module-wrapper.js",
26
- "check:version": "node .husky/check-version.mjs"
31
+ "tsc": "tsc --noEmit",
32
+ "check:version": "node .husky/check-version.mjs",
33
+ "test": "vitest"
27
34
  },
28
- "author": {
29
- "name": "Pyrus",
30
- "email": "contact@pyrus.com"
31
- },
32
- "license": "MIT",
33
35
  "devDependencies": {
34
36
  "@rollup/plugin-typescript": "^11.1.6",
35
37
  "@types/node": "^22.5.4",
@@ -38,9 +40,11 @@
38
40
  "husky": "^9.1.6",
39
41
  "lint-staged": "^15.2.10",
40
42
  "prettier": "2.5.1",
41
- "rollup": "^4.21.2",
43
+ "rollup": "4.59.0",
42
44
  "rollup-plugin-cleandir": "^3.0.0",
43
- "rollup-plugin-typescript2": "^0.36.0"
45
+ "rollup-plugin-typescript2": "^0.36.0",
46
+ "typescript": "^5.9.3",
47
+ "vitest": "^4.0.18"
44
48
  },
45
49
  "lint-staged": {
46
50
  "**/*": "prettier --write --ignore-unknown"