kitajchuk/node-squarespace-middleware — pull request #2 by psullivan6 (2014-12-13 19:59:06+00:00)
Title: Check data attributes against a "true" string

## What I changed
- Changed the data attribute conditionals to check against the "true" string because their values aren't returned as a Boolean and there's no big reason to parse the string values into a boolean and then perform the check
- On line 335, I wrapped the `data.limit` value in a `parseInt` function just to be safe. I'm pretty sure this can be removed though

## Issue that prompted the change
When trying to run the server locally, I encountered the following error:
`TypeError: Cannot read property 'length' of undefined`

I plugged in a log statement and found that `data.featured` returns a String value instead of a Boolean. Thus the conditional on [line 323](https://github.com/kitajchuk/node-squarespace-middleware/blob/master/squarespace-middleware.js#L323) of the JS file returns true regardless of the data-attribute value. I faced the same issue with the subsequent `data.limit` conditional, so I assume all of those should be changed to: `if ( data.something === "true" )` rather than `if( data.something )`.

**Full trace:**
``` bash
> sqs-server: Running site on localhost:5050
> sqs-server: AUTH - Login to Squarespace!
> sqs-server: GET - /
> sqs-server: LESS - tweak.less
> sqs-server: LESS - helpers.less
> sqs-server: LESS - mixins.less
> sqs-server: LESS - base.less
> sqs-server: LESS - blog.less
> sqs-server: LESS - index.less
> sqs-server: LESS - mobile.less
> sqs-server: Loading request from cache
> sqs-server: TEMPLATE - default.region

TypeError: Cannot read property 'length' of undefined
at Request._callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/node-squarespace-middleware/squarespace-middleware.js:324:42)
at Request.self.callback (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:373:22)
at Request.emit (events.js:98:17)
at Request. (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:1318:14)
at Request.emit (events.js:117:20)
at IncomingMessage. (/usr/local/lib/node_modules/node-squarespace-server/node_modules/request/request.js:1266:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:943:16
at process._tickCallback (node.js:419:13)
```