Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Commit

Permalink
General cleanup, formatting, and a small syntax error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tlovett1 committed Jul 28, 2015
1 parent 183b73b commit b99e3d6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions wp-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

window.wp = window.wp || {};

var pad;
wp.api = {
models: {},
collections: {},
Expand All @@ -14,7 +14,7 @@
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
*/
if ( ! Date.prototype.toISOString ) {
var pad = function( number ) {
pad = function( number ) {
var r = String( number );
if ( r.length === 1 ) {
r = '0' + r;
Expand Down Expand Up @@ -127,7 +127,7 @@
});

// Parse the author into a User object
if ( 'undefined' typeof response.author ) {
if ( 'undefined' !== typeof response.author ) {
response.author = new wp.api.models.User( response.author );
}

Expand Down Expand Up @@ -758,13 +758,7 @@
model: wp.api.models.PostStatus,

parse: function( response ) {
var responseArray = [];

for ( var property in response ) {
if ( response.hasOwnProperty( property ) ) {
responseArray.push( response[property] );
}
}
var responseArray = _.values( response );

return this.constructor.__super__.parse.call( this, responseArray );
}
Expand Down Expand Up @@ -916,4 +910,4 @@
* Todo: Handle post meta
*/

})( WP_API_Settings, Backbone, _, window, ( void 0 ) );
})( WP_API_Settings, Backbone, _, window, ( void 0 ) );

0 comments on commit b99e3d6

Please sign in to comment.