@tsparticles/engine 4.0.0-beta.1 → 4.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/browser/Core/Container.js +3 -0
  2. package/browser/Core/Engine.js +1 -1
  3. package/browser/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  4. package/browser/Core/ParticlesManager.js +1 -0
  5. package/cjs/Core/Container.js +3 -0
  6. package/cjs/Core/Engine.js +1 -1
  7. package/cjs/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  8. package/cjs/Core/ParticlesManager.js +1 -0
  9. package/dist_browser_Core_Container_js.js +3 -3
  10. package/esm/Core/Container.js +3 -0
  11. package/esm/Core/Engine.js +1 -1
  12. package/esm/Core/Interfaces/IPositionFromSizeParams.js +1 -1
  13. package/esm/Core/ParticlesManager.js +1 -0
  14. package/package.json +2 -3
  15. package/report.html +1 -1
  16. package/tsparticles.engine.js +2 -2
  17. package/tsparticles.engine.min.js +1 -1
  18. package/umd/Core/CanvasManager.js +0 -317
  19. package/umd/Core/Container.js +0 -383
  20. package/umd/Core/Engine.js +0 -183
  21. package/umd/Core/Interfaces/Colors.js +0 -12
  22. package/umd/Core/Interfaces/IBounds.js +0 -12
  23. package/umd/Core/Interfaces/IBubbleParticleData.js +0 -12
  24. package/umd/Core/Interfaces/ICircleBouncer.js +0 -12
  25. package/umd/Core/Interfaces/IColorManager.js +0 -12
  26. package/umd/Core/Interfaces/IContainerPlugin.js +0 -12
  27. package/umd/Core/Interfaces/ICoordinates.js +0 -12
  28. package/umd/Core/Interfaces/IDelta.js +0 -12
  29. package/umd/Core/Interfaces/IDimension.js +0 -12
  30. package/umd/Core/Interfaces/IDistance.js +0 -12
  31. package/umd/Core/Interfaces/IDrawParticleParams.js +0 -12
  32. package/umd/Core/Interfaces/IEffectDrawer.js +0 -12
  33. package/umd/Core/Interfaces/ILoadParams.js +0 -12
  34. package/umd/Core/Interfaces/IPalette.js +0 -12
  35. package/umd/Core/Interfaces/IParticleColorStyle.js +0 -12
  36. package/umd/Core/Interfaces/IParticleHslAnimation.js +0 -12
  37. package/umd/Core/Interfaces/IParticleLife.js +0 -12
  38. package/umd/Core/Interfaces/IParticleOpacityData.js +0 -12
  39. package/umd/Core/Interfaces/IParticleRetinaProps.js +0 -12
  40. package/umd/Core/Interfaces/IParticleRoll.js +0 -12
  41. package/umd/Core/Interfaces/IParticleRotateData.js +0 -12
  42. package/umd/Core/Interfaces/IParticleTransformValues.js +0 -12
  43. package/umd/Core/Interfaces/IParticleUpdater.js +0 -12
  44. package/umd/Core/Interfaces/IParticleValueAnimation.js +0 -12
  45. package/umd/Core/Interfaces/IPlugin.js +0 -12
  46. package/umd/Core/Interfaces/IPositionFromSizeParams.js +0 -12
  47. package/umd/Core/Interfaces/IRangeValue.js +0 -12
  48. package/umd/Core/Interfaces/IShapeDrawData.js +0 -12
  49. package/umd/Core/Interfaces/IShapeDrawer.js +0 -12
  50. package/umd/Core/Interfaces/IShapeValues.js +0 -12
  51. package/umd/Core/Interfaces/ISlowParticleData.js +0 -12
  52. package/umd/Core/Particle.js +0 -433
  53. package/umd/Core/ParticlesManager.js +0 -377
  54. package/umd/Core/RenderManager.js +0 -317
  55. package/umd/Core/Retina.js +0 -47
  56. package/umd/Core/Utils/Constants.js +0 -23
  57. package/umd/Core/Utils/EventListeners.js +0 -102
  58. package/umd/Core/Utils/PluginManager.js +0 -159
  59. package/umd/Core/Utils/Ranges.js +0 -91
  60. package/umd/Core/Utils/SpatialHashGrid.js +0 -116
  61. package/umd/Core/Utils/Vectors.js +0 -126
  62. package/umd/Enums/AnimationStatus.js +0 -18
  63. package/umd/Enums/Directions/MoveDirection.js +0 -27
  64. package/umd/Enums/Directions/OutModeDirection.js +0 -20
  65. package/umd/Enums/Directions/RotateDirection.js +0 -19
  66. package/umd/Enums/Modes/AnimationMode.js +0 -20
  67. package/umd/Enums/Modes/LimitMode.js +0 -18
  68. package/umd/Enums/Modes/OutMode.js +0 -21
  69. package/umd/Enums/Modes/PixelMode.js +0 -18
  70. package/umd/Enums/RangeType.js +0 -18
  71. package/umd/Enums/Types/AlterType.js +0 -18
  72. package/umd/Enums/Types/DestroyType.js +0 -19
  73. package/umd/Enums/Types/EasingType.js +0 -58
  74. package/umd/Enums/Types/EventType.js +0 -28
  75. package/umd/Enums/Types/GradientType.js +0 -19
  76. package/umd/Enums/Types/ParticleOutType.js +0 -19
  77. package/umd/Enums/Types/StartValueType.js +0 -19
  78. package/umd/Options/Classes/AnimatableColor.js +0 -52
  79. package/umd/Options/Classes/AnimationOptions.js +0 -79
  80. package/umd/Options/Classes/Background/Background.js +0 -56
  81. package/umd/Options/Classes/ColorAnimation.js +0 -44
  82. package/umd/Options/Classes/FullScreen/FullScreen.js +0 -34
  83. package/umd/Options/Classes/HslAnimation.js +0 -30
  84. package/umd/Options/Classes/Options.js +0 -171
  85. package/umd/Options/Classes/OptionsColor.js +0 -42
  86. package/umd/Options/Classes/Particles/Bounce/ParticlesBounce.js +0 -31
  87. package/umd/Options/Classes/Particles/Bounce/ParticlesBounceFactor.js +0 -21
  88. package/umd/Options/Classes/Particles/Effect/Effect.js +0 -46
  89. package/umd/Options/Classes/Particles/Fill.js +0 -42
  90. package/umd/Options/Classes/Particles/Move/Move.js +0 -120
  91. package/umd/Options/Classes/Particles/Move/MoveAngle.js +0 -35
  92. package/umd/Options/Classes/Particles/Move/MoveCenter.js +0 -45
  93. package/umd/Options/Classes/Particles/Move/MoveGravity.js +0 -45
  94. package/umd/Options/Classes/Particles/Move/OutModes.js +0 -38
  95. package/umd/Options/Classes/Particles/Move/Path/MovePath.js +0 -46
  96. package/umd/Options/Classes/Particles/Move/Spin.js +0 -40
  97. package/umd/Options/Classes/Particles/Number/ParticlesDensity.js +0 -41
  98. package/umd/Options/Classes/Particles/Number/ParticlesNumber.js +0 -37
  99. package/umd/Options/Classes/Particles/Number/ParticlesNumberLimit.js +0 -35
  100. package/umd/Options/Classes/Particles/Opacity/Opacity.js +0 -35
  101. package/umd/Options/Classes/Particles/Opacity/OpacityAnimation.js +0 -34
  102. package/umd/Options/Classes/Particles/ParticlesOptions.js +0 -116
  103. package/umd/Options/Classes/Particles/Shape/Shape.js +0 -46
  104. package/umd/Options/Classes/Particles/Size/Size.js +0 -35
  105. package/umd/Options/Classes/Particles/Size/SizeAnimation.js +0 -34
  106. package/umd/Options/Classes/Particles/Stroke.js +0 -39
  107. package/umd/Options/Classes/Particles/ZIndex/ZIndex.js +0 -42
  108. package/umd/Options/Classes/ResizeEvent.js +0 -34
  109. package/umd/Options/Classes/ValueWithRandom.js +0 -56
  110. package/umd/Options/Interfaces/Background/IBackground.js +0 -12
  111. package/umd/Options/Interfaces/FullScreen/IFullScreen.js +0 -12
  112. package/umd/Options/Interfaces/IAnimatable.js +0 -12
  113. package/umd/Options/Interfaces/IAnimatableColor.js +0 -12
  114. package/umd/Options/Interfaces/IAnimation.js +0 -12
  115. package/umd/Options/Interfaces/IColorAnimation.js +0 -12
  116. package/umd/Options/Interfaces/IHslAnimation.js +0 -12
  117. package/umd/Options/Interfaces/IOptionLoader.js +0 -12
  118. package/umd/Options/Interfaces/IOptions.js +0 -12
  119. package/umd/Options/Interfaces/IOptionsColor.js +0 -12
  120. package/umd/Options/Interfaces/IResizeEvent.js +0 -12
  121. package/umd/Options/Interfaces/IValueWithRandom.js +0 -12
  122. package/umd/Options/Interfaces/Particles/Bounce/IParticlesBounce.js +0 -12
  123. package/umd/Options/Interfaces/Particles/Effect/IEffect.js +0 -12
  124. package/umd/Options/Interfaces/Particles/IFill.js +0 -12
  125. package/umd/Options/Interfaces/Particles/IParticlesOptions.js +0 -12
  126. package/umd/Options/Interfaces/Particles/IStroke.js +0 -12
  127. package/umd/Options/Interfaces/Particles/Move/IMove.js +0 -12
  128. package/umd/Options/Interfaces/Particles/Move/IMoveAngle.js +0 -12
  129. package/umd/Options/Interfaces/Particles/Move/IMoveCenter.js +0 -12
  130. package/umd/Options/Interfaces/Particles/Move/IMoveGravity.js +0 -12
  131. package/umd/Options/Interfaces/Particles/Move/IOutModes.js +0 -12
  132. package/umd/Options/Interfaces/Particles/Move/ISpin.js +0 -12
  133. package/umd/Options/Interfaces/Particles/Move/Path/IMovePath.js +0 -12
  134. package/umd/Options/Interfaces/Particles/Number/IParticlesDensity.js +0 -12
  135. package/umd/Options/Interfaces/Particles/Number/IParticlesNumber.js +0 -12
  136. package/umd/Options/Interfaces/Particles/Number/IParticlesNumberLimit.js +0 -12
  137. package/umd/Options/Interfaces/Particles/Opacity/IOpacity.js +0 -12
  138. package/umd/Options/Interfaces/Particles/Opacity/IOpacityAnimation.js +0 -12
  139. package/umd/Options/Interfaces/Particles/Shape/IShape.js +0 -12
  140. package/umd/Options/Interfaces/Particles/Size/ISize.js +0 -12
  141. package/umd/Options/Interfaces/Particles/Size/ISizeAnimation.js +0 -12
  142. package/umd/Options/Interfaces/Particles/ZIndex/IZIndex.js +0 -12
  143. package/umd/Types/CanvasContextType.js +0 -12
  144. package/umd/Types/CustomEventArgs.js +0 -12
  145. package/umd/Types/CustomEventListener.js +0 -12
  146. package/umd/Types/EasingFunction.js +0 -12
  147. package/umd/Types/EngineInitializers.js +0 -12
  148. package/umd/Types/ExportResult.js +0 -12
  149. package/umd/Types/ISourceOptions.js +0 -12
  150. package/umd/Types/ParticlesGroups.js +0 -12
  151. package/umd/Types/PathOptions.js +0 -12
  152. package/umd/Types/RangeValue.js +0 -12
  153. package/umd/Types/RecursivePartial.js +0 -12
  154. package/umd/Types/ShapeData.js +0 -12
  155. package/umd/Types/SingleOrMultiple.js +0 -12
  156. package/umd/Utils/CanvasUtils.js +0 -145
  157. package/umd/Utils/ColorUtils.js +0 -395
  158. package/umd/Utils/EventDispatcher.js +0 -63
  159. package/umd/Utils/LogUtils.js +0 -37
  160. package/umd/Utils/MathUtils.js +0 -203
  161. package/umd/Utils/OptionsUtils.js +0 -25
  162. package/umd/Utils/TypeUtils.js +0 -40
  163. package/umd/Utils/Utils.js +0 -484
  164. package/umd/bundle.js +0 -32
  165. package/umd/export-types.js +0 -12
  166. package/umd/exports.js +0 -82
  167. package/umd/index.js +0 -32
  168. package/umd/initEngine.js +0 -17
