@lark-apaas/fullstack-nestjs-core 1.1.12-alpha.4 → 1.1.12-alpha.5
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/dist/index.cjs +13 -13
- package/dist/index.js +13 -13
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -172,38 +172,38 @@ var import_common3 = require("@nestjs/common");
|
|
|
172
172
|
var import_nestjs_common = require("@lark-apaas/nestjs-common");
|
|
173
173
|
|
|
174
174
|
// src/utils/safe-stringify.ts
|
|
175
|
-
function
|
|
175
|
+
function normalEscape(s) {
|
|
176
176
|
return s.replace(/[<>&='\u2028\u2029]/g, function(c) {
|
|
177
177
|
switch (c.charCodeAt(0)) {
|
|
178
178
|
case 60:
|
|
179
|
-
return "
|
|
179
|
+
return "<";
|
|
180
180
|
// <
|
|
181
181
|
case 62:
|
|
182
|
-
return "
|
|
182
|
+
return ">";
|
|
183
183
|
// >
|
|
184
184
|
case 38:
|
|
185
|
-
return "
|
|
185
|
+
return "&";
|
|
186
186
|
// &
|
|
187
187
|
case 61:
|
|
188
|
-
return "
|
|
188
|
+
return "=";
|
|
189
189
|
// =
|
|
190
190
|
case 39:
|
|
191
|
-
return "
|
|
191
|
+
return "'";
|
|
192
192
|
// '
|
|
193
193
|
// 正常来说用户无法输入这几个字符, 现代浏览器也修复了这个问题
|
|
194
194
|
// https://zhuanlan.zhihu.com/p/29958439
|
|
195
195
|
case 8232:
|
|
196
|
-
return "
|
|
196
|
+
return "\u2028";
|
|
197
197
|
// 行分隔符
|
|
198
198
|
case 8233:
|
|
199
|
-
return "
|
|
199
|
+
return "\u2029";
|
|
200
200
|
// 段落分隔符
|
|
201
201
|
default:
|
|
202
202
|
return c;
|
|
203
203
|
}
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
__name(
|
|
206
|
+
__name(normalEscape, "normalEscape");
|
|
207
207
|
|
|
208
208
|
// src/middlewares/view-context/index.ts
|
|
209
209
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
@@ -261,9 +261,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
261
261
|
csrfToken: csrfToken ?? "",
|
|
262
262
|
userId: userId ?? "",
|
|
263
263
|
appId: appId ?? "",
|
|
264
|
-
appName:
|
|
264
|
+
appName: normalEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
265
265
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
266
|
-
appDescription:
|
|
266
|
+
appDescription: normalEscape(appInfo?.app_description ?? ""),
|
|
267
267
|
tenantId
|
|
268
268
|
};
|
|
269
269
|
res.locals = {
|
|
@@ -272,9 +272,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
272
272
|
userId: userId ?? "",
|
|
273
273
|
tenantId: tenantId ?? "",
|
|
274
274
|
appId: appId ?? "",
|
|
275
|
-
appName:
|
|
275
|
+
appName: normalEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
276
276
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
277
|
-
appDescription:
|
|
277
|
+
appDescription: normalEscape(appInfo?.app_description ?? "")
|
|
278
278
|
};
|
|
279
279
|
next();
|
|
280
280
|
}
|
package/dist/index.js
CHANGED
|
@@ -130,38 +130,38 @@ import { Inject, Injectable as Injectable3, Logger } from "@nestjs/common";
|
|
|
130
130
|
import { PLATFORM_HTTP_CLIENT } from "@lark-apaas/nestjs-common";
|
|
131
131
|
|
|
132
132
|
// src/utils/safe-stringify.ts
|
|
133
|
-
function
|
|
133
|
+
function normalEscape(s) {
|
|
134
134
|
return s.replace(/[<>&='\u2028\u2029]/g, function(c) {
|
|
135
135
|
switch (c.charCodeAt(0)) {
|
|
136
136
|
case 60:
|
|
137
|
-
return "
|
|
137
|
+
return "<";
|
|
138
138
|
// <
|
|
139
139
|
case 62:
|
|
140
|
-
return "
|
|
140
|
+
return ">";
|
|
141
141
|
// >
|
|
142
142
|
case 38:
|
|
143
|
-
return "
|
|
143
|
+
return "&";
|
|
144
144
|
// &
|
|
145
145
|
case 61:
|
|
146
|
-
return "
|
|
146
|
+
return "=";
|
|
147
147
|
// =
|
|
148
148
|
case 39:
|
|
149
|
-
return "
|
|
149
|
+
return "'";
|
|
150
150
|
// '
|
|
151
151
|
// 正常来说用户无法输入这几个字符, 现代浏览器也修复了这个问题
|
|
152
152
|
// https://zhuanlan.zhihu.com/p/29958439
|
|
153
153
|
case 8232:
|
|
154
|
-
return "
|
|
154
|
+
return "\u2028";
|
|
155
155
|
// 行分隔符
|
|
156
156
|
case 8233:
|
|
157
|
-
return "
|
|
157
|
+
return "\u2029";
|
|
158
158
|
// 段落分隔符
|
|
159
159
|
default:
|
|
160
160
|
return c;
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
__name(
|
|
164
|
+
__name(normalEscape, "normalEscape");
|
|
165
165
|
|
|
166
166
|
// src/middlewares/view-context/index.ts
|
|
167
167
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
@@ -219,9 +219,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
219
219
|
csrfToken: csrfToken ?? "",
|
|
220
220
|
userId: userId ?? "",
|
|
221
221
|
appId: appId ?? "",
|
|
222
|
-
appName:
|
|
222
|
+
appName: normalEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
223
223
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
224
|
-
appDescription:
|
|
224
|
+
appDescription: normalEscape(appInfo?.app_description ?? ""),
|
|
225
225
|
tenantId
|
|
226
226
|
};
|
|
227
227
|
res.locals = {
|
|
@@ -230,9 +230,9 @@ var ViewContextMiddleware = class _ViewContextMiddleware {
|
|
|
230
230
|
userId: userId ?? "",
|
|
231
231
|
tenantId: tenantId ?? "",
|
|
232
232
|
appId: appId ?? "",
|
|
233
|
-
appName:
|
|
233
|
+
appName: normalEscape(appInfo?.app_name ?? "\u5999\u642D\u5E94\u7528"),
|
|
234
234
|
appAvatar: appInfo?.app_avatar ?? "",
|
|
235
|
-
appDescription:
|
|
235
|
+
appDescription: normalEscape(appInfo?.app_description ?? "")
|
|
236
236
|
};
|
|
237
237
|
next();
|
|
238
238
|
}
|