@mountainpass/waycharter 2.0.1 → 2.0.2
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
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## <small>2.0.2 (2022-08-04)</small>
|
|
2
|
+
|
|
3
|
+
* fix(collections): fixing nextPage links ([b34587a](https://github.com/mountain-pass/waycharter/commit/b34587a))
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
1
7
|
## <small>2.0.1 (2022-08-03)</small>
|
|
2
8
|
|
|
3
9
|
* feat(collections): added support for non-numberic paging ([7ecead9](https://github.com/mountain-pass/waycharter/commit/7ecead9))
|
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ This library is compatible with Node.js 10.x, 12.x and 14.x
|
|
|
13
13
|
|
|
14
14
|
<!-- [](https://www.codacy.com/gh/mountain-pass/waycharter/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mountain-pass/waycharter&utm_campaign=Badge_Grade) [](https://www.codacy.com/gh/mountain-pass/waycharter/dashboard?utm_source=github.com&utm_medium=referral&utm_content=mountain-pass/waycharter&utm_campaign=Badge_Coverage) -->
|
|
15
15
|
|
|
16
|
-
[](https://snyk.io/test/github/mountain-pass/waycharter) [](https://snyk.io/test/github/mountain-pass/waycharter) [](https://snyk.io/test/npm/@mountainpass/waycharter/2.0.2)
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
[](https://conventionalcommits.org) [](https://github.com/prettier/prettier)
|
|
@@ -21,7 +21,7 @@ exports.buildNextLink = void 0;
|
|
|
21
21
|
*/
|
|
22
22
|
function buildNextLink(hasMore, page, nextPage, collectionPath, otherParameters) {
|
|
23
23
|
var nextPageNumber = (nextPage !== null && nextPage !== void 0 ? nextPage : typeof page === 'number') ? (page + 1).toFixed() : undefined;
|
|
24
|
-
return hasMore
|
|
24
|
+
return hasMore || nextPage !== undefined
|
|
25
25
|
? [
|
|
26
26
|
{
|
|
27
27
|
rel: 'next',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-next-link.js","sourceRoot":"","sources":["../../src/collections/build-next-link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,OAAgB,EAChB,IAAqB,EACrB,QAA4B,EAC5B,cAAsB,EACtB,eAAsB;IAEtB,IAAM,cAAc,GAAG,CAAA,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,OAAO,IAAI,KAAK,QAAQ,EAAC,CAAC,CAAC,CAAE,IAAe,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IAC1G,OAAO,OAAO;
|
|
1
|
+
{"version":3,"file":"build-next-link.js","sourceRoot":"","sources":["../../src/collections/build-next-link.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,OAAgB,EAChB,IAAqB,EACrB,QAA4B,EAC5B,cAAsB,EACtB,eAAsB;IAEtB,IAAM,cAAc,GAAG,CAAA,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,OAAO,IAAI,KAAK,QAAQ,EAAC,CAAC,CAAC,CAAE,IAAe,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IAC1G,OAAO,OAAO,IAAI,QAAQ,KAAK,SAAS;QACtC,CAAC,CAAC;YACA;gBACE,GAAG,EAAE,MAAM;gBACX,GAAG,EAAE,UAAG,cAAc,cAAI,IAAI,eAAe,YAC3C,IAAI,EAAE,cAAc,IACjB,eAAe,EAClB,CAAC,QAAQ,EAAE,CAAE;aAChB;SACF;QACD,CAAC,CAAC,EAAE,CAAA;AACR,CAAC;AAnBD,sCAmBC"}
|
|
@@ -59,7 +59,6 @@ var to_links_1 = require("../to-links");
|
|
|
59
59
|
* @param itemActions
|
|
60
60
|
*/
|
|
61
61
|
function builtItemLinks(collectionPointer, itemEndPoint, selfUri, itemActions) {
|
|
62
|
-
console.log({ collectionPointer: collectionPointer, itemEndPoint: itemEndPoint, selfUri: selfUri, itemActions: itemActions });
|
|
63
62
|
var itemLinks = [];
|
|
64
63
|
var canonicalLinks = [];
|
|
65
64
|
itemLinks.push({
|
|
@@ -67,13 +66,6 @@ function builtItemLinks(collectionPointer, itemEndPoint, selfUri, itemActions) {
|
|
|
67
66
|
uri: "#".concat(collectionPointer)
|
|
68
67
|
});
|
|
69
68
|
if (itemEndPoint) {
|
|
70
|
-
console.log({
|
|
71
|
-
linkTo: {
|
|
72
|
-
rel: 'canonical',
|
|
73
|
-
uri: itemEndPoint.pathTemplate,
|
|
74
|
-
anchor: "#".concat(collectionPointer)
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
69
|
canonicalLinks.push({
|
|
78
70
|
rel: 'canonical',
|
|
79
71
|
uri: itemEndPoint.pathTemplate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-item-links.js","sourceRoot":"","sources":["../../src/collections/built-item-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAqC;AAKrC;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC5B,iBAAyB,EACzB,YAAyE,EACzE,OAAe,EACf,WAAyD;IAIzD,
|
|
1
|
+
{"version":3,"file":"built-item-links.js","sourceRoot":"","sources":["../../src/collections/built-item-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAAqC;AAKrC;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC5B,iBAAyB,EACzB,YAAyE,EACzE,OAAe,EACf,WAAyD;IAIzD,IAAM,SAAS,GAAG,EAAE,CAAA;IACpB,IAAM,cAAc,GAAG,EAAE,CAAA;IACzB,SAAS,CAAC,IAAI,CAAC;QACb,GAAG,EAAE,MAAM;QACX,GAAG,EAAE,WAAI,iBAAiB,CAAE;KAC7B,CAAC,CAAA;IACF,IAAI,YAAY,EAAE;QAChB,cAAc,CAAC,IAAI,CAAC;YAClB,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,YAAY,CAAC,YAAY;YAC9B,MAAM,EAAE,WAAI,iBAAiB,CAAE;SAChC,CAAC,CAAA;KACH;IACD,IAAI,WAAW,EAAE;QACf,SAAS,CAAC,IAAI,OAAd,SAAS,2BACJ,IAAA,kBAAO,EAAC,WAAW,EAAE,OAAO,EAAE,UAAA,MAAM;YAC7B,IAAA,MAAM,GAAuB,MAAM,OAA7B,EAAE,MAAM,GAAe,MAAM,OAArB,EAAK,KAAK,UAAK,MAAM,EAArC,oBAA4B,CAAF,CAAW;YAC3C,6BACK,KAAK,KACR,MAAM,EAAE,WAAI,iBAAiB,CAAE,EAC/B,MAAM,EAAE,MAAM,IAAI;oBAChB,kBAAkB;oBAClB,mCAAmC;oBACnC,qBAAqB;iBACtB,CAAC,uCAAuC;gBAC1C;QACH,CAAC,CAAC,WACH;KACF;IACD,OAAO,EAAE,SAAS,WAAA,EAAE,cAAc,gBAAA,EAAE,CAAA;AACtC,CAAC;AAtCD,wCAsCC"}
|