deno.land / x / rambda@v9.1.1 / source / remove.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { replace } from './replace.js'import { type } from './type.js'
export function remove(inputs, text){ if (arguments.length === 1){ return textHolder => remove(inputs, textHolder) }
if (type(text) !== 'String'){ throw new Error(`R.remove requires string not ${ type(text) }`) }
if (type(inputs) !== 'Array'){ return replace( inputs, '', text ) }
let textCopy = text
inputs.forEach(singleInput => { textCopy = replace( singleInput, '', textCopy ).trim() })
return textCopy}
rambda

Version Info

Tagged at
2 months ago