Deprecate utility tag

This commit is contained in:
Angelos Chalaris
2020-04-16 23:07:33 +03:00
parent 5e42f0aaa4
commit e31aea403d
60 changed files with 118 additions and 117 deletions

View File

@ -1,6 +1,6 @@
---
title: functionName
tags: utility,intermediate
tags: array,intermediate
---
Explain briefly what the snippet does.

View File

@ -1,6 +1,6 @@
---
title: CSVToArray
tags: string,array,utility,intermediate
tags: string,array,intermediate
---
Converts a comma-separated values (CSV) string to a 2D array.

View File

@ -1,6 +1,6 @@
---
title: RGBToHex
tags: utility,intermediate
tags: string,math,intermediate
---
Converts the values of RGB components to a color code.

View File

@ -1,6 +1,6 @@
---
title: URLJoin
tags: string,utility,regexp,advanced
tags: string,regexp,advanced
---
Joins all given URL segments together, then normalizes the resulting URL.

View File

@ -1,6 +1,6 @@
---
title: UUIDGeneratorBrowser
tags: browser,utility,random,intermediate
tags: browser,random,intermediate
---
Generates a UUID in a browser.

View File

@ -1,6 +1,6 @@
---
title: UUIDGeneratorNode
tags: node,utility,random,intermediate
tags: node,random,intermediate
---
Generates a UUID in Node.JS.

View File

@ -1,6 +1,6 @@
---
title: arrayToCSV
tags: array,string,utility,intermediate
tags: array,string,intermediate
---
Converts a 2D array to a comma-separated values (CSV) string.

View File

@ -1,6 +1,6 @@
---
title: atob
tags: node,string,utility,beginner
tags: node,string,beginner
---
Decodes a string of data which has been encoded using base-64 encoding.

View File

@ -1,6 +1,6 @@
---
title: btoa
tags: node,string,utility,beginner
tags: node,string,beginner
---
Creates a base-64 encoded ASCII string from a String object in which each character in the string is treated as a byte of binary data.

View File

@ -1,6 +1,6 @@
---
title: castArray
tags: utility,array,type,beginner
tags: type,array,beginner
---
Casts the provided value as an array if it's not one.

View File

@ -1,6 +1,6 @@
---
title: checkProp
tags: function,object,utility,beginner
tags: function,object,beginner
---
Given a `predicate` function and a `prop` string, this curried function will then take an `object` to inspect by calling the property and passing it to the predicate.

View File

@ -1,6 +1,6 @@
---
title: cloneRegExp
tags: utility,regexp,intermediate
tags: type,string,regexp,intermediate
---
Clones a regular expression.

View File

@ -1,6 +1,6 @@
---
title: coalesce
tags: utility,beginner
tags: type,beginner
---
Returns the first defined, non-null argument.

View File

@ -1,6 +1,6 @@
---
title: coalesceFactory
tags: utility,intermediate
tags: type,intermediate
---
Returns a customized coalesce function that returns the first argument that returns `true` from the provided argument validation function.

View File

@ -1,6 +1,6 @@
---
title: colorize
tags: node,utility,string,intermediate
tags: node,string,intermediate
---
Add special characters to text to print in color in the console (combined with `console.log()`).

View File

@ -1,6 +1,6 @@
---
title: createElement
tags: browser,utility,beginner
tags: browser,beginner
---
Creates an element from a string (without appending it to the document).

View File

@ -1,6 +1,6 @@
---
title: extendHex
tags: utility,string,intermediate
tags: string,intermediate
---
Extends a 3-digit color code to a 6-digit color code.

View File

@ -1,6 +1,6 @@
---
title: formatDuration
tags: date,math,string,utility,intermediate
tags: date,math,string,intermediate
---
Returns the human readable format of the given number of milliseconds.

View File

@ -1,6 +1,6 @@
---
title: functionName
tags: function,utility,beginner
tags: function,beginner
---
Logs the name of a function.

View File

@ -1,6 +1,6 @@
---
title: getURLParameters
tags: utility,browser,string,url,intermediate
tags: browser,string,url,intermediate
---
Returns an object containing the parameters of the current URL.

