@breautek/iterator
Advanced tools
Comparing version 2.0.1 to 3.0.0
@@ -1,1 +0,1 @@ | ||
{"processes":{"2be1ea6c-1cf3-4f79-aa91-e586c1f6f863":{"parent":null,"children":[]}},"files":{"/development/breautek/iterator/src/api.ts":["2be1ea6c-1cf3-4f79-aa91-e586c1f6f863"],"/development/breautek/iterator/src/Iterator.ts":["2be1ea6c-1cf3-4f79-aa91-e586c1f6f863"],"/development/breautek/iterator/src/DictionaryIterator.ts":["2be1ea6c-1cf3-4f79-aa91-e586c1f6f863"]},"externalIds":{}} | ||
{"processes":{"9e18d8be-bf7a-41c3-89df-1711f5ee893c":{"parent":null,"children":[]}},"files":{"/development/breautek/iterator/src/DictionaryIterator.ts":["9e18d8be-bf7a-41c3-89df-1711f5ee893c"],"/development/breautek/iterator/src/Iterator.ts":["9e18d8be-bf7a-41c3-89df-1711f5ee893c"],"/development/breautek/iterator/src/api.ts":["9e18d8be-bf7a-41c3-89df-1711f5ee893c"]},"externalIds":{}} |
@@ -10,3 +10,3 @@ import { Iterator } from './Iterator'; | ||
export declare class DictionaryIterator<T> extends Iterator<any> { | ||
private dictionary; | ||
private _dictionary; | ||
constructor(dictionary: IDictionary); | ||
@@ -13,0 +13,0 @@ next(): IDictionaryIteratorResult<T>; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.DictionaryIterator = void 0; | ||
var tslib_1 = require("tslib"); | ||
@@ -9,3 +10,3 @@ var Iterator_1 = require("./Iterator"); | ||
var _this = _super.call(this, Object.keys(dictionary)) || this; | ||
_this.dictionary = dictionary; | ||
_this._dictionary = dictionary; | ||
return _this; | ||
@@ -17,3 +18,3 @@ } | ||
key: key, | ||
value: this.dictionary[key] | ||
value: this._dictionary[key] | ||
}; | ||
@@ -25,3 +26,3 @@ }; | ||
key: key, | ||
value: this.dictionary[key] | ||
value: this._dictionary[key] | ||
}; | ||
@@ -28,0 +29,0 @@ }; |
"use strict"; | ||
exports.__esModule = true; | ||
exports.Iterator = void 0; | ||
var Iterator = (function () { | ||
@@ -11,3 +12,3 @@ function Iterator(collection, index) { | ||
Iterator.prototype.hasNext = function () { | ||
return !!this._collection[this._getIndex()]; | ||
return Object.prototype.hasOwnProperty.call(this._collection, this._getIndex()); | ||
}; | ||
@@ -20,3 +21,3 @@ Iterator.prototype.next = function () { | ||
Iterator.prototype.hasPrevious = function () { | ||
return !!this._collection[this.peekPreviousIndex()]; | ||
return Object.prototype.hasOwnProperty.call(this._collection, this.peekPreviousIndex()); | ||
}; | ||
@@ -23,0 +24,0 @@ Iterator.prototype.previous = function () { |
{ | ||
"name": "@breautek/iterator", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"description": "Iterator implementation", | ||
@@ -18,5 +18,4 @@ "main": "lib/api.js", | ||
"lint": "eslint --ext .ts './src/**/*.ts' && eslint --ext .ts './spec/**/*.ts'", | ||
"unit": "jasmine-ts", | ||
"test": "npm run-script lint && nyc --reporter=lcov --reporter=text jasmine-ts", | ||
"coverage": "codecov", | ||
"unit": "ts-node ./spec/support/jasmine.ts", | ||
"test": "npm run-script lint && nyc --reporter=lcov --reporter=text node --max_old_space_size=6144 -r ts-node/register ./spec/support/jasmine.ts", | ||
"clean": "rm -r ./lib && rm -r ./docs", | ||
@@ -40,22 +39,20 @@ "prepublishOnly": "npm run-script build" | ||
"dependencies": { | ||
"@types/node": "^12.7.3", | ||
"source-map-support": "^0.5.13", | ||
"tslib": "^1.10.0" | ||
"@types/node": "^12.12.67", | ||
"source-map-support": "^0.5.19", | ||
"tslib": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"@breautek/eslint-plugin": "^2.0.0", | ||
"@breautek/jasmine-ts": "^1.0.0", | ||
"@types/jasmine": "^3.4.0", | ||
"@typescript-eslint/eslint-plugin": "^2.1.0", | ||
"@typescript-eslint/parser": "^2.1.0", | ||
"codecov": "^3.5.0", | ||
"eslint": "^6.3.0", | ||
"jasmine": "^3.4.0", | ||
"jasmine-spec-reporter": "^4.2.1", | ||
"jasmine-ts-console-reporter": "^3.1.1", | ||
"nyc": "^14.1.1", | ||
"ts-node": "^8.3.0", | ||
"tsutils": "^3.17.1", | ||
"typescript": "^3.6.2" | ||
"@breautek/eslint-plugin": "^4.0.0", | ||
"@types/jasmine": "^3.5.14", | ||
"@typescript-eslint/eslint-plugin": "^4.4.1", | ||
"@typescript-eslint/parser": "^4.4.1", | ||
"eslint": "^7.11.0", | ||
"jasmine": "^3.6.1", | ||
"jasmine-spec-reporter": "^6.0.0", | ||
"jasmine-ts-console-reporter": "3.1.1", | ||
"nyc": "^15.1.0", | ||
"ts-node": "^9.0.0", | ||
"tsutils": "3.17.1", | ||
"typescript": "^4.0.3" | ||
} | ||
} |
@@ -5,6 +5,6 @@ | ||
describe('Iterator', () => { | ||
var iterator: Iterator<number>; | ||
let iterator: Iterator<number>; | ||
beforeEach(() => { | ||
const data: Array<number> = [ | ||
let data: Array<number> = [ | ||
1, | ||
@@ -20,3 +20,3 @@ 2, | ||
it('Iterator', () => { | ||
var iter: Iterator<number> = new Iterator<number>([ | ||
let iter: Iterator<number> = new Iterator<number>([ | ||
1, | ||
@@ -23,0 +23,0 @@ 2, |
@@ -13,14 +13,14 @@ import {Iterator} from './Iterator'; | ||
export class DictionaryIterator<T> extends Iterator<any> { | ||
private dictionary: IDictionary; | ||
private _dictionary: IDictionary; | ||
public constructor(dictionary: IDictionary) { | ||
super(Object.keys(dictionary)); | ||
this.dictionary = dictionary; | ||
this._dictionary = dictionary; | ||
} | ||
public next(): IDictionaryIteratorResult<T> { | ||
var key: string = super.next(); | ||
let key: string = super.next(); | ||
return { | ||
key : key, | ||
value : this.dictionary[key] | ||
value : this._dictionary[key] | ||
}; | ||
@@ -30,8 +30,8 @@ } | ||
public previous(): IDictionaryIteratorResult<T> { | ||
var key: string = super.previous(); | ||
let key: string = super.previous(); | ||
return { | ||
key : key, | ||
value : this.dictionary[key] | ||
value : this._dictionary[key] | ||
}; | ||
} | ||
} |
@@ -12,3 +12,3 @@ | ||
public hasNext(): boolean { | ||
return !!this._collection[this._getIndex()]; | ||
return Object.prototype.hasOwnProperty.call(this._collection, this._getIndex()); | ||
} | ||
@@ -23,3 +23,3 @@ | ||
public hasPrevious(): boolean { | ||
return !!this._collection[this.peekPreviousIndex()]; | ||
return Object.prototype.hasOwnProperty.call(this._collection, this.peekPreviousIndex()); | ||
} | ||
@@ -26,0 +26,0 @@ |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
100851
12
40
978
+ Addedtslib@2.8.1(transitive)
- Removedtslib@1.14.1(transitive)
Updated@types/node@^12.12.67
Updatedsource-map-support@^0.5.19
Updatedtslib@^2.0.3