diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-10-03 18:04:19 +0200 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-10-03 18:04:19 +0200 |
| commit | 3352727aa638fcfcc6461d2aaded8ef9603acc0d (patch) | |
| tree | 880b381af0c1e717803c6fa233cc8792193d84dd /apps/kit/src/actions/pwKey.ts | |
| parent | c5af87a9312affc84ee9dbc654f8a4942f0d1e1c (diff) | |
| download | greatoffice-3352727aa638fcfcc6461d2aaded8ef9603acc0d.tar.xz greatoffice-3352727aa638fcfcc6461d2aaded8ef9603acc0d.zip | |
feat: Initial setup facilitating testing
Diffstat (limited to 'apps/kit/src/actions/pwKey.ts')
| -rw-r--r-- | apps/kit/src/actions/pwKey.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/kit/src/actions/pwKey.ts b/apps/kit/src/actions/pwKey.ts new file mode 100644 index 0000000..a2f22e7 --- /dev/null +++ b/apps/kit/src/actions/pwKey.ts @@ -0,0 +1,10 @@ +import { is_development, is_testing } from "$lib/configuration"; + +export default function pwKey(node: HTMLElement, value: string | undefined) { + if (!value) return; + if (!is_testing()) { + if (is_development()) console.warn("VITE_TESTING is false, so not setting pw-key attributes"); + return; + } + node.setAttribute("pw-key", value); +}
\ No newline at end of file |
