Skip to content

Commit

Permalink
Merge pull request #56 from Neovici/feat/allow-path-locator-key
Browse files Browse the repository at this point in the history
feat: allow pathLocator as key in nodeObj
  • Loading branch information
megheaiulian authored Jul 21, 2022
2 parents 08445b0 + 2fe38b1 commit 4c0a8d6
Show file tree
Hide file tree
Showing 16 changed files with 17,288 additions and 17,103 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./node_modules/@neovici/cfg/eslint",
"rules": {
"max-lines-per-function": 0,
"import/group-exports": 0
}
}
3 changes: 0 additions & 3 deletions .eslintrc.json

This file was deleted.

File renamed without changes.
18 changes: 11 additions & 7 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Use Node.js 12.x
uses: actions/setup-node@v1
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: 16.x
cache: 'npm'

- name: Install
run: npm ci

- name: Lint commit messages
run: npx commitlint --from origin/master --to HEAD
uses: wagoid/commitlint-github-action@v3

- name: ESLint
run: npm run lint
Expand All @@ -40,7 +43,7 @@ jobs:
run: |
([[ -e $NEO_CC ]] || curl -L $NEO_CC_URL > $NEO_CC) && chmod +x $NEO_CC
$NEO_CC before-build
echo "::add-matcher::.github/karma-problem-matcher.json"
echo "::add-matcher::.github/problem-matcher.json"
npm test
$NEO_CC after-build --exit-code $?
Expand All @@ -49,4 +52,5 @@ jobs:
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
HUSKY: 0
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@neovici/cfg/prettier"
8 changes: 4 additions & 4 deletions cosmoz-default-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class DefaultTree extends Tree {

_getPathNodes(pathLocator, nodeObj = this._treeData, pathLocatorSeparator = this.pathLocatorSeparator) {
const path = pathLocator.split(pathLocatorSeparator),
nodes = this._pathToNodes(path, nodeObj);
nodes = this._pathToNodes(path, nodeObj, pathLocatorSeparator);

// Filter out undefined items of the start
while (nodes.length > 0 && nodes[0] === undefined) {
Expand All @@ -171,14 +171,14 @@ export class DefaultTree extends Tree {
return nodes;
}

_pathToNodes(path, nodes) {
_pathToNodes(path, nodes, separator) {
let pathSegment = nodes;
return path.map(nodeKey => {
return path.map((nodeKey, i) => {
// Get the nodes on the path
if (!pathSegment) {
return false;
}
const node = pathSegment[nodeKey];
const node = pathSegment[nodeKey] ?? pathSegment[path.slice(0, i + 1).join(separator)];
if (node) {
pathSegment = node[this.childProperty];
}
Expand Down
9 changes: 0 additions & 9 deletions es-dev-server.config.js

This file was deleted.

74 changes: 0 additions & 74 deletions karma.conf.js

This file was deleted.

Loading

0 comments on commit 4c0a8d6

Please sign in to comment.