UNPKG

1.23 kBJavaScriptView Raw
1"use strict";
2/**
3 * @license
4 * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
5 * This code may only be used under the BSD style license found at
6 * http://polymer.github.io/LICENSE.txt
7 * The complete set of authors may be found at
8 * http://polymer.github.io/AUTHORS.txt
9 * The complete set of contributors may be found at
10 * http://polymer.github.io/CONTRIBUTORS.txt
11 * Code distributed by Google as part of the polymer project is also
12 * subject to an additional IP rights grant found at
13 * http://polymer.github.io/PATENTS.txt
14 */
15Object.defineProperty(exports, "__esModule", { value: true });
16const json_document_1 = require("./json-document");
17class JsonParser {
18 parse(contents, url, _urlResolver, inlineDocInfo) {
19 const isInline = !!inlineDocInfo;
20 inlineDocInfo = inlineDocInfo || {};
21 return new json_document_1.ParsedJsonDocument({
22 url,
23 baseUrl: inlineDocInfo.baseUrl,
24 contents,
25 ast: JSON.parse(contents),
26 locationOffset: inlineDocInfo.locationOffset,
27 astNode: inlineDocInfo.astNode,
28 isInline
29 });
30 }
31}
32exports.JsonParser = JsonParser;
33//# sourceMappingURL=json-parser.js.map
\No newline at end of file