Get safe regular-expression
!!Important!! Wrose case on compress code with cache currying
- Bad (Do not use it in compresss code)
import getSafeReg, {cacheReg} from 'get-safe-reg';
const cache={};
const getRegString = name => '(?:^|\\s+)'+ getSafeReg(name)+ '(?:\\s+|$)';
export default name => cacheReg(cache)(getRegString)(name);
import getSafeReg, {cacheReg} from 'get-safe-reg';
const getRegString = name => '(?:^|\\s+)'+ getSafeReg(name)+ '(?:\\s+|$)';
const cache = cacheReg({})(getRegString)
export default name => cache(name);