View File

@ -1,6 +1,6 @@
---
title: hashBrowser
tags: browser,utility,advanced,promise,advanced
tags: browser,advanced,promise,advanced
---
Creates a hash for a value using the [SHA-256](https://en.wikipedia.org/wiki/SHA-2) algorithm. Returns a promise.

View File

@ -1,6 +1,6 @@
---
title: hashNode
tags: node,utility,promise,intermediate
tags: node,promise,intermediate
---
Creates a hash for a value using the [SHA-256](https://en.wikipedia.org/wiki/SHA-2) algorithm. Returns a promise.

View File

@ -1,6 +1,6 @@
---
title: hexToRGB
tags: utility,string,math,advanced
tags: string,math,advanced
---
Converts a color code to a `rgb()` or `rgba()` string if alpha value is provided.

View File

@ -1,6 +1,6 @@
---
title: httpDelete
tags: utility,url,browser,intermediate
tags: browser,url,intermediate
---
Makes a `DELETE` request to the passed URL.

View File

@ -1,6 +1,6 @@
---
title: httpGet
tags: utility,url,browser,intermediate
tags: browser,url,intermediate
---
Makes a `GET` request to the passed URL.

View File

@ -1,6 +1,6 @@
---
title: httpPost
tags: utility,url,browser,intermediate
tags: browser,url,intermediate
---
Makes a `POST` request to the passed URL.

View File

@ -1,6 +1,6 @@
---
title: httpPut
tags: utility,url,browser,intermediate
tags: browser,url,intermediate
---
Makes a `PUT` request to the passed URL.

View File

@ -1,6 +1,6 @@
---
title: indentString
tags: string,utility,beginner
tags: string,beginner
---
Indents each line in the provided string.

View File

@ -1,6 +1,6 @@
---
title: isAbsoluteURL
tags: string,utility,browser,url,intermediate
tags: string,browser,url,intermediate
---
Returns `true` if the given string is an absolute URL, `false` otherwise.

View File

@ -1,6 +1,6 @@
---
title: isAfterDate
tags: date,utility,beginner
tags: date,beginner
---
Check if a date is after another date.

View File

@ -1,6 +1,6 @@
---
title: isBeforeDate
tags: date,utility,beginner
tags: date,beginner
---
Check if a date is before another date.

View File

@ -1,6 +1,6 @@
---
title: isBrowser
tags: utility,browser,intermediate
tags: browser,intermediate
---
Determines if the current runtime environment is a browser so that front-end modules can run on the server (Node) without throwing errors.

View File

@ -1,6 +1,6 @@
---
title: isLowerCase
tags: string,utility,beginner
tags: string,beginner
---
Checks if a string is lower case.

View File

@ -1,6 +1,6 @@
---
title: isNegativeZero
tags: math,utility,beginner
tags: math,beginner
---
Checks if the given value is equal to negative zero (`-0`).

View File

@ -1,6 +1,6 @@
---
title: isSameDate
tags: date,utility,beginner
tags: date,beginner
---
Check if a date is the same as another date.

View File

@ -1,6 +1,6 @@
---
title: isUpperCase
tags: string,utility,beginner
tags: string,beginner
---
Checks if a string is upper case.

View File

@ -1,6 +1,6 @@
---
title: longestItem
tags: array,string,utility,intermediate
tags: array,string,intermediate
---
Takes any number of iterable objects or objects with a `length` property and returns the longest one.

View File

@ -1,6 +1,6 @@
---
title: luhnCheck
tags: math,utility,advanced
tags: math,advanced
---
Implementation of the [Luhn Algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.

View File

@ -1,6 +1,6 @@
---
title: mapString
tags: string,array,function,utility,beginner
tags: string,array,function,beginner
---
Creates a new string with the results of calling a provided function on every character in the calling string.

View File

@ -1,6 +1,6 @@
---
title: mask
tags: string,utility,intermediate
tags: string,intermediate
---
Replaces all but the last `num` of characters with the specified mask character.

View File

@ -1,6 +1,6 @@
---
title: mostPerformant
tags: utility,function
tags: function,intermediate
---
Returns the index of the function in an array of functions which executed the fastest.

View File

@ -1,6 +1,6 @@
---
title: nthArg
tags: utility,function,beginner
tags: function,beginner
---
Creates a function that gets the argument at index `n`. If `n` is negative, the nth argument from the end is returned.

View File

@ -1,6 +1,6 @@
---
title: objectToQueryString
tags: utility,object,function,intermediate
tags: object,function,intermediate
---
Returns a query string generated from the key-value pairs of the given object.

View File

@ -1,6 +1,6 @@
---
title: parseCookie
tags: utility,string,intermediate
tags: browser,string,intermediate
---
Parse an HTTP Cookie header string and return an object of all cookie name-value pairs.

View File

@ -1,6 +1,6 @@
---
title: prefix
tags: browser,utility,intermediate
tags: browser,intermediate
---
Returns the prefixed version (if necessary) of a CSS property that the browser supports.

View File

@ -1,6 +1,6 @@
---
title: prettyBytes
tags: utility,string,math,advanced
tags: string,math,advanced
---
Converts a number in bytes to a human-readable string.

View File

@ -1,11 +1,12 @@
---
title: randomHexColorCode
tags: utility,random,beginner
tags: math,random,beginner
---
Generates a random hexadecimal color code.
Use `Math.random` to generate a random 24-bit(6x4bits) hexadecimal number. Use bit shifting and then convert it to an hexadecimal String using `toString(16)`.
Use `Math.random` to generate a random 24-bit(6x4bits) hexadecimal number.
Use bit shifting and then convert it to an hexadecimal String using `toString(16)`.
```js
const randomHexColorCode = () => {

View File

@ -1,6 +1,6 @@
---
title: randomIntArrayInRange
tags: math,utility,random,intermediate
tags: math,random,intermediate
---
Returns an array of n random integers in the specified range.

View File

@ -1,6 +1,6 @@
---
title: randomIntegerInRange
tags: math,utility,random,beginner
tags: math,random,beginner
---
Returns a random integer in the specified range.

View File

@ -1,6 +1,6 @@
---
title: randomNumberInRange
tags: math,utility,random,beginner
tags: math,random,beginner
---
Returns a random number in the specified range.

View File

@ -1,6 +1,6 @@
---
title: recordAnimationFrames
tags: browser,utility,intermediate
tags: browser,intermediate
---
Invokes the provided callback on each animation frame.

View File

@ -1,6 +1,6 @@
---
title: sdbm
tags: math,utility,intermediate
tags: math,intermediate
---
Hashes the input string into a whole number.

View File

@ -1,6 +1,6 @@
---
title: serializeCookie
tags: utility,string,intermediate
tags: browser,string,intermediate
---
Serialize a cookie name-value pair into a Set-Cookie header string.

View File

@ -1,6 +1,6 @@
---
title: stripHTMLTags
tags: string,utility,regexp,beginner
tags: string,regexp,beginner
---
Removes HTML/XML tags from string.

View File

@ -1,6 +1,6 @@
---
title: timeTaken
tags: utility,beginner
tags: function,beginner
---
Measures the time taken by a function to execute.

View File

@ -1,6 +1,6 @@
---
title: toCurrency
tags: utility,intermediate
tags: math,string,intermediate
---
Take a number and return specified currency formatting.

View File

@ -1,6 +1,6 @@
---
title: toDecimalMark
tags: utility,math,beginner
tags: math,beginner
---
Converts a number to a decimal mark formatted string.

View File

@ -1,6 +1,6 @@
---
title: toOrdinalSuffix
tags: utility,math,intermediate
tags: math,intermediate
---
Adds an ordinal suffix to a number.

View File

@ -1,6 +1,6 @@
---
title: validateNumber
tags: utility,math,intermediate
tags: math,intermediate
---
Returns `true` if the given value is a number, `false` otherwise.

View File

@ -1,6 +1,6 @@
---
title: yesNo
tags: utility,regexp,intermediate
tags: string,regexp,intermediate
---
Returns `true` if the string is `y`/`yes` or `false` if the string is `n`/`no`.