Skip to content

Commit

Permalink
[*] some linting (ionic2 compatibility issues)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gugic committed Feb 25, 2017
1 parent 5b327ff commit f1962c1
Show file tree
Hide file tree
Showing 13 changed files with 82 additions and 70 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ You can find full list of interfaces [here](ts/Interfaces.ts)

## Changelog

## 2.0.0-beta.16
* some linting (ionic2 compatibility issues)

## 2.0.0-beta.15
* minor fixes, minor readme updates
* exported constants
Expand Down
4 changes: 2 additions & 2 deletions demo/typescript-project/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "api-ai-javascript-typescript-demo-project",
"version": "2.0.0-beta.15",
"version": "2.0.0-beta.16",
"description": "Javascript SDK for https://api.ai/ typescript demo project",
"devDependencies": {
"@types/es6-promise": "0.0.32",
"api-ai-javascript": "^2.0.0-beta.15",
"api-ai-javascript": "^2.0.0-beta.16",
"awesome-typescript-loader": "^3.0.0-beta.18",
"typescript": "^2.1.5",
"webpack": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion es6/ApiAiConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export var ApiAiConstants;
AVAILABLE_LANGUAGES[AVAILABLE_LANGUAGES["RU"] = "ru"] = "RU";
AVAILABLE_LANGUAGES[AVAILABLE_LANGUAGES["UK"] = "uk"] = "UK";
})(AVAILABLE_LANGUAGES = ApiAiConstants.AVAILABLE_LANGUAGES || (ApiAiConstants.AVAILABLE_LANGUAGES = {}));
ApiAiConstants.VERSION = "2.0.0-beta.15";
ApiAiConstants.VERSION = "2.0.0-beta.16";
ApiAiConstants.DEFAULT_BASE_URL = "https://api.api.ai/v1/";
ApiAiConstants.DEFAULT_API_VERSION = "20150910";
ApiAiConstants.DEFAULT_CLIENT_LANG = AVAILABLE_LANGUAGES.EN;
Expand Down
37 changes: 21 additions & 16 deletions es6/Stream/RecorderWorker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// import Resampler from "./Resampler";
// import Resampler from "./Resampler";
export default class RecorderWorker {
static createRecorderWorker() {
return function _recorderWorkerJs() {
Expand Down Expand Up @@ -68,38 +70,41 @@ export default class RecorderWorker {
view.setUint8(offset + i, string.charCodeAt(i));
}
}
function encodeWAV(samples) {
/* function encodeWAV(samples) {
var buffer = new ArrayBuffer(44 + samples.length * 2);
var view = new DataView(buffer);
/* RIFF identifier */
// RIFF identifier
_writeString(view, 0, 'RIFF');
/* file length */
// file length
view.setUint32(4, 32 + samples.length * 2, true);
/* RIFF type */
// RIFF type
_writeString(view, 8, 'WAVE');
/* format chunk identifier */
// format chunk identifier
_writeString(view, 12, 'fmt ');
/* format chunk length */
// format chunk length
view.setUint32(16, 16, true);
/* sample format (raw) */
// sample format (raw)
view.setUint16(20, 1, true);
/* channel count */
// channel count
view.setUint16(22, 2, true);
/* sample rate */
// sample rate
view.setUint32(24, sampleRate, true);
/* byte rate (sample rate * block align) */
// byte rate (sample rate * block align)
view.setUint32(28, sampleRate * 4, true);
/* block align (channel count * bytes per sample) */
// block align (channel count * bytes per sample)
view.setUint16(32, 4, true);
/* bits per sample */
// bits per sample
view.setUint16(34, 16, true);
/* data chunk identifier */
_writeString(view, 36, 'data');
/* data chunk length */
// data chunk identifier
_writeString(view, 36, "data");
// data chunk length
view.setUint32(40, samples.length * 2, true);
_floatTo16BitPCM(view, 44, samples);
return view;
}
} */
function encodeRAW(samples) {
var buffer = new ArrayBuffer(samples.length * 2);
var view = new DataView(buffer);
Expand Down
6 changes: 3 additions & 3 deletions es6/XhrRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class XhrRequest {
}
XhrRequest.XMLHttpFactories = [
() => new XMLHttpRequest(),
() => new ActiveXObject("Msxml2.XMLHTTP"),
() => new ActiveXObject("Msxml3.XMLHTTP"),
() => new ActiveXObject("Microsoft.XMLHTTP")
() => new window["ActiveXObject"]("Msxml2.XMLHTTP"),
() => new window["ActiveXObject"]("Msxml3.XMLHTTP"),
() => new window["ActiveXObject"]("Microsoft.XMLHTTP")
];
(function (XhrRequest) {
var Method;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "api-ai-javascript",
"version": "2.0.0-beta.15",
"version": "2.0.0-beta.16",
"description": "Javascript SDK for https://api.ai/",
"main": "index",
"dependencies": {
Expand Down
44 changes: 24 additions & 20 deletions target/ApiAi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion target/ApiAi.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions target/ApiAi.streamless.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f1962c1

Please sign in to comment.