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
// node transform-methods-to-arrows.js | |
// prettier --write . && eslint --fix . && tsc --noEmit --watch | |
const path = require('path') | |
const { Project, SyntaxKind } = require('ts-morph') | |
const project = new Project({ | |
tsConfigFilePath: "/home/srghma/jss/corporate/tsconfig.json", // adjust if needed | |
}) | |
project.addSourceFilesAtPaths("/home/srghma/jss/corporate/src/**/*.ts") | |
for (const file of project.getSourceFiles()) { |
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
Copyright (c) Serhii Khoma. <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
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
structure WithIsChangedOrWillBeUpdated (α : Type) where | |
v : α | |
isChanged : Bool | |
willBeUpdated : Bool | |
def withIsChangedOrWillBeUpdated [BEq a] (before now editing : a) : WithIsChangedOrWillBeUpdated a := | |
{ v := now, | |
isChanged := not (now == before), | |
willBeUpdated := not (now == editing) } |
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
import Std.Data.HashMap | |
open Std | |
structure DiffResult2 (s r a : Type) where | |
same : HashMap String s | |
removed : HashMap String r | |
added : HashMap String a | |
def diffListsBy (befores : HashMap String r) (nows : HashMap String a) : DiffResult2 a r a := |