Adding hotfixes for packages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
2
jsx-html/nodejs/node/utils/htmlEncode.d.ts
vendored
Normal file
2
jsx-html/nodejs/node/utils/htmlEncode.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function doubleQuoteEncode(text: string): string;
|
||||
export declare function htmlEncode(text: string): string;
|
12
jsx-html/nodejs/node/utils/htmlEncode.js
Normal file
12
jsx-html/nodejs/node/utils/htmlEncode.js
Normal file
@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.htmlEncode = exports.doubleQuoteEncode = void 0;
|
||||
function doubleQuoteEncode(text) {
|
||||
return text.replace(/"/g, '"');
|
||||
}
|
||||
exports.doubleQuoteEncode = doubleQuoteEncode;
|
||||
function htmlEncode(text) {
|
||||
return doubleQuoteEncode(text.replace(/&/g, '&').replace(/\//g, '/').replace(/</g, '<').replace(/>/g, '>').replace(/'/g, '''));
|
||||
}
|
||||
exports.htmlEncode = htmlEncode;
|
||||
//# sourceMappingURL=htmlEncode.js.map
|
1
jsx-html/nodejs/node/utils/htmlEncode.js.map
Normal file
1
jsx-html/nodejs/node/utils/htmlEncode.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"htmlEncode.js","sourceRoot":"","sources":["../../../tmp/node/utils/htmlEncode.ts"],"names":[],"mappings":";;;AAAA,SAAgB,iBAAiB,CAAC,IAAY;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACtC,CAAC;AAFD,8CAEC;AACD,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AACpJ,CAAC;AAFD,gCAEC"}
|
2
jsx-html/nodejs/node/utils/normalizeChildren.d.ts
vendored
Normal file
2
jsx-html/nodejs/node/utils/normalizeChildren.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import { NullableChildType, ChildNodeType } from "../../types";
|
||||
export declare function normalizeChildren(children: NullableChildType[]): ChildNodeType[];
|
27
jsx-html/nodejs/node/utils/normalizeChildren.js
Normal file
27
jsx-html/nodejs/node/utils/normalizeChildren.js
Normal file
@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.normalizeChildren = void 0;
|
||||
const TextNode_1 = require("../TextNode");
|
||||
const constants_1 = require("../../constants");
|
||||
function normalizeChildren(children) {
|
||||
const result = [];
|
||||
for (const child of children) {
|
||||
if (child && typeof child !== 'boolean') {
|
||||
if (typeof child === 'string' || typeof child === 'number') {
|
||||
result.push(new TextNode_1.TextNode(`${child}`));
|
||||
}
|
||||
else if (Array.isArray(child)) {
|
||||
normalizeChildren(child).forEach(result.push);
|
||||
}
|
||||
else if (child.type === constants_1.NODE_TYPE.ELEMENT || child.type === constants_1.NODE_TYPE.TEXT || child.type === constants_1.NODE_TYPE.COMPONENT) {
|
||||
result.push(child);
|
||||
}
|
||||
else {
|
||||
throw new TypeError(`Unrecognized node type: ${typeof child}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.normalizeChildren = normalizeChildren;
|
||||
//# sourceMappingURL=normalizeChildren.js.map
|
1
jsx-html/nodejs/node/utils/normalizeChildren.js.map
Normal file
1
jsx-html/nodejs/node/utils/normalizeChildren.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"normalizeChildren.js","sourceRoot":"","sources":["../../../tmp/node/utils/normalizeChildren.ts"],"names":[],"mappings":";;;AACA,0CAAuC;AACvC,+CAA4C;AAC5C,SAAgB,iBAAiB,CAAC,QAA6B;IAC7D,MAAM,MAAM,GAAU,EAAE,CAAC;IAEzB,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE;QAC5B,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;YACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC1D,MAAM,CAAC,IAAI,CAAC,IAAI,mBAAQ,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;aACvC;iBAAM,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAC/B,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC/C;iBAAM,IAAI,KAAK,CAAC,IAAI,KAAK,qBAAS,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,qBAAS,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,KAAK,qBAAS,CAAC,SAAS,EAAE;gBAClH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACpB;iBAAM;gBACL,MAAM,IAAI,SAAS,CAAC,2BAA2B,OAAO,KAAK,EAAE,CAAC,CAAC;aAChE;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAlBD,8CAkBC"}
|
Reference in New Issue
Block a user