mirror of
https://github.com/xodio/xod.git
synced 2026-03-18 22:56:51 +01:00
refactor(xod-project): remove isPinCurried function
This commit is contained in:
@@ -70,7 +70,7 @@ Manipulate with entities only using API functions or you can get unhandled excep
|
||||
|
||||
* **Check functions**
|
||||
If function checks something and returns boolean, it looks like a question.
|
||||
For example, `isPinCurried`, `hasPins`.
|
||||
For example, `isValidIdentifier`, `hasPins`.
|
||||
|
||||
### Getters, setters and their return values
|
||||
|
||||
|
||||
@@ -303,23 +303,6 @@ export const curryPin = def( // TODO: deprecated
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* @function isPinCurried
|
||||
* @param {string} key
|
||||
* @param {Node} node
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const isPinCurried = def( // TODO: deprecated
|
||||
'isPinCurried :: PinKey -> Node -> Boolean',
|
||||
R.useWith(
|
||||
R.pathSatisfies(R.equals(true)),
|
||||
[
|
||||
getPathToPinProperty('curried'),
|
||||
R.identity,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* Returns data type extracted from pinNode type
|
||||
* @function getPinNodeDataType
|
||||
|
||||
@@ -288,23 +288,6 @@ describe('Node', () => {
|
||||
expect(Node.isPinNode(nodeOfType('xod/patch-nodes/output-number'))).to.be.true();
|
||||
});
|
||||
});
|
||||
describe('isPinCurried', () => {
|
||||
it('should return false for non-existent pin', () => {
|
||||
expect(Node.isPinCurried('test', emptyNode)).to.be.false();
|
||||
});
|
||||
it('should return false for pin without `curried` property equal to true', () => {
|
||||
const node = Helper.defaultizeNode({ boundValues: { test: {} } });
|
||||
expect(Node.isPinCurried('test', node)).to.be.false();
|
||||
});
|
||||
it('should return true for pin that curried', () => {
|
||||
const node = Helper.defaultizeNode({ boundValues: { test: { value: 1, curried: true } } });
|
||||
expect(Node.isPinCurried('test', node)).to.be.true();
|
||||
});
|
||||
it('should return true for pin that curried, even it haven\'t a value', () => {
|
||||
const node = Helper.defaultizeNode({ boundValues: { test: { curried: true } } });
|
||||
expect(Node.isPinCurried('test', node)).to.be.true();
|
||||
});
|
||||
});
|
||||
// etc
|
||||
describe('getPinNodeDataType', () => {
|
||||
it('should throw error for non-existent data-type', () => {
|
||||
|
||||
Reference in New Issue
Block a user