efficient-functions
v1.0.3
Published
Funciones útiles que posiblemente te serán ayuda.
Downloads
1
Readme
Funciones útiles
isURL
const { isURL } = require("efficient-functions");
console.log(isURL("https://www.npmjs.com/package/efficient-functions")); //=> True
console.log(isURL("//efficient-functions.com")); //=> False
isImageURL
const { isImageURL } = require("efficient-functions");
// Async/Await
(async () => {
console.log(
await isImageURL("https://www.npmjs.com/package/efficient-functions")
);
})(); //=> False
// Promise
isImageURL("https://img.clubimagenes.com/ci/hola/hola_009.jpg").then(
(isImage) => {
console.log(isImage);
}
); //=> True
shortenText
const { shortenText } = require("efficient-functions");
console.log(shortenText("Holaaaa", 3)); //=> Hol
console.log(shortenText("Holaaaa", 3, "...")); //=> Hol...
shuffleArray
const { shuffleArray } = require("efficient-functions");
const array = [0, 1, 2, 3, 4, 5];
console.log(shuffleArray(array)); //=> [1, 5, 3, 4, 2, 0]
//Tu salida será distinta.
shuffleString
const { shuffleString } = require("efficient-functions");
const string = "efficient-functions";
console.log(shuffleString(string)); //=> t-ifeftesofcninnuic
//Tu salida será distinta.