• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

adobe / reactor-turbine / 26974271630

04 Jun 2026 07:23PM UTC coverage: 18.928% (-77.0%) from 95.912%
26974271630

Pull #201

github

web-flow
Merge 99f374fa8 into 4a42733a4
Pull Request #201: Platir 64071 update vulnerability chain

36 of 379 branches covered (9.5%)

Branch coverage included in aggregate %.

4 of 6 new or added lines in 1 file covered. (66.67%)

640 existing lines in 47 files now uncovered.

197 of 852 relevant lines covered (23.12%)

1.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.0
/src/getNamespacedStorage.js
1
/***************************************************************************************
2
 * (c) 2017 Adobe. All rights reserved.
3
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
 * you may not use this file except in compliance with the License. You may obtain a copy
5
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
 *
7
 * Unless required by applicable law or agreed to in writing, software distributed under
8
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
 * OF ANY KIND, either express or implied. See the License for the specific language
10
 * governing permissions and limitations under the License.
11
 ****************************************************************************************/
12

13
var validateInjectedParams = require('./helpers/validate-injected-params');
3✔
14

15
function injectGetNamespacedStorage({ window }) {
16
  var NAMESPACE = 'com.adobe.reactor.'; // Default namespace.
6✔
17
  return function getNamespacedStorage(storageType, additionalNamespace) {
6✔
18
    var finalNamespace = NAMESPACE + (additionalNamespace || '');
6!
19

20
    // When storage is disabled on Safari, the mere act of referencing window.localStorage
21
    // or window.sessionStorage throws an error. For this reason, we wrap in a try-catch.
22
    return {
6✔
23
      /**
24
       * Reads a value from storage.
25
       * @param {string} name The name of the item to be read.
26
       * @returns {string}
27
       */
28
      getItem: function (name) {
UNCOV
29
        try {
×
UNCOV
30
          return window[storageType].getItem(finalNamespace + name);
×
31
          // eslint-disable-next-line no-unused-vars
32
        } catch (e) {
UNCOV
33
          return null;
×
34
        }
35
      },
36
      /**
37
       * Saves a value to storage.
38
       * @param {string} name The name of the item to be saved.
39
       * @param {string} value The value of the item to be saved.
40
       * @returns {boolean} Whether the item was successfully saved to storage.
41
       */
42
      setItem: function (name, value) {
UNCOV
43
        try {
×
UNCOV
44
          window[storageType].setItem(finalNamespace + name, value);
×
UNCOV
45
          return true;
×
46
          // eslint-disable-next-line no-unused-vars
47
        } catch (e) {
UNCOV
48
          return false;
×
49
        }
50
      }
51
    };
52
  };
53
}
54

55
const validateInjection = validateInjectedParams(injectGetNamespacedStorage);
3✔
56

57
module.exports = validateInjection({
3✔
58
  window: require('@adobe/reactor-window')
59
});
60

61
if (REACTOR_KARMA_CI_UNIT_TEST_MODE) {
3!
62
  /* START.TESTS_ONLY */
63
  module.exports.injectGetNamespacedStorage = validateInjection;
3✔
64
  /* END.TESTS_ONLY */
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc