functionalscript 0.12.2 → 0.12.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/html/module.f.d.ts +2 -0
- package/html/module.f.js +4 -0
- package/package.json +1 -1
package/html/module.f.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type List } from '../types/list/module.f.ts';
|
|
2
|
+
import { type Vec } from '../types/bit_vec/module.f.ts';
|
|
2
3
|
type Tag = string;
|
|
3
4
|
type Element1 = readonly [Tag, ...Node[]];
|
|
4
5
|
type Element2 = readonly [Tag, Attributes, ...Node[]];
|
|
@@ -28,4 +29,5 @@ export declare const html: (_: Element) => List<string>;
|
|
|
28
29
|
* Renders an HTML element tree to a final string.
|
|
29
30
|
*/
|
|
30
31
|
export declare const htmlToString: (_: Element) => string;
|
|
32
|
+
export declare const htmlUtf8: (...head: readonly Node[]) => (...body: readonly Node[]) => Vec;
|
|
31
33
|
export {};
|
package/html/module.f.js
CHANGED
|
@@ -3,6 +3,8 @@ import { concat, concat as stringConcat } from "../types/string/module.f.js";
|
|
|
3
3
|
import { compose } from "../types/function/module.f.js";
|
|
4
4
|
import { stringToList } from "../text/utf16/module.f.js";
|
|
5
5
|
import { includes } from "../types/array/module.f.js";
|
|
6
|
+
import {} from "../types/bit_vec/module.f.js";
|
|
7
|
+
import { utf8 } from "../text/module.f.js";
|
|
6
8
|
const { fromCharCode } = String;
|
|
7
9
|
const { entries } = Object;
|
|
8
10
|
/**
|
|
@@ -87,3 +89,5 @@ export const html = compose(element)(listConcat(['<!DOCTYPE html>']));
|
|
|
87
89
|
* Renders an HTML element tree to a final string.
|
|
88
90
|
*/
|
|
89
91
|
export const htmlToString = compose(html)(stringConcat);
|
|
92
|
+
const metaUtf8 = ['meta', { charset: 'UTF-8' }];
|
|
93
|
+
export const htmlUtf8 = (...head) => (...body) => utf8(htmlToString(['html', ['head', metaUtf8, ...head], ['body', ...body]]));
|