@curveball/kernel
Advanced tools
Comparing version 0.20.0 to 0.20.1
Changelog | ||
========= | ||
0.20.1 (2022-11-01) | ||
------------------- | ||
* Added `setGlobalOrigin` and `getGlobalOrigin` functions, this lets users | ||
get direct access to the 'origin detection algoritm' and avoid reimplementing | ||
it. | ||
0.20.0 (2022-09-03) | ||
@@ -5,0 +13,0 @@ ------------------- |
@@ -11,2 +11,3 @@ "use strict"; | ||
const fetch_util_1 = require("./fetch-util"); | ||
const global_origin_1 = require("./global-origin"); | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
@@ -119,10 +120,3 @@ const pkg = require('../package.json'); | ||
} | ||
if (process.env.CURVEBALL_ORIGIN) { | ||
return process.env.CURVEBALL_ORIGIN; | ||
} | ||
if (process.env.PUBLIC_URI) { | ||
return new URL(process.env.PUBLIC_URI).origin; | ||
} | ||
const port = process.env.PORT ? +process.env.PORT : 80; | ||
return 'http://localhost' + (port !== 80 ? ':' + port : ''); | ||
return (0, global_origin_1.getGlobalOrigin)(); | ||
} | ||
@@ -129,0 +123,0 @@ set origin(baseUrl) { |
@@ -9,2 +9,3 @@ export { conditionalCheck } from './conditional'; | ||
export { Headers, HeadersInterface, HeadersObject } from './headers'; | ||
export { getGlobalOrigin, setGlobalOrigin, } from './global-origin'; | ||
export * as headerHelpers from './header-helpers'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.headerHelpers = exports.Headers = exports.Context = exports.middlewareCall = exports.invokeMiddlewares = exports.Application = exports.MemoryResponse = exports.MemoryRequest = exports.Response = exports.Request = exports.conditionalCheck = void 0; | ||
exports.headerHelpers = exports.setGlobalOrigin = exports.getGlobalOrigin = exports.Headers = exports.Context = exports.middlewareCall = exports.invokeMiddlewares = exports.Application = exports.MemoryResponse = exports.MemoryRequest = exports.Response = exports.Request = exports.conditionalCheck = void 0; | ||
var conditional_1 = require("./conditional"); | ||
@@ -22,3 +22,6 @@ Object.defineProperty(exports, "conditionalCheck", { enumerable: true, get: function () { return conditional_1.conditionalCheck; } }); | ||
Object.defineProperty(exports, "Headers", { enumerable: true, get: function () { return headers_1.Headers; } }); | ||
var global_origin_1 = require("./global-origin"); | ||
Object.defineProperty(exports, "getGlobalOrigin", { enumerable: true, get: function () { return global_origin_1.getGlobalOrigin; } }); | ||
Object.defineProperty(exports, "setGlobalOrigin", { enumerable: true, get: function () { return global_origin_1.setGlobalOrigin; } }); | ||
exports.headerHelpers = require("./header-helpers"); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@curveball/kernel", | ||
"version": "0.20.0", | ||
"version": "0.20.1", | ||
"description": "Curveball is a framework writting in Typescript for Node.js", | ||
@@ -41,3 +41,3 @@ "main": "dist/index.js", | ||
"@types/co-body": "^6.1.0", | ||
"@types/mocha": "^9.0.0", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node-fetch": "^2.5.8", | ||
@@ -52,3 +52,4 @@ "@typescript-eslint/eslint-plugin": "^5.9.0", | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.1.5" | ||
"typescript": "^4.1.5", | ||
"webpack-cli": "^4.10.0" | ||
}, | ||
@@ -55,0 +56,0 @@ "types": "dist/", |
@@ -16,5 +16,5 @@ import { EventEmitter } from 'events'; | ||
} from './fetch-util'; | ||
import { getGlobalOrigin } from './global-origin'; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
@@ -175,13 +175,4 @@ const pkg = require('../package.json'); | ||
if (process.env.CURVEBALL_ORIGIN) { | ||
return process.env.CURVEBALL_ORIGIN; | ||
} | ||
return getGlobalOrigin(); | ||
if (process.env.PUBLIC_URI) { | ||
return new URL(process.env.PUBLIC_URI).origin; | ||
} | ||
const port = process.env.PORT ? +process.env.PORT : 80; | ||
return 'http://localhost' + (port!==80?':' + port : ''); | ||
} | ||
@@ -188,0 +179,0 @@ |
@@ -26,2 +26,7 @@ export { conditionalCheck } from './conditional'; | ||
export { | ||
getGlobalOrigin, | ||
setGlobalOrigin, | ||
} from './global-origin'; | ||
export * as headerHelpers from './header-helpers'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
126666
57
2881
0
15