PageSourceSearch

https://wpt.fyi/node_modules/@polymer/polymer/lib/utils/wrap.js

js wpt.fyi collected 2026-09-24 08:46:02 UTC 1,168 bytes, 24 lines download raw bytes

1/**
2@license
3Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7Code distributed by Google as part of the polymer project is also
8subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9*/
10
11/* eslint-disable valid-jsdoc */
12/**
13 * Node wrapper to ensure ShadowDOM safe operation regardless of polyfill
14 * presence or mode. Note that with the introduction of `ShadyDOM.noPatch`,
15 * a node wrapper must be used to access ShadowDOM API.
16 * This is similar to using `Polymer.dom` but relies exclusively
17 * on the presence of the ShadyDOM polyfill rather than requiring the loading
18 * of legacy (Polymer.dom) API.
19 * @type {function(Node):Node}
20 */
21export const wrap = (window['ShadyDOM'] && window['ShadyDOM']['noPatch'] && window['ShadyDOM']['wrap']) ?
22  window['ShadyDOM']['wrap'] :
23  (window['ShadyDOM'] ? (n) => ShadyDOM['patch'](n) : (n) => n);
24

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.