@wixc3/patterns
Advanced tools
Comparing version 16.1.3 to 16.2.0
{ | ||
"name": "@wixc3/patterns", | ||
"version": "16.1.3", | ||
"version": "16.2.0", | ||
"description": "A utility for saving objects to be disposed", | ||
@@ -21,5 +21,5 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@wixc3/common": "^16.1.3", | ||
"@wixc3/common": "^16.2.0", | ||
"promise-assist": "^2.0.1" | ||
} | ||
} |
@@ -75,3 +75,6 @@ import { DisposalGroup, getGroupConstrainedIndex, GroupConstraints, normalizeConstraints } from './constraints'; | ||
private readonly constrains: GroupConstraints[] = []; | ||
constructor(private name: string, initialGroups: string[] = []) { | ||
constructor( | ||
private name: string, | ||
initialGroups: string[] = [], | ||
) { | ||
this.dispose = this.dispose.bind(this); | ||
@@ -121,3 +124,3 @@ this.groups.push(...initialGroups.map(createGroup)); | ||
throw new Error( | ||
`Invalid disposable: must be a function or object with a dispose method got ${disposable}` | ||
`Invalid disposable: must be a function or object with a dispose method got ${disposable}`, | ||
); | ||
@@ -124,0 +127,0 @@ } |
@@ -28,2 +28,2 @@ export interface IDisposable { | ||
); | ||
} | ||
} |
@@ -99,3 +99,3 @@ import { expect, use } from 'chai'; | ||
expect(() => groups.registerGroup('group1', { before: 'group2' })).to.throw( | ||
`Invalid constraint: "before: group2" - group not found` | ||
`Invalid constraint: "before: group2" - group not found`, | ||
); | ||
@@ -106,3 +106,3 @@ }); | ||
expect(() => groups.registerGroup('group1', [])).to.throw( | ||
`Invalid disposal group: must have at least one constraint` | ||
`Invalid disposal group: must have at least one constraint`, | ||
); | ||
@@ -116,3 +116,3 @@ }); | ||
expect(() => groups.registerGroup('invalid', { before: 'before', after: 'after' })).to.throw( | ||
'Invalid constraints: after runs after before, which contradicts prior constraints' | ||
'Invalid constraints: after runs after before, which contradicts prior constraints', | ||
); | ||
@@ -123,3 +123,3 @@ }); | ||
expect(() => groups.registerGroup('default', { before: 'default' })).to.throw( | ||
`Invalid group: "default" already exists` | ||
`Invalid group: "default" already exists`, | ||
); | ||
@@ -126,0 +126,0 @@ }); |
@@ -112,3 +112,3 @@ import { expect } from 'chai'; | ||
disposable.guard(() => 'guarded return value'), | ||
'guard return value' | ||
'guard return value', | ||
).to.eql('guarded return value'); | ||
@@ -115,0 +115,0 @@ const disposing = disposable.dispose(); |
{ | ||
"extends": "../../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "../dist/cjs" | ||
"outDir": "../dist/cjs", | ||
}, | ||
"references": [{ "path": "../../common/src" }] | ||
"references": [{ "path": "../../common/src" }], | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
268140
5184
Updated@wixc3/common@^16.2.0