This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // fastest and simple string hash function (10^9 hashes => zero collision) | |
| // keys 20 length => 1050 hash/ms | |
| // keys 50 length => 750 hash/ms | |
| // keys 500 length => 80 hash/ms | |
| const cyrb53 = (key, seed = 0) => { | |
| const A = 2654435761; | |
| const B = 1597334677; | |
| const C = 2246822507; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const gqlFileRegex = /\.(graphql|gql)$/; | |
| function gqlLoader(): Plugin { | |
| return { | |
| name: "gql-loader", | |
| transform(src, id) { | |
| if (gqlFileRegex.test(id)) { | |
| return { | |
| code: `const query = "${stripIgnoredCharacters( | |
| src |