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

Commit

Permalink
Update code to new packages
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Aug 10, 2016
1 parent b792457 commit 5091f9c
Show file tree
Hide file tree
Showing 14 changed files with 844 additions and 1,130 deletions.
3 changes: 2 additions & 1 deletion lib/assertion-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Copyright(c) 2013-2016 Denis Bardadym <bardadymchik@gmail.com>
* MIT Licensed
*/
import { merge, functionName } from './util';
import { merge } from 'should-util';
import { functionName } from './util';
import { format } from './format';

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*/

import format from 'should-format';
import { defaultTypeAdaptorStorage } from './iterator';
import { defaultTypeAdaptorStorage } from 'should-type-adaptors';

var config = {
typeAdaptors: defaultTypeAdaptorStorage,

getFormatter: function(opts) {
return new format.Formatter(opts || config);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* MIT Licensed
*/

import { merge } from '../util';
import { merge } from 'should-util';
import assert from './_assert';
import AssertionError from '../assertion-error';

Expand Down
2 changes: 1 addition & 1 deletion lib/ext/contain.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* MIT Licensed
*/

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

import eql from 'should-equal';

Expand Down
2 changes: 1 addition & 1 deletion lib/ext/eql.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import eql from 'should-equal';
import getType from 'should-type';
import { formatProp, format } from '../format';
import { forEach } from '../iterator';
import { forEach } from 'should-type-adaptors';

function formatEqlResult(r, a, b) {
return ((r.path.length > 0 ? 'at ' + r.path.map(formatProp).join(' -> ') : '') +
Expand Down
3 changes: 2 additions & 1 deletion lib/ext/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Copyright(c) 2013-2016 Denis Bardadym <bardadymchik@gmail.com>
* MIT Licensed
*/
import { functionName, isIterator, isGeneratorFunction } from '../util';
import { isIterator, isGeneratorFunction } from 'should-util';
import { functionName } from '../util';

export default function(should, Assertion) {
var i = should.format;
Expand Down
2 changes: 1 addition & 1 deletion lib/ext/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

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

export default function(should, Assertion) {
Expand Down
5 changes: 3 additions & 2 deletions lib/ext/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
* MIT Licensed
*/

import { convertPropertyName, hasOwnProperty } from '../util';
import { convertPropertyName } from '../util';
import { hasOwnProperty } from 'should-util';
import { formatProp } from '../format';
import { isEmpty, has as hasKey, get as getValue, size } from '../iterator';
import { isEmpty, has as hasKey, get as getValue, size } from 'should-type-adaptors';
import eql from 'should-equal';

var aSlice = Array.prototype.slice;
Expand Down
5 changes: 3 additions & 2 deletions lib/format.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

import sformat from 'should-format';
import config from './config';

export function format(value, opts) {
return config.getFormatter(opts).format(value);
}

export function formatProp(value) {
return config.getFormatter().formatPropertyName(String(value));
var formatter = config.getFormatter();
return sformat.formatPlainObjectKey.call(formatter, value);
}
262 changes: 0 additions & 262 deletions lib/iterator.js

This file was deleted.

10 changes: 9 additions & 1 deletion lib/should.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* Copyright(c) 2013-2016 Denis Bardadym <bardadymchik@gmail.com>
* MIT Licensed
*/

import t from 'should-type';
import eq from 'should-equal';
import defaultFormat from 'should-format';

import { isWrapperType } from './util';
import { format } from './format';
Expand Down Expand Up @@ -42,6 +44,12 @@ function should(obj) {
should.AssertionError = AssertionError;
should.Assertion = Assertion;

// exposing modules dirty way
should.modules = {
format: defaultFormat,
type: t,
equal: eq
};
should.format = format;

/**
Expand Down
Loading

0 comments on commit 5091f9c

Please sign in to comment.