Comparing version 0.1.26 to 0.1.27
@@ -16,3 +16,3 @@ import { Segments, Node, IdentifierNode, IgnoreExpressionNode, DestructorExpressionNode, ExpandOperatorNode, WildcardOperatorNode, GroupExpressionNode, RangeExpressionNode, DotOperatorNode } from './types'; | ||
matchWildcardOperator(path: Segments, node: WildcardOperatorNode): any; | ||
matchGroupExpression(path: Segments, node: GroupExpressionNode): boolean; | ||
matchGroupExpression(path: Segments, node: GroupExpressionNode): any; | ||
matchRangeExpression(path: Segments, node: RangeExpressionNode): boolean; | ||
@@ -19,0 +19,0 @@ matchDotOperator(path: Segments, node: DotOperatorNode): any; |
@@ -87,3 +87,4 @@ "use strict"; | ||
this.excluding = !!node.isExclude; | ||
var result = utils_1.toArray(node.value).some(function (_node) { | ||
var method = this.excluding ? 'every' : 'some'; | ||
var result = utils_1.toArray(node.value)[method](function (_node) { | ||
_this.pos = current; | ||
@@ -90,0 +91,0 @@ return _this.matchAtom(path, _node); |
{ | ||
"name": "cool-path", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"description": "Path Matcher/Getter/Setter for Object/Array", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -121,3 +121,4 @@ import { | ||
this.excluding = !!node.isExclude | ||
const result = toArray(node.value).some(_node => { | ||
const method = this.excluding ? 'every' : 'some' | ||
const result = toArray(node.value)[method](_node => { | ||
this.pos = current | ||
@@ -124,0 +125,0 @@ return this.matchAtom(path, _node) |
@@ -55,2 +55,4 @@ import expect from 'expect' | ||
expect(patttern2.matchAliasGroup(['array', 0], ['array', 0])).toEqual(false) | ||
expect(Path.parse('*(!aaa,bbb)').match('ggg')).toBeTruthy() | ||
expect(Path.parse('*(!aaa,bbb)').match('bbb')).toBeFalsy() | ||
}) | ||
@@ -120,3 +122,4 @@ | ||
'*(!aa,bb,bb.aa)': [['xx'], ['yyy']], | ||
'*(!aaa)': [['bbb']] | ||
'*(!aaa)': [['bbb']], | ||
'*(!aaa,bbb)': [['ccc'],['ggg']] | ||
}) | ||
@@ -123,0 +126,0 @@ |
163175
5207