@m4k/common 0.2.5 → 0.2.7

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/lib/index.d.ts CHANGED
@@ -131,4 +131,5 @@ export declare class ProcessedFile {
131
131
  constructor(name: string, type: string, stream?: AsyncIterable<Uint8Array> | undefined);
132
132
  }
133
133
  export { mimeTypes } from "./mime.js";
134
+ export declare function isImageNoOp(opt: ImageOptions, inputExt: string): boolean;
134
135
  //# sourceMappingURL=index.d.ts.map
package/lib/index.js CHANGED
@@ -9,4 +9,17 @@ export class ProcessedFile {
9
9
  }
10
10
  }
11
11
  export { mimeTypes } from "./mime.js";
12
+ export function isImageNoOp(opt, inputExt) {
13
+ const outFmt = opt.format ?? opt.ext ?? "avif";
14
+ if (outFmt !== inputExt)
15
+ return false;
16
+ return (!opt.resize &&
17
+ !opt.crop &&
18
+ opt.rotate == null &&
19
+ opt.quality == null &&
20
+ !opt.colorspace &&
21
+ !opt.keepExif &&
22
+ !opt.keepIcc &&
23
+ !opt.keepMetadata);
24
+ }
12
25
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
1
  {
2
2
  "name": "@m4k/common",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
+ "description": "Common types and utilities for m4k",
5
+ "license": "MIT",
6
+ "author": "sv2dev",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/sv2dev/m4k.git"
10
+ },
4
11
  "type": "module",
5
12
  "main": "./lib/index.js",
6
- "types": "./lib/index.d.ts",
7
13
  "module": "./lib/index.js",
14
+ "types": "./lib/index.d.ts",
8
15
  "exports": {
9
16
  ".": {
10
17
  "types": "./lib/index.d.ts",
11
18
  "import": "./lib/index.js"
12
19
  }
13
20
  },
14
- "license": "MIT",
15
- "description": "Common types and utilities for m4k",
16
- "author": "sv2dev",
17
21
  "scripts": {
18
22
  "prepublishOnly": "bun run build",
19
23
  "build": "tsc -b",
20
24
  "typecheck": "tsc --noEmit"
21
25
  },
22
26
  "devDependencies": {
23
- "typescript": "^5.8.3"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/sv2dev/m4k.git"
27
+ "typescript": "^6.0.2"
28
28
  }
29
29
  }