jsonpath/docs/0.bootstrap.js

38 lines
20 KiB
JavaScript
Raw Normal View History

2019-03-04 00:16:03 +09:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{
2019-04-13 22:27:33 +09:00
/***/ "../all_pkg/jsonpath_wasm.js":
/*!***********************************!*\
!*** ../all_pkg/jsonpath_wasm.js ***!
\***********************************/
/*! exports provided: __wbg_error_34d316e12ff05c33, compile, selector, select, deleteValue, replaceWith, __wbg_call_88d2a6153573084e, __wbindgen_object_clone_ref, __wbindgen_object_drop_ref, __wbindgen_string_new, __wbindgen_is_string, __wbindgen_string_get, __wbindgen_debug_string, __wbindgen_cb_forget, __wbindgen_json_parse, __wbindgen_json_serialize, __wbindgen_rethrow, __wbindgen_closure_wrapper24, __wbindgen_closure_wrapper26, SelectorMut, Selector, __wbindgen_throw */
2019-03-04 00:16:03 +09:00
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_error_34d316e12ff05c33\", function() { return __wbg_error_34d316e12ff05c33; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compile\", function() { return compile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"selector\", function() { return selector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"select\", function() { return select; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteValue\", function() { return deleteValue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"replaceWith\", function() { return replaceWith; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_call_88d2a6153573084e\", function() { return __wbg_call_88d2a6153573084e; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_clone_ref\", function() { return __wbindgen_object_clone_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_object_drop_ref\", function() { return __wbindgen_object_drop_ref; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_new\", function() { return __wbindgen_string_new; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_is_string\", function() { return __wbindgen_is_string; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_string_get\", function() { return __wbindgen_string_get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_debug_string\", function() { return __wbindgen_debug_string; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_cb_forget\", function() { return __wbindgen_cb_forget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_json_parse\", function() { return __wbindgen_json_parse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_json_serialize\", function() { return __wbindgen_json_serialize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_rethrow\", function() { return __wbindgen_rethrow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_closure_wrapper24\", function() { return __wbindgen_closure_wrapper24; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_closure_wrapper26\", function() { return __wbindgen_closure_wrapper26; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectorMut\", function() { return SelectorMut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Selector\", function() { return Selector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_throw\", function() { return __wbindgen_throw; });\n/* harmony import */ var _jsonpath_wasm_bg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonpath_wasm_bg */ \"../all_pkg/jsonpath_wasm_bg.wasm\");\n/* tslint:disable */\n\n\nlet cachedTextDecoder = new TextDecoder('utf-8');\n\nlet cachegetUint8Memory = null;\nfunction getUint8Memory() {\n if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== _jsonpath_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory = new Uint8Array(_jsonpath_wasm_bg__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory;\n}\n\nfunction getStringFromWasm(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len));\n}\n\nfunction __wbg_error_34d316e12ff05c33(arg0, arg1) {\n let varg0 = getStringFromWasm(arg0, arg1);\n console.error(varg0);\n}\n\nlet cach
2019-03-04 00:16:03 +09:00
/***/ }),
2019-04-13 22:27:33 +09:00
/***/ "../all_pkg/jsonpath_wasm_bg.wasm":
/*!****************************************!*\
!*** ../all_pkg/jsonpath_wasm_bg.wasm ***!
\****************************************/
/*! exports provided: memory, compile, selector, select, deleteValue, replaceWith, __wbg_selector_free, selector_new, selector_path, selector_value, selector_select, __wbg_selectormut_free, selectormut_new, selectormut_path, selectormut_value, selectormut_deleteValue, selectormut_replaceWith, selectormut_take, __wbindgen_malloc, __wbindgen_free, __wbg_function_table */
2019-03-04 00:16:03 +09:00
/***/ (function(module, exports, __webpack_require__) {
2019-04-13 22:27:33 +09:00
eval("\"use strict\";\n// Instantiate WebAssembly module\nvar wasmExports = __webpack_require__.w[module.i];\n__webpack_require__.r(exports);\n// export exports from WebAssembly module\nfor(var name in wasmExports) if(name != \"__webpack_init__\") exports[name] = wasmExports[name];\n// exec imports from WebAssembly module (for esm order)\n/* harmony import */ var m0 = __webpack_require__(/*! ./jsonpath_wasm */ \"../all_pkg/jsonpath_wasm.js\");\n\n\n// exec wasm module\nwasmExports[\"__webpack_init__\"]()\n\n//# sourceURL=webpack:///../all_pkg/jsonpath_wasm_bg.wasm?");
2019-03-04 23:07:09 +09:00
/***/ }),
/***/ "./index.js":
/*!******************!*\
!*** ./index.js ***!
\******************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
2019-04-13 22:27:33 +09:00
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jsonpath_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jsonpath-wasm */ \"../all_pkg/jsonpath_wasm.js\");\n\n\nfunction getTextarea() {\n return document.querySelector('#json-example');\n}\n\nfunction getJsonpathInput() {\n return document.querySelector('#jsonpath-input');\n}\n\nfunction getReadBtn() {\n return document.querySelector('#read-json');\n}\n\nfunction getReadResult() {\n return document.querySelector('#read-result');\n}\n\nfunction getLinks() {\n return document.querySelectorAll('.path>a');\n}\n\nfunction initData(url) {\n return fetch(url)\n .then((res) => res.text())\n .then((jsonStr) => getTextarea().value = jsonStr)\n .catch(console.error);\n}\n\nfunction initEvent() {\n getJsonpathInput().onkeyup = function(e) {\n var charCode = (typeof e.which === \"number\") ? e.which : e.keyCode;\n if(charCode == 13) {\n read();\n }\n }\n\n getReadBtn().onclick = function() {\n read();\n }\n\n getLinks().forEach(function(anchor) {\n anchor.href = \"#\" + encodeURIComponent(anchor.textContent);\n });\n\n function read() {\n let ret = jsonpath_wasm__WEBPACK_IMPORTED_MODULE_0__[\"select\"](getTextarea().value, getJsonpathInput().value);\n if(typeof ret === 'string') {\n getReadResult().innerText = ret;\n } else {\n getReadResult().innerText = JSON.stringify(ret, null, 2);\n }\n }\n}\n\nfunction readPathParam() {\n if(location.href.indexOf('#') > -1) {\n readPath()\n }\n}\n\nfunction forceClick(ctrl) {\n let doc = ctrl.ownerDocument;\n let event = doc.createEvent('MouseEvents');\n event.initEvent('click', true, true);\n event.synthetic = true;\n ctrl.dispatchEvent(event, true);\n}\n\nfunction readPath() {\n let query = location.href.substring(location.href.indexOf('#') + 1);\n let path = decodeURIComponent(query);\n getJsonpathInput().value = path;\n forceClick(getReadBtn());\n}\n\nwindow.onpopstate = readPath;\n\ninitData('data/example.json').then(initEvent).then(readPathParam);\n\n//# sourceURL=webpack:///./index.js?");
2019-03-04 00:16:03 +09:00
/***/ })
}]);