-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add types #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add types #3
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
eba500f
adds type definitions
guillaumegarcia13 200fc95
Update package.json
guillaumegarcia13 598c89e
Update types/index.d.ts
guillaumegarcia13 43834f1
Update types/index.d.ts
guillaumegarcia13 8134e93
amends based on reviews
guillaumegarcia13 10891a0
Merge branch 'main' of https://github.com/guillaumegarcia13/unist-uti…
guillaumegarcia13 43afc88
adds tslint.json
guillaumegarcia13 c230075
fixes formatting
guillaumegarcia13 6baa5db
adds type test
guillaumegarcia13 027e875
Update types/test.ts
guillaumegarcia13 7d68fe3
Update types/index.d.ts
guillaumegarcia13 931878b
Update types/index.d.ts
guillaumegarcia13 3f226b3
Update package.json
guillaumegarcia13 8ab150d
adds fixes
guillaumegarcia13 ab3d07f
fixes multiple export with same name
guillaumegarcia13 f965220
changes syntax to matcht unist-builder's one
guillaumegarcia13 6a4f5a5
fixes superfluous declare
guillaumegarcia13 93006d4
Update types/index.d.ts
guillaumegarcia13 b37a296
adds options within namespace
guillaumegarcia13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,91 @@ | ||
{ | ||
"name": "unist-util-remove", | ||
"version": "2.0.1", | ||
"description": "unist utility to remove nodes from a tree", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unist", | ||
"unist-util", | ||
"util", | ||
"utility", | ||
"ast", | ||
"tree", | ||
"node", | ||
"cascade", | ||
"delete", | ||
"mutable", | ||
"remove", | ||
"squeeze", | ||
"strip" | ||
], | ||
"repository": "syntax-tree/unist-util-remove", | ||
"bugs": "https://github.com/syntax-tree/unist-util-remove/issues", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/unified" | ||
}, | ||
"author": "Eugene Sharygin <eush77@gmail.com>", | ||
"contributors": [ | ||
"Eugene Sharygin <eush77@gmail.com>", | ||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)" | ||
], | ||
"files": [ | ||
"index.js" | ||
], | ||
"dependencies": { | ||
"unist-util-is": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"nyc": "^15.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"tape": "^5.0.0", | ||
"unist-builder": "^2.0.0", | ||
"xo": "^0.35.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
"test-api": "node test", | ||
"test-coverage": "nyc --reporter lcov tape test.js", | ||
"test": "npm run format && npm run test-coverage" | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"lines": 100, | ||
"functions": 100, | ||
"branches": 100 | ||
}, | ||
"prettier": { | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"trailingComma": "none" | ||
}, | ||
"xo": { | ||
"prettier": true, | ||
"esnext": false, | ||
"rules": { | ||
"eqeqeq": [ | ||
"error", | ||
"always", | ||
{ | ||
"null": "ignore" | ||
"name": "unist-util-remove", | ||
"version": "2.0.1", | ||
"description": "unist utility to remove nodes from a tree", | ||
"license": "MIT", | ||
"keywords": [ | ||
"unist", | ||
"unist-util", | ||
"util", | ||
"utility", | ||
"ast", | ||
"tree", | ||
"node", | ||
"cascade", | ||
"delete", | ||
"mutable", | ||
"remove", | ||
"squeeze", | ||
"strip" | ||
], | ||
"repository": "syntax-tree/unist-util-remove", | ||
"bugs": "https://github.com/syntax-tree/unist-util-remove/issues", | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/unified" | ||
}, | ||
"author": "Eugene Sharygin <eush77@gmail.com>", | ||
"contributors": [ | ||
"Eugene Sharygin <eush77@gmail.com>", | ||
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)" | ||
], | ||
"files": [ | ||
"index.js", | ||
"types/index.d.ts" | ||
], | ||
"types": "types/index.d.ts", | ||
"dependencies": { | ||
"dtslint": "^4.0.7", | ||
"unist-util-is": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"nyc": "^15.0.0", | ||
"prettier": "^2.0.0", | ||
"remark-cli": "^9.0.0", | ||
"remark-preset-wooorm": "^8.0.0", | ||
"tape": "^5.0.0", | ||
"unist-builder": "^2.0.0", | ||
"xo": "^0.35.0" | ||
}, | ||
"scripts": { | ||
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", | ||
"test-api": "node test", | ||
"test-coverage": "nyc --reporter lcov tape test.js", | ||
"test": "npm run format && npm run test-coverage", | ||
"test-types": "dtslint types" | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"lines": 100, | ||
"functions": 100, | ||
"branches": 100 | ||
}, | ||
"prettier": { | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"trailingComma": "none" | ||
}, | ||
"xo": { | ||
"prettier": true, | ||
"esnext": false, | ||
"rules": { | ||
"eqeqeq": [ | ||
"error", | ||
"always", | ||
{ | ||
"null": "ignore" | ||
} | ||
], | ||
"no-eq-null": "off", | ||
"unicorn/explicit-length-check": "off" | ||
} | ||
], | ||
"no-eq-null": "off", | ||
"unicorn/explicit-length-check": "off" | ||
}, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"preset-wooorm" | ||
] | ||
} | ||
}, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"preset-wooorm" | ||
] | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// TypeScript Version: 3.5 | ||
|
||
import { Node } from 'unist'; | ||
import { Test } from 'unist-util-is'; | ||
|
||
declare namespace remove { | ||
interface RemoveOptions { | ||
cascade?: boolean; | ||
guillaumegarcia13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
||
/** | ||
* | ||
* Mutate the given tree by removing all nodes that pass test. The tree is walked in preorder (NLR), visiting the node itself, then its head, etc. | ||
* | ||
* @param tree Tree to filter | ||
* @param options Whether to drop parent nodes if they had children, but all their children were filtered out | ||
* @param test is-compatible test (such as a type) | ||
*/ | ||
declare function remove( | ||
tree: Node, | ||
options: remove.RemoveOptions = {cascade: true}, | ||
test?: Test<Node> | ||
): Node; | ||
guillaumegarcia13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
export = remove; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.