Skip to content

Instantly share code, notes, and snippets.

View MikeyBurkman's full-sized avatar

Michael Burkman MikeyBurkman

  • Truebill
  • Washington, DC, USA
View GitHub Profile
@MikeyBurkman
MikeyBurkman / banProps.ts
Last active September 11, 2019 13:19
Ban Props TS
export type BanProps<T extends string> = { [P in T]: never } & {
[key: string]: any;
};
interface Foo {
x: string;
y: number;
}
export type NotFoo = BanProps<keyof Foo>;
@MikeyBurkman
MikeyBurkman / parser.ts
Created April 30, 2020 16:37
XPath for TypeScript
import { SelectedValue, useNamespaces } from 'xpath';
import { DOMParser } from 'xmldom';
import * as _ from 'lodash';
import { VError } from 'verror';
interface Parser {
parseXml: (xml: string) => Document;
/**
* Type guard that returns true iff the selected value is a Node.