├── .gitmodules ├── assets ├── Doug.png ├── Lenny.jpg └── Halia Cover.png ├── test ├── FishFeeder.js ├── HelloBox.js └── elvan.test.ts ├── dist ├── test │ ├── elvan.test.d.ts │ ├── elvan.test.js.map │ └── elvan.test.js └── src │ ├── index.d.ts │ ├── index.js.map │ ├── index.js │ ├── elvan.d.ts │ ├── elvan.js.map │ └── elvan.js ├── src ├── index.ts └── elvan.ts ├── jest.config.js ├── tsconfig.json ├── .gitignore ├── .npmignore ├── package.json ├── LICENSE ├── tslint.json ├── README.md └── yarn.lock /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/Doug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zuluana/Elvan/HEAD/assets/Doug.png -------------------------------------------------------------------------------- /assets/Lenny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zuluana/Elvan/HEAD/assets/Lenny.jpg -------------------------------------------------------------------------------- /assets/Halia Cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zuluana/Elvan/HEAD/assets/Halia Cover.png -------------------------------------------------------------------------------- /test/FishFeeder.js: -------------------------------------------------------------------------------- 1 | exports = ({ food }) => { 2 | return { 3 | feedFish: () => `You fed the fish ${ food }!` 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /dist/test/elvan.test.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - January 2021) 3 | */ 4 | export {}; 5 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - January 2021) 3 | */ 4 | 5 | export * from "./elvan"; 6 | -------------------------------------------------------------------------------- /dist/src/index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - January 2021) 3 | */ 4 | export * from "./elvan"; 5 | -------------------------------------------------------------------------------- /dist/src/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAEH,6BAAwB"} -------------------------------------------------------------------------------- /dist/src/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - January 2021) 4 | */ 5 | function __export(m) { 6 | for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; 7 | } 8 | Object.defineProperty(exports, "__esModule", { value: true }); 9 | __export(require("./elvan")); 10 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | globals: { 3 | 'ts-jest': { 4 | tsConfigFile: 'tsconfig.json' 5 | } 6 | }, 7 | moduleFileExtensions: [ 8 | 'ts', 9 | 'js' 10 | ], 11 | transform: { 12 | '^.+\\.(ts|tsx)$': './node_modules/ts-jest/preprocessor.js' 13 | }, 14 | testMatch: [ 15 | '**/test/**/*.test.(ts|js)' 16 | ], 17 | testEnvironment: 'node' 18 | }; -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "esModuleInterop": true, 5 | "target": "es5", 6 | "noImplicitAny": true, 7 | "moduleResolution": "node", 8 | "sourceMap": true, 9 | "outDir": "dist", 10 | "baseUrl": ".", 11 | "jsx": "react" 12 | }, 13 | "include": [ 14 | "src/**/*", 15 | "test/**/*" 16 | ] 17 | } -------------------------------------------------------------------------------- /test/HelloBox.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // hello-box.tsx 3 | exports = ({ React, ReactNative: { View, Text } }) => { 4 | // Create a Component to say "Hello" 5 | const HelloBox = ({ name }) => (React.createElement(View, null, 6 | React.createElement(Text, null, 7 | "Hello ", 8 | name))); 9 | // Export the Component 10 | return HelloBox; 11 | }; 12 | //# sourceMappingURL=my_module.js.map -------------------------------------------------------------------------------- /dist/src/elvan.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - February 2021) 3 | */ 4 | export declare type ModuleFactory = (imports: any) => any; 5 | export interface ElvanLoader { 6 | register: (factory: ModuleFactory) => void; 7 | } 8 | export declare const loadFromUrl: (url: string, imports?: any) => Promise; 9 | export declare const loadFromString: (js: string, imports?: any) => Promise; 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib-cov 2 | *.seed 3 | *.log 4 | *.csv 5 | *.dat 6 | *.out 7 | *.pid 8 | *.gz 9 | *.swp 10 | 11 | pids 12 | logs 13 | results 14 | tmp 15 | 16 | # Build 17 | public/css/main.css 18 | 19 | # Coverage reports 20 | coverage 21 | 22 | # API keys and secrets 23 | .env 24 | 25 | # Dependency directory 26 | node_modules 27 | bower_components 28 | 29 | # Editors 30 | .idea 31 | *.iml 32 | 33 | # OS metadata 34 | .DS_Store 35 | Thumbs.db 36 | 37 | # Ignore Backups 38 | backups 39 | 40 | # VSCode 41 | .vscode/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # NOTE: This ensures the `prepare` script output is saved in the `node_modules` tree (which won't happen if we default to .gitignore). 2 | # REFERENCE: https://stackoverflow.com/a/56082369/3625866 3 | 4 | lib-cov 5 | *.seed 6 | *.log 7 | *.csv 8 | *.dat 9 | *.out 10 | *.pid 11 | *.gz 12 | *.swp 13 | 14 | pids 15 | logs 16 | results 17 | tmp 18 | 19 | # Coverage reports 20 | coverage 21 | 22 | # API keys and secrets 23 | .env 24 | 25 | # Dependency directory 26 | node_modules 27 | bower_components 28 | 29 | # Editors 30 | .idea 31 | *.iml 32 | 33 | # OS metadata 34 | .DS_Store 35 | Thumbs.db 36 | -------------------------------------------------------------------------------- /dist/src/elvan.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"elvan.js","sourceRoot":"","sources":["../../src/elvan.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,4DAAgC;AAOhC,iIAAiI;AACjI,0EAA0E;AAC1E,qEAAqE;AACrE,oGAAoG;AAEvF,QAAA,WAAW,GAAG,UAAO,GAAW,EAAE,OAAa;;;;oBAGzC,qBAAM,qBAAK,CAAC,GAAG,CAAC,EAAA;;gBAA3B,QAAQ,GAAG,SAAgB;gBACtB,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;gBAA1B,EAAE,GAAG,SAAqB;gBAGzB,qBAAM,sBAAc,CAAC,EAAE,EAAE,OAAO,CAAC,EAAA;;YADxC,oBAAoB;YACpB,sBAAO,SAAiC,EAAC;;;KAC1C,CAAC;AAEW,QAAA,cAAc,GAAG,UAAO,EAAU,EAAE,OAAa;;;;;gBAE5D,2CAA2C;gBAC3C,IAAI,CAAC,EAAE,CAAC,CAAC;gBAGM,qBAAM,OAAO,CAAC,OAAO,CAAC,EAAA;;gBAA/B,MAAM,GAAG,SAAsB;gBAErC,qBAAqB;gBACrB,sBAAO,MAAM,EAAC;;;KACf,CAAC"} -------------------------------------------------------------------------------- /dist/test/elvan.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"elvan.test.js","sourceRoot":"","sources":["../../test/elvan.test.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,kDAAsC;AACtC,6BAA8B;AAE9B,QAAQ,CAAC,OAAO,EAAE;IAEhB,EAAE,CAAC,gCAAgC,EAAE;;;;wBAGb,qBAAM,KAAK,CAAC,WAAW,CAAC,iHAAiH,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,EAAA;;oBAAtL,QAAQ,GAAQ,SAAsK;oBACtL,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;oBACjC,aAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC;;;;SACzD,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE;;;;;oBAElC,EAAE,GAAG,sFAAsF,CAAC;oBAG5E,qBAAM,KAAK,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,EAAA;;oBAA1E,QAAQ,GAAQ,SAA0D;oBAC1E,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;oBACjC,aAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,kCAAkC,CAAC,CAAC;;;;SACzD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elvan", 3 | "version": "0.1.0", 4 | "description": "JavaScript Plugin Loader", 5 | "author": "Oranda", 6 | "main": "./dist/src/index.js", 7 | "types": "./dist/src/index.d.ts", 8 | "scripts": { 9 | "build": "npm run build-ts && npm run tslint", 10 | "test": "mocha ./dist/test/**/*.test.js", 11 | "build-ts": "tsc --declaration", 12 | "tslint": "tslint -c tslint.json -p tsconfig.json", 13 | "tslint-fix": "tslint -c tslint.json -p tsconfig.json --fix" 14 | }, 15 | "devDependencies": { 16 | "@types/expect": "^1.20.3", 17 | "@types/mocha": "^5.2.5", 18 | "@types/node": "^9.6.55", 19 | "chai": "^4.2.0", 20 | "mocha": "^5.2.0", 21 | "ts-node": "^5.0.0", 22 | "tslint": "^5.12.1", 23 | "typescript": "^3.5.3" 24 | }, 25 | "dependencies": { 26 | "@types/chai": "^4.2.15", 27 | "cross-fetch": "^3.0.6" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/elvan.test.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - January 2021) 3 | */ 4 | 5 | import * as Elvan from "../src/elvan"; 6 | import { expect } from "chai"; 7 | 8 | describe("Elvan", () => { 9 | 10 | it("should load a module from URL.", async () => { 11 | 12 | // TODO: Remove the token once public 13 | const myModule: any = await Elvan.loadFromUrl("https://raw.githubusercontent.com/CodalReef/Elvan/master/test/FishFeeder.js?token=ANUDGQ2H7INTXI7L5ACGA4DADXFRY", { food: "tasty speckles" }); 14 | const name = myModule.feedFish(); 15 | expect(name).equals("You fed the fish tasty speckles!"); 16 | }); 17 | 18 | it("should load a module from a string.", async () => { 19 | 20 | const js = "exports = ({ food }) => { return { feedFish: () => `You fed the fish ${ food }!` } }"; 21 | 22 | // TODO: Remove the token once public 23 | const myModule: any = await Elvan.loadFromString(js, { food: "tasty speckles" }); 24 | const name = myModule.feedFish(); 25 | expect(name).equals("You fed the fish tasty speckles!"); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Oranda 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/elvan.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - February 2021) 3 | */ 4 | 5 | import fetch from "cross-fetch"; 6 | export type ModuleFactory = (imports: any) => any; 7 | 8 | export interface ElvanLoader { 9 | register: (factory: ModuleFactory) => void; 10 | } 11 | 12 | // CONSIDER: Build Plugins or (more functions) for various loaders to resolve various module types, like AMD / CommonJS, etc... 13 | // CONSIDER: Use a single object as the param set so it can be modified. 14 | // CONSIDER: Add Registers so users can build Plugins like Webpack. 15 | // TODO: Make this "Pluggable" with Registers and similar Plugin Oriented Design (POD) principles. 16 | 17 | export const loadFromUrl = async (url: string, imports?: any) => { 18 | 19 | // Get the Code 20 | const response = await fetch(url); 21 | const js = await response.text(); 22 | 23 | // Load From String 24 | return await loadFromString(js, imports); 25 | }; 26 | 27 | export const loadFromString = async (js: string, imports?: any) => { 28 | 29 | // Run the Loaded Plugin in "this" Context 30 | eval(js); 31 | 32 | // Build the Module 33 | const module = await exports(imports); 34 | 35 | // Return the Module 36 | return module; 37 | }; 38 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "file-name-casing": [ 4 | true, 5 | "kebab-case" 6 | ], 7 | "class-name": true, 8 | "comment-format": [ 9 | true, 10 | "check-space" 11 | ], 12 | "indent": [ 13 | true, 14 | "spaces" 15 | ], 16 | "one-line": [ 17 | true, 18 | "check-open-brace", 19 | "check-whitespace" 20 | ], 21 | "no-var-keyword": true, 22 | "quotemark": [ 23 | true, 24 | "double", 25 | "avoid-escape" 26 | ], 27 | "semicolon": [ 28 | true, 29 | "always", 30 | "ignore-bound-class-methods" 31 | ], 32 | "whitespace": [ 33 | true, 34 | "check-branch", 35 | "check-decl", 36 | "check-operator", 37 | "check-module", 38 | "check-separator", 39 | "check-type" 40 | ], 41 | "typedef-whitespace": [ 42 | true, 43 | { 44 | "call-signature": "nospace", 45 | "index-signature": "nospace", 46 | "parameter": "nospace", 47 | "property-declaration": "nospace", 48 | "variable-declaration": "nospace" 49 | }, 50 | { 51 | "call-signature": "onespace", 52 | "index-signature": "onespace", 53 | "parameter": "onespace", 54 | "property-declaration": "onespace", 55 | "variable-declaration": "onespace" 56 | } 57 | ], 58 | "no-internal-module": true, 59 | "no-trailing-whitespace": true, 60 | "no-null-keyword": true, 61 | "prefer-const": true, 62 | "jsdoc-format": false 63 | } 64 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Elvan 4 | 5 | ### TS / JS External Module Loader 6 | > Load Modules from External URLs 7 | 8 | Load external modules in TS / JS apps, including React Native apps. 9 | > 10 | ### Define a Module 11 | ```javascript 12 | // fish-feeder.js 13 | exports = ({ food }) => { 14 | return { 15 | feedFish: () => console.log(`You fed the fish ${ food }!`) 16 | } 17 | } 18 | ``` 19 | 20 | ### Load the Module 21 | 22 | ```javascript 23 | // URL to the Module 24 | const url = "https://my.site/fish-feeder.js"; 25 | 26 | // Module Imports 27 | const imports = { 28 | food: "tasty speckles" 29 | } 30 | 31 | // Load the Module 32 | const FishFeeder = await Elvan.loadFromUrl(url, imports); 33 | 34 | // Use the Module 35 | FishFeeder.feedFish(); // Console: 'You fed the fish tasty speckles!' 36 | ``` 37 | 38 | 39 | ## React Native + Typescript 40 | 41 | ### Define a TS / RN Module 42 | 43 | Let's build a module with a custom component. 44 | 45 | ```typescript 46 | // hello-box.tsx 47 | exports = ({ React, ReactNative: { View, Text } }) => { 48 | 49 | // Create a Component to say "Hello" 50 | const HelloBox = ({ name }: { name: string }) => ( 51 | 52 | Hello { name } 53 | 54 | ); 55 | 56 | // Export the Component 57 | return HelloBox; 58 | } 59 | ``` 60 | 61 | ### Transpile the Module 62 | To load the module dynamically, it needs to be transpiled to ES6. We can use `tsc` to do that. 63 | 64 | ```javascript 65 | "use strict"; 66 | // hello-box.tsx 67 | exports = ({ React, ReactNative: { View, Text } }) => { 68 | // Create a Component to say "Hello" 69 | const HelloBox = ({ name }) => (React.createElement(View, null, 70 | React.createElement(Text, null, 71 | "Hello ", 72 | name))); 73 | // Export the Component 74 | return HelloBox; 75 | }; 76 | //# sourceMappingURL=my_module.js.map 77 | ``` 78 | 79 | ### Load the Module 80 | 81 | ```typescript 82 | import * as React from 'react'; 83 | import * as ReactNative from 'react-native'; 84 | 85 | 86 | interface MyComponentState { 87 | HelloBox: undefined | React.FunctionComponent<{ name: string }>; 88 | } 89 | 90 | class MyComponent extends React.Component { 91 | 92 | constructor (props: any) { 93 | super(props); 94 | this.state = { HelloBox: undefined }; 95 | } 96 | async componentDidMount() { 97 | 98 | // URL to the Module 99 | const url = "https://my.site/hello-box.js"; 100 | 101 | // Module Imports 102 | const imports = { 103 | React, ReactNative 104 | } 105 | 106 | // Load the Component 107 | const HelloBox = await Elvan.loadFromUrl(url, imports); 108 | this.setState({ HelloBox }); 109 | } 110 | 111 | render() { 112 | 113 | const { HelloBox } = this.state; 114 | 115 | return HelloBox ? 116 | : 117 | null 118 | } 119 | } 120 | ``` 121 | 122 | 123 | ## Anti-Pitch 124 | 125 | This library is likely a band-aid until there's native support for loading via URL. However, we are adding "Plugin Oriented Design" (POD )elements to make this library extensible. 126 | 127 | Currently, it's only possible to load "Elvan" modules, but we hope to build core support or add Plugins for standard module types. 128 | 129 | There's currently no integrity check on the URL. 130 | 131 | ## Acknowledgments 132 | Elvan is inspired by similar module tools including Webpack, Node, CommonJS, SystemJS, AMD, etc... 133 | -------------------------------------------------------------------------------- /dist/src/elvan.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - February 2021) 4 | */ 5 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 6 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 7 | return new (P || (P = Promise))(function (resolve, reject) { 8 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 9 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 10 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 11 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 12 | }); 13 | }; 14 | var __generator = (this && this.__generator) || function (thisArg, body) { 15 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 16 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 17 | function verb(n) { return function (v) { return step([n, v]); }; } 18 | function step(op) { 19 | if (f) throw new TypeError("Generator is already executing."); 20 | while (_) try { 21 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 22 | if (y = 0, t) op = [op[0] & 2, t.value]; 23 | switch (op[0]) { 24 | case 0: case 1: t = op; break; 25 | case 4: _.label++; return { value: op[1], done: false }; 26 | case 5: _.label++; y = op[1]; op = [0]; continue; 27 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 28 | default: 29 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 30 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 31 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 32 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 33 | if (t[2]) _.ops.pop(); 34 | _.trys.pop(); continue; 35 | } 36 | op = body.call(thisArg, _); 37 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 38 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 39 | } 40 | }; 41 | var __importDefault = (this && this.__importDefault) || function (mod) { 42 | return (mod && mod.__esModule) ? mod : { "default": mod }; 43 | }; 44 | Object.defineProperty(exports, "__esModule", { value: true }); 45 | var cross_fetch_1 = __importDefault(require("cross-fetch")); 46 | // CONSIDER: Build Plugins or (more functions) for various loaders to resolve various module types, like AMD / CommonJS, etc... 47 | // CONSIDER: Use a single object as the param set so it can be modified. 48 | // CONSIDER: Add Registers so users can build Plugins like Webpack. 49 | // TODO: Make this "Pluggable" with Registers and similar Plugin Oriented Design (POD) principles. 50 | exports.loadFromUrl = function (url, imports) { return __awaiter(void 0, void 0, void 0, function () { 51 | var response, js; 52 | return __generator(this, function (_a) { 53 | switch (_a.label) { 54 | case 0: return [4 /*yield*/, cross_fetch_1.default(url)]; 55 | case 1: 56 | response = _a.sent(); 57 | return [4 /*yield*/, response.text()]; 58 | case 2: 59 | js = _a.sent(); 60 | return [4 /*yield*/, exports.loadFromString(js, imports)]; 61 | case 3: 62 | // Load From String 63 | return [2 /*return*/, _a.sent()]; 64 | } 65 | }); 66 | }); }; 67 | exports.loadFromString = function (js, imports) { return __awaiter(void 0, void 0, void 0, function () { 68 | var module; 69 | return __generator(this, function (_a) { 70 | switch (_a.label) { 71 | case 0: 72 | // Run the Loaded Plugin in "this" Context 73 | eval(js); 74 | return [4 /*yield*/, exports(imports)]; 75 | case 1: 76 | module = _a.sent(); 77 | // Return the Module 78 | return [2 /*return*/, module]; 79 | } 80 | }); 81 | }); }; 82 | //# sourceMappingURL=elvan.js.map -------------------------------------------------------------------------------- /dist/test/elvan.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | /** 3 | * Copyright (C) Oranda - All Rights Reserved (January 2019 - January 2021) 4 | */ 5 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 6 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 7 | return new (P || (P = Promise))(function (resolve, reject) { 8 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 9 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 10 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 11 | step((generator = generator.apply(thisArg, _arguments || [])).next()); 12 | }); 13 | }; 14 | var __generator = (this && this.__generator) || function (thisArg, body) { 15 | var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 16 | return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 17 | function verb(n) { return function (v) { return step([n, v]); }; } 18 | function step(op) { 19 | if (f) throw new TypeError("Generator is already executing."); 20 | while (_) try { 21 | if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 22 | if (y = 0, t) op = [op[0] & 2, t.value]; 23 | switch (op[0]) { 24 | case 0: case 1: t = op; break; 25 | case 4: _.label++; return { value: op[1], done: false }; 26 | case 5: _.label++; y = op[1]; op = [0]; continue; 27 | case 7: op = _.ops.pop(); _.trys.pop(); continue; 28 | default: 29 | if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 30 | if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 31 | if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 32 | if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 33 | if (t[2]) _.ops.pop(); 34 | _.trys.pop(); continue; 35 | } 36 | op = body.call(thisArg, _); 37 | } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 38 | if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 39 | } 40 | }; 41 | var __importStar = (this && this.__importStar) || function (mod) { 42 | if (mod && mod.__esModule) return mod; 43 | var result = {}; 44 | if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; 45 | result["default"] = mod; 46 | return result; 47 | }; 48 | Object.defineProperty(exports, "__esModule", { value: true }); 49 | var Elvan = __importStar(require("../src/elvan")); 50 | var chai_1 = require("chai"); 51 | describe("Elvan", function () { 52 | it("should load a module from URL.", function () { return __awaiter(void 0, void 0, void 0, function () { 53 | var myModule, name; 54 | return __generator(this, function (_a) { 55 | switch (_a.label) { 56 | case 0: return [4 /*yield*/, Elvan.loadFromUrl("https://raw.githubusercontent.com/CodalReef/Elvan/master/test/FishFeeder.js?token=ANUDGQ2H7INTXI7L5ACGA4DADXFRY", { food: "tasty speckles" })]; 57 | case 1: 58 | myModule = _a.sent(); 59 | name = myModule.feedFish(); 60 | chai_1.expect(name).equals("You fed the fish tasty speckles!"); 61 | return [2 /*return*/]; 62 | } 63 | }); 64 | }); }); 65 | it("should load a module from a string.", function () { return __awaiter(void 0, void 0, void 0, function () { 66 | var js, myModule, name; 67 | return __generator(this, function (_a) { 68 | switch (_a.label) { 69 | case 0: 70 | js = "exports = ({ food }) => { return { feedFish: () => `You fed the fish ${ food }!` } }"; 71 | return [4 /*yield*/, Elvan.loadFromString(js, { food: "tasty speckles" })]; 72 | case 1: 73 | myModule = _a.sent(); 74 | name = myModule.feedFish(); 75 | chai_1.expect(name).equals("You fed the fish tasty speckles!"); 76 | return [2 /*return*/]; 77 | } 78 | }); 79 | }); }); 80 | }); 81 | //# sourceMappingURL=elvan.test.js.map -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/code-frame@^7.0.0": 6 | version "7.8.3" 7 | resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" 8 | dependencies: 9 | "@babel/highlight" "^7.8.3" 10 | 11 | "@babel/helper-validator-identifier@^7.9.0": 12 | version "7.9.0" 13 | resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.0.tgz#ad53562a7fc29b3b9a91bbf7d10397fd146346ed" 14 | 15 | "@babel/highlight@^7.8.3": 16 | version "7.9.0" 17 | resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.9.0.tgz#4e9b45ccb82b79607271b2979ad82c7b68163079" 18 | dependencies: 19 | "@babel/helper-validator-identifier" "^7.9.0" 20 | chalk "^2.0.0" 21 | js-tokens "^4.0.0" 22 | 23 | "@types/chai@^4.2.15": 24 | version "4.2.15" 25 | resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.15.tgz#b7a6d263c2cecf44b6de9a051cf496249b154553" 26 | 27 | "@types/expect@^1.20.3": 28 | version "1.20.4" 29 | resolved "https://registry.yarnpkg.com/@types/expect/-/expect-1.20.4.tgz#8288e51737bf7e3ab5d7c77bfa695883745264e5" 30 | 31 | "@types/mocha@^5.2.5": 32 | version "5.2.7" 33 | resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" 34 | 35 | "@types/node@^9.6.55": 36 | version "9.6.55" 37 | resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.55.tgz#7cc1358c9c18e71f6c020e410962971863232cf5" 38 | 39 | ansi-styles@^3.2.1: 40 | version "3.2.1" 41 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 42 | dependencies: 43 | color-convert "^1.9.0" 44 | 45 | argparse@^1.0.7: 46 | version "1.0.10" 47 | resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" 48 | dependencies: 49 | sprintf-js "~1.0.2" 50 | 51 | arrify@^1.0.0: 52 | version "1.0.1" 53 | resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" 54 | 55 | assertion-error@^1.1.0: 56 | version "1.1.0" 57 | resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" 58 | 59 | balanced-match@^1.0.0: 60 | version "1.0.0" 61 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 62 | 63 | brace-expansion@^1.1.7: 64 | version "1.1.11" 65 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 66 | dependencies: 67 | balanced-match "^1.0.0" 68 | concat-map "0.0.1" 69 | 70 | browser-stdout@1.3.1: 71 | version "1.3.1" 72 | resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" 73 | 74 | buffer-from@^1.0.0: 75 | version "1.1.1" 76 | resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 77 | 78 | builtin-modules@^1.1.1: 79 | version "1.1.1" 80 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" 81 | 82 | chai@^4.2.0: 83 | version "4.2.0" 84 | resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" 85 | dependencies: 86 | assertion-error "^1.1.0" 87 | check-error "^1.0.2" 88 | deep-eql "^3.0.1" 89 | get-func-name "^2.0.0" 90 | pathval "^1.1.0" 91 | type-detect "^4.0.5" 92 | 93 | chalk@^2.0.0, chalk@^2.3.0: 94 | version "2.4.2" 95 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 96 | dependencies: 97 | ansi-styles "^3.2.1" 98 | escape-string-regexp "^1.0.5" 99 | supports-color "^5.3.0" 100 | 101 | check-error@^1.0.2: 102 | version "1.0.2" 103 | resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" 104 | 105 | color-convert@^1.9.0: 106 | version "1.9.3" 107 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 108 | dependencies: 109 | color-name "1.1.3" 110 | 111 | color-name@1.1.3: 112 | version "1.1.3" 113 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 114 | 115 | commander@2.15.1: 116 | version "2.15.1" 117 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" 118 | 119 | commander@^2.12.1: 120 | version "2.20.3" 121 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" 122 | 123 | concat-map@0.0.1: 124 | version "0.0.1" 125 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 126 | 127 | cross-fetch@^3.0.6: 128 | version "3.0.6" 129 | resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" 130 | dependencies: 131 | node-fetch "2.6.1" 132 | 133 | debug@3.1.0: 134 | version "3.1.0" 135 | resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" 136 | dependencies: 137 | ms "2.0.0" 138 | 139 | deep-eql@^3.0.1: 140 | version "3.0.1" 141 | resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" 142 | dependencies: 143 | type-detect "^4.0.0" 144 | 145 | diff@3.5.0, diff@^3.1.0: 146 | version "3.5.0" 147 | resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" 148 | 149 | diff@^4.0.1: 150 | version "4.0.2" 151 | resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" 152 | 153 | escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: 154 | version "1.0.5" 155 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 156 | 157 | esprima@^4.0.0: 158 | version "4.0.1" 159 | resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" 160 | 161 | fs.realpath@^1.0.0: 162 | version "1.0.0" 163 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 164 | 165 | get-func-name@^2.0.0: 166 | version "2.0.0" 167 | resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" 168 | 169 | glob@7.1.2: 170 | version "7.1.2" 171 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" 172 | dependencies: 173 | fs.realpath "^1.0.0" 174 | inflight "^1.0.4" 175 | inherits "2" 176 | minimatch "^3.0.4" 177 | once "^1.3.0" 178 | path-is-absolute "^1.0.0" 179 | 180 | glob@^7.1.1: 181 | version "7.1.6" 182 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" 183 | dependencies: 184 | fs.realpath "^1.0.0" 185 | inflight "^1.0.4" 186 | inherits "2" 187 | minimatch "^3.0.4" 188 | once "^1.3.0" 189 | path-is-absolute "^1.0.0" 190 | 191 | growl@1.10.5: 192 | version "1.10.5" 193 | resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" 194 | 195 | has-flag@^3.0.0: 196 | version "3.0.0" 197 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 198 | 199 | he@1.1.1: 200 | version "1.1.1" 201 | resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" 202 | 203 | inflight@^1.0.4: 204 | version "1.0.6" 205 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 206 | dependencies: 207 | once "^1.3.0" 208 | wrappy "1" 209 | 210 | inherits@2: 211 | version "2.0.4" 212 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 213 | 214 | js-tokens@^4.0.0: 215 | version "4.0.0" 216 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" 217 | 218 | js-yaml@^3.13.1: 219 | version "3.13.1" 220 | resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" 221 | dependencies: 222 | argparse "^1.0.7" 223 | esprima "^4.0.0" 224 | 225 | make-error@^1.1.1: 226 | version "1.3.6" 227 | resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" 228 | 229 | minimatch@3.0.4, minimatch@^3.0.4: 230 | version "3.0.4" 231 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 232 | dependencies: 233 | brace-expansion "^1.1.7" 234 | 235 | minimist@0.0.8: 236 | version "0.0.8" 237 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 238 | 239 | minimist@^1.2.0, minimist@^1.2.5: 240 | version "1.2.5" 241 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" 242 | 243 | mkdirp@0.5.1: 244 | version "0.5.1" 245 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 246 | dependencies: 247 | minimist "0.0.8" 248 | 249 | mkdirp@^0.5.1: 250 | version "0.5.4" 251 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.4.tgz#fd01504a6797ec5c9be81ff43d204961ed64a512" 252 | dependencies: 253 | minimist "^1.2.5" 254 | 255 | mocha@^5.2.0: 256 | version "5.2.0" 257 | resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" 258 | dependencies: 259 | browser-stdout "1.3.1" 260 | commander "2.15.1" 261 | debug "3.1.0" 262 | diff "3.5.0" 263 | escape-string-regexp "1.0.5" 264 | glob "7.1.2" 265 | growl "1.10.5" 266 | he "1.1.1" 267 | minimatch "3.0.4" 268 | mkdirp "0.5.1" 269 | supports-color "5.4.0" 270 | 271 | ms@2.0.0: 272 | version "2.0.0" 273 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 274 | 275 | node-fetch@2.6.1: 276 | version "2.6.1" 277 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" 278 | 279 | once@^1.3.0: 280 | version "1.4.0" 281 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 282 | dependencies: 283 | wrappy "1" 284 | 285 | path-is-absolute@^1.0.0: 286 | version "1.0.1" 287 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 288 | 289 | path-parse@^1.0.6: 290 | version "1.0.6" 291 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" 292 | 293 | pathval@^1.1.0: 294 | version "1.1.0" 295 | resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" 296 | 297 | resolve@^1.3.2: 298 | version "1.15.1" 299 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8" 300 | dependencies: 301 | path-parse "^1.0.6" 302 | 303 | semver@^5.3.0: 304 | version "5.7.1" 305 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" 306 | 307 | source-map-support@^0.5.3: 308 | version "0.5.16" 309 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" 310 | dependencies: 311 | buffer-from "^1.0.0" 312 | source-map "^0.6.0" 313 | 314 | source-map@^0.6.0: 315 | version "0.6.1" 316 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 317 | 318 | sprintf-js@~1.0.2: 319 | version "1.0.3" 320 | resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" 321 | 322 | supports-color@5.4.0: 323 | version "5.4.0" 324 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" 325 | dependencies: 326 | has-flag "^3.0.0" 327 | 328 | supports-color@^5.3.0: 329 | version "5.5.0" 330 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 331 | dependencies: 332 | has-flag "^3.0.0" 333 | 334 | ts-node@^5.0.0: 335 | version "5.0.1" 336 | resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-5.0.1.tgz#78e5d1cb3f704de1b641e43b76be2d4094f06f81" 337 | dependencies: 338 | arrify "^1.0.0" 339 | chalk "^2.3.0" 340 | diff "^3.1.0" 341 | make-error "^1.1.1" 342 | minimist "^1.2.0" 343 | mkdirp "^0.5.1" 344 | source-map-support "^0.5.3" 345 | yn "^2.0.0" 346 | 347 | tslib@^1.8.0, tslib@^1.8.1: 348 | version "1.11.1" 349 | resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" 350 | 351 | tslint@^5.12.1: 352 | version "5.20.1" 353 | resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.20.1.tgz#e401e8aeda0152bc44dd07e614034f3f80c67b7d" 354 | dependencies: 355 | "@babel/code-frame" "^7.0.0" 356 | builtin-modules "^1.1.1" 357 | chalk "^2.3.0" 358 | commander "^2.12.1" 359 | diff "^4.0.1" 360 | glob "^7.1.1" 361 | js-yaml "^3.13.1" 362 | minimatch "^3.0.4" 363 | mkdirp "^0.5.1" 364 | resolve "^1.3.2" 365 | semver "^5.3.0" 366 | tslib "^1.8.0" 367 | tsutils "^2.29.0" 368 | 369 | tsutils@^2.29.0: 370 | version "2.29.0" 371 | resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99" 372 | dependencies: 373 | tslib "^1.8.1" 374 | 375 | type-detect@^4.0.0, type-detect@^4.0.5: 376 | version "4.0.8" 377 | resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" 378 | 379 | typescript@^3.5.3: 380 | version "3.8.3" 381 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" 382 | 383 | wrappy@1: 384 | version "1.0.2" 385 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 386 | 387 | yn@^2.0.0: 388 | version "2.0.0" 389 | resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" 390 | --------------------------------------------------------------------------------