npm.io
1.0.4 • Published 6 years ago

jsmp-infra-utils

Licence
ISC
Version
1.0.4
Deps
1
Size
7 kB
Vulns
0
Weekly
0

Functions

  • replaceElements; Replace all elements of array with provided element
  • replaceWords; Replace all words in string with provided string

Examples

Here is example how to use replaceElements

const {replaceElements} = require("jsmp-infra-utils");

const array = [123, 15 ,55];
const newArray = replaceElements(array, "?");

console.log(newArray) // ["?", "?", "?"];

Here is example how to use replaceWords

const {replaceWords} = require("jsmp-infra-utils");

const string = "adsf, asdf fd";
const newString = replaceWords(string, "?");

console.log(newString) // "? ? ?";

Keywords