@ekino/rendr-core
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -96,3 +96,3 @@ var __extends = (this && this.__extends) || (function () { | ||
return { | ||
message: defaultMessage | ||
message: defaultMessage, | ||
}; | ||
@@ -102,3 +102,3 @@ } | ||
return { | ||
message: args[0] | ||
message: args[0], | ||
}; | ||
@@ -109,3 +109,3 @@ } | ||
message: defaultMessage, | ||
previousError: args[0] | ||
previousError: args[0], | ||
}; | ||
@@ -116,3 +116,3 @@ } | ||
message: args[0], | ||
previousError: args[1] | ||
previousError: args[1], | ||
}; | ||
@@ -186,3 +186,3 @@ } | ||
this.cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -195,3 +195,3 @@ this.head = { | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -216,3 +216,3 @@ this.blocks = []; | ||
group: "", | ||
settings: settings ? settings : {} | ||
settings: settings ? settings : {}, | ||
}; | ||
@@ -397,3 +397,3 @@ } | ||
var cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -414,3 +414,3 @@ if (!isObject(data)) { | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -467,3 +467,3 @@ if (!isObject(data)) { | ||
settings: "settings" in data && isObject(data.settings) ? data.settings : {}, | ||
type: data.type | ||
type: data.type, | ||
}; | ||
@@ -507,3 +507,3 @@ } | ||
res: isServerSide ? res : null, | ||
settings: {} | ||
settings: {}, | ||
}; | ||
@@ -529,3 +529,3 @@ return ctx; | ||
: page.head.htmlAttributes, | ||
meta: __spreadArrays(page.head.meta, p.head.meta) | ||
meta: __spreadArrays(page.head.meta, p.head.meta), | ||
}; | ||
@@ -532,0 +532,0 @@ page.path = p.path; |
@@ -28,3 +28,3 @@ var __extends = (this && this.__extends) || (function () { | ||
return { | ||
message: defaultMessage | ||
message: defaultMessage, | ||
}; | ||
@@ -34,3 +34,3 @@ } | ||
return { | ||
message: args[0] | ||
message: args[0], | ||
}; | ||
@@ -41,3 +41,3 @@ } | ||
message: defaultMessage, | ||
previousError: args[0] | ||
previousError: args[0], | ||
}; | ||
@@ -48,3 +48,3 @@ } | ||
message: args[0], | ||
previousError: args[1] | ||
previousError: args[1], | ||
}; | ||
@@ -51,0 +51,0 @@ } |
@@ -63,3 +63,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
group: "", | ||
settings: settings ? settings : {} | ||
settings: settings ? settings : {}, | ||
}; | ||
@@ -66,0 +66,0 @@ } |
@@ -33,3 +33,3 @@ var __assign = (this && this.__assign) || function () { | ||
var cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -49,3 +49,3 @@ if (!isObject(data)) { | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -100,3 +100,3 @@ if (!isObject(data)) { | ||
settings: "settings" in data && isObject(data.settings) ? data.settings : {}, | ||
type: data.type | ||
type: data.type, | ||
}; | ||
@@ -138,3 +138,3 @@ } | ||
res: isServerSide ? res : null, | ||
settings: {} | ||
settings: {}, | ||
}; | ||
@@ -159,3 +159,3 @@ return ctx; | ||
: page.head.htmlAttributes, | ||
meta: __spreadArrays(page.head.meta, p.head.meta) | ||
meta: __spreadArrays(page.head.meta, p.head.meta), | ||
}; | ||
@@ -162,0 +162,0 @@ page.path = p.path; |
@@ -7,3 +7,3 @@ var Page = (function () { | ||
this.cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -16,3 +16,3 @@ this.head = { | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -19,0 +19,0 @@ this.blocks = []; |
@@ -30,3 +30,3 @@ "use strict"; | ||
return { | ||
message: defaultMessage | ||
message: defaultMessage, | ||
}; | ||
@@ -36,3 +36,3 @@ } | ||
return { | ||
message: args[0] | ||
message: args[0], | ||
}; | ||
@@ -43,3 +43,3 @@ } | ||
message: defaultMessage, | ||
previousError: args[0] | ||
previousError: args[0], | ||
}; | ||
@@ -50,3 +50,3 @@ } | ||
message: args[0], | ||
previousError: args[1] | ||
previousError: args[1], | ||
}; | ||
@@ -53,0 +53,0 @@ } |
@@ -68,3 +68,3 @@ "use strict"; | ||
group: "", | ||
settings: settings ? settings : {} | ||
settings: settings ? settings : {}, | ||
}; | ||
@@ -71,0 +71,0 @@ } |
@@ -43,3 +43,3 @@ "use strict"; | ||
var cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -60,3 +60,3 @@ if (!isObject(data)) { | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -113,3 +113,3 @@ if (!isObject(data)) { | ||
settings: "settings" in data && isObject(data.settings) ? data.settings : {}, | ||
type: data.type | ||
type: data.type, | ||
}; | ||
@@ -153,3 +153,3 @@ } | ||
res: isServerSide ? res : null, | ||
settings: {} | ||
settings: {}, | ||
}; | ||
@@ -175,3 +175,3 @@ return ctx; | ||
: page.head.htmlAttributes, | ||
meta: __spreadArrays(page.head.meta, p.head.meta) | ||
meta: __spreadArrays(page.head.meta, p.head.meta), | ||
}; | ||
@@ -178,0 +178,0 @@ page.path = p.path; |
@@ -9,3 +9,3 @@ "use strict"; | ||
this.cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -18,3 +18,3 @@ this.head = { | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -21,0 +21,0 @@ this.blocks = []; |
{ | ||
"name": "@ekino/rendr-core", | ||
"license": "MIT", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"main": "dist/lib/index.js", | ||
@@ -22,3 +22,3 @@ "typing": "dist/lib/index.d.ts", | ||
}, | ||
"gitHead": "42720e423cf54b2976e74fe476d588c891becb91" | ||
"gitHead": "ed31cb2c6fdb510cdca6b6fc8800f04d0b4702e0" | ||
} |
--- | ||
<p align="center"> | ||
<strong> | ||
The package is part of the `@ekino/rendr` project. Please visit <a aria-label=rendr learn" href="https://github.com/ekino/rendr">https://github.com/ekino/rendr</a> to get started with rendr. | ||
The package is part of the `@ekino/rendr` project. Please visit <a aria-label="rendr learn" href="https://github.com/ekino/rendr">https://github.com/ekino/rendr</a> to get started with rendr. | ||
</strong> | ||
@@ -6,0 +6,0 @@ </p> |
@@ -5,3 +5,3 @@ import { | ||
NormalizationError, | ||
RendrError | ||
RendrError, | ||
} from "./errors"; | ||
@@ -13,3 +13,3 @@ | ||
message: "Not Found Error", | ||
name: "NotFoundError" | ||
name: "NotFoundError", | ||
}, | ||
@@ -19,3 +19,3 @@ { | ||
message: "Internal Server Error", | ||
name: "InternalServerError" | ||
name: "InternalServerError", | ||
}, | ||
@@ -25,8 +25,8 @@ { | ||
message: "Normalization Error", | ||
name: "NormalizationError" | ||
} | ||
name: "NormalizationError", | ||
}, | ||
]; | ||
describe("test errors", () => { | ||
errors.forEach(error => { | ||
errors.forEach((error) => { | ||
it(`${error.message} > should return default message`, () => { | ||
@@ -33,0 +33,0 @@ const err = new error.class(); |
@@ -9,3 +9,3 @@ // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work | ||
return { | ||
message: defaultMessage | ||
message: defaultMessage, | ||
}; | ||
@@ -16,3 +16,3 @@ } | ||
return { | ||
message: args[0] | ||
message: args[0], | ||
}; | ||
@@ -24,3 +24,3 @@ } | ||
message: defaultMessage, | ||
previousError: args[0] | ||
previousError: args[0], | ||
}; | ||
@@ -32,3 +32,3 @@ } | ||
message: args[0], | ||
previousError: args[1] | ||
previousError: args[1], | ||
}; | ||
@@ -52,3 +52,3 @@ } | ||
stack: new Error().stack, | ||
name: "RendrError" | ||
name: "RendrError", | ||
}); | ||
@@ -67,3 +67,3 @@ } | ||
stack: new Error().stack, | ||
name: "NotFoundError" | ||
name: "NotFoundError", | ||
}); | ||
@@ -79,3 +79,3 @@ } | ||
stack: new Error().stack, | ||
name: "InternalServerError" | ||
name: "InternalServerError", | ||
}); | ||
@@ -91,5 +91,5 @@ } | ||
stack: new Error().stack, | ||
name: "NormalizationError" | ||
name: "NormalizationError", | ||
}); | ||
} | ||
} |
import { AsyncPageReferenceGenerator } from "./types"; | ||
import { | ||
createPageReferencesGenerator, | ||
createPageReference | ||
createPageReference, | ||
} from "./generator"; | ||
async function* pagesGenerator(): AsyncPageReferenceGenerator { | ||
await new Promise(resolve => setTimeout(resolve, 10)); | ||
await new Promise((resolve) => setTimeout(resolve, 10)); | ||
yield createPageReference("https://localhost/" + "x".repeat(40 - 18), { | ||
lastmod: "2005-01-01" | ||
lastmod: "2005-01-01", | ||
}); | ||
await new Promise(resolve => setTimeout(resolve, 10)); | ||
await new Promise((resolve) => setTimeout(resolve, 10)); | ||
yield createPageReference("https://localhost/", { | ||
lastmod: "2005-01-01" | ||
lastmod: "2005-01-01", | ||
}); | ||
@@ -25,3 +25,3 @@ } | ||
group_1: pagesGenerator, | ||
group_2: pagesGenerator | ||
group_2: pagesGenerator, | ||
}); | ||
@@ -28,0 +28,0 @@ |
@@ -5,3 +5,3 @@ import { | ||
Settings, | ||
TransformGenerator | ||
TransformGenerator, | ||
} from "./types"; | ||
@@ -32,3 +32,3 @@ | ||
group: "", | ||
settings: settings ? settings : {} | ||
settings: settings ? settings : {}, | ||
}; | ||
@@ -35,0 +35,0 @@ } |
@@ -15,4 +15,4 @@ import { createPage, mergePages, Page, createContext } from "./index"; | ||
title: "My Custom Title", | ||
meta: [] | ||
} | ||
meta: [], | ||
}, | ||
}); | ||
@@ -26,4 +26,4 @@ | ||
cache: { | ||
ttl: 999 | ||
} | ||
ttl: 999, | ||
}, | ||
}); | ||
@@ -40,13 +40,13 @@ | ||
settings: { | ||
foo: "bar" | ||
foo: "bar", | ||
}, | ||
type: "my.container" | ||
type: "my.container", | ||
}, | ||
{ | ||
settings: { | ||
non: "valid block as missing the type attribute" | ||
} | ||
non: "valid block as missing the type attribute", | ||
}, | ||
}, | ||
1 | ||
] | ||
1, | ||
], | ||
}); | ||
@@ -73,3 +73,3 @@ | ||
settings: {}, | ||
type: "type-parent-1" | ||
type: "type-parent-1", | ||
}, | ||
@@ -80,4 +80,4 @@ { | ||
settings: {}, | ||
type: "type-parent-2" | ||
} | ||
type: "type-parent-2", | ||
}, | ||
]; | ||
@@ -89,3 +89,3 @@ | ||
page.head.htmlAttributes = { | ||
foo: "bar" | ||
foo: "bar", | ||
}; | ||
@@ -102,3 +102,3 @@ page.head.meta = [{ property: "value" }]; | ||
settings: {}, | ||
type: "type-child-1" | ||
type: "type-child-1", | ||
}, | ||
@@ -109,4 +109,4 @@ { | ||
settings: {}, | ||
type: "type-child-2" | ||
} | ||
type: "type-child-2", | ||
}, | ||
]; | ||
@@ -113,0 +113,0 @@ |
@@ -20,3 +20,3 @@ import { IncomingMessage, ServerResponse } from "http"; | ||
const cache: Cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -38,5 +38,5 @@ | ||
title: "-", | ||
link: "", | ||
links: [], | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -60,4 +60,4 @@ | ||
if ("link" in data) { | ||
head.link = data.link; | ||
if ("links" in data) { | ||
head.links = data.links; | ||
} | ||
@@ -83,3 +83,3 @@ | ||
data.map(b => { | ||
data.map((b) => { | ||
const block = normalizeBlockDefinition(b); | ||
@@ -111,3 +111,3 @@ | ||
"settings" in data && isObject(data.settings) ? data.settings : {}, | ||
type: data.type | ||
type: data.type, | ||
}; | ||
@@ -170,3 +170,3 @@ } | ||
res: isServerSide ? res : null, | ||
settings: {} | ||
settings: {}, | ||
}; | ||
@@ -181,3 +181,3 @@ | ||
pages.forEach(p => { | ||
pages.forEach((p) => { | ||
page.cache.ttl = p.cache.ttl; | ||
@@ -194,3 +194,3 @@ page.head = { | ||
title: p.head.title.length > 0 ? p.head.title : page.head.title, | ||
link: p.head.link.length > 0 ? p.head.link : page.head.link, | ||
links: [...page.head.links, ...p.head.links], | ||
htmlAttributes: | ||
@@ -201,3 +201,3 @@ Object.keys(p.head.htmlAttributes).length > 0 | ||
// for meta, we append from parent | ||
meta: [...page.head.meta, ...p.head.meta] | ||
meta: [...page.head.meta, ...p.head.meta], | ||
}; | ||
@@ -204,0 +204,0 @@ page.path = p.path; |
@@ -26,3 +26,3 @@ import { IncomingMessage, ServerResponse } from "http"; | ||
title: string; | ||
link: string; | ||
links: Settings[]; | ||
htmlAttributes: Settings; | ||
@@ -38,3 +38,3 @@ meta: Settings[]; | ||
public cache: Cache = { | ||
ttl: 0 | ||
ttl: 0, | ||
}; | ||
@@ -45,5 +45,5 @@ public head: Head = { | ||
title: "-", | ||
link: "", | ||
links: [], | ||
htmlAttributes: {}, | ||
meta: [] | ||
meta: [], | ||
}; | ||
@@ -50,0 +50,0 @@ public blocks: BlockDefinition[] = []; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126313
40
2491