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

Remove type-detect dependency #98

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions component.json

This file was deleted.

18 changes: 17 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@
* MIT Licensed
*/

import type from 'type-detect';
function type(obj) {
if (typeof obj === 'undefined') {
return 'undefined';
}

if (obj === null) {
return 'null';
}

const stringTag = obj[Symbol.toStringTag];
if (typeof stringTag === 'string') {
return stringTag;
}
const sliceStart = 8;
const sliceEnd = -1;
return Object.prototype.toString.call(obj).slice(sliceStart, sliceEnd);
}

function FakeMap() {
this._key = 'chai/deep-eql__' + Math.random() + Date.now();
Expand Down
31 changes: 10 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
"ecmaVersion": 2015
}
},
"dependencies": {
"type-detect": "^4.0.0"
},
"devDependencies": {
"@js-temporal/polyfill": "^0.4.3",
"@rollup/plugin-commonjs": "^24.1.0",
Expand All @@ -68,7 +65,7 @@
"lcov-result-merger": "^1.0.2",
"lodash.isequal": "^4.4.0",
"mocha": "^9.1.1",
"simple-assert": "^1.0.0"
"simple-assert": "^2.0.0"
},
"engines": {
"node": ">=6"
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'simple-assert';
import { assert } from 'simple-assert';
import eql, { MemoizeMap } from '../index.js';

function describeIf(condition) {
Expand Down
2 changes: 1 addition & 1 deletion test/new-ecmascript-types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-eval */
import assert from 'simple-assert';
import { assert } from 'simple-assert';
import eql from '../index.js';
var emptyFunction = Function.prototype;
var symbolExists = typeof Symbol === 'function';
Expand Down
2 changes: 1 addition & 1 deletion test/temporal-types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import assert from 'simple-assert';
import { assert } from 'simple-assert';
import { Temporal } from '@js-temporal/polyfill';
import eql from '../index.js';

Expand Down
15 changes: 1 addition & 14 deletions web-test-runner.config.mjs
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import { fromRollup } from '@web/dev-server-rollup';
import rollupCommonjs from '@rollup/plugin-commonjs';

const commonjs = fromRollup(rollupCommonjs);

export default {
mimeTypes: {
'**/*.cjs': '*.js',
},
nodeResolve: true,
files: [ 'test/*.{js,mjs}' ],
plugins: [
commonjs({
include: [ './index.js', './test/*.js', './node_modules/simple-assert/**/*', './node_modules/assertion-error/**/*', './node_modules/type-detect/**/*' ],
}),
],
files: ["test/*.{js,mjs}"]
};
Loading