Better HN
topnewbestaskshowjobs
Log inSign up

steen_hansen

2 karma · joined Apr 13, 2016 (10y ago) · 6 submissions

Submissions

comment 3y ago · link · parent

Location: Vancouver Canada

Remote: yes

Willing to relocate: no

Technologies: Go, React-Native, Selenium, RxjS, Docker, Neo4j, SSR

GitHub: github.com/steenhansen/repository-list

Résumé/CV: bit.ly/steen-hansen-resume

Email: steen_hansen@yahoo.com

comment 4y ago · link · parent

Hey I got an idea, let's ignore a better solution like Closure.spec's runtime type checking.

Its even like "functional", you can turn it on or off at will, it can even do regular expression tests to validate string parameters.

I partially copied it for Javascript, https://www.npmjs.com/package/type-czech, it even runs in JsFiddle https://jsfiddle.net/steen_hansen/1Lshcept/?Example-Contents

comment 4y ago · link · parent

One dark and stormy night I decided to finally learn about JavaScript Proxies. So I started reading and noticed that it was possible to inspect parameters before function execution, and results after function returns; just like Clojure Spec https://news.ycombinator.com/item?id=24432461 does.

At first I thought that I would be confined to type checking plain JavaScript functions, but I managed to handle constructors and methods inside classes, closures, and IIFEs. Thus TypeCzech was born with an odd but unique searchable name.

Why you might want to use: - Type signtures are JavaScript strings, arrays, and objects; thus can be constants - No complilation, no dependencies, no new syntax, easy to decouple - Throw exceptions or just console.log errors

More live examples than you can shake a stick at at https://jsfiddle.net/steen_hansen/1Lshcept/?Example-Contents

4.

Show HN: I made TypeCzech, a detachable runtime type checking JavaScript library(github.com ↗)

1 points · by steen_hansen · 4y ago · 1 comment

5.

Crockford's latest Classless JavaScript, no this, no new(jerkersearcher.com ↗)

2 points · by steen_hansen · 10y ago · discuss