Fix quotes

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-20 23:29:39 +03:00
parent caa67e2a49
commit fd68c221da
15 changed files with 22 additions and 21 deletions

View File

@ -15,5 +15,5 @@ const detectDeviceType = () =>
```
```js
detectDeviceType(); // "Mobile" or "Desktop"
detectDeviceType(); // 'Mobile' or 'Desktop'
```

View File

@ -20,6 +20,6 @@ juxt(
)(1, 2, 3); // [[2, 3, 4], [0, 1, 2], [10, 20, 30]]
juxt(
s => s.length,
s => s.split(" ").join("-")
)("30 seconds of code"); // [[18], ['30-seconds-of-code']]
s => s.split(' ').join('-')
)('30 seconds of code'); // [[18], ['30-seconds-of-code']]
```

View File

@ -22,7 +22,7 @@ const prettyBytes = (num, precision = 3, addSpace = true) => {
```
```js
prettyBytes(1000); // "1 KB"
prettyBytes(-27145424323.5821, 5); // "-27.145 GB"
prettyBytes(123456789, 3, false); // "123MB"
prettyBytes(1000); // '1 KB'
prettyBytes(-27145424323.5821, 5); // '-27.145 GB'
prettyBytes(123456789, 3, false); // '123MB'
```

View File

@ -16,5 +16,5 @@ const randomHexColorCode = () => {
```
```js
randomHexColorCode(); // "#e34155"
randomHexColorCode(); // '#e34155'
```

View File

@ -19,5 +19,5 @@ reduceWhich([1, 3, 2], (a, b) => b - a); // 3
reduceWhich(
[{ name: 'Tom', age: 12 }, { name: 'Jack', age: 18 }, { name: 'Lucy', age: 9 }],
(a, b) => a.age - b.age
); // {name: "Lucy", age: 9}
); // {name: 'Lucy', age: 9}
```

View File

@ -9,7 +9,7 @@ Removes accents from strings.
- Use `String.prototype.replace()` to replace diacritical marks in the given Unicode range by empty strings.
```js
const removeAccents = str => str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
const removeAccents = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
```
```js

View File

@ -12,5 +12,5 @@ const toDecimalMark = num => num.toLocaleString('en-US');
```
```js
toDecimalMark(12305030388.9087); // "12,305,030,388.909"
toDecimalMark(12305030388.9087); // '12,305,030,388.909'
```

View File

@ -17,5 +17,5 @@ const toHSLObject = hslStr => {
```
```js
toHSLObject("hsl(50,10%,10%)"); // { hue: 50, saturation: 10, lightness: 10 }
toHSLObject('hsl(50,10%,10%)'); // { hue: 50, saturation: 10, lightness: 10 }
```

View File

@ -29,5 +29,5 @@ managers.forEach(
return this[id];
}, toHash(users, 'id')))
);
managers; // [ { manager:1, employees: [ { id: 2, first: "Joe" }, { id: 3, first: "Moe" } ] } ]
managers; // [ { manager:1, employees: [ { id: 2, first: 'Joe' }, { id: 3, first: 'Moe' } ] } ]
```

View File

@ -26,5 +26,5 @@ const toISOStringWithTimezone = date => {
```
```js
toISOStringWithTimezone(new Date()); // "2020-10-06T20:43:33-04:00"
toISOStringWithTimezone(new Date()); // '2020-10-06T20:43:33-04:00'
```

View File

@ -20,6 +20,6 @@ const toKebabCase = str =>
toKebabCase('camelCase'); // 'camel-case'
toKebabCase('some text'); // 'some-text'
toKebabCase('some-mixed_string With spaces_underscores-and-hyphens'); // 'some-mixed-string-with-spaces-underscores-and-hyphens'
toKebabCase('AllThe-small Things'); // "all-the-small-things"
toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); // "i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-xml-and-html"
toKebabCase('AllThe-small Things'); // 'all-the-small-things'
toKebabCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); // 'i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-xml-and-html'
```

View File

@ -23,5 +23,5 @@ const toOrdinalSuffix = num => {
```
```js
toOrdinalSuffix('123'); // "123rd"
toOrdinalSuffix('123'); // '123rd'
```

View File

@ -17,5 +17,5 @@ const toRGBObject = rgbStr => {
```
```js
toRGBObject("rgb(255,12,0)"); // {red: 255, green: 12, blue: 0}
toRGBObject('rgb(255,12,0)'); // {red: 255, green: 12, blue: 0}
```

View File

@ -20,6 +20,7 @@ const toSnakeCase = str =>
toSnakeCase('camelCase'); // 'camel_case'
toSnakeCase('some text'); // 'some_text'
toSnakeCase('some-mixed_string With spaces_underscores-and-hyphens'); // 'some_mixed_string_with_spaces_underscores_and_hyphens'
toSnakeCase('AllThe-small Things'); // "all_the_small_things"
toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); // "i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"
toSnakeCase('AllThe-small Things'); // 'all_the_small_things'
toSnakeCase('IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML'); //
'i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html'
```

View File

@ -14,6 +14,6 @@ const words = (str, pattern = /[^a-zA-Z-]+/) => str.split(pattern).filter(Boolea
```
```js
words('I love javaScript!!'); // ["I", "love", "javaScript"]
words('python, javaScript & coffee'); // ["python", "javaScript", "coffee"]
words('I love javaScript!!'); // ['I', 'love', 'javaScript']
words('python, javaScript & coffee'); // ['python', 'javaScript', 'coffee']
```