UNPKG

jsfakeit

Version:

![alt text](https://raw.githubusercontent.com/Anirban20001962/jsfakeit/main/logo.png)

15 lines (14 loc) 426 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.replaceWithNumber = void 0; function replaceWithNumber(s) { const arr = Array.from(s); for (let i = 0; i < arr.length; i++) { if (arr[i] === '#') { let n = Math.floor(Math.random() * 10); arr[i] = n.toString(); } } return arr.join(''); } exports.replaceWithNumber = replaceWithNumber;