@barchart/portfolio-api-common 1.2.76 → 1.2.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -371,15 +371,17 @@ module.exports = (() => {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
setPositionLock(position) {
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
if (position) {
|
|
375
|
+
assert.argumentIsRequired(position, 'position', Object);
|
|
376
|
+
assert.argumentIsRequired(position.position, 'position.position', String);
|
|
376
377
|
|
|
377
|
-
|
|
378
|
+
const item = this._items.find((i) => i.position.position === position.position);
|
|
378
379
|
|
|
379
|
-
|
|
380
|
-
|
|
380
|
+
if (item) {
|
|
381
|
+
const locked = is.object(position.system) && is.boolean(position.system.locked) && position.system.locked;
|
|
381
382
|
|
|
382
|
-
|
|
383
|
+
item.setPositionLock(locked);
|
|
384
|
+
}
|
|
383
385
|
}
|
|
384
386
|
}
|
|
385
387
|
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -1750,15 +1750,17 @@ module.exports = (() => {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
|
|
1752
1752
|
setPositionLock(position) {
|
|
1753
|
-
|
|
1754
|
-
|
|
1753
|
+
if (position) {
|
|
1754
|
+
assert.argumentIsRequired(position, 'position', Object);
|
|
1755
|
+
assert.argumentIsRequired(position.position, 'position.position', String);
|
|
1755
1756
|
|
|
1756
|
-
|
|
1757
|
+
const item = this._items.find((i) => i.position.position === position.position);
|
|
1757
1758
|
|
|
1758
|
-
|
|
1759
|
-
|
|
1759
|
+
if (item) {
|
|
1760
|
+
const locked = is.object(position.system) && is.boolean(position.system.locked) && position.system.locked;
|
|
1760
1761
|
|
|
1761
|
-
|
|
1762
|
+
item.setPositionLock(locked);
|
|
1763
|
+
}
|
|
1762
1764
|
}
|
|
1763
1765
|
}
|
|
1764
1766
|
|