@erickxavier/no-js 1.8.2 → 1.9.1
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/README.md +2 -2
- package/dist/cjs/no.js +9 -6
- package/dist/cjs/no.js.map +3 -3
- package/dist/esm/no.js +9 -6
- package/dist/esm/no.js.map +3 -3
- package/dist/iife/no.js +9 -6
- package/dist/iife/no.js.map +3 -3
- package/package.json +2 -3
- package/src/directives/loops.js +18 -0
- package/src/evaluate.js +1039 -93
- package/src/globals.js +0 -1
- package/src/i18n.js +4 -4
- package/src/index.js +5 -1
package/src/globals.js
CHANGED
package/src/i18n.js
CHANGED
|
@@ -21,7 +21,7 @@ export function _notifyI18n() {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// ─── Deep merge (recursive, returns new object) ─────────────────────
|
|
24
|
-
|
|
24
|
+
function _deepMerge(target, source) {
|
|
25
25
|
const out = { ...target };
|
|
26
26
|
for (const key of Object.keys(source)) {
|
|
27
27
|
if (
|
|
@@ -37,11 +37,11 @@ export function _deepMerge(target, source) {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// ─── Locale file cache: Map<string, object> key = "en" or "en:dashboard"
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const _i18nCache = new Map();
|
|
41
|
+
const _loadedNs = new Set();
|
|
42
42
|
|
|
43
43
|
// ─── Fetch a single JSON file and merge into _i18n.locales[locale] ──
|
|
44
|
-
|
|
44
|
+
async function _loadLocale(locale, ns) {
|
|
45
45
|
const cacheKey = ns ? `${locale}:${ns}` : locale;
|
|
46
46
|
if (_config.i18n.cache && _i18nCache.has(cacheKey)) return;
|
|
47
47
|
|
package/src/index.js
CHANGED
|
@@ -83,6 +83,10 @@ const NoJS = {
|
|
|
83
83
|
const prevTemplates = { ..._config.templates };
|
|
84
84
|
const prevRouter = { ..._config.router };
|
|
85
85
|
const prevI18n = { ..._config.i18n };
|
|
86
|
+
if ("csp" in opts) {
|
|
87
|
+
_warn("csp config option removed — No.JS is now CSP-safe by default");
|
|
88
|
+
delete opts.csp;
|
|
89
|
+
}
|
|
86
90
|
Object.assign(_config, opts);
|
|
87
91
|
if (opts.headers)
|
|
88
92
|
_config.headers = { ...prevHeaders, ...opts.headers };
|
|
@@ -240,7 +244,7 @@ const NoJS = {
|
|
|
240
244
|
resolve,
|
|
241
245
|
|
|
242
246
|
// Version
|
|
243
|
-
version: "1.
|
|
247
|
+
version: "1.9.1",
|
|
244
248
|
};
|
|
245
249
|
|
|
246
250
|
export default NoJS;
|