typescript-equals
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

typescript-equals

Rough implementation of checking of AST equality: Ignores spaces, comments, quotes, semicolons, parenthesis.

Install

npm i -S typescript-equals

Usage

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

equals(firstTextstring, secondTextstring)boolean;

Package Sidebar

Install

npm i typescript-equals

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

8.55 kB

Total Files

6

Last publish

Collaborators

  • iamthes