@rss/common
Advanced tools
Comparing version 0.1.22 to 0.1.23
@@ -5,3 +5,3 @@ "use strict"; | ||
return relationships.filter(function (r) { | ||
return r._id === id; | ||
return r.nodeId === id; | ||
}).map(function (r) { | ||
@@ -14,4 +14,4 @@ return r.role; | ||
return relationships.some(function (r) { | ||
return r._id === id; | ||
return r.nodeId === id; | ||
}); | ||
}; |
@@ -13,2 +13,4 @@ "use strict"; | ||
var EDGE_ROLE = require('../../constant/relationship/edge-role.constant'); | ||
var Edge = | ||
@@ -62,3 +64,3 @@ /*#__PURE__*/ | ||
role: { | ||
enum: ['OWNER', 'MEMBER', 'LOCATION'] | ||
enum: Object.keys(EDGE_ROLE) | ||
} | ||
@@ -65,0 +67,0 @@ }, |
@@ -21,4 +21,2 @@ "use strict"; | ||
var ObjectId = require('bson').ObjectID; | ||
var PersonReference = require('../core/person-reference'); | ||
@@ -25,0 +23,0 @@ |
@@ -58,2 +58,3 @@ // constant - assessment | ||
exports.NODE_TYPE = require('./dist/constant/relationship/node-type.constant'); | ||
exports.EDGE_ROLE = require('./dist/constant/relationship/edge-role.constant'); | ||
@@ -144,2 +145,3 @@ // constant - reminder | ||
exports.createCardFactory = require('./dist/helper/card-factory').createCardFactory; | ||
exports.AssessmentHelper = require('./dist/helper/assessment.helper'); | ||
exports.Helper = require('./dist/helper/helper'); | ||
@@ -146,0 +148,0 @@ exports.PermissionHelper = require('./dist/helper/permission.helper'); |
{ | ||
"name": "@rss/common", | ||
"version": "0.1.22", | ||
"version": "0.1.23", | ||
"description": "common constant, classes, & helper", | ||
@@ -5,0 +5,0 @@ "author": "Risk & Safety Solution", |
module.exports.hasRelationshipWithRole = (id, relationships, role) => { | ||
return relationships | ||
.filter((r) => r._id === id) | ||
.filter((r) => r.nodeId === id) | ||
.map((r) => r.role) | ||
@@ -8,4 +8,2 @@ .includes(role); | ||
module.exports.hasRelationship = (relationships, id) => { | ||
return relationships.some((r) => r._id === id); | ||
}; | ||
module.exports.hasRelationship = (relationships, id) => relationships.some((r) => r.nodeId === id); |
const ObjectId = require('bson').ObjectID; | ||
const tv4 = require('tv4'); | ||
const EDGE_ROLE = require('../../constant/relationship/edge-role.constant'); | ||
class Edge { | ||
@@ -37,3 +39,3 @@ constructor(opt) { | ||
source: { type: 'string' }, | ||
role: { enum: ['OWNER', 'MEMBER', 'LOCATION'] }, | ||
role: { enum: Object.keys(EDGE_ROLE) }, | ||
}, | ||
@@ -40,0 +42,0 @@ required: Object.keys(new Edge()), |
@@ -1,2 +0,1 @@ | ||
const ObjectId = require('bson').ObjectID; | ||
const PersonReference = require('../core/person-reference'); | ||
@@ -3,0 +2,0 @@ const clone = require('clone'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
1404699
0
268
19055