jazz-tools 0.7.0-alpha.20 → 0.7.0-alpha.21
Sign up to get free protection for your applications and to get access to all the features.
package/.turbo/turbo-build.log
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.7.0-alpha.
|
2
|
+
> jazz-tools@0.7.0-alpha.20 build /Users/anselm/jazz/jazz/packages/jazz-tools
|
3
3
|
> npm run lint && rm -rf ./dist && tsc --sourceMap --outDir dist
|
4
4
|
|
5
5
|
|
6
|
-
> jazz-tools@0.7.0-alpha.
|
6
|
+
> jazz-tools@0.7.0-alpha.20 lint
|
7
7
|
> eslint src/**/*.ts
|
8
8
|
|
9
9
|
|
package/CHANGELOG.md
CHANGED
@@ -7,11 +7,13 @@ export class ImageDefinition extends CoMap {
|
|
7
7
|
this.placeholderDataURL = co.string;
|
8
8
|
this[_a] = co.ref(BinaryCoStream);
|
9
9
|
}
|
10
|
-
|
10
|
+
highestResAvailable(options) {
|
11
11
|
if (!subscriptionsScopes.get(this)) {
|
12
12
|
console.warn("highestResAvailable() only makes sense when used within a subscription.");
|
13
13
|
}
|
14
|
-
const resolutions = Object.keys(this).filter((key) => key.match(/^\d+x\d+$/)
|
14
|
+
const resolutions = Object.keys(this).filter((key) => key.match(/^\d+x\d+$/) &&
|
15
|
+
(!options?.maxWidth ||
|
16
|
+
Number(key.split("x")[0]) <= options.maxWidth));
|
15
17
|
resolutions.sort((a, b) => {
|
16
18
|
const aWidth = Number(a.split("x")[0]);
|
17
19
|
const bWidth = Number(b.split("x")[0]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"imageDef.js","sourceRoot":"","sources":["../../../src/coValues/extensions/imageDef.ts"],"names":[],"mappings":";AAAA,OAAO,EACH,cAAc,EACd,KAAK,EACL,EAAE,EACF,mBAAmB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,OAAO,eAAgB,SAAQ,KAAsB;IAA3D;;QACI,iBAAY,GAAG,EAAE,CAAC,IAAI,EAAoB,CAAC;QAC3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OAAO,MAAM,GAAG,MAAM,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,IAAI,0BAA6D,CAAC;QAElE,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC;gBACpD,0BAA0B,GAAG,UAAU,CAAC;YAC5C,CAAC;iBAAM,CAAC;gBACJ,OAAO,CACH,0BAA0B,IAAI;oBAC1B,GAAG,EAAE,0BAA0B;oBAC/B,MAAM,EAAE,IAAI,CAAC,0BAA0B,CAAE;iBAC5C,CACJ,CAAC;YACN,CAAC;QACL,CAAC;QACD,OAAO,CACH,0BAA0B,IAAI;YAC1B,GAAG,EAAE,0BAA0B;YAC/B,MAAM,EAAE,IAAI,CAAC,0BAA0B,CAAE;SAC5C,CACJ,CAAC;IACN,CAAC;CACJ;KA9CI,EAAE,CAAC,KAAK"}
|
package/package.json
CHANGED
@@ -12,17 +12,20 @@ export class ImageDefinition extends CoMap<ImageDefinition> {
|
|
12
12
|
[co.items] = co.ref(BinaryCoStream);
|
13
13
|
[res: `${number}x${number}`]: co<BinaryCoStream | null>;
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
highestResAvailable(options?: {
|
16
|
+
maxWidth?: number;
|
17
|
+
}): { res: `${number}x${number}`; stream: BinaryCoStream } | undefined {
|
18
18
|
if (!subscriptionsScopes.get(this)) {
|
19
19
|
console.warn(
|
20
20
|
"highestResAvailable() only makes sense when used within a subscription."
|
21
21
|
);
|
22
22
|
}
|
23
23
|
|
24
|
-
const resolutions = Object.keys(this).filter(
|
25
|
-
key
|
24
|
+
const resolutions = Object.keys(this).filter(
|
25
|
+
(key) =>
|
26
|
+
key.match(/^\d+x\d+$/) &&
|
27
|
+
(!options?.maxWidth ||
|
28
|
+
Number(key.split("x")[0]) <= options.maxWidth)
|
26
29
|
) as `${number}x${number}`[];
|
27
30
|
|
28
31
|
resolutions.sort((a, b) => {
|
@@ -52,4 +55,4 @@ export class ImageDefinition extends CoMap<ImageDefinition> {
|
|
52
55
|
}
|
53
56
|
);
|
54
57
|
}
|
55
|
-
}
|
58
|
+
}
|