]> gerrit.simantics Code Review - simantics/district.git/blob - 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/test/object/find-key.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 / test / object / find-key.js
1 'use strict';
2
3 var o = { 1: 1, 2: 2, 3: 3 };
4
5 module.exports = function (t, a) {
6         var o2 = {}, i = 0;
7         t(o, function (value, name) {
8                 o2[name] = value;
9                 return false;
10         });
11         a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
12
13         a(t(o, function () {
14                 ++i;
15                 return true;
16         }), '1', "Finds");
17         a(i, 1, "Stops iteration after condition is met");
18
19         a(t(o, function () {
20                 return false;
21         }), undefined, "Fails");
22
23 };