File tree 1 file changed +12
-10
lines changed
Project-JS/clear-localstorage
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
- /*Exposing a window-level function to clear localStorage values who's key includes the substring 'optimizely'
2
- */
3
- window . clearOptlyLocalStorage = function ( ) {
4
- for ( var key in window . localStorage ) {
5
- if ( key . indexOf ( 'optimizely' ) !== - 1 ) {
6
- window . localStorage . removeItem ( key )
7
- }
1
+ /**
2
+ * Exposing a window-level function to clear localStorage values who's key includes the substring 'optimizely'
3
+ */
4
+ window . clearOptlyLocalStorage = function ( ) {
5
+ for ( var key in window . localStorage ) {
6
+ if ( key . indexOf ( 'optimizely' ) !== - 1 ) {
7
+ window . localStorage . removeItem ( key )
8
8
}
9
+ }
9
10
}
10
- //The function can be called from Optimizely Project JS based on an available boolean flag, such as a cookie's value
11
+
12
+ // The function can be called from Optimizely Project JS based on an available boolean flag, such as a cookie's value
11
13
var should_clear = window . customer_storage_flag_boolean ;
12
- if ( should_clear ) {
13
- clearOptimizelyLocalStorage ( ) ;
14
+ if ( should_clear ) {
15
+ clearOptlyLocalStorage ( ) ;
14
16
}
You can’t perform that action at this time.
0 commit comments