Permalink
Browse files

updated dependencies and fixed build under node 6.4

  • Loading branch information...
1 parent 461a436 commit 26ab08ce150c5574bc3112fbcb6d9a79a9a90e32 @konsultaner committed Jun 28, 2016
View
@@ -1539,6 +1539,7 @@ jsonOdm.Geo.edgeIntersectsBounds = function (edge, bounds) {
};
/**
+ * TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite
* Checks whether a line follows another line or is on the line respectively
* @param {Array} lineString An array of points, i.e. [[1,1],[1,2],[1,3]]
* @param {Array} inLineString An array of points, i.e. [[1,1],[1,2],[1,3]]
@@ -1561,9 +1562,9 @@ jsonOdm.Geo.lineStringWithinLineString = function (lineString, inLineString) {
!(
// next is not the next one
(inLineString[j + 1] && lineString[i + 1][0] === inLineString[j + 1][0] && lineString[i + 1][1] === inLineString[j + 1][1]) ||
- // next is not the same one
+ // next is not the same one
(lineString[i + 1][0] === inLineString[j][0] && lineString[i + 1][1] === inLineString[j][1]) ||
- // next is not the previous one
+ // next is not the previous one
(j > 0 && lineString[i + 1][0] === inLineString[j - 1][0] && lineString[i + 1][1] === inLineString[j - 1][1])
)
) {
@@ -1619,6 +1620,7 @@ jsonOdm.Collection.decorate = function (collection) {
var decorate = function (collection) {
if (jsonOdm.util.isArray(collection)) {
/**
+ * // TODO needs a proper has many functionality that aromatically gathers the child elements
* Creates a has many relation to another collection
* @param {Array|String} foreignKeyMapName The name of the field that holds an array of foreign keys
* @param {int|String} privateKeyField The private key of the foreign collection objects
@@ -1669,6 +1671,11 @@ jsonOdm.Collection.decorate = function (collection) {
* @param {String} alias The new field that will carry the connected data.
* @memberof jsonOdm.Collection.prototype
* @method $hasOne
+ * @example
+ * var customers = new jsonOdm.Collection("customers");
+ * customers.$hasOne("id","customerGroupId","customerGroup","group");
+ * console.log(customers[0]);
+ * // > {name:"Some Name",age:"25",...,customerGroupId:1,gourp:{id:1,name:"VIP"},...}
*/
collection.$hasOne = function (foreignKey, privateKeyField, childCollectionName, alias) {
// SET THE ALIAS
View
Oops, something went wrong.
@@ -977,6 +977,7 @@
var decorate = function (collection) {
if (jsonOdm.util.isArray(collection)) {
/**
+ * // TODO needs a proper has many functionality that aromatically gathers the child elements
* Creates a has many relation to another collection
* @param {Array|String} foreignKeyMapName The name of the field that holds an array of foreign keys
* @param {int|String} privateKeyField The private key of the foreign collection objects
@@ -1027,6 +1028,11 @@
* @param {String} alias The new field that will carry the connected data.
* @memberof jsonOdm.Collection.prototype
* @method $hasOne
+ * @example
+ * var customers = new jsonOdm.Collection("customers");
+ * customers.$hasOne("id","customerGroupId","customerGroup","group");
+ * console.log(customers[0]);
+ * // > {name:"Some Name",age:"25",...,customerGroupId:1,gourp:{id:1,name:"VIP"},...}
*/
collection.$hasOne = function (foreignKey, privateKeyField, childCollectionName, alias) {
// SET THE ALIAS
@@ -2229,6 +2229,7 @@
};
/**
+ * TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite
* Checks whether a line follows another line or is on the line respectively
* @param {Array} lineString An array of points, i.e. [[1,1],[1,2],[1,3]]
* @param {Array} inLineString An array of points, i.e. [[1,1],[1,2],[1,3]]
@@ -2251,9 +2252,9 @@
!(
// next is not the next one
(inLineString[j + 1] && lineString[i + 1][0] === inLineString[j + 1][0] && lineString[i + 1][1] === inLineString[j + 1][1]) ||
- // next is not the same one
+ // next is not the same one
(lineString[i + 1][0] === inLineString[j][0] && lineString[i + 1][1] === inLineString[j][1]) ||
- // next is not the previous one
+ // next is not the previous one
(j > 0 && lineString[i + 1][0] === inLineString[j - 1][0] && lineString[i + 1][1] === inLineString[j - 1][1])
)
) {
@@ -1224,7 +1224,8 @@ <h3 class="subsection-title">
</td>
<td class="description">
- Creates a has many relation to another collection
+ // TODO needs a proper has many functionality that aromatically gathers the child elements
+Creates a has many relation to another collection
@@ -1475,7 +1476,8 @@ <h3 class="subsection-title">
<div class="description">
<p>
- Creates a has many relation to another collection
+ // TODO needs a proper has many functionality that aromatically gathers the child elements
+Creates a has many relation to another collection
</p>
</div>
@@ -1878,6 +1880,14 @@ <h3 class="subsection-title">
+ <h4>Example</h4>
+
+ <pre class="prettyprint"><code>var customers = new jsonOdm.Collection("customers");
+customers.$hasOne("id","customerGroupId","customerGroup","group");
+console.log(customers[0]);
+// > {name:"Some Name",age:"25",...,customerGroupId:1,gourp:{id:1,name:"VIP"},...}</code></pre>
+
+
</dd>
@@ -1270,7 +1270,8 @@ <h3 class="subsection-title">
</td>
<td class="description">
- Checks whether a line follows another line or is on the line respectively
+ TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite
+Checks whether a line follows another line or is on the line respectively
@@ -3455,7 +3456,8 @@ <h3 class="subsection-title">
<div class="description">
<p>
- Checks whether a line follows another line or is on the line respectively
+ TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite
+Checks whether a line follows another line or is on the line respectively
</p>
</div>
View
@@ -39,6 +39,7 @@ jsonOdm.Collection.decorate = function (collection) {
var decorate = function (collection) {
if (jsonOdm.util.isArray(collection)) {
/**
+ * // TODO needs a proper has many functionality that aromatically gathers the child elements
* Creates a has many relation to another collection
* @param {Array|String} foreignKeyMapName The name of the field that holds an array of foreign keys
* @param {int|String} privateKeyField The private key of the foreign collection objects
@@ -89,6 +90,11 @@ jsonOdm.Collection.decorate = function (collection) {
* @param {String} alias The new field that will carry the connected data.
* @memberof jsonOdm.Collection.prototype
* @method $hasOne
+ * @example
+ * var customers = new jsonOdm.Collection("customers");
+ * customers.$hasOne("id","customerGroupId","customerGroup","group");
+ * console.log(customers[0]);
+ * // > {name:"Some Name",age:"25",...,customerGroupId:1,gourp:{id:1,name:"VIP"},...}
*/
collection.$hasOne = function (foreignKey, privateKeyField, childCollectionName, alias) {
// SET THE ALIAS
View
@@ -1291,6 +1291,7 @@ jsonOdm.Geo.edgeIntersectsBounds = function (edge, bounds) {
};
/**
+ * TODO: ALSO needs to return true for [[1,1],[2,2,]] and [[0,0],[4,4]] // probably needs a rewrite
* Checks whether a line follows another line or is on the line respectively
* @param {Array} lineString An array of points, i.e. [[1,1],[1,2],[1,3]]
* @param {Array} inLineString An array of points, i.e. [[1,1],[1,2],[1,3]]
@@ -1313,9 +1314,9 @@ jsonOdm.Geo.lineStringWithinLineString = function (lineString, inLineString) {
!(
// next is not the next one
(inLineString[j + 1] && lineString[i + 1][0] === inLineString[j + 1][0] && lineString[i + 1][1] === inLineString[j + 1][1]) ||
- // next is not the same one
+ // next is not the same one
(lineString[i + 1][0] === inLineString[j][0] && lineString[i + 1][1] === inLineString[j][1]) ||
- // next is not the previous one
+ // next is not the previous one
(j > 0 && lineString[i + 1][0] === inLineString[j - 1][0] && lineString[i + 1][1] === inLineString[j - 1][1])
)
) {
View
@@ -75,6 +75,13 @@ describe("Geo Tools", function () {
expect(jsonOdm.Geo.edgeWithinPolygon([[2,5],[10,6]],[[0,0],[10,0],[10,10],[6,10],[6,4],[5,10],[0,10]])).toBeFalsy();
});
});
+ describe("LineString within LineString", function () {
+ it("Sould only take arrays", function () {
+ expect(jsonOdm.Geo.lineStringWithinLineString([[1,2],[3,2]],[[0,0],[1,2],[3,2],[4,4]])).toBeTruthy();
+ expect(jsonOdm.Geo.lineStringWithinLineString([[1,1],[2,2]],[[0,0],[1,1]])).toBeFalsy();
+ expect(jsonOdm.Geo.lineStringWithinLineString()).toBeFalsy();
+ })
+ });
describe("Point on LineString", function () {
var point = [10,10];
var line1 = [[0,0],[0,10],[10,10],[10,0]];

0 comments on commit 26ab08c

Please sign in to comment.