pwi-plata-type 0.2.15 → 0.2.16

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/Dockerfile CHANGED
@@ -1,13 +1,18 @@
1
- FROM node:16-alpine
1
+ FROM node:16-alpine AS build
2
2
 
3
3
  WORKDIR /usr/src/app
4
4
 
5
- COPY package*.json ./
5
+ COPY . ./
6
+
7
+ RUN npm ci --only=production && \
8
+ npm run build
9
+
10
+ FROM node:16-alpine AS bin
6
11
 
7
12
  EXPOSE 3050
8
13
 
9
- RUN npm ci --only=production
14
+ WORKDIR /usr/src/app
10
15
 
11
- COPY . ./
16
+ COPY --from=build /usr/src/app/build .
12
17
 
13
- CMD [ "node", "/usr/src/app" ]
18
+ CMD [ "npm", "start" ]
package/libs/model.ts CHANGED
@@ -279,7 +279,9 @@ export function Int(): ModelValicacaoPrimitivo {
279
279
  }
280
280
  }
281
281
 
282
- if (Math.round(valor) !== valor) {
282
+ const v = +valor
283
+
284
+ if (Math.round(v) !== v) {
283
285
  return {
284
286
  error: {
285
287
  errorID: "BPMVINT002",
package/libs/swagger.ts CHANGED
@@ -45,7 +45,8 @@ export namespace PlataSwagger {
45
45
 
46
46
  obj.paths[httpPath][metodo] = { ...header, responses: response }
47
47
 
48
- if (body !== {}) {
48
+ //https://bobbyhadz.com/blog/javascript-check-if-object-is-empty
49
+ if (Object.keys(body).length !== 0) {
49
50
  if (!Array.isArray(obj.paths[httpPath][metodo].parameters)) {
50
51
  obj.paths[httpPath][metodo].parameters = []
51
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwi-plata-type",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "jest": "^28.1.1",
24
24
  "swagger-ui-express": "^4.4.0",
25
25
  "ts-jest": "^28.0.4",
26
- "ts-node": "^10.8.1"
26
+ "ts-node": "10.8.2"
27
27
  },
28
28
  "description": "",
29
29
  "devDependencies": {