@artsy/img 1.0.2 → 1.0.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.
- package/CHANGELOG.md +12 -0
- package/dist/services/lambda.js +1 -1
- package/package.json +1 -1
- package/src/__tests__/services.test.ts +12 -0
- package/src/services/lambda.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v1.0.3 (Tue Dec 20 2022)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- fix(lambda): fixes replacement [#13](https://github.com/artsy/img/pull/13) ([@dzucconi](https://github.com/dzucconi))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Damon ([@dzucconi](https://github.com/dzucconi))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v1.0.2 (Tue Dec 20 2022)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
package/dist/services/lambda.js
CHANGED
|
@@ -11,7 +11,7 @@ const lambda = (config) => {
|
|
|
11
11
|
});
|
|
12
12
|
if (!source)
|
|
13
13
|
return src;
|
|
14
|
-
const key = decodeURIComponent(src.replace(`${source.source}/`, "")).replace(
|
|
14
|
+
const key = decodeURIComponent(src.replace(`${source.source}/`, "")).replace(/\+/g, " ");
|
|
15
15
|
const params = {
|
|
16
16
|
bucket: source.bucket,
|
|
17
17
|
key,
|
package/package.json
CHANGED
|
@@ -136,5 +136,17 @@ describe("strategies", () => {
|
|
|
136
136
|
"https://d1j88w5k23s1nr.cloudfront.net/eyJidWNrZXQiOiJhcnRzeS1tZWRpYS11cGxvYWRzIiwia2V5IjoiSXhlVThfa0RmdFh6Q2ZGZE0zNmZXQS9NQUdfVGV4dGlsZSBBcnRpc3RzLmpwZyIsImVkaXRzIjp7InJlc2l6ZSI6eyJ3aWR0aCI6MjAwLCJoZWlnaHQiOjIwMCwiZml0IjoiY292ZXIifSwid2VicCI6eyJxdWFsaXR5Ijo4MH0sImpwZWciOnsicXVhbGl0eSI6ODB9LCJyb3RhdGUiOm51bGx9fQ=="
|
|
137
137
|
);
|
|
138
138
|
});
|
|
139
|
+
|
|
140
|
+
it("decodes keys with multiple '+'", () => {
|
|
141
|
+
const img = lambda.exec(
|
|
142
|
+
"crop",
|
|
143
|
+
"https://artsy-media-uploads.s3.amazonaws.com/XPPFfQt-eyhkbVmFlcii2g%2FHauser+%26+Wirth+New+York%2C+542+West+22nd+Street-hires-4.jpg",
|
|
144
|
+
{ width: 200, height: 200 }
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
expect(img).toEqual(
|
|
148
|
+
"https://d1j88w5k23s1nr.cloudfront.net/eyJidWNrZXQiOiJhcnRzeS1tZWRpYS11cGxvYWRzIiwia2V5IjoiWFBQRmZRdC1leWhrYlZtRmxjaWkyZy9IYXVzZXIgJiBXaXJ0aCBOZXcgWW9yaywgNTQyIFdlc3QgMjJuZCBTdHJlZXQtaGlyZXMtNC5qcGciLCJlZGl0cyI6eyJyZXNpemUiOnsid2lkdGgiOjIwMCwiaGVpZ2h0IjoyMDAsImZpdCI6ImNvdmVyIn0sIndlYnAiOnsicXVhbGl0eSI6ODB9LCJqcGVnIjp7InF1YWxpdHkiOjgwfSwicm90YXRlIjpudWxsfX0="
|
|
149
|
+
);
|
|
150
|
+
});
|
|
139
151
|
});
|
|
140
152
|
});
|
package/src/services/lambda.ts
CHANGED