Skip to content

Commit

Permalink
fix: updated all npm dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Mar 14, 2017
1 parent 636e4ba commit 5fb5bb4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,15 @@
Branch.setIdentity(userId).then(function (res) {
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
alert('Error: ' + JSON.stringify(err))
alert('Error: ' + JSON.stringify(err.message))
})
```

```js
Branch.logout().then(function (res) {
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
alert('Error: ' + JSON.stringify(err))
alert('Error: ' + JSON.stringify(err.message))
})
```

Expand All @@ -483,7 +483,7 @@
Branch.userCompletedAction(eventName, metaData).then(function (res) {
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
alert('Error: ' + JSON.stringify(err))
alert('Error: ' + JSON.stringify(err.message))
})
```

Expand All @@ -492,7 +492,7 @@
Branch.userCompletedAction(eventName).then(function (res) {
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
alert('Error: ' + JSON.stringify(err))
alert('Error: ' + JSON.stringify(err.message))
})
```

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@
"dependencies": {
"mkpath": "^1.0.0",
"node-version-compare": "^1.0.1",
"plist": "^1.2.0",
"xml2js": "^0.4.16"
"plist": "^2.0.1",
"xml2js": "^0.4.17"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-standard": "^8.0.3",
"husky": "^0.12.0",
"gulp-standard": "^9.0.0",
"husky": "^0.13.2",
"mkpath": "^1.0.0",
"node-version-compare": "^1.0.1",
"plist": "^1.2.0",
"plist": "^2.0.1",
"semantic-release": "^6.3.6",
"validate-commit-msg": "^2.8.2",
"validate-commit-msg": "^2.11.2",
"xml2js": "^0.4.17"
}
}
}
6 changes: 3 additions & 3 deletions src/branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Branch.prototype.setIdentity = function (identity) {
return execute('setIdentity', [String(identity)])
} else {
return new Promise(function (resolve, reject) {
reject('Please set an identity')
reject(new Error('Please set an identity'))
})
}
}
Expand All @@ -98,7 +98,7 @@ Branch.prototype.logout = function () {
Branch.prototype.userCompletedAction = function (action, metaData) {
if (!action) {
return new Promise(function (resolve, reject) {
reject('Please set an event name')
reject(new Error('Please set an event name'))
})
}

Expand Down Expand Up @@ -159,7 +159,7 @@ Branch.prototype.createBranchUniversalObject = function (options) {
return execute('listOnSpotlight', [obj.instanceId])
} else {
return new Promise(function (resolve, reject) {
reject('iOS Spotlight only')
reject(new Error('iOS Spotlight only'))
})
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/scripts/ios/updatePlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
var obj = convertXmlToObject(xml)

obj = appendPlist(obj, preferences)
obj = correctPlistBlanks(obj)
xml = convertObjectToXml(obj)
writePList(filePath, xml)
}
Expand Down Expand Up @@ -87,4 +88,15 @@

return obj
}

// npm list 1.2.0 -> 2.0.1 causes app crash due to malformed plist (from <string/> to <string></string>)
// specifically NSMainNibFile and NSMainNibFile~ipad
function correctPlistBlanks (obj) {
for (var key in obj) {
var val = obj[key]
if (!val) obj[key] = ''
}

return obj
}
})()
6 changes: 3 additions & 3 deletions testbed/www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function BranchEvent () {
console.log('Trigger BranchEvent()')

// event name
var event = document.getElementById('custom-action').value || 'blank'
var event = document.getElementById('custom-action').value

// optional
var metadata = { 'custom_dictionary': 123, 'anything': 'everything' }
Expand All @@ -55,7 +55,7 @@ function BranchEvent () {
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
console.error(err)
alert('Error: ' + JSON.stringify(err))
alert('Error: ' + JSON.stringify(err.message))
})
}

Expand Down Expand Up @@ -92,7 +92,7 @@ function BranchUser () {
alert('Response: ' + JSON.stringify(res))
}).catch(function (err) {
console.error(err)
alert('Error: ' + JSON.stringify(err))
alert('Error: ' + JSON.stringify(err.message))
})
}

Expand Down

0 comments on commit 5fb5bb4

Please sign in to comment.