@cycle/time
Advanced tools
Comparing version 0.20.0 to 0.21.0
@@ -0,1 +1,12 @@ | ||
## 0.21.0 (2021-03-15) | ||
* feat(time): correct parsing and printing of Time.diagram() strings ([7adec09](https://github.com/cyclejs/cyclejs/commit/7adec09)), closes [#962](https://github.com/cyclejs/cyclejs/issues/962) [#963](https://github.com/cyclejs/cyclejs/issues/963) | ||
### BREAKING CHANGE | ||
* The scheduling of events is now more correct, but people depending on the current behavior will be | ||
impacted | ||
## 0.20.0 (2019-09-10) | ||
@@ -2,0 +13,0 @@ |
@@ -153,3 +153,3 @@ "use strict"; | ||
if (entry.type === 'next') { | ||
return stringifyIfObject(entry.value); | ||
return stringify(entry.value); | ||
} | ||
@@ -179,6 +179,3 @@ if (entry.type === 'complete') { | ||
else { | ||
var characters = ['('].concat(chunk.map(characterString), [')']); | ||
characters.forEach(function (character, subIndex) { | ||
diagram[characterIndex + subIndex] = character; | ||
}); | ||
diagram[characterIndex] = ['('].concat(chunk.map(characterString), [')']).join(''); | ||
} | ||
@@ -192,7 +189,7 @@ }); | ||
} | ||
function stringifyIfObject(value) { | ||
function stringify(value) { | ||
if (typeof value === 'object') { | ||
return JSON.stringify(value); | ||
} | ||
return value; | ||
return String(value); | ||
} | ||
@@ -199,0 +196,0 @@ function displayUnexpectedErrors(errors) { |
@@ -24,7 +24,11 @@ "use strict"; | ||
var multipleValueFrame = false; | ||
characters.forEach(function (character, index) { | ||
var index = -1; | ||
characters.forEach(function (character) { | ||
if (!multipleValueFrame) { | ||
index++; | ||
} | ||
if (character === '-') { | ||
return; | ||
} | ||
var timeToSchedule = index * interval; | ||
var timeToSchedule = currentTime() + index * interval; | ||
if (character === '(') { | ||
@@ -31,0 +35,0 @@ multipleValueFrame = timeToSchedule; |
@@ -150,3 +150,3 @@ import xs from 'xstream'; | ||
if (entry.type === 'next') { | ||
return stringifyIfObject(entry.value); | ||
return stringify(entry.value); | ||
} | ||
@@ -176,6 +176,3 @@ if (entry.type === 'complete') { | ||
else { | ||
var characters = ['('].concat(chunk.map(characterString), [')']); | ||
characters.forEach(function (character, subIndex) { | ||
diagram[characterIndex + subIndex] = character; | ||
}); | ||
diagram[characterIndex] = ['('].concat(chunk.map(characterString), [')']).join(''); | ||
} | ||
@@ -189,7 +186,7 @@ }); | ||
} | ||
function stringifyIfObject(value) { | ||
function stringify(value) { | ||
if (typeof value === 'object') { | ||
return JSON.stringify(value); | ||
} | ||
return value; | ||
return String(value); | ||
} | ||
@@ -196,0 +193,0 @@ function displayUnexpectedErrors(errors) { |
@@ -22,7 +22,11 @@ import { adapt } from '@cycle/run/lib/adapt'; | ||
var multipleValueFrame = false; | ||
characters.forEach(function (character, index) { | ||
var index = -1; | ||
characters.forEach(function (character) { | ||
if (!multipleValueFrame) { | ||
index++; | ||
} | ||
if (character === '-') { | ||
return; | ||
} | ||
var timeToSchedule = index * interval; | ||
var timeToSchedule = currentTime() + index * interval; | ||
if (character === '(') { | ||
@@ -29,0 +33,0 @@ multipleValueFrame = timeToSchedule; |
144
package.json
{ | ||
"name": "@cycle/time", | ||
"version": "0.20.0", | ||
"description": "A time driver designed to enable awesome testing and dev tooling", | ||
"license": "MIT", | ||
"homepage": "https://cycle.js.org", | ||
"bugs": "https://github.com/cyclejs/cyclejs/issues", | ||
"repository": "https://github.com/cyclejs/cyclejs/tree/master/time", | ||
"author": "Nick Johnstone", | ||
"main": "lib/cjs/index.js", | ||
"module": "lib/es6/index.js", | ||
"typings": "lib/cjs/index.d.ts", | ||
"types": "lib/cjs/index.d.ts", | ||
"dependencies": { | ||
"@cycle/run": "^5.2.0", | ||
"combine-errors": "3.0.x", | ||
"most": "*", | ||
"performance-now": "^2.1.0", | ||
"raf": "3.4.x", | ||
"rxjs": "*", | ||
"setimmediate": "1.0.x", | ||
"sorted-immutable-list": "1.1.x", | ||
"variable-diff": "1.1.x", | ||
"xstream": "*" | ||
}, | ||
"devDependencies": { | ||
"@cycle/dom": "^22.2.0", | ||
"@cycle/rxjs-run": "^10.2.0", | ||
"@types/mocha": "5.2.x", | ||
"@types/node": "10.12.x", | ||
"budo": "^11.5.0", | ||
"garnish": "5.2.x", | ||
"markdown-doctest": "0.9.x", | ||
"mocha": "~6.2.0", | ||
"most": "1.7.x", | ||
"rxjs": "6.3.x", | ||
"snabbdom-selector": "4.1.x", | ||
"ts-node": "^7.0.1", | ||
"tslint": "^5.11.0", | ||
"typescript": "=3.2.4" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"lib/", | ||
"dist/", | ||
"most.js", | ||
"rxjs.js", | ||
"most.d.ts", | ||
"rxjs.d.ts" | ||
], | ||
"react-native": { | ||
"variable-diff": false | ||
}, | ||
"scripts": { | ||
"build": "pnpm run build-cjs && pnpm run build-es6", | ||
"build-cjs": "tsc --module commonjs --outDir ./lib/cjs", | ||
"build-es6": "tsc --module es6 --outDir ./lib/es6", | ||
"docs": ":", | ||
"lint": "tslint --project tsconfig.lint.json --config ../tslint.json", | ||
"changelog": "cd .. && node .scripts/update-changelogs.js time", | ||
"start": "budo -d example example/index.ts:index.js --live -- -p tsify", | ||
"test-watch": "mocha 'test/**/*.ts' --require ts-node/register --watch -R min", | ||
"test-node": "mocha 'test/**/*.ts' --require ts-node/register --exit", | ||
"test": "pnpm run test-node && pnpm run test-docs", | ||
"test-ci": "../.scripts/retry.sh pnpm test", | ||
"test-docs": "markdown-doctest", | ||
"postbuild": "tsc rxjs.ts most.ts --declaration --lib DOM,ES5,ES6 && rm src/*.d.ts && rm src/*.js", | ||
"prepublishOnly": "pnpm run build && pnpm test" | ||
} | ||
"name": "@cycle/time", | ||
"version": "0.21.0", | ||
"description": "A time driver designed to enable awesome testing and dev tooling", | ||
"license": "MIT", | ||
"homepage": "https://cycle.js.org", | ||
"bugs": "https://github.com/cyclejs/cyclejs/issues", | ||
"repository": "https://github.com/cyclejs/cyclejs/tree/master/time", | ||
"author": "Nick Johnstone", | ||
"main": "lib/cjs/index.js", | ||
"module": "lib/es6/index.js", | ||
"typings": "lib/cjs/index.d.ts", | ||
"types": "lib/cjs/index.d.ts", | ||
"dependencies": { | ||
"@cycle/run": "^5.2.0", | ||
"combine-errors": "3.0.x", | ||
"most": "*", | ||
"performance-now": "^2.1.0", | ||
"raf": "3.4.x", | ||
"rxjs": "*", | ||
"setimmediate": "1.0.x", | ||
"sorted-immutable-list": "1.1.x", | ||
"variable-diff": "1.1.x", | ||
"xstream": "*" | ||
}, | ||
"devDependencies": { | ||
"@cycle/dom": "^22.2.0", | ||
"@cycle/rxjs-run": "^10.2.0", | ||
"@types/mocha": "5.2.x", | ||
"@types/node": "10.12.x", | ||
"budo": "^11.5.0", | ||
"garnish": "5.2.x", | ||
"markdown-doctest": "0.9.x", | ||
"mocha": "~6.2.0", | ||
"most": "1.7.x", | ||
"rxjs": "6.3.x", | ||
"snabbdom-selector": "4.1.x", | ||
"ts-node": "^7.0.1", | ||
"tslint": "^5.11.0", | ||
"typescript": "=3.2.4" | ||
}, | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/cyclejs" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"files": [ | ||
"lib/", | ||
"dist/", | ||
"most.js", | ||
"rxjs.js", | ||
"most.d.ts", | ||
"rxjs.d.ts" | ||
], | ||
"react-native": { | ||
"variable-diff": false | ||
}, | ||
"scripts": { | ||
"build": "pnpm run build-cjs && pnpm run build-es6", | ||
"build-cjs": "tsc --module commonjs --outDir ./lib/cjs", | ||
"build-es6": "tsc --module es6 --outDir ./lib/es6", | ||
"docs": ":", | ||
"lint": "tslint --project tsconfig.lint.json --config ../tslint.json", | ||
"changelog": "cd .. && node .scripts/update-changelogs.js time", | ||
"start": "budo -d example example/index.ts:index.js --live -- -p tsify", | ||
"test-watch": "mocha 'test/**/*.ts' --require ts-node/register --watch -R min", | ||
"test-node": "mocha 'test/**/*.ts' --require ts-node/register --exit", | ||
"test": "pnpm run test-node && pnpm run test-docs", | ||
"test-ci": "../.scripts/retry.sh pnpm test", | ||
"test-docs": "markdown-doctest", | ||
"postbuild": "tsc rxjs.ts most.ts --declaration --lib DOM,ES5,ES6 && rm src/*.d.ts && rm src/*.js", | ||
"prepublishOnly": "pnpm run build && pnpm test" | ||
} | ||
} |
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
158658
2030