@almaclaine/env
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@almaclaine/env", | ||
"version": "0.0.1", | ||
"type": "commonjs", | ||
"version": "0.0.2", | ||
"type": "module", | ||
"exports": { | ||
"types": "./src/index.d.ts", | ||
"default": "./src/index.js" | ||
}, | ||
"peerDependencies": { | ||
"@almaclaine/option": "0.0.1", | ||
"@almaclaine/option": "0.0.12", | ||
"@swc/helpers": "0.4.14" | ||
}, | ||
"main": "./src/index.js", | ||
"exports": { | ||
".": { | ||
"require": "./src/index.js" | ||
} | ||
} | ||
"main": "./src/index.js" | ||
} |
@@ -1,14 +0,3 @@ | ||
"use strict"; | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
setEnv: ()=>_env.setEnv, | ||
getEnv: ()=>_env.getEnv | ||
}); | ||
const _env = require("./lib/env"); | ||
export { setEnv, getEnv } from './lib/env'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,17 +0,6 @@ | ||
"use strict"; | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
getEnv: ()=>getEnv, | ||
setEnv: ()=>setEnv | ||
}); | ||
const _option = require("@almaclaine/option"); | ||
import { none, some } from '@almaclaine/option'; | ||
const getEnv = (envVar)=>{ | ||
// if no process.env return none, could be in browser | ||
if (!(process == null ? void 0 : process.env)) { | ||
return (0, _option.none)(); | ||
return none(); | ||
} | ||
@@ -21,5 +10,5 @@ const val = process.env[envVar]; | ||
if (!val) { | ||
return (0, _option.none)(); | ||
return none(); | ||
} | ||
return (0, _option.some)(val); | ||
return some(val); | ||
}; | ||
@@ -33,3 +22,4 @@ const setEnv = (envVar, value)=>{ | ||
}; | ||
export { getEnv, setEnv }; | ||
//# sourceMappingURL=env.js.map |
/// <reference types="vitest" /> | ||
"use strict"; | ||
Object.defineProperty(exports, "default", { | ||
enumerable: true, | ||
get: ()=>_default | ||
}); | ||
const _vite = require("vite"); | ||
const _viteTsconfigPaths = require("vite-tsconfig-paths"); | ||
const _default = (0, _vite.defineConfig)({ | ||
import { defineConfig } from 'vite'; | ||
import viteTsConfigPaths from 'vite-tsconfig-paths'; | ||
export default defineConfig({ | ||
cacheDir: '../../node_modules/.vite/env', | ||
plugins: [ | ||
(0, _viteTsconfigPaths.default)({ | ||
viteTsConfigPaths({ | ||
root: '../../' | ||
@@ -14,0 +9,0 @@ }) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Yes
4902
56