Skip to content

Commit

Permalink
t push origin masterMerge branch 'fabioh8010-master'
Browse files Browse the repository at this point in the history
* fabioh8010-master:
  Updates readme methods
  Updates lib version, dist and readme
  Adds toRawValue() method to service
  • Loading branch information
Ben-hur Santos Ott committed Jun 3, 2018
2 parents df31029 + 1670a07 commit 89559ab
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4,506 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ If you want, we expose the `MaskService`. You can use it:
* static toMask(type, value, settings): mask a value.
_ `type` (String, required): the type of the mask (`cpf`, `datetime`, etc...)
_ `value` (String, required): the value to be masked \* `settings` (Object, optional): if the mask type accepts options, pass it in the settings parameter
* static toRawValue(type, maskedValue, settings): get the raw value of a masked value.
_ `type` (String, required): the type of the mask (`cpf`, `datetime`, etc...)
_ `maskedValue` (String, required): the masked value to be converted in raw value \* `settings` (Object, optional): if the mask type accepts options, pass it in the settings parameter
* static isValid(type, value, settings): validate if the mask and the value match.
_ `type` (String, required): the type of the mask (`cpf`, `datetime`, etc...)
_ `value` (String, required): the value to be masked \* `settings` (Object, optional): if the mask type accepts options, pass it in the settings parameter
Expand All @@ -390,11 +393,13 @@ var money = MaskService.toMask('money', '123', {

* If the `es2015` error throw by babel, try run `react-native start --reset-cache`


# Changelog

## 1.7.0

* Adding `ts definitions`. (thanks to [iiandrade](https://github.com/iiandrade))
* Adding `toRawValue` method to MaskService. (thanks to [fabioh8010](https://github.com/fabioh8010))

## 1.6.5

Expand Down
4 changes: 4 additions & 0 deletions dist/lib/mask-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Object.defineProperty(exports,"__esModule",{value:true});var _createClass=functi
MaskService=function(){function MaskService(){_classCallCheck(this,MaskService);}_createClass(MaskService,null,[{key:'toMask',value:function toMask(
type,value,settings){
return _maskResolver2.default.resolve(type).getValue(value,settings);
}},{key:'toRawValue',value:function toRawValue(

type,maskedValue,settings){
return _maskResolver2.default.resolve(type).getRawValue(maskedValue,settings);
}},{key:'isValid',value:function isValid(

type,value,settings){
Expand Down
4 changes: 4 additions & 0 deletions lib/mask-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export default class MaskService {
return MaskResolver.resolve(type).getValue(value, settings);
}

static toRawValue(type, maskedValue, settings) {
return MaskResolver.resolve(type).getRawValue(maskedValue, settings);
}

static isValid(type, value, settings) {
return MaskResolver.resolve(type).validate(value, settings);
}
Expand Down
Loading

0 comments on commit 89559ab

Please sign in to comment.