Skip to content

Commit 052c74c

Browse files
committed
0.1.9
1 parent eb72079 commit 052c74c

File tree

9 files changed

+52
-46
lines changed

9 files changed

+52
-46
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ We can also apply a middleware object to a target object. Middleware object is a
8383
Function's name start or end with "_" will not be able to apply middleware.
8484

8585
```
86-
const PersonMiddleware {
86+
const PersonMiddleware = {
8787
walk: target => next => step => {
8888
console.log(`walk start, steps: step.`);
8989
const result = next(step);
@@ -158,27 +158,29 @@ If the first argument is a middleware object, the rest arguments must be middlew
158158
2. Run `gulp` to builds the library, generates `dist/middleware.js` as the core script, watches for file changes,
159159
starts a HTTP server for debug.
160160
```
161-
Usage
162-
gulp [TASK]
163-
164-
Available tasks
165-
default Run tasks: clean, lint, build, docs, watch, server
166-
build Builds the library
167-
clean Cleans files
168-
clean:dist Cleans dist files
169-
docs Builds documentation
170-
docs:html Builds HTML documentation
171-
docs:md Builds markdown documentation
172-
help Display this help text.
173-
lint Lint JS files
174-
server Starts a HTTP server for debug.
175-
watch Watches for changes in files, re-lint, re-build & re-docs
161+
Usage
162+
gulp [TASK] [OPTIONS...]
163+
164+
Available tasks
165+
build Builds the library.
166+
clean Cleans files.
167+
clean:dist Cleans dist files.
168+
clean:docs Cleans docs files.
169+
default
170+
docs Builds documentation.
171+
docs:html Builds HTML documentation.
172+
docs:md Builds markdown documentation.
173+
help Display this help text.
174+
lint Lint JS files.
175+
mini Minify the library.
176+
server Starts a HTTP server for debug.
177+
test Run test cases.
178+
watch Watches for changes in files, re-lint, re-build & re-docs.
176179
```
177180
3. Run `gulp docs` to build docs. View markdown docs with `docs/API.md`, or run `gulp server` to start a HTTP server
178181
and view HTML docs with [localhost:3000/docs/html/](localhost:3000/docs/html/).
179182

180183
# Roadmap & Make contributions
184+
- Supports RegExp to match method names, pass the current method name as param to the current middleware.
181185
- **once(methodName, ...middlewares)** Apply middlewares only run once.
182-
- Supports RegExp to match method names, pass the current method name to the current middleware.
183186
- Be able to **unuse** middlewares.
184-
-

dist/middleware.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/html/MiddlewareManager.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ <h5>Example</h5>
231231
We can also apply a middleware object to a target object.
232232
Middleware object is an object that contains function&#x27;s name as same as the target object&#x27;s function name.
233233

234-
const PersonMiddleware {
234+
const PersonMiddleware = {
235235
walk: target =&gt; next =&gt; step =&gt; {
236236
console.log(&#x60;walk start, steps: step.&#x60;);
237237
const result = next(step);
@@ -1001,7 +1001,7 @@ <h4 class="modal-title">Search results</h4>
10011001
<span class="jsdoc-message">
10021002
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
10031003

1004-
on 2017-04-21
1004+
on 2017-04-26
10051005

10061006
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
10071007
</span>

docs/html/classes.list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ <h4 class="modal-title">Search results</h4>
205205
<span class="jsdoc-message">
206206
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
207207

208-
on 2017-04-21
208+
on 2017-04-26
209209

210210
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
211211
</span>

docs/html/global.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h4 class="modal-title">Search results</h4>
367367
<span class="jsdoc-message">
368368
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
369369

370-
on 2017-04-21
370+
on 2017-04-26
371371

372372
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
373373
</span>

docs/html/index.html

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ <h1>Usages</h1><h2>Basic</h2><p>We define a Person class.</p>
145145
p.walk(3);</code></pre><p>Whenever a Person instance call it's walk method, we'll see logs from the looger middleware.</p>
146146
<h2>Middleware object</h2><p>We can also apply a middleware object to a target object. Middleware object is an object that contains function's name as same as the target object's function name.
147147
Function's name start or end with &quot;_&quot; will not be able to apply middleware.</p>
148-
<pre class="prettyprint source"><code>const PersonMiddleware {
148+
<pre class="prettyprint source"><code>const PersonMiddleware = {
149149
walk: target => next => step => {
150150
console.log(`walk start, steps: step.`);
151151
const result = next(step);
@@ -208,29 +208,31 @@ <h1>Build</h1><ol>
208208
</li>
209209
<li><p>Run <code>gulp</code> to builds the library, generates <code>dist/middleware.js</code> as the core script, watches for file changes,
210210
starts a HTTP server for debug.</p>
211-
<pre class="prettyprint source"><code> Usage
212-
gulp [TASK]
213-
214-
Available tasks
215-
default Run tasks: clean, lint, build, docs, watch, server
216-
build Builds the library
217-
clean Cleans files
218-
clean:dist Cleans dist files
219-
docs Builds documentation
220-
docs:html Builds HTML documentation
221-
docs:md Builds markdown documentation
222-
help Display this help text.
223-
lint Lint JS files
224-
server Starts a HTTP server for debug.
225-
watch Watches for changes in files, re-lint, re-build & re-docs</code></pre></li>
211+
<pre class="prettyprint source"><code>Usage
212+
gulp [TASK] [OPTIONS...]
213+
214+
Available tasks
215+
build Builds the library.
216+
clean Cleans files.
217+
clean:dist Cleans dist files.
218+
clean:docs Cleans docs files.
219+
default
220+
docs Builds documentation.
221+
docs:html Builds HTML documentation.
222+
docs:md Builds markdown documentation.
223+
help Display this help text.
224+
lint Lint JS files.
225+
mini Minify the library.
226+
server Starts a HTTP server for debug.
227+
test Run test cases.
228+
watch Watches for changes in files, re-lint, re-build & re-docs.</code></pre></li>
226229
<li>Run <code>gulp docs</code> to build docs. View markdown docs with <code>docs/API.md</code>, or run <code>gulp server</code> to start a HTTP server
227230
and view HTML docs with <a href="localhost:3000/docs/html/">localhost:3000/docs/html/</a>.</li>
228231
</ol>
229232
<h1>Roadmap &amp; Make contributions</h1><ul>
233+
<li>Supports RegExp to match method names, pass the current method name as param to the current middleware.</li>
230234
<li><strong>once(methodName, ...middlewares)</strong> Apply middlewares only run once.</li>
231-
<li>Supports RegExp to match method names, pass the current method name to the current middleware.</li>
232235
<li>Be able to <strong>unuse</strong> middlewares.</li>
233-
<li></li>
234236
</ul></article>
235237
</section>
236238

@@ -277,7 +279,7 @@ <h4 class="modal-title">Search results</h4>
277279
<span class="jsdoc-message">
278280
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
279281

280-
on 2017-04-21
282+
on 2017-04-26
281283

282284
using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
283285
</span>

docs/html/quicksearch.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

lib/Middleware.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function compose(...funcs) {
111111
* We can also apply a middleware object to a target object.
112112
* Middleware object is an object that contains function's name as same as the target object's function name.
113113
*
114-
* const PersonMiddleware {
114+
* const PersonMiddleware = {
115115
* walk: target => next => step => {
116116
* console.log(`walk start, steps: step.`);
117117
* const result = next(step);

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-middleware",
33
"description": "Powerful Javascript Middleware Pattern Implementation.",
4-
"version": "0.1.8",
4+
"version": "0.1.9",
55
"license": "MIT",
66
"main": "dist/middleware.js",
77
"repository": "unbug/js-middleware",
@@ -32,6 +32,7 @@
3232
"browser-sync": "^2.18.8",
3333
"browserify": "^14.3.0",
3434
"bundle-collapser": "^1.2.1",
35+
"chai": "^3.5.0",
3536
"del": "^2.2.2",
3637
"derequire": "^2.0.6",
3738
"esdoc": "^0.4.8",
@@ -42,6 +43,7 @@
4243
"gulp-help": "^1.6.1",
4344
"gulp-jsdoc3": "^1.0.1",
4445
"gulp-load-plugins": "^1.5.0",
46+
"gulp-mocha": "^4.3.0",
4547
"gulp-rename": "^1.2.2",
4648
"gulp-size": "^2.1.0",
4749
"gulp-uglify": "^2.1.2",

0 commit comments

Comments
 (0)