Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unlight/typescript-equals
Rough implementation of checking of AST equality
https://github.com/unlight/typescript-equals
ast ast-comparison ast-equality comparison equality typescript
Last synced: about 2 months ago
JSON representation
Rough implementation of checking of AST equality
- Host: GitHub
- URL: https://github.com/unlight/typescript-equals
- Owner: unlight
- License: mit
- Created: 2020-08-15T14:45:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-15T14:58:36.000Z (over 4 years ago)
- Last Synced: 2024-10-31T14:31:41.694Z (about 2 months ago)
- Topics: ast, ast-comparison, ast-equality, comparison, equality, typescript
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# typescript-equals
Rough implementation of checking of AST equality:
Ignores spaces, comments, quotes, semicolons, parenthesis.## Install
```sh
npm i -S typescript-equals
```## Usage
```js
import { equals } from 'typescript-equals';const text1 = `var a = {a:1}`;
const text2 = `var a = {a:1,}`;
const text3 = `var a = {a: 1} // comment`;equals(text1, text2); // => true
equals(text1, text3); // => true
equals(text2, text3); // => true
```## API
```ts
equals(firstText: string, secondText: string): boolean;
```