init commit
This commit is contained in:
14
js/absolute-path.js
Normal file
14
js/absolute-path.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* getAbsoluteFSPath
|
||||
* @return {string} When run in NodeJS env, returns the absolute path to the current directory
|
||||
* When run outside of NodeJS, will return an error message
|
||||
*/
|
||||
const getAbsoluteFSPath = function () {
|
||||
// detect whether we are running in a browser or nodejs
|
||||
if (typeof module !== "undefined" && module.exports) {
|
||||
return require("path").resolve(__dirname)
|
||||
}
|
||||
throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
|
||||
}
|
||||
|
||||
module.exports = getAbsoluteFSPath
|
||||
17
js/index.js
Normal file
17
js/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
try {
|
||||
module.exports.SwaggerUIBundle = require("./swagger-ui-bundle.js")
|
||||
module.exports.SwaggerUIStandalonePreset = require("./swagger-ui-standalone-preset.js")
|
||||
} catch(e) {
|
||||
// swallow the error if there's a problem loading the assets.
|
||||
// allows this module to support providing the assets for browserish contexts,
|
||||
// without exploding in a Node context.
|
||||
//
|
||||
// see https://github.com/swagger-api/swagger-ui/issues/3291#issuecomment-311195388
|
||||
// for more information.
|
||||
}
|
||||
|
||||
// `absolutePath` and `getAbsoluteFSPath` are both here because at one point,
|
||||
// we documented having one and actually implemented the other.
|
||||
// They were both retained so we don't break anyone's code.
|
||||
module.exports.absolutePath = require("./absolute-path.js")
|
||||
module.exports.getAbsoluteFSPath = require("./absolute-path.js")
|
||||
134
js/swagger-ui-bundle.js
Normal file
134
js/swagger-ui-bundle.js
Normal file
File diff suppressed because one or more lines are too long
1
js/swagger-ui-bundle.js.map
Normal file
1
js/swagger-ui-bundle.js.map
Normal file
File diff suppressed because one or more lines are too long
22
js/swagger-ui-standalone-preset.js
Normal file
22
js/swagger-ui-standalone-preset.js
Normal file
File diff suppressed because one or more lines are too long
1
js/swagger-ui-standalone-preset.js.map
Normal file
1
js/swagger-ui-standalone-preset.js.map
Normal file
File diff suppressed because one or more lines are too long
9
js/swagger-ui.js
Normal file
9
js/swagger-ui.js
Normal file
File diff suppressed because one or more lines are too long
1
js/swagger-ui.js.map
Normal file
1
js/swagger-ui.js.map
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user