dtable-utils
Advanced tools
Comparing version 4.2.4 to 4.2.5
@@ -237,2 +237,3 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty'; | ||
* @param {array} collaborators e.g. [{ email, name, ... }, ...]. Default as "[]" | ||
* @param {array} departments e.g. [{ name, id }, ...]. Default as "[]" | ||
* @param {bool} isArchiveView If is archive view, get original cell value from "row", otherwise get cell value from "formulaRows" | ||
@@ -247,2 +248,4 @@ * @returns formatted cell value, string | ||
collaborators = _ref4$collaborators === void 0 ? [] : _ref4$collaborators, | ||
_ref4$departments = _ref4.departments, | ||
departments = _ref4$departments === void 0 ? [] : _ref4$departments, | ||
_ref4$isArchiveView = _ref4.isArchiveView, | ||
@@ -249,0 +252,0 @@ isArchiveView = _ref4$isArchiveView === void 0 ? false : _ref4$isArchiveView; |
@@ -9,9 +9,9 @@ /** | ||
if (!id || !departments || departments.length === 0) return ''; | ||
var department = departments.find(function (department) { | ||
var targetDepartment = departments.find(function (department) { | ||
return department.id === id; | ||
}); | ||
if (!department) return ''; | ||
return department.name || ''; | ||
if (!targetDepartment) return ''; | ||
return targetDepartment.name || ''; | ||
}; | ||
export { getDepartmentName }; |
@@ -245,2 +245,3 @@ 'use strict'; | ||
* @param {array} collaborators e.g. [{ email, name, ... }, ...]. Default as "[]" | ||
* @param {array} departments e.g. [{ name, id }, ...]. Default as "[]" | ||
* @param {bool} isArchiveView If is archive view, get original cell value from "row", otherwise get cell value from "formulaRows" | ||
@@ -255,2 +256,4 @@ * @returns formatted cell value, string | ||
collaborators = _ref4$collaborators === void 0 ? [] : _ref4$collaborators, | ||
_ref4$departments = _ref4.departments, | ||
departments = _ref4$departments === void 0 ? [] : _ref4$departments, | ||
_ref4$isArchiveView = _ref4.isArchiveView, | ||
@@ -257,0 +260,0 @@ isArchiveView = _ref4$isArchiveView === void 0 ? false : _ref4$isArchiveView; |
@@ -13,9 +13,9 @@ 'use strict'; | ||
if (!id || !departments || departments.length === 0) return ''; | ||
var department = departments.find(function (department) { | ||
var targetDepartment = departments.find(function (department) { | ||
return department.id === id; | ||
}); | ||
if (!department) return ''; | ||
return department.name || ''; | ||
if (!targetDepartment) return ''; | ||
return targetDepartment.name || ''; | ||
}; | ||
exports.getDepartmentName = getDepartmentName; |
{ | ||
"name": "dtable-utils", | ||
"version": "4.2.4", | ||
"version": "4.2.5", | ||
"description": "dtable common utils", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is too big to display
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
662658
14775