PageSourceSearch

https://www.springerpub.com/static/version1789146322/base/Magento/…/lib/knockout/template/observable_source.js

js springerpub.com collected 2026-09-24 08:47:42 UTC 1,110 bytes, 42 lines download raw bytes

1/**
2 * Copyright © Magento, Inc. All rights reserved.
3 * See COPYING.txt for license details.
4 */
5/**
6 * Is being used by knockout template engine to store template to.
7 */
8define([
9    'ko',
10    'uiClass'
11], function (ko, Class) {
12    'use strict';
13
14    return Class.extend({
15
16        /**
17         * Initializes templateName, _data, nodes properties.
18         *
19         * @param  {template} template - identifier of template
20         */
21        initialize: function (template) {
22            this.templateName = template;
23            this._data = {};
24            this.nodes = ko.observable([]);
25        },
26
27        /**
28         * Data setter. If only one arguments passed, returns corresponding value.
29         * Else, writes into it.
30         * @param  {String} key - key to write to or to read from
31         * @param  {*} value
32         * @return {*} - if 1 arg provided, Returns _data[key] property
33         */
34        data: function (key, value) {
35            if (arguments.length === 1) {
36                return this._data[key];
37            }
38
39            this._data[key] = value;
40        }
41    });
42});

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.