refactor(xod-project): remove isPinCurried function

This commit is contained in:
Evgeny Kochetkov
2017-05-17 20:20:06 +03:00
parent cd897c342f
commit 32ce58eba7
3 changed files with 1 additions and 35 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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', () => {