1 | /* Javascript Object Inheritance Implementation ______ ________ |
||
2 | * (c) 2016 <[email protected]> __ / / __ \/ _/ _/ |
||
3 | * Licensed under MIT. / // / /_/ // /_/ / |
||
4 | * ------------------------------------------------------ \___/\____/___/__*/ |
||
5 | 'use strict'; |
||
6 | |||
7 | (function (factory) { |
||
8 | |||
9 | if (typeof define === 'function' && define.amd) { |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
10 | // AMD. Register as an anonymous module. |
||
11 | define([], factory); |
||
0 ignored issues
–
show
|
|||
12 | } else if (typeof exports === 'object') { |
||
13 | // Node/CommonJS |
||
14 | factory(exports); |
||
15 | } else { |
||
16 | // Browser globals |
||
17 | factory(window); |
||
18 | } |
||
19 | |||
20 | } (function (root) |
||
21 | { |
||
22 | // allows use as both raw source in the browser and compiled dist |
||
23 | // easier to test/debug when using the raw source |
||
24 | root = typeof (root) !== 'undefined' ? root : {}; |
||
25 | var JOII = typeof (root.JOII) !== 'undefined' ? root.JOII : {}; |
||
26 | |||
27 | /** |
||
28 | * Source code combined/packaged using ISC to prevent scope bleeding. |
||
29 | * @link https://npmjs.com/package/isc/ |
||
30 | * |
||
31 | * @include("./Config.js") |
||
32 | * @include("./Compatibility.js") |
||
33 | * @include("./PrototypeBuilder.js") |
||
34 | * @include("./ClassBuilder.js") |
||
35 | * @include("./InterfaceBuilder.js") |
||
36 | * @include("./EnumBuilder.js") |
||
37 | * @include("./Reflection.js") |
||
38 | */ |
||
39 | root.JOII = JOII; // Access to internals. (used by unit tests & Reflection) |
||
40 | root.Class = JOII.ClassBuilder; |
||
41 | root.Interface = JOII.InterfaceBuilder; |
||
42 | root.Enum = JOII.EnumBuilder; |
||
43 | |||
44 | /** |
||
45 | * Registers JOII to the global scope. You should only need this in Node |
||
46 | * environments. |
||
47 | */ |
||
48 | root.useGlobal = function () { |
||
49 | var g = (typeof window === 'object' ? window : global); |
||
50 | |||
51 | for (var i in root) { |
||
52 | if (root.hasOwnProperty(i) === false) continue; |
||
53 | g[i] = root[i]; |
||
54 | } |
||
55 | }; |
||
56 | |||
57 | return root; |
||
58 | })); |
||
59 |