PageSourceSearch

https://rustbattle.net/node_modules/@polymer/polymer/lib/legacy/polymer-fn.js

js rustbattle.net collected 2026-10-09 00:47:01 UTC 1,831 bytes, 57 lines download raw bytes

1define(["exports", "./class.js", "../utils/boot.js"], function (_exports, _class, _boot) {
2  "use strict";
3
4  Object.defineProperty(_exports, "__esModule", {
5    value: true
6  });
7  _exports.Polymer = void 0;
8
9  /**
10  @license
11  Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
12  This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
13  The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
14  The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
15  Code distributed by Google as part of the polymer project is also
16  subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
17  */
18
19  /**
20   * Legacy class factory and registration helper for defining Polymer
21   * elements.
22   *
23   * This method is equivalent to
24   *
25   *     import {Class} from '@polymer/polymer/lib/legacy/class.js';
26   *     customElements.define(info.is, Class(info));
27   *
28   * See `Class` for details on valid legacy metadata format for `info`.
29   *
30   * @global
31   * @override
32   * @function
33   * @param {!PolymerInit} info Object containing Polymer metadata and functions
34   *   to become class methods.
35   * @return {function(new: HTMLElement)} Generated class
36   * @suppress {duplicate, invalidCasts, checkTypes}
37   */
38  const Polymer = function (info) {
39    // if input is a `class` (aka a function with a prototype), use the prototype
40    // remember that the `constructor` will never be called
41    let klass;
42
43    if (typeof info === 'function') {
44      klass = info;
45    } else {
46      klass = Polymer.Class(info);
47    }
48
49    customElements.define(klass.is,
50    /** @type {!HTMLElement} */
51    klass);
52    return klass;
53  };
54
55  _exports.Polymer = Polymer;
56  Polymer.Class = _class.Class;
57});

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.