-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close #9
- Loading branch information
Aurélien Allienne
committed
Jan 23, 2018
1 parent
a1fbb80
commit 1794f70
Showing
1 changed file
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
let traps = { | ||
/* votre solution ici */ | ||
/* votre solution ici */ | ||
set: function (target, prop, value) { | ||
if (!isNaN(prop) && !target.includes(value)) { | ||
target.push(value.toLowerCase()); | ||
} | ||
return true | ||
}, | ||
|
||
get: function (target, prop) { | ||
if (isNaN(prop)) { | ||
return target[prop]; | ||
} | ||
return target[prop].replace(/\W/g, ''); | ||
} | ||
}; | ||
|
||
module.exports = {traps}; |