Skip to content
This repository was archived by the owner on Nov 4, 2020. It is now read-only.

Commit 5091f9c

Browse files
committed
Update code to new packages
1 parent b792457 commit 5091f9c

14 files changed

+844
-1130
lines changed

Diff for: lib/assertion-error.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* Copyright(c) 2013-2016 Denis Bardadym <[email protected]>
55
* MIT Licensed
66
*/
7-
import { merge, functionName } from './util';
7+
import { merge } from 'should-util';
8+
import { functionName } from './util';
89
import { format } from './format';
910

1011
/**

Diff for: lib/config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77

88
import format from 'should-format';
9-
import { defaultTypeAdaptorStorage } from './iterator';
9+
import { defaultTypeAdaptorStorage } from 'should-type-adaptors';
1010

1111
var config = {
1212
typeAdaptors: defaultTypeAdaptorStorage,
13-
13+
1414
getFormatter: function(opts) {
1515
return new format.Formatter(opts || config);
1616
}

Diff for: lib/ext/assert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MIT Licensed
66
*/
77

8-
import { merge } from '../util';
8+
import { merge } from 'should-util';
99
import assert from './_assert';
1010
import AssertionError from '../assertion-error';
1111

Diff for: lib/ext/contain.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MIT Licensed
66
*/
77

8-
import { isIterable, some, isEmpty, forEach, iterator } from '../iterator';
8+
import { isIterable, some, isEmpty, forEach, iterator } from 'should-type-adaptors';
99

1010
import eql from 'should-equal';
1111

Diff for: lib/ext/eql.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import eql from 'should-equal';
99
import getType from 'should-type';
1010
import { formatProp, format } from '../format';
11-
import { forEach } from '../iterator';
11+
import { forEach } from 'should-type-adaptors';
1212

1313
function formatEqlResult(r, a, b) {
1414
return ((r.path.length > 0 ? 'at ' + r.path.map(formatProp).join(' -> ') : '') +

Diff for: lib/ext/error.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
* Copyright(c) 2013-2016 Denis Bardadym <[email protected]>
55
* MIT Licensed
66
*/
7-
import { functionName, isIterator, isGeneratorFunction } from '../util';
7+
import { isIterator, isGeneratorFunction } from 'should-util';
8+
import { functionName } from '../util';
89

910
export default function(should, Assertion) {
1011
var i = should.format;

Diff for: lib/ext/match.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import { formatProp } from '../format';
9-
import { some, forEach } from '../iterator';
9+
import { some, forEach } from 'should-type-adaptors';
1010
import eql from 'should-equal';
1111

1212
export default function(should, Assertion) {

Diff for: lib/ext/property.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
* MIT Licensed
66
*/
77

8-
import { convertPropertyName, hasOwnProperty } from '../util';
8+
import { convertPropertyName } from '../util';
9+
import { hasOwnProperty } from 'should-util';
910
import { formatProp } from '../format';
10-
import { isEmpty, has as hasKey, get as getValue, size } from '../iterator';
11+
import { isEmpty, has as hasKey, get as getValue, size } from 'should-type-adaptors';
1112
import eql from 'should-equal';
1213

1314
var aSlice = Array.prototype.slice;

Diff for: lib/format.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
1+
import sformat from 'should-format';
22
import config from './config';
33

44
export function format(value, opts) {
55
return config.getFormatter(opts).format(value);
66
}
77

88
export function formatProp(value) {
9-
return config.getFormatter().formatPropertyName(String(value));
9+
var formatter = config.getFormatter();
10+
return sformat.formatPlainObjectKey.call(formatter, value);
1011
}

Diff for: lib/iterator.js

-262
This file was deleted.

Diff for: lib/should.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
* Copyright(c) 2013-2016 Denis Bardadym <[email protected]>
55
* MIT Licensed
66
*/
7-
7+
import t from 'should-type';
8+
import eq from 'should-equal';
9+
import defaultFormat from 'should-format';
810

911
import { isWrapperType } from './util';
1012
import { format } from './format';
@@ -42,6 +44,12 @@ function should(obj) {
4244
should.AssertionError = AssertionError;
4345
should.Assertion = Assertion;
4446

47+
// exposing modules dirty way
48+
should.modules = {
49+
format: defaultFormat,
50+
type: t,
51+
equal: eq
52+
};
4553
should.format = format;
4654

4755
/**

0 commit comments

Comments
 (0)