easywork-common-lib 1.0.290 → 1.0.292

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.
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ import { Observable } from "rxjs";
3
+ export declare function resizeImage(buffer: Buffer, width?: number): Observable<Buffer>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.resizeImage = void 0;
7
+ const rxjs_1 = require("rxjs");
8
+ const sharp_1 = __importDefault(require("sharp"));
9
+ function resizeImage(buffer, width = 200) {
10
+ return (0, rxjs_1.from)((0, sharp_1.default)(buffer)
11
+ .resize({ width })
12
+ .toBuffer());
13
+ }
14
+ exports.resizeImage = resizeImage;
15
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/common/functions/image.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAwC;AACxC,kDAA0B;AAE1B,SAAgB,WAAW,CAAC,MAAc,EAAE,QAAgB,GAAG;IAC3D,OAAO,IAAA,WAAI,EACP,IAAA,eAAK,EAAC,MAAM,CAAC;SACR,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;SACjB,QAAQ,EAAE,CAClB,CAAA;AACL,CAAC;AAND,kCAMC"}
@@ -1 +1,2 @@
1
1
  export * from "./cripto";
2
+ export * from "./image";
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./cripto"), exports);
18
+ __exportStar(require("./image"), exports);
18
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,0CAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.290",
3
+ "version": "1.0.292",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -29,6 +29,7 @@
29
29
  "class-validator": "^0.14.1",
30
30
  "nanoid": "3",
31
31
  "rxjs": "^7.8.1",
32
+ "sharp": "^0.33.5",
32
33
  "typeorm": "^0.3.20"
33
34
  },
34
35
  "devDependencies": {