svelte-adapter-uws 0.2.4 → 0.2.6
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/index.js +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -119,13 +119,14 @@ export default function (opts = {}) {
|
|
|
119
119
|
const isPublic = args.path.includes('/public');
|
|
120
120
|
const isStatic = args.path.includes('/static');
|
|
121
121
|
const entries = Object.entries(allEnv).filter(([k]) =>
|
|
122
|
-
isPublic ? k.startsWith(publicPrefix) : !k.startsWith(publicPrefix)
|
|
122
|
+
(isPublic ? k.startsWith(publicPrefix) : !k.startsWith(publicPrefix))
|
|
123
|
+
&& /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(k)
|
|
123
124
|
);
|
|
124
125
|
if (isStatic) {
|
|
125
126
|
return { contents: entries.map(([k, v]) => `export const ${k} = ${JSON.stringify(v)};`).join('\n') || 'export {};' };
|
|
126
127
|
}
|
|
127
|
-
// dynamic:
|
|
128
|
-
return { contents:
|
|
128
|
+
// dynamic: re-export process.env directly
|
|
129
|
+
return { contents: 'export const env = process.env;' };
|
|
129
130
|
});
|
|
130
131
|
}
|
|
131
132
|
}]
|
package/package.json
CHANGED