feat: sdks and docs (#239)
* init * fix * update docs * bump: all sdks * rename types test
This commit is contained in:
committed by
GitHub
parent
790801b728
commit
83e223a496
23
packages/sdks/web/src/init-snippet.ts
Normal file
23
packages/sdks/web/src/init-snippet.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
// Source:
|
||||
// window.op = window.op || (function() {
|
||||
// var q = [];
|
||||
// var op = new Proxy(function() {
|
||||
// if (arguments.length > 0) {
|
||||
// q.push(Array.prototype.slice.call(arguments));
|
||||
// }
|
||||
// }, {
|
||||
// get: function(_, prop) {
|
||||
// if (prop === 'q') {
|
||||
// return q;
|
||||
// }
|
||||
// return function() {
|
||||
// q.push([prop].concat(Array.prototype.slice.call(arguments)));
|
||||
// };
|
||||
// }
|
||||
// });
|
||||
// return op;
|
||||
// })();
|
||||
|
||||
export function getInitSnippet(): string {
|
||||
return `window.op=window.op||function(){var n=[],o=new Proxy((function(){arguments.length>0&&n.push(Array.prototype.slice.call(arguments))}),{get:function(o,t){return"q"===t?n:function(){n.push([t].concat(Array.prototype.slice.call(arguments)))}}});return o}();`;
|
||||
}
|
||||
Reference in New Issue
Block a user