]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / array / # / copy-within / shim.js
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/copy-within/shim.js
new file mode 100644 (file)
index 0000000..c0bfb8b
--- /dev/null
@@ -0,0 +1,39 @@
+// Taken from: https://github.com/paulmillr/es6-shim/
+
+'use strict';
+
+var toInteger  = require('../../../number/to-integer')
+  , toPosInt   = require('../../../number/to-pos-integer')
+  , validValue = require('../../../object/valid-value')
+
+  , hasOwnProperty = Object.prototype.hasOwnProperty
+  , max = Math.max, min = Math.min;
+
+module.exports = function (target, start/*, end*/) {
+       var o = validValue(this), end = arguments[2], l = toPosInt(o.length)
+         , to, from, fin, count, direction;
+
+       target = toInteger(target);
+       start = toInteger(start);
+       end = (end === undefined) ? l : toInteger(end);
+
+       to = target < 0 ? max(l + target, 0) : min(target, l);
+       from = start < 0 ? max(l + start, 0) : min(start, l);
+       fin = end < 0 ? max(l + end, 0) : min(end, l);
+       count = min(fin - from, l - to);
+       direction = 1;
+
+       if ((from < to) && (to < (from + count))) {
+               direction = -1;
+               from += count - 1;
+               to += count - 1;
+       }
+       while (count > 0) {
+               if (hasOwnProperty.call(o, from)) o[to] = o[from];
+               else delete o[from];
+               from += direction;
+               to += direction;
+               count -= 1;
+       }
+       return o;
+};