@@ -1,37 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.setLogger = setLogger;
13
- exports.getLogger = getLogger;
14
- const errorPrefix = "tsParticles - Error";
15
- const _logger = {
16
- debug: console.debug,
17
- error: (message, optionalParams) => {
18
- console.error(`${errorPrefix} - ${message}`, optionalParams);
19
- },
20
- info: console.info,
21
- log: console.log,
22
- trace: console.trace,
23
- verbose: console.log,
24
- warning: console.warn,
25
- };
26
- function setLogger(logger) {
27
- _logger.debug = logger.debug;
28
- _logger.error = logger.error;
29
- _logger.info = logger.info;
30
- _logger.log = logger.log;
31
- _logger.verbose = logger.verbose;
32
- _logger.warning = logger.warning;
33
- }
34
- function getLogger() {
35
- return _logger;
36
- }
37
- });
@@ -1,203 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../Enums/Directions/MoveDirection.js", "../Core/Utils/Constants.js", "../Core/Utils/Vectors.js", "./TypeUtils.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.setRandom = setRandom;
13
- exports.getRandom = getRandom;
14
- exports.getRandomInRange = getRandomInRange;
15
- exports.setAnimationFunctions = setAnimationFunctions;
16
- exports.animate = animate;
17
- exports.cancelAnimation = cancelAnimation;
18
- exports.clamp = clamp;
19
- exports.mix = mix;
20
- exports.randomInRangeValue = randomInRangeValue;
21
- exports.getRangeValue = getRangeValue;
22
- exports.getRangeMin = getRangeMin;
23
- exports.getRangeMax = getRangeMax;
24
- exports.setRangeValue = setRangeValue;
25
- exports.getDistances = getDistances;
26
- exports.getDistanceSq = getDistanceSq;
27
- exports.getDistance = getDistance;
28
- exports.checkDistance = checkDistance;
29
- exports.degToRad = degToRad;
30
- exports.getParticleDirectionAngle = getParticleDirectionAngle;
31
- exports.getParticleBaseVelocity = getParticleBaseVelocity;
32
- exports.collisionVelocity = collisionVelocity;
33
- exports.calcPositionFromSize = calcPositionFromSize;
34
- exports.calcPositionOrRandomFromSize = calcPositionOrRandomFromSize;
35
- exports.calcPositionOrRandomFromSizeRanged = calcPositionOrRandomFromSizeRanged;
36
- exports.calcExactPositionOrRandomFromSize = calcExactPositionOrRandomFromSize;
37
- exports.calcExactPositionOrRandomFromSizeRanged = calcExactPositionOrRandomFromSizeRanged;
38
- exports.parseAlpha = parseAlpha;
39
- const MoveDirection_js_1 = require("../Enums/Directions/MoveDirection.js");
40
- const Constants_js_1 = require("../Core/Utils/Constants.js");
41
- const Vectors_js_1 = require("../Core/Utils/Vectors.js");
42
- const TypeUtils_js_1 = require("./TypeUtils.js");
43
- const piDeg = 180, degToRadFactor = Math.PI / piDeg;
44
- let _random = Math.random;
45
- const _animationLoop = {
46
- nextFrame: (cb) => requestAnimationFrame(cb),
47
- cancel: (idx) => {
48
- cancelAnimationFrame(idx);
49
- },
50
- };
51
- function setRandom(rnd = Math.random) {
52
- _random = rnd;
53
- }
54
- function getRandom() {
55
- const min = 0, max = 1;
56
- return clamp(_random(), min, max - Number.EPSILON);
57
- }
58
- function getRandomInRange(min, max) {
59
- return getRandom() * (max - min) + min;
60
- }
61
- function setAnimationFunctions(nextFrame, cancel) {
62
- _animationLoop.nextFrame = nextFrame;
63
- _animationLoop.cancel = cancel;
64
- }
65
- function animate(fn) {
66
- return _animationLoop.nextFrame(fn);
67
- }
68
- function cancelAnimation(handle) {
69
- _animationLoop.cancel(handle);
70
- }
71
- function clamp(num, min, max) {
72
- return Math.min(Math.max(num, min), max);
73
- }
74
- function mix(comp1, comp2, weight1, weight2) {
75
- return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
76
- }
77
- function randomInRangeValue(r) {
78
- const max = getRangeMax(r), minOffset = 0;
79
- let min = getRangeMin(r);
80
- if (max === min) {
81
- min = minOffset;
82
- }
83
- return getRandomInRange(min, max);
84
- }
85
- function getRangeValue(value) {
86
- return (0, TypeUtils_js_1.isNumber)(value) ? value : randomInRangeValue(value);
87
- }
88
- function getRangeMin(value) {
89
- return (0, TypeUtils_js_1.isNumber)(value) ? value : value.min;
90
- }
91
- function getRangeMax(value) {
92
- return (0, TypeUtils_js_1.isNumber)(value) ? value : value.max;
93
- }
94
- function setRangeValue(source, value) {
95
- if (source === value || (value === undefined && (0, TypeUtils_js_1.isNumber)(source))) {
96
- return source;
97
- }
98
- const min = getRangeMin(source), max = getRangeMax(source);
99
- return value !== undefined
100
- ? {
101
- min: Math.min(min, value),
102
- max: Math.max(max, value),
103
- }
104
- : setRangeValue(min, max);
105
- }
106
- function getDistances(pointA, pointB) {
107
- const dx = pointA.x - pointB.x, dy = pointA.y - pointB.y;
108
- return { dx: dx, dy: dy, distance: Math.hypot(dx, dy) };
109
- }
110
- function getDistanceSq(pointA, pointB) {
111
- const dx = pointA.x - pointB.x, dy = pointA.y - pointB.y;
112
- return dx * dx + dy * dy;
113
- }
114
- function getDistance(pointA, pointB) {
115
- return Math.sqrt(getDistanceSq(pointA, pointB));
116
- }
117
- function checkDistance(pointA, pointB, distance) {
118
- return getDistanceSq(pointA, pointB) <= distance * distance;
119
- }
120
- function degToRad(degrees) {
121
- return degrees * degToRadFactor;
122
- }
123
- function getParticleDirectionAngle(direction, position, center) {
124
- if ((0, TypeUtils_js_1.isNumber)(direction)) {
125
- return degToRad(direction);
126
- }
127
- switch (direction) {
128
- case MoveDirection_js_1.MoveDirection.top:
129
- return -Math.PI * Constants_js_1.half;
130
- case MoveDirection_js_1.MoveDirection.topRight:
131
- return -Math.PI * Constants_js_1.quarter;
132
- case MoveDirection_js_1.MoveDirection.right:
133
- return Constants_js_1.empty;
134
- case MoveDirection_js_1.MoveDirection.bottomRight:
135
- return Math.PI * Constants_js_1.quarter;
136
- case MoveDirection_js_1.MoveDirection.bottom:
137
- return Math.PI * Constants_js_1.half;
138
- case MoveDirection_js_1.MoveDirection.bottomLeft:
139
- return Math.PI * Constants_js_1.threeQuarter;
140
- case MoveDirection_js_1.MoveDirection.left:
141
- return Math.PI;
142
- case MoveDirection_js_1.MoveDirection.topLeft:
143
- return -Math.PI * Constants_js_1.threeQuarter;
144
- case MoveDirection_js_1.MoveDirection.inside:
145
- return Math.atan2(center.y - position.y, center.x - position.x);
146
- case MoveDirection_js_1.MoveDirection.outside:
147
- return Math.atan2(position.y - center.y, position.x - center.x);
148
- default:
149
- return getRandom() * Constants_js_1.doublePI;
150
- }
151
- }
152
- function getParticleBaseVelocity(direction) {
153
- const baseVelocity = Vectors_js_1.Vector.origin;
154
- baseVelocity.length = 1;
155
- baseVelocity.angle = direction;
156
- return baseVelocity;
157
- }
158
- function collisionVelocity(v1, v2, m1, m2) {
159
- return Vectors_js_1.Vector.create((v1.x * (m1 - m2)) / (m1 + m2) + (v2.x * Constants_js_1.double * m2) / (m1 + m2), v1.y);
160
- }
161
- function calcPositionFromSize(data) {
162
- return data.position?.x !== undefined && data.position.y !== undefined
163
- ? {
164
- x: (data.position.x * data.size.width) / Constants_js_1.percentDenominator,
165
- y: (data.position.y * data.size.height) / Constants_js_1.percentDenominator,
166
- }
167
- : undefined;
168
- }
169
- function calcPositionOrRandomFromSize(data) {
170
- return {
171
- x: ((data.position?.x ?? getRandom() * Constants_js_1.percentDenominator) * data.size.width) / Constants_js_1.percentDenominator,
172
- y: ((data.position?.y ?? getRandom() * Constants_js_1.percentDenominator) * data.size.height) / Constants_js_1.percentDenominator,
173
- };
174
- }
175
- function calcPositionOrRandomFromSizeRanged(data) {
176
- const position = {
177
- x: data.position?.x !== undefined ? getRangeValue(data.position.x) : undefined,
178
- y: data.position?.y !== undefined ? getRangeValue(data.position.y) : undefined,
179
- };
180
- return calcPositionOrRandomFromSize({ size: data.size, position });
181
- }
182
- function calcExactPositionOrRandomFromSize(data) {
183
- const { position, size } = data;
184
- return {
185
- x: position?.x ?? getRandom() * size.width,
186
- y: position?.y ?? getRandom() * size.height,
187
- };
188
- }
189
- function calcExactPositionOrRandomFromSizeRanged(data) {
190
- const position = {
191
- x: data.position?.x !== undefined ? getRangeValue(data.position.x) : undefined,
192
- y: data.position?.y !== undefined ? getRangeValue(data.position.y) : undefined,
193
- };
194
- return calcExactPositionOrRandomFromSize({ size: data.size, position });
195
- }
196
- function parseAlpha(input) {
197
- const defaultAlpha = 1;
198
- if (!input) {
199
- return defaultAlpha;
200
- }
201
- return input.endsWith("%") ? parseFloat(input) / Constants_js_1.percentDenominator : parseFloat(input);
202
- }
203
- });
@@ -1,25 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../Options/Classes/Particles/ParticlesOptions.js"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.loadOptions = loadOptions;
13
- exports.loadParticlesOptions = loadParticlesOptions;
14
- const ParticlesOptions_js_1 = require("../Options/Classes/Particles/ParticlesOptions.js");
15
- function loadOptions(options, ...sourceOptionsArr) {
16
- for (const sourceOptions of sourceOptionsArr) {
17
- options.load(sourceOptions);
18
- }
19
- }
20
- function loadParticlesOptions(pluginManager, container, ...sourceOptionsArr) {
21
- const options = new ParticlesOptions_js_1.ParticlesOptions(pluginManager, container);
22
- loadOptions(options, ...sourceOptionsArr);
23
- return options;
24
- }
25
- });
@@ -1,40 +0,0 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- "use strict";
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.isBoolean = isBoolean;
13
- exports.isString = isString;
14
- exports.isNumber = isNumber;
15
- exports.isFunction = isFunction;
16
- exports.isObject = isObject;
17
- exports.isArray = isArray;
18
- exports.isNull = isNull;
19
- function isBoolean(arg) {
20
- return typeof arg === "boolean";
21
- }
22
- function isString(arg) {
23
- return typeof arg === "string";
24
- }
25
- function isNumber(arg) {
26
- return typeof arg === "number";
27
- }
28
- function isFunction(arg) {
29
- return typeof arg === "function";
30
- }
31
- function isObject(arg) {
32
- return typeof arg === "object" && arg !== null;
33
- }
34
- function isArray(arg) {
35
- return Array.isArray(arg);
36
- }
37
- function isNull(arg) {
38
- return arg === null || arg === undefined;
39
- }
40
- });