jsonpath/docs/bench/1.bootstrap.js

38 lines
24 KiB
JavaScript
Raw Normal View History

2019-03-08 17:27:24 +09:00
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[1],{
2020-04-15 10:09:19 +09:00
/***/ "../web_pkg/jsonpath_wasm.js":
/*!***********************************!*\
!*** ../web_pkg/jsonpath_wasm.js ***!
\***********************************/
/*! exports provided: compile, selector, select, deleteValue, replaceWith, Selector, SelectorMut, __wbindgen_json_parse, __wbindgen_json_serialize, __wbindgen_cb_forget, __wbg_error_e7d3e8dbb31828c8, __wbindgen_object_drop_ref, __wbindgen_object_clone_ref, __wbindgen_string_new, __wbg_call_1ad0eb4a7ab279eb, __wbindgen_is_string, __wbindgen_string_get, __wbindgen_debug_string, __wbindgen_throw, __wbindgen_rethrow, __wbindgen_closure_wrapper28, __wbindgen_closure_wrapper26 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\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__, \"Selector\", function() { return Selector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SelectorMut\", function() { return SelectorMut; });\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_cb_forget\", function() { return __wbindgen_cb_forget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbg_error_e7d3e8dbb31828c8\", function() { return __wbg_error_e7d3e8dbb31828c8; });\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_object_clone_ref\", function() { return __wbindgen_object_clone_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__, \"__wbg_call_1ad0eb4a7ab279eb\", function() { return __wbg_call_1ad0eb4a7ab279eb; });\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_throw\", function() { return __wbindgen_throw; });\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_wrapper28\", function() { return __wbindgen_closure_wrapper28; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__wbindgen_closure_wrapper26\", function() { return __wbindgen_closure_wrapper26; });\n/* harmony import */ var _jsonpath_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonpath_wasm_bg.wasm */ \"../web_pkg/jsonpath_wasm_bg.wasm\");\n\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? __webpack_require__(/*! util */ \"./node_modules/util/util.js\").TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachegetUint8Memory0 = null;\nfunction getUint8Memory0() {\n if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== _jsonpath_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer) {\n cachegetUint8Memory0 = new Uint8Array(_jsonpath_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__[\"memory\"].buffer);\n }\n return cachegetUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n
/***/ }),
/***/ "../web_pkg/jsonpath_wasm_bg.wasm":
/*!****************************************!*\
!*** ../web_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, ffi_select, ffi_path_compile, ffi_select_with_compiled_path, __wbindgen_malloc, __wbindgen_realloc, __wbindgen_export_2, _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h74450c618a80136f, _dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h97edf32b3dc25aad, __wbindgen_exn_store */
2019-03-08 17:27:24 +09:00
/***/ (function(module, exports, __webpack_require__) {
2020-04-15 10:09:19 +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.js */ \"../web_pkg/jsonpath_wasm.js\");\n\n\n// exec wasm module\nwasmExports[\"__webpack_init__\"]()\n\n//# sourceURL=webpack:///../web_pkg/jsonpath_wasm_bg.wasm?");
2019-03-08 17:27:24 +09:00
/***/ }),
2020-04-15 10:09:19 +09:00
/***/ "./index.js":
/*!******************!*\
!*** ./index.js ***!
\******************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
2019-03-08 17:27:24 +09:00
2020-04-15 10:09:19 +09:00
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jsonpath_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jsonpath-wasm */ \"../web_pkg/jsonpath_wasm.js\");\n/* harmony import */ var jsonpath_jsonpath_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jsonpath/jsonpath.js */ \"./node_modules/jsonpath/jsonpath.js\");\n/* harmony import */ var jsonpath_jsonpath_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jsonpath_jsonpath_js__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nfunction run(message, iter, cb) {\n return new Promise(function(resolve, _reject) {\n let d = Date.now();\n for (let i = 0; i < iter; i++) {\n cb();\n }\n msg([message, Date.now() - d].join(\", \"));\n setTimeout(resolve, 0);\n })\n}\n\nfunction msg(msg) {\n console.log(msg);\n let div = document.createElement(\"div\");\n div.innerText = msg;\n document.body.appendChild(div);\n}\n\nlet json = {\n \"store\": {\n \"book\": [\n {\n \"category\": \"reference\",\n \"author\": \"Nigel Rees\",\n \"title\": \"Sayings of the Century\",\n \"price\": 8.95\n },\n {\n \"category\": \"fiction\",\n \"author\": \"Evelyn Waugh\",\n \"title\": \"Sword of Honour\",\n \"price\": 12.99\n },\n {\n \"category\": \"fiction\",\n \"author\": \"Herman Melville\",\n \"title\": \"Moby Dick\",\n \"isbn\": \"0-553-21311-3\",\n \"price\": 8.99\n },\n {\n \"category\": \"fiction\",\n \"author\": \"J. R. R. Tolkien\",\n \"title\": \"The Lord of the Rings\",\n \"isbn\": \"0-395-19395-8\",\n \"price\": 22.99\n }\n ],\n \"bicycle\": {\n \"color\": \"red\",\n \"price\": 19.95\n }\n },\n \"expensive\": 10\n};\n\nlet path = '$..book[?(@.price<30 && @.category==\"fiction\")]';\nlet template = jsonpath_wasm__WEBPACK_IMPORTED_MODULE_0__[\"compile\"](path);\nlet selector = jsonpath_wasm__WEBPACK_IMPORTED_MODULE_0__[\"selector\"](json);\n\nlet iterCount = 2000;\n\nrun('jsonpath', iterCount, function() { jsonpath_jsonpath_js__WEBPACK_IMPORTED_MODULE_1__[\"query\"](json, path) })\n .then(function() {\n return run('jsonpath-wasm- selector', iterCount, function() { selector(path) });\n })\n .then(function() {\n return run('jsonpath-wasm- compile', iterCount, function() { template(json) });\n })\n .then(function() {\n return run('jsonpath-wasm- select', iterCount, function() { jsonpath_wasm__WEBPACK_IMPORTED_MODULE_0__[\"select\"](json, path) });\n })\n .finally(function() {});\n\n\n//# sourceURL=webpack:///./index.js?");
2019-03-08 17:27:24 +09:00
/***/ })
}]);