@kitware/vtk.js 25.10.0 → 26.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.
- package/Common/Core/CellArray.d.ts +0 -6
- package/Common/Core/CellArray.js +21 -12
- package/Common/Core/ClassHierarchy.js +11 -6
- package/Common/Core/DataArray.d.ts +20 -0
- package/Common/Core/DataArray.js +21 -4
- package/Proxy/Core/ViewProxy.js +17 -9
- package/Rendering/Core/ColorTransferFunction.d.ts +0 -20
- package/Rendering/Core/ColorTransferFunction.js +0 -63
- package/Rendering/Core/Prop3D.js +1 -6
- package/Rendering/Core/RenderWindow.js +9 -6
- package/Rendering/Core/VolumeProperty.js +2 -3
- package/Rendering/Misc/CanvasView.js +6 -5
- package/Rendering/Misc/GenericRenderWindow.js +12 -7
- package/Rendering/OpenGL/Actor.js +4 -4
- package/Rendering/OpenGL/Actor2D.js +4 -4
- package/Rendering/OpenGL/Camera.js +7 -4
- package/Rendering/OpenGL/CubeAxesActor.js +7 -5
- package/Rendering/OpenGL/ForwardPass.js +1 -1
- package/Rendering/OpenGL/Glyph3DMapper.js +4 -4
- package/Rendering/OpenGL/ImageMapper.js +9 -5
- package/Rendering/OpenGL/ImageSlice.js +3 -3
- package/Rendering/OpenGL/PixelSpaceCallbackMapper.js +9 -5
- package/Rendering/OpenGL/PolyDataMapper.js +27 -21
- package/Rendering/OpenGL/PolyDataMapper2D.js +17 -10
- package/Rendering/OpenGL/ScalarBarActor.js +6 -4
- package/Rendering/OpenGL/Skybox.js +10 -6
- package/Rendering/OpenGL/Texture.js +6 -5
- package/Rendering/OpenGL/Volume.js +2 -2
- package/Rendering/OpenGL/VolumeMapper.js +11 -11
- package/Rendering/OpenGL/glsl/vtkVolumeFS.glsl.js +1 -1
- package/Rendering/SceneGraph/RenderPass.js +3 -2
- package/Rendering/WebGPU/ForwardPass.js +1 -1
- package/Rendering/WebGPU/HardwareSelectionPass.js +1 -1
- package/Rendering/WebGPU/HardwareSelector.js +14 -13
- package/Rendering/WebGPU/OpaquePass.js +1 -1
- package/Rendering/WebGPU/OrderIndependentTranslucentPass.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Utilities/config/rules-tests.js +28 -0
- package/Widgets/Core/AbstractWidgetFactory.js +1 -0
- package/Widgets/Core/StateBuilder/color3Mixin.js +22 -0
- package/Widgets/Core/StateBuilder/colorMixin.js +7 -0
- package/Widgets/Core/StateBuilder.js +2 -0
- package/Widgets/Core/WidgetManager.js +21 -256
- package/Widgets/Representations/ArrowHandleRepresentation.js +28 -110
- package/Widgets/Representations/CircleContextRepresentation.js +43 -165
- package/Widgets/Representations/ContextRepresentation.js +0 -3
- package/Widgets/Representations/ConvexFaceContextRepresentation.js +11 -11
- package/Widgets/Representations/CroppingOutlineRepresentation.js +5 -12
- package/Widgets/Representations/CubeHandleRepresentation.js +15 -104
- package/Widgets/Representations/GlyphRepresentation.js +320 -0
- package/Widgets/Representations/HandleRepresentation.js +0 -5
- package/Widgets/Representations/ImplicitPlaneRepresentation.js +68 -49
- package/Widgets/Representations/LineHandleRepresentation.js +116 -0
- package/Widgets/Representations/PolyLineRepresentation.js +52 -49
- package/Widgets/Representations/RectangleContextRepresentation.js +16 -21
- package/Widgets/Representations/SphereContextRepresentation.js +30 -109
- package/Widgets/Representations/SphereHandleRepresentation.js +13 -110
- package/Widgets/Representations/SplineContextRepresentation.js +53 -36
- package/Widgets/Representations/WidgetRepresentation.d.ts +52 -1
- package/Widgets/Representations/WidgetRepresentation.js +140 -78
- package/Widgets/Representations.js +6 -0
- package/Widgets/Widgets3D/AngleWidget.js +1 -4
- package/Widgets/Widgets3D/EllipseWidget/state.js +1 -1
- package/Widgets/Widgets3D/EllipseWidget.js +0 -7
- package/Widgets/Widgets3D/LabelWidget/behavior.js +0 -7
- package/Widgets/Widgets3D/LabelWidget.js +1 -18
- package/Widgets/Widgets3D/LineWidget/behavior.js +0 -44
- package/Widgets/Widgets3D/LineWidget.js +0 -11
- package/Widgets/Widgets3D/PolyLineWidget.js +0 -10
- package/Widgets/Widgets3D/RectangleWidget.js +0 -7
- package/Widgets/Widgets3D/ResliceCursorWidget/Constants.js +15 -3
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +93 -36
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +75 -82
- package/Widgets/Widgets3D/ResliceCursorWidget/state.js +49 -170
- package/Widgets/Widgets3D/ResliceCursorWidget.js +61 -23
- package/Widgets/Widgets3D/ShapeWidget.js +1 -1
- package/index.d.ts +0 -1
- package/macros.d.ts +3 -5
- package/macros.js +4 -35
- package/package.json +3 -2
- package/Widgets/Core/WidgetManager/vdom.js +0 -172
- package/Widgets/Representations/ResliceCursorContextRepresentation/Constants.js +0 -12
- package/Widgets/Representations/ResliceCursorContextRepresentation.d.ts +0 -54
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +0 -357
- package/Widgets/SVG/SVGLandmarkRepresentation/Constants.js +0 -28
- package/Widgets/SVG/SVGLandmarkRepresentation.js +0 -179
- package/Widgets/SVG/SVGRepresentation.js +0 -163
- package/_vendor/available-typed-arrays/index.js_commonjs-proxy.js +0 -1
- package/_vendor/call-bind/callBound.js_commonjs-proxy.js +0 -1
- package/_vendor/call-bind/index.js_commonjs-module.js +0 -3
- package/_vendor/call-bind/index.js_commonjs-proxy.js +0 -1
- package/_vendor/deep-equal/node_modules/isarray/index.js_commonjs-proxy.js +0 -1
- package/_vendor/define-properties/index.js_commonjs-proxy.js +0 -1
- package/_vendor/es-abstract/helpers/getOwnPropertyDescriptor.js_commonjs-proxy.js +0 -1
- package/_vendor/es-get-iterator/index.js_commonjs-module.js +0 -3
- package/_vendor/es-get-iterator/index.js_commonjs-proxy.js +0 -1
- package/_vendor/es-get-iterator/node_modules/isarray/index.js_commonjs-proxy.js +0 -1
- package/_vendor/foreach/index.js_commonjs-proxy.js +0 -1
- package/_vendor/function-bind/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/function-bind/index.js_commonjs-proxy.js +0 -1
- package/_vendor/get-intrinsic/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has/src/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-bigints/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-symbols/index.js_commonjs-proxy.js +0 -1
- package/_vendor/has-symbols/shams.js_commonjs-proxy.js +0 -1
- package/_vendor/has-tostringtag/shams.js_commonjs-proxy.js +0 -1
- package/_vendor/is-arguments/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-bigint/index.js_commonjs-module.js +0 -3
- package/_vendor/is-bigint/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-boolean-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-date-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-map/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-number-object/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-regex/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-set/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-string/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-symbol/index.js_commonjs-module.js +0 -3
- package/_vendor/is-symbol/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-typed-array/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-weakmap/index.js_commonjs-proxy.js +0 -1
- package/_vendor/is-weakset/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-inspect/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/object-is/shim.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object-keys/isArguments.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/index.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/object.assign/shim.js_commonjs-proxy.js +0 -2
- package/_vendor/regexp.prototype.flags/implementation.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/index.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/polyfill.js_commonjs-proxy.js +0 -1
- package/_vendor/regexp.prototype.flags/shim.js_commonjs-proxy.js +0 -1
- package/_vendor/side-channel/index.js_commonjs-proxy.js +0 -1
- package/_vendor/which-boxed-primitive/index.js_commonjs-proxy.js +0 -5
- package/_vendor/which-collection/index.js_commonjs-proxy.js +0 -4
- package/_vendor/which-typed-array/index.js_commonjs-proxy.js +0 -1
- package/_virtual/_node-resolve_empty.js_commonjs-proxy.js +0 -6
- package/_virtual/commonjsHelpers.js +0 -18
- package/_virtual/node-resolve_empty.js +0 -8
- package/_virtual/polyfill-node.global.js +0 -5
- package/_virtual/polyfill-node.process.js +0 -225
- package/vendor/available-typed-arrays/index.js +0 -29
- package/vendor/call-bind/callBound.js +0 -19
- package/vendor/call-bind/index.js +0 -52
- package/vendor/deep-equal/index.js +0 -379
- package/vendor/deep-equal/node_modules/isarray/index.js +0 -7
- package/vendor/define-properties/index.js +0 -60
- package/vendor/es-abstract/helpers/getOwnPropertyDescriptor.js +0 -17
- package/vendor/es-get-iterator/index.js +0 -217
- package/vendor/es-get-iterator/node_modules/isarray/index.js +0 -7
- package/vendor/foreach/index.js +0 -22
- package/vendor/function-bind/implementation.js +0 -52
- package/vendor/function-bind/index.js +0 -7
- package/vendor/get-intrinsic/index.js +0 -334
- package/vendor/has/src/index.js +0 -7
- package/vendor/has-bigints/index.js +0 -12
- package/vendor/has-symbols/index.js +0 -15
- package/vendor/has-symbols/shams.js +0 -42
- package/vendor/has-tostringtag/shams.js +0 -9
- package/vendor/is-arguments/index.js +0 -36
- package/vendor/is-bigint/index.js +0 -39
- package/vendor/is-boolean-object/index.js +0 -29
- package/vendor/is-date-object/index.js +0 -22
- package/vendor/is-map/index.js +0 -42
- package/vendor/is-number-object/index.js +0 -26
- package/vendor/is-regex/index.js +0 -61
- package/vendor/is-set/index.js +0 -42
- package/vendor/is-string/index.js +0 -26
- package/vendor/is-symbol/index.js +0 -36
- package/vendor/is-typed-array/index.js +0 -67
- package/vendor/is-weakmap/index.js +0 -42
- package/vendor/is-weakset/index.js +0 -42
- package/vendor/object-inspect/index.js +0 -515
- package/vendor/object-is/implementation.js +0 -18
- package/vendor/object-is/index.js +0 -25
- package/vendor/object-is/polyfill.js +0 -9
- package/vendor/object-is/shim.js +0 -17
- package/vendor/object-keys/implementation.js +0 -124
- package/vendor/object-keys/index.js +0 -35
- package/vendor/object-keys/isArguments.js +0 -17
- package/vendor/object.assign/implementation.js +0 -46
- package/vendor/object.assign/index.js +0 -29
- package/vendor/object.assign/polyfill.js +0 -57
- package/vendor/object.assign/shim.js +0 -17
- package/vendor/regexp.prototype.flags/implementation.js +0 -30
- package/vendor/regexp.prototype.flags/index.js +0 -25
- package/vendor/regexp.prototype.flags/polyfill.js +0 -23
- package/vendor/regexp.prototype.flags/shim.js +0 -29
- package/vendor/side-channel/index.js +0 -128
- package/vendor/which-boxed-primitive/index.js +0 -38
- package/vendor/which-collection/index.js +0 -29
- package/vendor/which-typed-array/index.js +0 -63
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { o as objectKeys } from '../object-keys/index.js';
|
|
2
|
-
|
|
3
|
-
var keys = objectKeys;
|
|
4
|
-
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
|
5
|
-
|
|
6
|
-
var toStr = Object.prototype.toString;
|
|
7
|
-
var concat = Array.prototype.concat;
|
|
8
|
-
var origDefineProperty = Object.defineProperty;
|
|
9
|
-
|
|
10
|
-
var isFunction = function (fn) {
|
|
11
|
-
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
var arePropertyDescriptorsSupported = function () {
|
|
15
|
-
var obj = {};
|
|
16
|
-
try {
|
|
17
|
-
origDefineProperty(obj, 'x', { enumerable: false, value: obj });
|
|
18
|
-
// eslint-disable-next-line no-unused-vars, no-restricted-syntax
|
|
19
|
-
for (var _ in obj) { // jscs:ignore disallowUnusedVariables
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return obj.x === obj;
|
|
23
|
-
} catch (e) { /* this is IE 8. */
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
|
|
28
|
-
|
|
29
|
-
var defineProperty = function (object, name, value, predicate) {
|
|
30
|
-
if (name in object && (!isFunction(predicate) || !predicate())) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (supportsDescriptors) {
|
|
34
|
-
origDefineProperty(object, name, {
|
|
35
|
-
configurable: true,
|
|
36
|
-
enumerable: false,
|
|
37
|
-
value: value,
|
|
38
|
-
writable: true
|
|
39
|
-
});
|
|
40
|
-
} else {
|
|
41
|
-
object[name] = value;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var defineProperties = function (object, map) {
|
|
46
|
-
var predicates = arguments.length > 2 ? arguments[2] : {};
|
|
47
|
-
var props = keys(map);
|
|
48
|
-
if (hasSymbols) {
|
|
49
|
-
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
|
50
|
-
}
|
|
51
|
-
for (var i = 0; i < props.length; i += 1) {
|
|
52
|
-
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
defineProperties.supportsDescriptors = !!supportsDescriptors;
|
|
57
|
-
|
|
58
|
-
var defineProperties_1 = defineProperties;
|
|
59
|
-
|
|
60
|
-
export { defineProperties_1 as d };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { g as getIntrinsic } from '../../get-intrinsic/index.js';
|
|
2
|
-
|
|
3
|
-
var GetIntrinsic = getIntrinsic;
|
|
4
|
-
|
|
5
|
-
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
|
6
|
-
if ($gOPD) {
|
|
7
|
-
try {
|
|
8
|
-
$gOPD([], 'length');
|
|
9
|
-
} catch (e) {
|
|
10
|
-
// IE 8 has a broken gOPD
|
|
11
|
-
$gOPD = null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
var getOwnPropertyDescriptor = $gOPD;
|
|
16
|
-
|
|
17
|
-
export { getOwnPropertyDescriptor as g };
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import { b as browser$1 } from '../../_virtual/polyfill-node.process.js';
|
|
2
|
-
import { e as esGetIterator } from '../../_vendor/es-get-iterator/index.js_commonjs-module.js';
|
|
3
|
-
import { i as isArguments$1 } from '../is-arguments/index.js';
|
|
4
|
-
import { h as hasSymbols } from '../has-symbols/index.js';
|
|
5
|
-
import { s as shams } from '../has-symbols/shams.js';
|
|
6
|
-
import { i as isarray } from './node_modules/isarray/index.js';
|
|
7
|
-
import { i as isString$1 } from '../is-string/index.js';
|
|
8
|
-
import { g as getIntrinsic } from '../get-intrinsic/index.js';
|
|
9
|
-
import { c as callBound$1 } from '../call-bind/callBound.js';
|
|
10
|
-
import { i as isMap$1 } from '../is-map/index.js';
|
|
11
|
-
import { i as isSet$1 } from '../is-set/index.js';
|
|
12
|
-
|
|
13
|
-
/* eslint global-require: 0 */
|
|
14
|
-
// the code is structured this way so that bundlers can
|
|
15
|
-
// alias out `has-symbols` to `() => true` or `() => false` if your target
|
|
16
|
-
// environments' Symbol capabilities are known, and then use
|
|
17
|
-
// dead code elimination on the rest of this module.
|
|
18
|
-
//
|
|
19
|
-
// Similarly, `isarray` can be aliased to `Array.isArray` if
|
|
20
|
-
// available in all target environments.
|
|
21
|
-
|
|
22
|
-
var isArguments = isArguments$1;
|
|
23
|
-
|
|
24
|
-
if (hasSymbols() || shams()) {
|
|
25
|
-
var $iterator = Symbol.iterator;
|
|
26
|
-
// Symbol is available natively or shammed
|
|
27
|
-
// natively:
|
|
28
|
-
// - Chrome >= 38
|
|
29
|
-
// - Edge 12-14?, Edge >= 15 for sure
|
|
30
|
-
// - FF >= 36
|
|
31
|
-
// - Safari >= 9
|
|
32
|
-
// - node >= 0.12
|
|
33
|
-
esGetIterator.exports = function getIterator(iterable) {
|
|
34
|
-
// alternatively, `iterable[$iterator]?.()`
|
|
35
|
-
if (iterable != null && typeof iterable[$iterator] !== 'undefined') {
|
|
36
|
-
return iterable[$iterator]();
|
|
37
|
-
}
|
|
38
|
-
if (isArguments(iterable)) {
|
|
39
|
-
// arguments objects lack Symbol.iterator
|
|
40
|
-
// - node 0.12
|
|
41
|
-
return Array.prototype[$iterator].call(iterable);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
} else {
|
|
45
|
-
// Symbol is not available, native or shammed
|
|
46
|
-
var isArray = isarray;
|
|
47
|
-
var isString = isString$1;
|
|
48
|
-
var GetIntrinsic = getIntrinsic;
|
|
49
|
-
var $Map = GetIntrinsic('%Map%', true);
|
|
50
|
-
var $Set = GetIntrinsic('%Set%', true);
|
|
51
|
-
var callBound = callBound$1;
|
|
52
|
-
var $arrayPush = callBound('Array.prototype.push');
|
|
53
|
-
var $charCodeAt = callBound('String.prototype.charCodeAt');
|
|
54
|
-
var $stringSlice = callBound('String.prototype.slice');
|
|
55
|
-
|
|
56
|
-
var advanceStringIndex = function advanceStringIndex(S, index) {
|
|
57
|
-
var length = S.length;
|
|
58
|
-
if ((index + 1) >= length) {
|
|
59
|
-
return index + 1;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var first = $charCodeAt(S, index);
|
|
63
|
-
if (first < 0xD800 || first > 0xDBFF) {
|
|
64
|
-
return index + 1;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
var second = $charCodeAt(S, index + 1);
|
|
68
|
-
if (second < 0xDC00 || second > 0xDFFF) {
|
|
69
|
-
return index + 1;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return index + 2;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var getArrayIterator = function getArrayIterator(arraylike) {
|
|
76
|
-
var i = 0;
|
|
77
|
-
return {
|
|
78
|
-
next: function next() {
|
|
79
|
-
var done = i >= arraylike.length;
|
|
80
|
-
var value;
|
|
81
|
-
if (!done) {
|
|
82
|
-
value = arraylike[i];
|
|
83
|
-
i += 1;
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
done: done,
|
|
87
|
-
value: value
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
var getNonCollectionIterator = function getNonCollectionIterator(iterable, noPrimordialCollections) {
|
|
94
|
-
if (isArray(iterable) || isArguments(iterable)) {
|
|
95
|
-
return getArrayIterator(iterable);
|
|
96
|
-
}
|
|
97
|
-
if (isString(iterable)) {
|
|
98
|
-
var i = 0;
|
|
99
|
-
return {
|
|
100
|
-
next: function next() {
|
|
101
|
-
var nextIndex = advanceStringIndex(iterable, i);
|
|
102
|
-
var value = $stringSlice(iterable, i, nextIndex);
|
|
103
|
-
i = nextIndex;
|
|
104
|
-
return {
|
|
105
|
-
done: nextIndex > iterable.length,
|
|
106
|
-
value: value
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// es6-shim and es-shims' es-map use a string "_es6-shim iterator_" property on different iterables, such as MapIterator.
|
|
113
|
-
if (noPrimordialCollections && typeof iterable['_es6-shim iterator_'] !== 'undefined') {
|
|
114
|
-
return iterable['_es6-shim iterator_']();
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
if (!$Map && !$Set) {
|
|
119
|
-
// the only language iterables are Array, String, arguments
|
|
120
|
-
// - Safari <= 6.0
|
|
121
|
-
// - Chrome < 38
|
|
122
|
-
// - node < 0.12
|
|
123
|
-
// - FF < 13
|
|
124
|
-
// - IE < 11
|
|
125
|
-
// - Edge < 11
|
|
126
|
-
|
|
127
|
-
esGetIterator.exports = function getIterator(iterable) {
|
|
128
|
-
if (iterable != null) {
|
|
129
|
-
return getNonCollectionIterator(iterable, true);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
} else {
|
|
133
|
-
// either Map or Set are available, but Symbol is not
|
|
134
|
-
// - es6-shim on an ES5 browser
|
|
135
|
-
// - Safari 6.2 (maybe 6.1?)
|
|
136
|
-
// - FF v[13, 36)
|
|
137
|
-
// - IE 11
|
|
138
|
-
// - Edge 11
|
|
139
|
-
// - Safari v[6, 9)
|
|
140
|
-
|
|
141
|
-
var isMap = isMap$1;
|
|
142
|
-
var isSet = isSet$1;
|
|
143
|
-
|
|
144
|
-
// Firefox >= 27, IE 11, Safari 6.2 - 9, Edge 11, es6-shim in older envs, all have forEach
|
|
145
|
-
var $mapForEach = callBound('Map.prototype.forEach', true);
|
|
146
|
-
var $setForEach = callBound('Set.prototype.forEach', true);
|
|
147
|
-
if (typeof browser$1 === 'undefined' || !browser$1.versions || !browser$1.versions.node) { // "if is not node"
|
|
148
|
-
|
|
149
|
-
// Firefox 17 - 26 has `.iterator()`, whose iterator `.next()` either
|
|
150
|
-
// returns a value, or throws a StopIteration object. These browsers
|
|
151
|
-
// do not have any other mechanism for iteration.
|
|
152
|
-
var $mapIterator = callBound('Map.prototype.iterator', true);
|
|
153
|
-
var $setIterator = callBound('Set.prototype.iterator', true);
|
|
154
|
-
var getStopIterationIterator = function (iterator) {
|
|
155
|
-
var done = false;
|
|
156
|
-
return {
|
|
157
|
-
next: function next() {
|
|
158
|
-
try {
|
|
159
|
-
return {
|
|
160
|
-
done: done,
|
|
161
|
-
value: done ? undefined : iterator.next()
|
|
162
|
-
};
|
|
163
|
-
} catch (e) {
|
|
164
|
-
done = true;
|
|
165
|
-
return {
|
|
166
|
-
done: true,
|
|
167
|
-
value: undefined
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
// Firefox 27-35, and some older es6-shim versions, use a string "@@iterator" property
|
|
175
|
-
// this returns a proper iterator object, so we should use it instead of forEach.
|
|
176
|
-
// newer es6-shim versions use a string "_es6-shim iterator_" property.
|
|
177
|
-
var $mapAtAtIterator = callBound('Map.prototype.@@iterator', true) || callBound('Map.prototype._es6-shim iterator_', true);
|
|
178
|
-
var $setAtAtIterator = callBound('Set.prototype.@@iterator', true) || callBound('Set.prototype._es6-shim iterator_', true);
|
|
179
|
-
|
|
180
|
-
var getCollectionIterator = function getCollectionIterator(iterable) {
|
|
181
|
-
if (isMap(iterable)) {
|
|
182
|
-
if ($mapIterator) {
|
|
183
|
-
return getStopIterationIterator($mapIterator(iterable));
|
|
184
|
-
}
|
|
185
|
-
if ($mapAtAtIterator) {
|
|
186
|
-
return $mapAtAtIterator(iterable);
|
|
187
|
-
}
|
|
188
|
-
if ($mapForEach) {
|
|
189
|
-
var entries = [];
|
|
190
|
-
$mapForEach(iterable, function (v, k) {
|
|
191
|
-
$arrayPush(entries, [k, v]);
|
|
192
|
-
});
|
|
193
|
-
return getArrayIterator(entries);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
if (isSet(iterable)) {
|
|
197
|
-
if ($setIterator) {
|
|
198
|
-
return getStopIterationIterator($setIterator(iterable));
|
|
199
|
-
}
|
|
200
|
-
if ($setAtAtIterator) {
|
|
201
|
-
return $setAtAtIterator(iterable);
|
|
202
|
-
}
|
|
203
|
-
if ($setForEach) {
|
|
204
|
-
var values = [];
|
|
205
|
-
$setForEach(iterable, function (v) {
|
|
206
|
-
$arrayPush(values, v);
|
|
207
|
-
});
|
|
208
|
-
return getArrayIterator(values);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
esGetIterator.exports = function getIterator(iterable) {
|
|
214
|
-
return getCollectionIterator(iterable) || getNonCollectionIterator(iterable);
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
}
|
package/vendor/foreach/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var hasOwn = Object.prototype.hasOwnProperty;
|
|
2
|
-
var toString = Object.prototype.toString;
|
|
3
|
-
|
|
4
|
-
var foreach = function forEach (obj, fn, ctx) {
|
|
5
|
-
if (toString.call(fn) !== '[object Function]') {
|
|
6
|
-
throw new TypeError('iterator must be a function');
|
|
7
|
-
}
|
|
8
|
-
var l = obj.length;
|
|
9
|
-
if (l === +l) {
|
|
10
|
-
for (var i = 0; i < l; i++) {
|
|
11
|
-
fn.call(ctx, obj[i], i, obj);
|
|
12
|
-
}
|
|
13
|
-
} else {
|
|
14
|
-
for (var k in obj) {
|
|
15
|
-
if (hasOwn.call(obj, k)) {
|
|
16
|
-
fn.call(ctx, obj[k], k, obj);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { foreach as f };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/* eslint no-invalid-this: 1 */
|
|
2
|
-
|
|
3
|
-
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
4
|
-
var slice = Array.prototype.slice;
|
|
5
|
-
var toStr = Object.prototype.toString;
|
|
6
|
-
var funcType = '[object Function]';
|
|
7
|
-
|
|
8
|
-
var implementation = function bind(that) {
|
|
9
|
-
var target = this;
|
|
10
|
-
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
|
|
11
|
-
throw new TypeError(ERROR_MESSAGE + target);
|
|
12
|
-
}
|
|
13
|
-
var args = slice.call(arguments, 1);
|
|
14
|
-
|
|
15
|
-
var bound;
|
|
16
|
-
var binder = function () {
|
|
17
|
-
if (this instanceof bound) {
|
|
18
|
-
var result = target.apply(
|
|
19
|
-
this,
|
|
20
|
-
args.concat(slice.call(arguments))
|
|
21
|
-
);
|
|
22
|
-
if (Object(result) === result) {
|
|
23
|
-
return result;
|
|
24
|
-
}
|
|
25
|
-
return this;
|
|
26
|
-
} else {
|
|
27
|
-
return target.apply(
|
|
28
|
-
that,
|
|
29
|
-
args.concat(slice.call(arguments))
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var boundLength = Math.max(0, target.length - args.length);
|
|
35
|
-
var boundArgs = [];
|
|
36
|
-
for (var i = 0; i < boundLength; i++) {
|
|
37
|
-
boundArgs.push('$' + i);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
41
|
-
|
|
42
|
-
if (target.prototype) {
|
|
43
|
-
var Empty = function Empty() {};
|
|
44
|
-
Empty.prototype = target.prototype;
|
|
45
|
-
bound.prototype = new Empty();
|
|
46
|
-
Empty.prototype = null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return bound;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { implementation as i };
|