@lopatnov/as-umd-module
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -341,3 +341,9 @@ var types = {}, typesToString = types.toString, buildInList = [ | ||
var mv = values_1[_a]; | ||
moduleBody += "exports." + mv.name + " = " + javaScriptToString(mv.exports) + ";\n"; | ||
var exps = mv.exports; | ||
if (exps !== undefined) { | ||
moduleBody += "exports." + mv.name + " = " + javaScriptToString(exps, mv.options) + ";\n"; | ||
} | ||
else { | ||
moduleBody += "var " + mv.name + " = " + javaScriptToString(mv.declare, mv.options) + ";\n"; | ||
} | ||
} | ||
@@ -344,0 +350,0 @@ return "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global));\n }(this, function (exports) { 'use strict';\n " + moduleBody + "\n Object.defineProperty(exports, '__esModule', { value: true });\n }));"; |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global = global || self, global.asUmdModule = factory()); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.asUmdModule = factory()); | ||
}(this, (function () { 'use strict'; | ||
@@ -347,3 +347,9 @@ | ||
var mv = values_1[_a]; | ||
moduleBody += "exports." + mv.name + " = " + javaScriptToString(mv.exports) + ";\n"; | ||
var exps = mv.exports; | ||
if (exps !== undefined) { | ||
moduleBody += "exports." + mv.name + " = " + javaScriptToString(exps, mv.options) + ";\n"; | ||
} | ||
else { | ||
moduleBody += "var " + mv.name + " = " + javaScriptToString(mv.declare, mv.options) + ";\n"; | ||
} | ||
} | ||
@@ -350,0 +356,0 @@ return "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global));\n }(this, function (exports) { 'use strict';\n " + moduleBody + "\n Object.defineProperty(exports, '__esModule', { value: true });\n }));"; |
@@ -15,3 +15,9 @@ "use strict"; | ||
var mv = values_1[_a]; | ||
moduleBody += "exports." + mv.name + " = " + javascripttostring_1.default(mv.exports) + ";\n"; | ||
var exps = mv.exports; | ||
if (exps !== undefined) { | ||
moduleBody += "exports." + mv.name + " = " + javascripttostring_1.default(exps, mv.options) + ";\n"; | ||
} | ||
else { | ||
moduleBody += "var " + mv.name + " = " + javascripttostring_1.default(mv.declare, mv.options) + ";\n"; | ||
} | ||
} | ||
@@ -18,0 +24,0 @@ return "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global));\n }(this, function (exports) { 'use strict';\n " + moduleBody + "\n Object.defineProperty(exports, '__esModule', { value: true });\n }));"; |
@@ -0,6 +1,13 @@ | ||
import { IJ2SOptions } from '@lopatnov/javascripttostring'; | ||
export interface IModuleValue { | ||
name: string; | ||
exports: any; | ||
options?: IJ2SOptions; | ||
} | ||
declare function asUmdModule(...values: IModuleValue[]): string; | ||
export interface IInnerValue { | ||
name: string; | ||
declare: any; | ||
options?: IJ2SOptions; | ||
} | ||
declare function asUmdModule(...values: Array<IInnerValue | IModuleValue>): string; | ||
export default asUmdModule; |
{ | ||
"name": "@lopatnov/as-umd-module", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"license": "Apache-2.0", | ||
@@ -37,15 +37,15 @@ "author": "lopatnov", | ||
"devDependencies": { | ||
"@types/jest": "^24.0.24", | ||
"@types/node": "^12.12.21", | ||
"jest": "^24.9.0", | ||
"jest-config": "^24.9.0", | ||
"rollup": "^1.27.14", | ||
"@types/jest": "^26.0.9", | ||
"@types/node": "^14.0.27", | ||
"jest": "^26.2.2", | ||
"jest-config": "^26.2.2", | ||
"rollup": "^2.23.1", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"rollup-plugin-typescript2": "^0.24.3", | ||
"ts-jest": "^24.2.0", | ||
"typedoc": "^0.15.5", | ||
"typescript": "^3.7.4" | ||
"rollup-plugin-sourcemaps": "^0.6.2", | ||
"rollup-plugin-typescript2": "^0.27.2", | ||
"ts-jest": "^26.1.4", | ||
"typedoc": "^0.17.8", | ||
"typescript": "^3.9.7" | ||
}, | ||
@@ -52,0 +52,0 @@ "publishConfig": { |
@@ -12,3 +12,3 @@ # @lopatnov/as-umd-module | ||
[![https://nodei.co/npm/%40lopatnov%2Fas-umd-module.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/%40lopatnov%2Fas-umd-module.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/@lopatnov/as-umd-module) | ||
[![https://nodei.co/npm/@lopatnov/as-umd-module.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/@lopatnov/as-umd-module.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/@lopatnov/as-umd-module) | ||
@@ -109,8 +109,4 @@ ```shell | ||
Test it with a runkit: [https://npm.runkit.com/as-umd-module](https://npm.runkit.com/as-umd-module) | ||
Test it with a runkit: [https://npm.runkit.com/%40lopatnov%2Fas-umd-module](https://npm.runkit.com/%40lopatnov%2Fas-umd-module) | ||
## TBD | ||
— [Resolve common references](https://github.com/lopatnov/as-umd-module/issues/1) | ||
## Rights and Agreements | ||
@@ -120,2 +116,2 @@ | ||
Copyright 2019 Oleksandr Lopatnov | ||
Copyright 2019-2020 Oleksandr Lopatnov |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91266
747
115