Skip to content

Commit

Permalink
initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Apr 24, 2024
1 parent dcbe204 commit 6178171
Show file tree
Hide file tree
Showing 13 changed files with 2,402 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .c8rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporter": ["lcov"],
"exclude": [
"lib/test"
]
}
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
root = true

[*]
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.tshy
/node_modules
/lib
*.swp
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"bracketSpacing": false,
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false,
"arrowParens": "always"
}
21 changes: 21 additions & 0 deletions bench/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {Bench} from 'tinybench';
import {parse} from '../lib/main.js';

const inputs = [
'foo=123&bar=456',
'foo[bar]=123&baz=456',
'foo=123&bar=456&foo=123',
'foo[bar][baz]=woof'
];
const bench = new Bench();

bench.add('nanoquery (parse)', () => {
for (const input of inputs) {
parse(input);
}
});

await bench.warmup();
await bench.run();

console.table(bench.table());
14 changes: 14 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import eslint from '@eslint/js';
import {configs as tseslintConfigs} from 'typescript-eslint';

const {configs: eslintConfigs} = eslint;

export default [
{
files: [
'src/**/*.ts'
]
},
eslintConfigs.recommended,
...tseslintConfigs.strict
];
Loading

0 comments on commit 6178171

Please sign in to comment.