Skip to content

Instantly share code, notes, and snippets.

Avatar

bouzuya bouzuya

View GitHub Profile
@bouzuya
bouzuya / create-store.ts
Created Sep 4, 2016
Raynos/weakmap-shim create-store.ts
View create-store.ts
// Original: https://github.com/Raynos/weakmap-shim create-store
type StoreId = Object;
type Store = (obj: Object) => Object;
type Item = { _storeId: StoreId; valueOf: ItemValueOf; };
type ItemValueOf = (storeId?: StoreId) => Object | Item;
const createStore = (): Store => {
const storeId: StoreId = {};
return (obj: Object | Item): Item => {
View npm-packages.md
  • [backlog-api][] ![][badge:backlog-api]
  • [backlog-cli][] ![][badge:backlog-cli]
  • [bath][] ![][badge:bath]
  • [beater][] ![][badge:beater]
  • [beater-cli][] ![][badge:beater-cli]
  • [beater-cli-reporter][] ![][badge:beater-cli-reporter]
  • [beater-html-reporter][] ![][badge:beater-html-reporter]
  • [beater-reporter][] ![][badge:beater-reporter]
  • [b-html][] ![][badge:b-html]
  • [b-html-cli][] ![][badge:b-html-cli]
@bouzuya
bouzuya / README.md
Last active Jul 16, 2016
bath - A simple path template engine
View README.md

bath

A simple path template engine.

Usage

$ npm install bath
@bouzuya
bouzuya / README.md
Last active Jul 16, 2016
simple router
View README.md

simple-router-b

A simple router.

Concept

  • path -> name + params
  • name + params -> path

Usage

@bouzuya
bouzuya / es-modules.md
Last active Jun 22, 2016
ES Modules と TypeScript での CommonJS interop
View es-modules.md
View generator-test.ts
import * as assert from 'power-assert';
import beater from 'beater';
import { range, range2, take, fib, fib2, splitWord } from './generator';
const { test } = beater();
test('range()', () => {
const iterator = range(3);
assert.deepEqual(iterator.next(), { value: 0, done: false });
assert.deepEqual(iterator.next(), { value: 1, done: false });
@bouzuya
bouzuya / beater-tests.ts
Last active Jun 11, 2016
beater の test 定義
View beater-tests.ts
// 1. test はいずれかひとつの group に属しないといけないのかが気になる。
import { group } from 'beater';
const g = group('g1');
g.test('t1', () => {
assert(1 === 1);
});
// 2. 1. の callback 版。1. と同じ問題がある。
import { group } from 'beater';
group('g1', test => {
View 1.log
% npm test (git)-[master] -?
> rfc6570-expand@0.1.0 test /Users/bouzuya/.ghq/github.com/bouzuya/rfc6570-expand
> eater
19 files
✓ success: .tmp/test/extended2.js
✓ success: .tmp/test/extended4.js
✓ success: .tmp/test/extended1.js
✓ success: .tmp/test/extended3.js
@bouzuya
bouzuya / rfc6570-npm-packages.md
Last active May 29, 2016
RFC6570 - URI Template のための npm package に関する覚書
View rfc6570-npm-packages.md
@bouzuya
bouzuya / rfc6570.md
Last active Jul 21, 2019
RFC6570 - URI Template に関する覚書
View rfc6570.md

RFC6570 - URI Template に関する覚書

RFC6570 の情報やそれを JavaScript から利用するための npm package についての覚書。

RFC6570 とは

RFC6570 - URI Template

URI Template は変数展開を通じて URI の範囲を示す文字列。この仕様は URI Template の構文とそのURI Template を URI 参照に展開するための処理を定義する。