@prezly/events
Advanced tools
Comparing version 1.0.2 to 2.0.0
{ | ||
"name": "@prezly/events", | ||
"version": "1.0.2", | ||
"version": "2.0.0", | ||
"description": "Event emitter with DOM-like EventTarget API & strong TypeScript typings", | ||
"license": "MIT", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"main": "build/commonjs/index.js", | ||
"module": "build/esm/index.mjs", | ||
"types": "build/types/index.d.ts", | ||
"repository": { | ||
@@ -17,3 +18,5 @@ "type": "git", | ||
"scripts": { | ||
"build": "tsc --project .", | ||
"build": "npm run build:esm && npm run build:commonjs", | ||
"build:commonjs": "tsc --project ./tsconfig.commonjs.json", | ||
"build:esm": "tsc --project ./tsconfig.esm.json && renamer --force --find '.js' --replace '.mjs' 'build/esm/**/*.{js,js.map}'", | ||
"check": "npm run prettier", | ||
@@ -30,2 +33,3 @@ "clean": "rimraf build/ node_modules/", | ||
"prettier": "^2.2.1", | ||
"renamer": "^4.0.0", | ||
"rimraf": "^3.0.2", | ||
@@ -32,0 +36,0 @@ "typescript": "^4.1.5" |
@@ -21,3 +21,3 @@ # @prezly/events | ||
```tsx | ||
import Events from '@prezly/events'; | ||
import { Events } from '@prezly/events'; | ||
@@ -24,0 +24,0 @@ const ref = { current: 0 }; |
@@ -1,4 +0,4 @@ | ||
import { Listener, RemoveListener } from './types'; | ||
import type { Listener, RemoveListener } from './types'; | ||
class Events<EventMap extends Record<string, unknown>> { | ||
export class Events<EventMap extends Record<string, unknown>> { | ||
private listeners: Partial<Record<keyof EventMap, Listener<any>[]>> = {}; | ||
@@ -40,3 +40,1 @@ | ||
} | ||
export default Events; |
@@ -1,2 +0,3 @@ | ||
export { default } from './Events'; | ||
import { Events } from './Events'; | ||
export * from './types'; | ||
export { Events }; |
{ | ||
"compilerOptions": { | ||
"allowSyntheticDefaultImports": true, | ||
"declaration": true, | ||
"allowSyntheticDefaultImports": false, | ||
"downlevelIteration": true, | ||
"esModuleInterop": true, | ||
"esModuleInterop": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"importsNotUsedAsValues": "error", | ||
"isolatedModules": true, | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"noEmit": true, | ||
"noImplicitAny": true, | ||
@@ -17,8 +18,4 @@ "noImplicitReturns": true, | ||
"strict": true, | ||
"target": "es5", | ||
"outDir": "./build", | ||
"rootDir": "./src" | ||
}, | ||
"include": ["./src"] | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18792
33
199
5
2