- Updated tests for this change.
- Tested the changes locally.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun String.pluralize(count: Int): String? { | |
return this.pluralize(count, null) | |
} | |
fun String.pluralize(count: Int, plural: String?): String? { | |
return if (count > 1) { | |
plural ?: this + 's' | |
} else { | |
this | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
class App extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
players: [ | |
{ | |
name: 'Player 1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 0; | |
padding: 0; | |
font-family: sans-serif; | |
} | |
.score-container { | |
display: flex; | |
align-items: center; | |
text-align: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import annyang from 'annyang' | |
class Annyang { | |
// 1 | |
isSupported() { | |
return annyang !== null | |
} | |
// 2 | |
start() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
import annyang from './Annyang' | |
class App extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
players: [ | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hasAccessToPhoto = (user, photo) => { | |
if (photo.privacy !== 'public') { | |
if (user.role !== 'admin') { | |
if (photo.userId !== user.id) { | |
return photo.user.friends.includes(user.id) || photo.taggedUsers.includes(user.Id); | |
} | |
} | |
} | |
return true; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const totalPrice = (value, discount) => { | |
return ((value * 1.07) - discount) * 1.1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cc = async (v, b, q) => { | |
const rate = await currency.fetchRate(b, q); | |
return v * rate; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// whoLikeThis.js | |
const whoLikeThis = (names) => { | |
return `${names[0]} and ${names.length - 1} others liked this`; | |
}; | |
// whoLikeThis.test.js | |
it('should return the first person name and count of the rest`, () => { |
OlderNewer