Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition to Typescript #112

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- 18
- 16
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should support of node 16 be dropped?

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
yarn.lock
dist
13 changes: 7 additions & 6 deletions benchmark.js → bench.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/naming-convention */
import Benchmark from 'benchmark';
import {getProperty, setProperty, hasProperty, deleteProperty} from './index.js';
import {getProperty, setProperty, hasProperty, deleteProperty} from './source/index.js';

const suite = new Benchmark.Suite();

Expand Down Expand Up @@ -34,7 +35,7 @@ suite
getProperty(fixture2, 'foo');
getProperty({}, 'hasOwnProperty');

function fn() {}
function fn() {} // eslint-disable-line @typescript-eslint/no-empty-function
fn.foo = {bar: 1};
getProperty(fn);
getProperty(fn, 'foo');
Expand All @@ -53,7 +54,7 @@ suite
})
.add('setProperty', () => {
const func = () => 'test';
let fixture1 = {};
let fixture1: Record<PropertyKey, unknown> = {};

setProperty(fixture1, 'foo', 2);

Expand All @@ -74,7 +75,7 @@ suite

setProperty(fixture1, 'foo.function', func);

function fn() {}
function fn() {} // eslint-disable-line @typescript-eslint/no-empty-function
setProperty(fn, 'foo.bar', 1);

fixture1.fn = fn;
Expand Down Expand Up @@ -102,7 +103,7 @@ suite
hasProperty({foo: {bar: {baz: null}}}, 'foo.bar.baz');
hasProperty({foo: {bar: 'a'}}, 'foo.fake.fake2');

function fn() {}
function fn() {} // eslint-disable-line @typescript-eslint/no-empty-function
fn.foo = {bar: 1};
hasProperty(fn);
hasProperty(fn, 'foo');
Expand Down Expand Up @@ -144,7 +145,7 @@ suite
setProperty(fixture1, 'foo\\.bar.baz', true);
deleteProperty(fixture1, 'foo\\.bar.baz');

const fixture2 = {};
const fixture2: Record<PropertyKey, unknown> = {};
setProperty(fixture2, 'foo.bar\\.baz', true);
deleteProperty(fixture2, 'foo.bar\\.baz');

Expand Down
164 changes: 0 additions & 164 deletions index.d.ts

This file was deleted.