diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 6700e253..00000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,9 +0,0 @@ -languages: - JavaScript: true -exclude_paths: -- "build/**" -- "demo/**" -- "dict/**" -- "example/**" -- "test/**" -- "gulpfile.js" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..7b493f2a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: Test + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version-file: ".node-version" + cache: "npm" + + - shell: bash + run: npm ci + + - run: npm run lint + - run: npm run test diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 8f06fd78..00000000 --- a/.jshintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "quotmark": "double", - "shadow": "outer", - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": false, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "unused": "vars", - "boss": true, - "eqnull": true, - "trailing": true, - "browser": true, - "node": true -} \ No newline at end of file diff --git a/.node-version b/.node-version index 7f6758ef..fdb2eaaf 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -8.10.0 +22.11.0 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 577bb08f..00000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: node_js -node_js: - - 4.4.7 - -before_install: - - npm install -g gulp - -script: - - gulp test - -after_script: - - gulp coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js - - bash <(curl -s https://codecov.io/bash) diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 615f9dd1..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,94 +0,0 @@ - -## [0.1.2](https://github.com/takuyaa/kuromoji.js/compare/0.1.1...0.1.2) (2018-03-20) - -### Bug Fixes - -* tokenization of `研/究` ([#16](https://github.com/takuyaa/kuromoji.js/pull/16)) and `協/会` ([#23](https://github.com/takuyaa/kuromoji.js/pull/23)) is not valid - -### Bump deps - -* update dependencies and devDependencies in package.json - - - - -## [0.1.1](https://github.com/takuyaa/kuromoji.js/compare/0.1.0...0.1.1) (2016-08-07) - -### Breaking Changes - -* dictionary directory path is changed from `dist/dict/` to `dict/`, and browserified file `kuromoji.js` is moved from `dist/browser/kuromoji.js` to `build/kuromoji.js` ([#13](https://github.com/takuyaa/kuromoji.js/pull/13)) - -### Bug Fixes - -* browserified `kuromoji.js` does not work in browser ([#13](https://github.com/takuyaa/kuromoji.js/pull/13)) - - - - -## [0.1.0](https://github.com/takuyaa/kuromoji.js/compare/0.0.5...0.1.0) (2016-08-06) - -### Breaking Changes - -* change binary format of `cc.dat.gz` (connection costs dictionary) ([761eaf2](https://github.com/takuyaa/kuromoji.js/commit/761eaf299ff5db4887974cbbdc74eaf42fe39cc7), [c64cc22](https://github.com/takuyaa/kuromoji.js/commit/c64cc22c6100edaf95665f9b208837893608a287)) - -### Bug Fixes - -* word_position returns the real position in the text ([#10](https://github.com/takuyaa/kuromoji.js/pull/10)) - -### Performance Improvements - -* read seed dictionary line-by-line to reduce memory consumption when building dictionary - -### Bump deps - -* update dependencies in package.json - -### Miscellaneous - -* separate mecab-ipadic seed dictionary to different repo as a npm package [mecab-ipadic-seed](https://www.npmjs.com/package/mecab-ipadic-seed) ([#12](https://github.com/takuyaa/kuromoji.js/pull/12)) -* remove jsdoc directory from git repo ([817c23e](https://github.com/takuyaa/kuromoji.js/commit/817c23e6f57160c48655356762a5e6c059d54633)) -* define `deploy` gulp task to publish [jsdoc](https://takuyaa.github.io/kuromoji.js/jsdoc/) and [demo](http://takuyaa.github.io/kuromoji.js/demo/tokenize.html) as GitHub Pages ([2d638aa](https://github.com/takuyaa/kuromoji.js/commit/2d638aa57d4ec150c0f03656e05fb327e40d0ef9)) - - - - -## [0.0.5](https://github.com/takuyaa/kuromoji.js/compare/0.0.4...0.0.5) (2015-11-19) - -### Bug Fixes - -* add error handling when DictionaryLoader try to load non-exist dictionaries ([#7](https://github.com/takuyaa/kuromoji.js/pull/7)) -* work with Atom editor ([#8](https://github.com/takuyaa/kuromoji.js/pull/8)) - - - - -## [0.0.4](https://github.com/takuyaa/kuromoji.js/compare/0.0.3...0.0.4) (2015-09-07) - -### Bump deps - -* update dependencies in package.json ([#5](https://github.com/takuyaa/kuromoji.js/pull/5)) - -### Performance Improvements - -* use built-in zlib module instead of zlib.js on node.js ([#6](https://github.com/takuyaa/kuromoji.js/pull/6)) - - - - -## [0.0.3](https://github.com/takuyaa/kuromoji.js/compare/0.0.2...0.0.3) (2015-09-06) - - -### Miscellaneous - -* introduce Travis CI, Coveralls.io and Code Climate -* update README.md - - - - -## [0.0.2](https://github.com/takuyaa/kuromoji.js/compare/0.0.1...0.0.2) (2014-12-04) - - -### Miscellaneous - -* version to 0.0.2 because of failure to npm publish ([1cdad3c](https://github.com/takuyaa/kuromoji.js/commit/1cdad3cfc9ec7add7bbe83ed2c8019991bc9d39b)) diff --git a/README.md b/README.md index af529146..1bfb04ee 100644 --- a/README.md +++ b/README.md @@ -1,104 +1,53 @@ -kuromoji.js -=========== +# VOICEVOX kuromoji.js -[![Build Status](https://travis-ci.org/takuyaa/kuromoji.js.svg?branch=master)](https://travis-ci.org/takuyaa/kuromoji.js) -[![Coverage Status](https://coveralls.io/repos/github/takuyaa/kuromoji.js/badge.svg?branch=master)](https://coveralls.io/github/takuyaa/kuromoji.js?branch=master) -[![npm version](https://badge.fury.io/js/kuromoji.svg)](https://badge.fury.io/js/kuromoji) -[![dependencies](https://david-dm.org/takuyaa/kuromoji.js.svg)](https://david-dm.org/takuyaa/kuromoji.js) -[![Code Climate](https://codeclimate.com/github/takuyaa/kuromoji.js/badges/gpa.svg)](https://codeclimate.com/github/takuyaa/kuromoji.js) -[![Downloads](https://img.shields.io/npm/dm/kuromoji.svg)](https://www.npmjs.com/package/kuromoji) +[VOICEVOXエディタ](https://github.com/VOICEVOX/voicevox)のモック用にチューニングした[kuromoji.js](https://github.com/takuyaa/kuromoji.js)です。 +ESModuleとして利用できます。 -JavaScript implementation of Japanese morphological analyzer. -This is a pure JavaScript porting of [Kuromoji](https://www.atilika.com/ja/kuromoji/). +機能追加はしない予定で、VOICEVOXエディタ内で不都合が生じない限り積極的にメンテナンスもしない予定です。 +標準的なライブラリやフレームワークを用いた開発環境の改善は歓迎します。 -You can see how kuromoji.js works in [demo site](https://takuyaa.github.io/kuromoji.js/demo/tokenize.html). +## 使い方 +```sh +npm install github:VOICEVOX/kuromoji.js +``` -Directory ---------- +```ts +import { builder, IpadicFeatures, Tokenizer } from "kuromoji"; -Directory tree is as follows: +let _tokenizer: Tokenizer; - build/ - kuromoji.js -- JavaScript file for browser (Browserified) - demo/ -- Demo - dict/ -- Dictionaries for tokenizer (gzipped) - example/ -- Examples to use in Node.js - src/ -- JavaScript source - test/ -- Unit test +// ブラウザで使う場合 +builder({ + nodeOrBrowser: "browser", + dicPath: "https://url/to/dict", +}).build((err: Error, tokenizer: Tokenizer) => { + _tokenizer = tokenizer; +}); +// Node.jsで使う場合 +builder({ + nodeOrBrowser: "node", + dicPath: "node_modules/kuromoji/dict", +}).build((err: Error, tokenizer: Tokenizer) => { + _tokenizer = tokenizer; +}); +``` -Usage ------ +## 開発環境 -You can tokenize sentences with only 5 lines of code. -If you need working examples, you can see the files under the demo or example directory. +```sh +npm i +``` +## テスト -### Node.js +```sh +npm run test +``` -Install with npm package manager: +## フォーマット - npm install kuromoji - -Load this library as follows: - - var kuromoji = require("kuromoji"); - -You can prepare tokenizer like this: - - kuromoji.builder({ dicPath: "path/to/dictionary/dir/" }).build(function (err, tokenizer) { - // tokenizer is ready - var path = tokenizer.tokenize("すもももももももものうち"); - console.log(path); - }); - - - -### Browser - -You only need the build/kuromoji.js and dict/*.dat.gz files - -Install with Bower package manager: - - bower install kuromoji - -Or you can use the kuromoji.js file and dictionary files from the GitHub repository. - -In your HTML: - - - -In your JavaScript: - - kuromoji.builder({ dicPath: "/url/to/dictionary/dir/" }).build(function (err, tokenizer) { - // tokenizer is ready - var path = tokenizer.tokenize("すもももももももものうち"); - console.log(path); - }); - - -API ---- - -The function tokenize() returns an JSON array like this: - - [ { - word_id: 509800, // 辞書内での単語ID - word_type: 'KNOWN', // 単語タイプ(辞書に登録されている単語ならKNOWN, 未知語ならUNKNOWN) - word_position: 1, // 単語の開始位置 - surface_form: '黒文字', // 表層形 - pos: '名詞', // 品詞 - pos_detail_1: '一般', // 品詞細分類1 - pos_detail_2: '*', // 品詞細分類2 - pos_detail_3: '*', // 品詞細分類3 - conjugated_type: '*', // 活用型 - conjugated_form: '*', // 活用形 - basic_form: '黒文字', // 基本形 - reading: 'クロモジ', // 読み - pronunciation: 'クロモジ' // 発音 - } ] - -(This is defined in src/util/IpadicFormatter.js) - -See also [JSDoc page](https://takuyaa.github.io/kuromoji.js/jsdoc/) in details. +```sh +npm run fmt +``` diff --git a/bower.json b/bower.json deleted file mode 100644 index 7a9b4294..00000000 --- a/bower.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "kuromoji", - "version": "0.1.2", - "authors": [ - "Takuya Asano " - ], - "description": "JavaScript implementation of Japanese morphological analyzer", - "main": [ - "build/kuromoji.js", - "dict/base.dat.gz", - "dict/cc.dat.gz", - "dict/check.dat.gz", - "dict/tid.dat.gz", - "dict/tid_map.dat.gz", - "dict/tid_pos.dat.gz", - "dict/unk.dat.gz", - "dict/unk_char.dat.gz", - "dict/unk_compat.dat.gz", - "dict/unk_invoke.dat.gz", - "dict/unk_map.dat.gz", - "dict/unk_pos.dat.gz" - ], - "keywords": [ - "morphological analyzer", - "tokenizer", - "japanese", - "pos", - "pos tagger", - "nlp" - ], - "license": "Apache-2.0", - "homepage": "https://github.com/takuyaa/kuromoji.js", - "ignore": [ - "**/.*", - "bower_components", - "coverage", - "demo", - "example", - "jsdoc", - "node_modules", - "src", - "test", - "gulpfile.js", - "package-lock.json", - "package.json" - ] -} diff --git a/build/kuromoji.js b/build/kuromoji.js deleted file mode 100644 index f0f4ae91..00000000 --- a/build/kuromoji.js +++ /dev/null @@ -1,9059 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.kuromoji = f()}})(function(){var define,module,exports;return (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o var fn = async.apply(sys.puts, 'one'); - * node> fn('two', 'three'); - * one - * two - * three - */ -var apply = function(fn/*, ...args*/) { - var args = slice(arguments, 1); - return function(/*callArgs*/) { - var callArgs = slice(arguments); - return fn.apply(null, args.concat(callArgs)); - }; -}; - -var initialParams = function (fn) { - return function (/*...args, callback*/) { - var args = slice(arguments); - var callback = args.pop(); - fn.call(this, args, callback); - }; -}; - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); -} - -var hasSetImmediate = typeof setImmediate === 'function' && setImmediate; -var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function'; - -function fallback(fn) { - setTimeout(fn, 0); -} - -function wrap(defer) { - return function (fn/*, ...args*/) { - var args = slice(arguments, 1); - defer(function () { - fn.apply(null, args); - }); - }; -} - -var _defer; - -if (hasSetImmediate) { - _defer = setImmediate; -} else if (hasNextTick) { - _defer = process.nextTick; -} else { - _defer = fallback; -} - -var setImmediate$1 = wrap(_defer); - -/** - * Take a sync function and make it async, passing its return value to a - * callback. This is useful for plugging sync functions into a waterfall, - * series, or other async functions. Any arguments passed to the generated - * function will be passed to the wrapped function (except for the final - * callback argument). Errors thrown will be passed to the callback. - * - * If the function passed to `asyncify` returns a Promise, that promises's - * resolved/rejected state will be used to call the callback, rather than simply - * the synchronous return value. - * - * This also means you can asyncify ES2017 `async` functions. - * - * @name asyncify - * @static - * @memberOf module:Utils - * @method - * @alias wrapSync - * @category Util - * @param {Function} func - The synchronous function, or Promise-returning - * function to convert to an {@link AsyncFunction}. - * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be - * invoked with `(args..., callback)`. - * @example - * - * // passing a regular synchronous function - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(JSON.parse), - * function (data, next) { - * // data is the result of parsing the text. - * // If there was a parsing error, it would have been caught. - * } - * ], callback); - * - * // passing a function returning a promise - * async.waterfall([ - * async.apply(fs.readFile, filename, "utf8"), - * async.asyncify(function (contents) { - * return db.model.create(contents); - * }), - * function (model, next) { - * // `model` is the instantiated model object. - * // If there was an error, this function would be skipped. - * } - * ], callback); - * - * // es2017 example, though `asyncify` is not needed if your JS environment - * // supports async functions out of the box - * var q = async.queue(async.asyncify(async function(file) { - * var intermediateStep = await processFile(file); - * return await somePromise(intermediateStep) - * })); - * - * q.push(files); - */ -function asyncify(func) { - return initialParams(function (args, callback) { - var result; - try { - result = func.apply(this, args); - } catch (e) { - return callback(e); - } - // if result is Promise object - if (isObject(result) && typeof result.then === 'function') { - result.then(function(value) { - invokeCallback(callback, null, value); - }, function(err) { - invokeCallback(callback, err.message ? err : new Error(err)); - }); - } else { - callback(null, result); - } - }); -} - -function invokeCallback(callback, error, value) { - try { - callback(error, value); - } catch (e) { - setImmediate$1(rethrow, e); - } -} - -function rethrow(error) { - throw error; -} - -var supportsSymbol = typeof Symbol === 'function'; - -function isAsync(fn) { - return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction'; -} - -function wrapAsync(asyncFn) { - return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn; -} - -function applyEach$1(eachfn) { - return function(fns/*, ...args*/) { - var args = slice(arguments, 1); - var go = initialParams(function(args, callback) { - var that = this; - return eachfn(fns, function (fn, cb) { - wrapAsync(fn).apply(that, args.concat(cb)); - }, callback); - }); - if (args.length) { - return go.apply(this, args); - } - else { - return go; - } - }; -} - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); - -/** Built-in value references. */ -var Symbol$1 = root.Symbol; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; - -/** Built-in value references. */ -var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined; - -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - var isOwn = hasOwnProperty.call(value, symToStringTag$1), - tag = value[symToStringTag$1]; - - try { - value[symToStringTag$1] = undefined; - var unmasked = true; - } catch (e) {} - - var result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag$1] = tag; - } else { - delete value[symToStringTag$1]; - } - } - return result; -} - -/** Used for built-in method references. */ -var objectProto$1 = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString$1 = objectProto$1.toString; - -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString$1.call(value); -} - -/** `Object#toString` result references. */ -var nullTag = '[object Null]'; -var undefinedTag = '[object Undefined]'; - -/** Built-in value references. */ -var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined; - -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]'; -var funcTag = '[object Function]'; -var genTag = '[object GeneratorFunction]'; -var proxyTag = '[object Proxy]'; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; -} - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This method is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); -} - -// A temporary value used to identify if the loop should be broken. -// See #1064, #1293 -var breakLoop = {}; - -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} - -function once(fn) { - return function () { - if (fn === null) return; - var callFn = fn; - fn = null; - callFn.apply(this, arguments); - }; -} - -var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator; - -var getIterator = function (coll) { - return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol](); -}; - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; - -/** - * The base implementation of `_.isArguments`. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; -} - -/** Used for built-in method references. */ -var objectProto$3 = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty$2 = objectProto$3.hasOwnProperty; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto$3.propertyIsEnumerable; - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * This method returns `false`. - * - * @static - * @memberOf _ - * @since 4.13.0 - * @category Util - * @returns {boolean} Returns `false`. - * @example - * - * _.times(2, _.stubFalse); - * // => [false, false] - */ -function stubFalse() { - return false; -} - -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @since 4.3.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = nativeIsBuffer || stubFalse; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER$1 = 9007199254740991; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - length = length == null ? MAX_SAFE_INTEGER$1 : length; - return !!length && - (typeof value == 'number' || reIsUint.test(value)) && - (value > -1 && value % 1 == 0 && value < length); -} - -/** `Object#toString` result references. */ -var argsTag$1 = '[object Arguments]'; -var arrayTag = '[object Array]'; -var boolTag = '[object Boolean]'; -var dateTag = '[object Date]'; -var errorTag = '[object Error]'; -var funcTag$1 = '[object Function]'; -var mapTag = '[object Map]'; -var numberTag = '[object Number]'; -var objectTag = '[object Object]'; -var regexpTag = '[object RegExp]'; -var setTag = '[object Set]'; -var stringTag = '[object String]'; -var weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]'; -var dataViewTag = '[object DataView]'; -var float32Tag = '[object Float32Array]'; -var float64Tag = '[object Float64Array]'; -var int8Tag = '[object Int8Array]'; -var int16Tag = '[object Int16Array]'; -var int32Tag = '[object Int32Array]'; -var uint8Tag = '[object Uint8Array]'; -var uint8ClampedTag = '[object Uint8ClampedArray]'; -var uint16Tag = '[object Uint16Array]'; -var uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag$1] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; - -/** - * The base implementation of `_.isTypedArray` without Node.js optimizations. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - */ -function baseIsTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; -} - -/** - * The base implementation of `_.unary` without support for storing metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** Detect free variable `exports`. */ -var freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports; - -/** Detect free variable `module`. */ -var freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1; - -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports$1 && freeGlobal.process; - -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} -}()); - -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - -/** - * Checks if `value` is classified as a typed array. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. - * @example - * - * _.isTypedArray(new Uint8Array); - * // => true - * - * _.isTypedArray([]); - * // => false - */ -var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - -/** Used for built-in method references. */ -var objectProto$2 = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty$1 = objectProto$2.hasOwnProperty; - -/** - * Creates an array of the enumerable property names of the array-like `value`. - * - * @private - * @param {*} value The value to query. - * @param {boolean} inherited Specify returning inherited property names. - * @returns {Array} Returns the array of property names. - */ -function arrayLikeKeys(value, inherited) { - var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; - - for (var key in value) { - if ((inherited || hasOwnProperty$1.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { - result.push(key); - } - } - return result; -} - -/** Used for built-in method references. */ -var objectProto$5 = Object.prototype; - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5; - - return value === proto; -} - -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; -} - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = overArg(Object.keys, Object); - -/** Used for built-in method references. */ -var objectProto$4 = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty$3 = objectProto$4.hasOwnProperty; - -/** - * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result = []; - for (var key in Object(object)) { - if (hasOwnProperty$3.call(object, key) && key != 'constructor') { - result.push(key); - } - } - return result; -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} - -function createArrayIterator(coll) { - var i = -1; - var len = coll.length; - return function next() { - return ++i < len ? {value: coll[i], key: i} : null; - } -} - -function createES2015Iterator(iterator) { - var i = -1; - return function next() { - var item = iterator.next(); - if (item.done) - return null; - i++; - return {value: item.value, key: i}; - } -} - -function createObjectIterator(obj) { - var okeys = keys(obj); - var i = -1; - var len = okeys.length; - return function next() { - var key = okeys[++i]; - return i < len ? {value: obj[key], key: key} : null; - }; -} - -function iterator(coll) { - if (isArrayLike(coll)) { - return createArrayIterator(coll); - } - - var iterator = getIterator(coll); - return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); -} - -function onlyOnce(fn) { - return function() { - if (fn === null) throw new Error("Callback was already called."); - var callFn = fn; - fn = null; - callFn.apply(this, arguments); - }; -} - -function _eachOfLimit(limit) { - return function (obj, iteratee, callback) { - callback = once(callback || noop); - if (limit <= 0 || !obj) { - return callback(null); - } - var nextElem = iterator(obj); - var done = false; - var running = 0; - - function iterateeCallback(err, value) { - running -= 1; - if (err) { - done = true; - callback(err); - } - else if (value === breakLoop || (done && running <= 0)) { - done = true; - return callback(null); - } - else { - replenish(); - } - } - - function replenish () { - while (running < limit && !done) { - var elem = nextElem(); - if (elem === null) { - done = true; - if (running <= 0) { - callback(null); - } - return; - } - running += 1; - iteratee(elem.value, elem.key, onlyOnce(iterateeCallback)); - } - } - - replenish(); - }; -} - -/** - * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a - * time. - * - * @name eachOfLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.eachOf]{@link module:Collections.eachOf} - * @alias forEachOfLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. The `key` is the item's key, or index in the case of an - * array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -function eachOfLimit(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback); -} - -function doLimit(fn, limit) { - return function (iterable, iteratee, callback) { - return fn(iterable, limit, iteratee, callback); - }; -} - -// eachOf implementation optimized for array-likes -function eachOfArrayLike(coll, iteratee, callback) { - callback = once(callback || noop); - var index = 0, - completed = 0, - length = coll.length; - if (length === 0) { - callback(null); - } - - function iteratorCallback(err, value) { - if (err) { - callback(err); - } else if ((++completed === length) || value === breakLoop) { - callback(null); - } - } - - for (; index < length; index++) { - iteratee(coll[index], index, onlyOnce(iteratorCallback)); - } -} - -// a generic version of eachOf which can handle array, object, and iterator cases. -var eachOfGeneric = doLimit(eachOfLimit, Infinity); - -/** - * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument - * to the iteratee. - * - * @name eachOf - * @static - * @memberOf module:Collections - * @method - * @alias forEachOf - * @category Collection - * @see [async.each]{@link module:Collections.each} - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each - * item in `coll`. - * The `key` is the item's key, or index in the case of an array. - * Invoked with (item, key, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @example - * - * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; - * var configs = {}; - * - * async.forEachOf(obj, function (value, key, callback) { - * fs.readFile(__dirname + value, "utf8", function (err, data) { - * if (err) return callback(err); - * try { - * configs[key] = JSON.parse(data); - * } catch (e) { - * return callback(e); - * } - * callback(); - * }); - * }, function (err) { - * if (err) console.error(err.message); - * // configs is now a map of JSON data - * doSomethingWith(configs); - * }); - */ -var eachOf = function(coll, iteratee, callback) { - var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric; - eachOfImplementation(coll, wrapAsync(iteratee), callback); -}; - -function doParallel(fn) { - return function (obj, iteratee, callback) { - return fn(eachOf, obj, wrapAsync(iteratee), callback); - }; -} - -function _asyncMap(eachfn, arr, iteratee, callback) { - callback = callback || noop; - arr = arr || []; - var results = []; - var counter = 0; - var _iteratee = wrapAsync(iteratee); - - eachfn(arr, function (value, _, callback) { - var index = counter++; - _iteratee(value, function (err, v) { - results[index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); -} - -/** - * Produces a new collection of values by mapping each value in `coll` through - * the `iteratee` function. The `iteratee` is called with an item from `coll` - * and a callback for when it has finished processing. Each of these callback - * takes 2 arguments: an `error`, and the transformed item from `coll`. If - * `iteratee` passes an error to its callback, the main `callback` (for the - * `map` function) is immediately called with the error. - * - * Note, that since this function applies the `iteratee` to each item in - * parallel, there is no guarantee that the `iteratee` functions will complete - * in order. However, the results array will be in the same order as the - * original `coll`. - * - * If `map` is passed an Object, the results will be an Array. The results - * will roughly be in the order of the original Objects' keys (but this can - * vary across JavaScript engines). - * - * @name map - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an Array of the - * transformed items from the `coll`. Invoked with (err, results). - * @example - * - * async.map(['file1','file2','file3'], fs.stat, function(err, results) { - * // results is now an array of stats for each file - * }); - */ -var map = doParallel(_asyncMap); - -/** - * Applies the provided arguments to each function in the array, calling - * `callback` after all functions have completed. If you only provide the first - * argument, `fns`, then it will return a function which lets you pass in the - * arguments as if it were a single function call. If more arguments are - * provided, `callback` is required while `args` is still optional. - * - * @name applyEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s - * to all call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {Function} - If only the first argument, `fns`, is provided, it will - * return a function which lets you pass in the arguments as if it were a single - * function call. The signature is `(..args, callback)`. If invoked with any - * arguments, `callback` is required. - * @example - * - * async.applyEach([enableSearch, updateSchema], 'bucket', callback); - * - * // partial application example: - * async.each( - * buckets, - * async.applyEach([enableSearch, updateSchema]), - * callback - * ); - */ -var applyEach = applyEach$1(map); - -function doParallelLimit(fn) { - return function (obj, limit, iteratee, callback) { - return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback); - }; -} - -/** - * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time. - * - * @name mapLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - */ -var mapLimit = doParallelLimit(_asyncMap); - -/** - * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time. - * - * @name mapSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.map]{@link module:Collections.map} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with the transformed item. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Results is an array of the - * transformed items from the `coll`. Invoked with (err, results). - */ -var mapSeries = doLimit(mapLimit, 1); - -/** - * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time. - * - * @name applyEachSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.applyEach]{@link module:ControlFlow.applyEach} - * @category Control Flow - * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all - * call with the same arguments - * @param {...*} [args] - any number of separate arguments to pass to the - * function. - * @param {Function} [callback] - the final argument should be the callback, - * called when all functions have completed processing. - * @returns {Function} - If only the first argument is provided, it will return - * a function which lets you pass in the arguments as if it were a single - * function call. - */ -var applyEachSeries = applyEach$1(mapSeries); - -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * Creates a base function for methods like `_.forIn` and `_.forOwn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -/** - * The base implementation of `baseForOwn` which iterates over `object` - * properties returned by `keysFunc` and invokes `iteratee` for each property. - * Iteratee functions may exit iteration early by explicitly returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -/** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Function} predicate The function invoked per iteration. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - if (predicate(array[index], index, array)) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.isNaN` without support for number objects. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. - */ -function baseIsNaN(value) { - return value !== value; -} - -/** - * A specialized version of `_.indexOf` which performs strict equality - * comparisons of values, i.e. `===`. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to inspect. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); -} - -/** - * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on - * their requirements. Each function can optionally depend on other functions - * being completed first, and each function is run as soon as its requirements - * are satisfied. - * - * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence - * will stop. Further tasks will not execute (so any other functions depending - * on it will not run), and the main `callback` is immediately called with the - * error. - * - * {@link AsyncFunction}s also receive an object containing the results of functions which - * have completed so far as the first argument, if they have dependencies. If a - * task function has no dependencies, it will only be passed a callback. - * - * @name auto - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Object} tasks - An object. Each of its properties is either a - * function or an array of requirements, with the {@link AsyncFunction} itself the last item - * in the array. The object's key of a property serves as the name of the task - * defined by that property, i.e. can be used when specifying requirements for - * other tasks. The function receives one or two arguments: - * * a `results` object, containing the results of the previously executed - * functions, only passed if the task has any dependencies, - * * a `callback(err, result)` function, which must be called when finished, - * passing an `error` (which can be `null`) and the result of the function's - * execution. - * @param {number} [concurrency=Infinity] - An optional `integer` for - * determining the maximum number of tasks that can be run in parallel. By - * default, as many as possible. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback. Results are always returned; however, if an - * error occurs, no further `tasks` will be performed, and the results object - * will only contain partial results. Invoked with (err, results). - * @returns undefined - * @example - * - * async.auto({ - * // this function will just be passed a callback - * readData: async.apply(fs.readFile, 'data.txt', 'utf-8'), - * showData: ['readData', function(results, cb) { - * // results.readData is the file's contents - * // ... - * }] - * }, callback); - * - * async.auto({ - * get_data: function(callback) { - * console.log('in get_data'); - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * console.log('in make_folder'); - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: ['get_data', 'make_folder', function(results, callback) { - * console.log('in write_file', JSON.stringify(results)); - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(results, callback) { - * console.log('in email_link', JSON.stringify(results)); - * // once the file is written let's email a link to it... - * // results.write_file contains the filename returned by write_file. - * callback(null, {'file':results.write_file, 'email':'user@example.com'}); - * }] - * }, function(err, results) { - * console.log('err = ', err); - * console.log('results = ', results); - * }); - */ -var auto = function (tasks, concurrency, callback) { - if (typeof concurrency === 'function') { - // concurrency is optional, shift the args. - callback = concurrency; - concurrency = null; - } - callback = once(callback || noop); - var keys$$1 = keys(tasks); - var numTasks = keys$$1.length; - if (!numTasks) { - return callback(null); - } - if (!concurrency) { - concurrency = numTasks; - } - - var results = {}; - var runningTasks = 0; - var hasError = false; - - var listeners = Object.create(null); - - var readyTasks = []; - - // for cycle detection: - var readyToCheck = []; // tasks that have been identified as reachable - // without the possibility of returning to an ancestor task - var uncheckedDependencies = {}; - - baseForOwn(tasks, function (task, key) { - if (!isArray(task)) { - // no dependencies - enqueueTask(key, [task]); - readyToCheck.push(key); - return; - } - - var dependencies = task.slice(0, task.length - 1); - var remainingDependencies = dependencies.length; - if (remainingDependencies === 0) { - enqueueTask(key, task); - readyToCheck.push(key); - return; - } - uncheckedDependencies[key] = remainingDependencies; - - arrayEach(dependencies, function (dependencyName) { - if (!tasks[dependencyName]) { - throw new Error('async.auto task `' + key + - '` has a non-existent dependency `' + - dependencyName + '` in ' + - dependencies.join(', ')); - } - addListener(dependencyName, function () { - remainingDependencies--; - if (remainingDependencies === 0) { - enqueueTask(key, task); - } - }); - }); - }); - - checkForDeadlocks(); - processQueue(); - - function enqueueTask(key, task) { - readyTasks.push(function () { - runTask(key, task); - }); - } - - function processQueue() { - if (readyTasks.length === 0 && runningTasks === 0) { - return callback(null, results); - } - while(readyTasks.length && runningTasks < concurrency) { - var run = readyTasks.shift(); - run(); - } - - } - - function addListener(taskName, fn) { - var taskListeners = listeners[taskName]; - if (!taskListeners) { - taskListeners = listeners[taskName] = []; - } - - taskListeners.push(fn); - } - - function taskComplete(taskName) { - var taskListeners = listeners[taskName] || []; - arrayEach(taskListeners, function (fn) { - fn(); - }); - processQueue(); - } - - - function runTask(key, task) { - if (hasError) return; - - var taskCallback = onlyOnce(function(err, result) { - runningTasks--; - if (arguments.length > 2) { - result = slice(arguments, 1); - } - if (err) { - var safeResults = {}; - baseForOwn(results, function(val, rkey) { - safeResults[rkey] = val; - }); - safeResults[key] = result; - hasError = true; - listeners = Object.create(null); - - callback(err, safeResults); - } else { - results[key] = result; - taskComplete(key); - } - }); - - runningTasks++; - var taskFn = wrapAsync(task[task.length - 1]); - if (task.length > 1) { - taskFn(results, taskCallback); - } else { - taskFn(taskCallback); - } - } - - function checkForDeadlocks() { - // Kahn's algorithm - // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm - // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html - var currentTask; - var counter = 0; - while (readyToCheck.length) { - currentTask = readyToCheck.pop(); - counter++; - arrayEach(getDependents(currentTask), function (dependent) { - if (--uncheckedDependencies[dependent] === 0) { - readyToCheck.push(dependent); - } - }); - } - - if (counter !== numTasks) { - throw new Error( - 'async.auto cannot execute tasks due to a recursive dependency' - ); - } - } - - function getDependents(taskName) { - var result = []; - baseForOwn(tasks, function (task, key) { - if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) { - result.push(key); - } - }); - return result; - } -}; - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); -} - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol$1 ? Symbol$1.prototype : undefined; -var symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isArray(value)) { - // Recursively convert values (susceptible to call stack limits). - return arrayMap(value, baseToString) + ''; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the last unmatched string symbol. - */ -function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} - -/** - * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol - * that is not found in the character symbols. - * - * @private - * @param {Array} strSymbols The string symbols to inspect. - * @param {Array} chrSymbols The character symbols to find. - * @returns {number} Returns the index of the first unmatched string symbol. - */ -function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, - length = strSymbols.length; - - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; -} - -/** - * Converts an ASCII `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function asciiToArray(string) { - return string.split(''); -} - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff'; -var rsComboMarksRange = '\\u0300-\\u036f'; -var reComboHalfMarksRange = '\\ufe20-\\ufe2f'; -var rsComboSymbolsRange = '\\u20d0-\\u20ff'; -var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange; -var rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsZWJ = '\\u200d'; - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - -/** - * Checks if `string` contains Unicode symbols. - * - * @private - * @param {string} string The string to inspect. - * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ -function hasUnicode(string) { - return reHasUnicode.test(string); -} - -/** Used to compose unicode character classes. */ -var rsAstralRange$1 = '\\ud800-\\udfff'; -var rsComboMarksRange$1 = '\\u0300-\\u036f'; -var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f'; -var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff'; -var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1; -var rsVarRange$1 = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange$1 + ']'; -var rsCombo = '[' + rsComboRange$1 + ']'; -var rsFitz = '\\ud83c[\\udffb-\\udfff]'; -var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')'; -var rsNonAstral = '[^' + rsAstralRange$1 + ']'; -var rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}'; -var rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]'; -var rsZWJ$1 = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?'; -var rsOptVar = '[' + rsVarRange$1 + ']?'; -var rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*'; -var rsSeq = rsOptVar + reOptMod + rsOptJoin; -var rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** - * Converts a Unicode `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function unicodeToArray(string) { - return string.match(reUnicode) || []; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return hasUnicode(string) - ? unicodeToArray(string) - : asciiToArray(string); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** - * Removes leading and trailing whitespace or specified characters from `string`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to trim. - * @param {string} [chars=whitespace] The characters to trim. - * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. - * @returns {string} Returns the trimmed string. - * @example - * - * _.trim(' abc '); - * // => 'abc' - * - * _.trim('-_-abc-_-', '_-'); - * // => 'abc' - * - * _.map([' foo ', ' bar '], _.trim); - * // => ['foo', 'bar'] - */ -function trim(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined)) { - return string.replace(reTrim, ''); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars), - start = charsStartIndex(strSymbols, chrSymbols), - end = charsEndIndex(strSymbols, chrSymbols) + 1; - - return castSlice(strSymbols, start, end).join(''); -} - -var FN_ARGS = /^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m; -var FN_ARG_SPLIT = /,/; -var FN_ARG = /(=.+)?(\s*)$/; -var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; - -function parseParams(func) { - func = func.toString().replace(STRIP_COMMENTS, ''); - func = func.match(FN_ARGS)[2].replace(' ', ''); - func = func ? func.split(FN_ARG_SPLIT) : []; - func = func.map(function (arg){ - return trim(arg.replace(FN_ARG, '')); - }); - return func; -} - -/** - * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent - * tasks are specified as parameters to the function, after the usual callback - * parameter, with the parameter names matching the names of the tasks it - * depends on. This can provide even more readable task graphs which can be - * easier to maintain. - * - * If a final callback is specified, the task results are similarly injected, - * specified as named parameters after the initial error parameter. - * - * The autoInject function is purely syntactic sugar and its semantics are - * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}. - * - * @name autoInject - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.auto]{@link module:ControlFlow.auto} - * @category Control Flow - * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of - * the form 'func([dependencies...], callback). The object's key of a property - * serves as the name of the task defined by that property, i.e. can be used - * when specifying requirements for other tasks. - * * The `callback` parameter is a `callback(err, result)` which must be called - * when finished, passing an `error` (which can be `null`) and the result of - * the function's execution. The remaining parameters name other tasks on - * which the task is dependent, and the results from those tasks are the - * arguments of those parameters. - * @param {Function} [callback] - An optional callback which is called when all - * the tasks have been completed. It receives the `err` argument if any `tasks` - * pass an error to their callback, and a `results` object with any completed - * task results, similar to `auto`. - * @example - * - * // The example from `auto` can be rewritten as follows: - * async.autoInject({ - * get_data: function(callback) { - * // async code to get some data - * callback(null, 'data', 'converted to array'); - * }, - * make_folder: function(callback) { - * // async code to create a directory to store a file in - * // this is run at the same time as getting the data - * callback(null, 'folder'); - * }, - * write_file: function(get_data, make_folder, callback) { - * // once there is some data and the directory exists, - * // write the data to a file in the directory - * callback(null, 'filename'); - * }, - * email_link: function(write_file, callback) { - * // once the file is written let's email a link to it... - * // write_file contains the filename returned by write_file. - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * } - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - * - * // If you are using a JS minifier that mangles parameter names, `autoInject` - * // will not work with plain functions, since the parameter names will be - * // collapsed to a single letter identifier. To work around this, you can - * // explicitly specify the names of the parameters your task function needs - * // in an array, similar to Angular.js dependency injection. - * - * // This still has an advantage over plain `auto`, since the results a task - * // depends on are still spread into arguments. - * async.autoInject({ - * //... - * write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) { - * callback(null, 'filename'); - * }], - * email_link: ['write_file', function(write_file, callback) { - * callback(null, {'file':write_file, 'email':'user@example.com'}); - * }] - * //... - * }, function(err, results) { - * console.log('err = ', err); - * console.log('email_link = ', results.email_link); - * }); - */ -function autoInject(tasks, callback) { - var newTasks = {}; - - baseForOwn(tasks, function (taskFn, key) { - var params; - var fnIsAsync = isAsync(taskFn); - var hasNoDeps = - (!fnIsAsync && taskFn.length === 1) || - (fnIsAsync && taskFn.length === 0); - - if (isArray(taskFn)) { - params = taskFn.slice(0, -1); - taskFn = taskFn[taskFn.length - 1]; - - newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn); - } else if (hasNoDeps) { - // no dependencies, use the function as-is - newTasks[key] = taskFn; - } else { - params = parseParams(taskFn); - if (taskFn.length === 0 && !fnIsAsync && params.length === 0) { - throw new Error("autoInject task functions require explicit parameters."); - } - - // remove callback param - if (!fnIsAsync) params.pop(); - - newTasks[key] = params.concat(newTask); - } - - function newTask(results, taskCb) { - var newArgs = arrayMap(params, function (name) { - return results[name]; - }); - newArgs.push(taskCb); - wrapAsync(taskFn).apply(null, newArgs); - } - }); - - auto(newTasks, callback); -} - -// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation -// used for queues. This implementation assumes that the node provided by the user can be modified -// to adjust the next and last properties. We implement only the minimal functionality -// for queue support. -function DLL() { - this.head = this.tail = null; - this.length = 0; -} - -function setInitial(dll, node) { - dll.length = 1; - dll.head = dll.tail = node; -} - -DLL.prototype.removeLink = function(node) { - if (node.prev) node.prev.next = node.next; - else this.head = node.next; - if (node.next) node.next.prev = node.prev; - else this.tail = node.prev; - - node.prev = node.next = null; - this.length -= 1; - return node; -}; - -DLL.prototype.empty = function () { - while(this.head) this.shift(); - return this; -}; - -DLL.prototype.insertAfter = function(node, newNode) { - newNode.prev = node; - newNode.next = node.next; - if (node.next) node.next.prev = newNode; - else this.tail = newNode; - node.next = newNode; - this.length += 1; -}; - -DLL.prototype.insertBefore = function(node, newNode) { - newNode.prev = node.prev; - newNode.next = node; - if (node.prev) node.prev.next = newNode; - else this.head = newNode; - node.prev = newNode; - this.length += 1; -}; - -DLL.prototype.unshift = function(node) { - if (this.head) this.insertBefore(this.head, node); - else setInitial(this, node); -}; - -DLL.prototype.push = function(node) { - if (this.tail) this.insertAfter(this.tail, node); - else setInitial(this, node); -}; - -DLL.prototype.shift = function() { - return this.head && this.removeLink(this.head); -}; - -DLL.prototype.pop = function() { - return this.tail && this.removeLink(this.tail); -}; - -DLL.prototype.toArray = function () { - var arr = Array(this.length); - var curr = this.head; - for(var idx = 0; idx < this.length; idx++) { - arr[idx] = curr.data; - curr = curr.next; - } - return arr; -}; - -DLL.prototype.remove = function (testFn) { - var curr = this.head; - while(!!curr) { - var next = curr.next; - if (testFn(curr)) { - this.removeLink(curr); - } - curr = next; - } - return this; -}; - -function queue(worker, concurrency, payload) { - if (concurrency == null) { - concurrency = 1; - } - else if(concurrency === 0) { - throw new Error('Concurrency must not be zero'); - } - - var _worker = wrapAsync(worker); - var numRunning = 0; - var workersList = []; - - var processingScheduled = false; - function _insert(data, insertAtFront, callback) { - if (callback != null && typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - if (!isArray(data)) { - data = [data]; - } - if (data.length === 0 && q.idle()) { - // call drain immediately if there are no tasks - return setImmediate$1(function() { - q.drain(); - }); - } - - for (var i = 0, l = data.length; i < l; i++) { - var item = { - data: data[i], - callback: callback || noop - }; - - if (insertAtFront) { - q._tasks.unshift(item); - } else { - q._tasks.push(item); - } - } - - if (!processingScheduled) { - processingScheduled = true; - setImmediate$1(function() { - processingScheduled = false; - q.process(); - }); - } - } - - function _next(tasks) { - return function(err){ - numRunning -= 1; - - for (var i = 0, l = tasks.length; i < l; i++) { - var task = tasks[i]; - - var index = baseIndexOf(workersList, task, 0); - if (index === 0) { - workersList.shift(); - } else if (index > 0) { - workersList.splice(index, 1); - } - - task.callback.apply(task, arguments); - - if (err != null) { - q.error(err, task.data); - } - } - - if (numRunning <= (q.concurrency - q.buffer) ) { - q.unsaturated(); - } - - if (q.idle()) { - q.drain(); - } - q.process(); - }; - } - - var isProcessing = false; - var q = { - _tasks: new DLL(), - concurrency: concurrency, - payload: payload, - saturated: noop, - unsaturated:noop, - buffer: concurrency / 4, - empty: noop, - drain: noop, - error: noop, - started: false, - paused: false, - push: function (data, callback) { - _insert(data, false, callback); - }, - kill: function () { - q.drain = noop; - q._tasks.empty(); - }, - unshift: function (data, callback) { - _insert(data, true, callback); - }, - remove: function (testFn) { - q._tasks.remove(testFn); - }, - process: function () { - // Avoid trying to start too many processing operations. This can occur - // when callbacks resolve synchronously (#1267). - if (isProcessing) { - return; - } - isProcessing = true; - while(!q.paused && numRunning < q.concurrency && q._tasks.length){ - var tasks = [], data = []; - var l = q._tasks.length; - if (q.payload) l = Math.min(l, q.payload); - for (var i = 0; i < l; i++) { - var node = q._tasks.shift(); - tasks.push(node); - workersList.push(node); - data.push(node.data); - } - - numRunning += 1; - - if (q._tasks.length === 0) { - q.empty(); - } - - if (numRunning === q.concurrency) { - q.saturated(); - } - - var cb = onlyOnce(_next(tasks)); - _worker(data, cb); - } - isProcessing = false; - }, - length: function () { - return q._tasks.length; - }, - running: function () { - return numRunning; - }, - workersList: function () { - return workersList; - }, - idle: function() { - return q._tasks.length + numRunning === 0; - }, - pause: function () { - q.paused = true; - }, - resume: function () { - if (q.paused === false) { return; } - q.paused = false; - setImmediate$1(q.process); - } - }; - return q; -} - -/** - * A cargo of tasks for the worker function to complete. Cargo inherits all of - * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}. - * @typedef {Object} CargoObject - * @memberOf module:ControlFlow - * @property {Function} length - A function returning the number of items - * waiting to be processed. Invoke like `cargo.length()`. - * @property {number} payload - An `integer` for determining how many tasks - * should be process per round. This property can be changed after a `cargo` is - * created to alter the payload on-the-fly. - * @property {Function} push - Adds `task` to the `queue`. The callback is - * called once the `worker` has finished processing the task. Instead of a - * single task, an array of `tasks` can be submitted. The respective callback is - * used for every task in the list. Invoke like `cargo.push(task, [callback])`. - * @property {Function} saturated - A callback that is called when the - * `queue.length()` hits the concurrency and further tasks will be queued. - * @property {Function} empty - A callback that is called when the last item - * from the `queue` is given to a `worker`. - * @property {Function} drain - A callback that is called when the last item - * from the `queue` has returned from the `worker`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke like `cargo.idle()`. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke like `cargo.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke like `cargo.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`. - */ - -/** - * Creates a `cargo` object with the specified payload. Tasks added to the - * cargo will be processed altogether (up to the `payload` limit). If the - * `worker` is in progress, the task is queued until it becomes available. Once - * the `worker` has completed some tasks, each callback of those tasks is - * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) - * for how `cargo` and `queue` work. - * - * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers - * at a time, cargo passes an array of tasks to a single worker, repeating - * when the worker is finished. - * - * @name cargo - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An asynchronous function for processing an array - * of queued tasks. Invoked with `(tasks, callback)`. - * @param {number} [payload=Infinity] - An optional `integer` for determining - * how many tasks should be processed per round; if omitted, the default is - * unlimited. - * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the cargo and inner queue. - * @example - * - * // create a cargo object with payload 2 - * var cargo = async.cargo(function(tasks, callback) { - * for (var i=0; i true - */ -function identity(value) { - return value; -} - -function _createTester(check, getResult) { - return function(eachfn, arr, iteratee, cb) { - cb = cb || noop; - var testPassed = false; - var testResult; - eachfn(arr, function(value, _, callback) { - iteratee(value, function(err, result) { - if (err) { - callback(err); - } else if (check(result) && !testResult) { - testPassed = true; - testResult = getResult(true, value); - callback(null, breakLoop); - } else { - callback(); - } - }); - }, function(err) { - if (err) { - cb(err); - } else { - cb(null, testPassed ? testResult : getResult(false)); - } - }); - }; -} - -function _findGetResult(v, x) { - return x; -} - -/** - * Returns the first value in `coll` that passes an async truth test. The - * `iteratee` is applied in parallel, meaning the first iteratee to return - * `true` will fire the detect `callback` with that result. That means the - * result might not be the first item in the original `coll` (in terms of order) - * that passes the test. - - * If order within the original `coll` is important, then look at - * [`detectSeries`]{@link module:Collections.detectSeries}. - * - * @name detect - * @static - * @memberOf module:Collections - * @method - * @alias find - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - * @example - * - * async.detect(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // result now equals the first file in the list that exists - * }); - */ -var detect = doParallel(_createTester(identity, _findGetResult)); - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a - * time. - * - * @name detectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findLimit - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - */ -var detectLimit = doParallelLimit(_createTester(identity, _findGetResult)); - -/** - * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time. - * - * @name detectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.detect]{@link module:Collections.detect} - * @alias findSeries - * @category Collections - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`. - * The iteratee must complete with a boolean value as its result. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the `iteratee` functions have finished. - * Result will be the first item in the array that passes the truth test - * (iteratee) or the value `undefined` if none passed. Invoked with - * (err, result). - */ -var detectSeries = doLimit(detectLimit, 1); - -function consoleFunc(name) { - return function (fn/*, ...args*/) { - var args = slice(arguments, 1); - args.push(function (err/*, ...args*/) { - var args = slice(arguments, 1); - if (typeof console === 'object') { - if (err) { - if (console.error) { - console.error(err); - } - } else if (console[name]) { - arrayEach(args, function (x) { - console[name](x); - }); - } - } - }); - wrapAsync(fn).apply(null, args); - }; -} - -/** - * Logs the result of an [`async` function]{@link AsyncFunction} to the - * `console` using `console.dir` to display the properties of the resulting object. - * Only works in Node.js or in browsers that support `console.dir` and - * `console.error` (such as FF and Chrome). - * If multiple arguments are returned from the async function, - * `console.dir` is called on each argument in order. - * - * @name dir - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, {hello: name}); - * }, 1000); - * }; - * - * // in the node repl - * node> async.dir(hello, 'world'); - * {hello: 'world'} - */ -var dir = consoleFunc('dir'); - -/** - * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in - * the order of operations, the arguments `test` and `fn` are switched. - * - * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function. - * @name doDuring - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.during]{@link module:ControlFlow.during} - * @category Control Flow - * @param {AsyncFunction} fn - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `fn`. Invoked with (...args, callback), where `...args` are the - * non-error args from the previous callback of `fn`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error if one occurred, otherwise `null`. - */ -function doDuring(fn, test, callback) { - callback = onlyOnce(callback || noop); - var _fn = wrapAsync(fn); - var _test = wrapAsync(test); - - function next(err/*, ...args*/) { - if (err) return callback(err); - var args = slice(arguments, 1); - args.push(check); - _test.apply(this, args); - } - - function check(err, truth) { - if (err) return callback(err); - if (!truth) return callback(null); - _fn(next); - } - - check(null, true); - -} - -/** - * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in - * the order of operations, the arguments `test` and `iteratee` are switched. - * - * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. - * - * @name doWhilst - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - A function which is called each time `test` - * passes. Invoked with (callback). - * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with any non-error callback results of - * `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. - * `callback` will be passed an error and any arguments passed to the final - * `iteratee`'s callback. Invoked with (err, [results]); - */ -function doWhilst(iteratee, test, callback) { - callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync(iteratee); - var next = function(err/*, ...args*/) { - if (err) return callback(err); - var args = slice(arguments, 1); - if (test.apply(this, args)) return _iteratee(next); - callback.apply(null, [null].concat(args)); - }; - _iteratee(next); -} - -/** - * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the - * argument ordering differs from `until`. - * - * @name doUntil - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.doWhilst]{@link module:ControlFlow.doWhilst} - * @category Control Flow - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} test - synchronous truth test to perform after each - * execution of `iteratee`. Invoked with any non-error callback results of - * `iteratee`. - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - */ -function doUntil(iteratee, test, callback) { - doWhilst(iteratee, function() { - return !test.apply(this, arguments); - }, callback); -} - -/** - * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that - * is passed a callback in the form of `function (err, truth)`. If error is - * passed to `test` or `fn`, the main callback is immediately called with the - * value of the error. - * - * @name during - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {AsyncFunction} test - asynchronous truth test to perform before each - * execution of `fn`. Invoked with (callback). - * @param {AsyncFunction} fn - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `fn` has stopped. `callback` - * will be passed an error, if one occurred, otherwise `null`. - * @example - * - * var count = 0; - * - * async.during( - * function (callback) { - * return callback(null, count < 5); - * }, - * function (callback) { - * count++; - * setTimeout(callback, 1000); - * }, - * function (err) { - * // 5 seconds have passed - * } - * ); - */ -function during(test, fn, callback) { - callback = onlyOnce(callback || noop); - var _fn = wrapAsync(fn); - var _test = wrapAsync(test); - - function next(err) { - if (err) return callback(err); - _test(check); - } - - function check(err, truth) { - if (err) return callback(err); - if (!truth) return callback(null); - _fn(next); - } - - _test(check); -} - -function _withoutIndex(iteratee) { - return function (value, index, callback) { - return iteratee(value, callback); - }; -} - -/** - * Applies the function `iteratee` to each item in `coll`, in parallel. - * The `iteratee` is called with an item from the list, and a callback for when - * it has finished. If the `iteratee` passes an error to its `callback`, the - * main `callback` (for the `each` function) is immediately called with the - * error. - * - * Note, that since this function applies `iteratee` to each item in parallel, - * there is no guarantee that the iteratee functions will complete in order. - * - * @name each - * @static - * @memberOf module:Collections - * @method - * @alias forEach - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to - * each item in `coll`. Invoked with (item, callback). - * The array index is not passed to the iteratee. - * If you need the index, use `eachOf`. - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - * @example - * - * // assuming openFiles is an array of file names and saveFile is a function - * // to save the modified contents of that file: - * - * async.each(openFiles, saveFile, function(err){ - * // if any of the saves produced an error, err would equal that error - * }); - * - * // assuming openFiles is an array of file names - * async.each(openFiles, function(file, callback) { - * - * // Perform operation on file here. - * console.log('Processing file ' + file); - * - * if( file.length > 32 ) { - * console.log('This file name is too long'); - * callback('File name too long'); - * } else { - * // Do work to process file here - * console.log('File processed'); - * callback(); - * } - * }, function(err) { - * // if any of the file processing produced an error, err would equal that error - * if( err ) { - * // One of the iterations produced an error. - * // All processing will now stop. - * console.log('A file failed to process'); - * } else { - * console.log('All files have been processed successfully'); - * } - * }); - */ -function eachLimit(coll, iteratee, callback) { - eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} - -/** - * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time. - * - * @name eachLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfLimit`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -function eachLimit$1(coll, limit, iteratee, callback) { - _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback); -} - -/** - * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. - * - * @name eachSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.each]{@link module:Collections.each} - * @alias forEachSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each - * item in `coll`. - * The array index is not passed to the iteratee. - * If you need the index, use `eachOfSeries`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called when all - * `iteratee` functions have finished, or an error occurs. Invoked with (err). - */ -var eachSeries = doLimit(eachLimit$1, 1); - -/** - * Wrap an async function and ensure it calls its callback on a later tick of - * the event loop. If the function already calls its callback on a next tick, - * no extra deferral is added. This is useful for preventing stack overflows - * (`RangeError: Maximum call stack size exceeded`) and generally keeping - * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) - * contained. ES2017 `async` functions are returned as-is -- they are immune - * to Zalgo's corrupting influences, as they always resolve on a later tick. - * - * @name ensureAsync - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - an async function, one that expects a node-style - * callback as its last argument. - * @returns {AsyncFunction} Returns a wrapped function with the exact same call - * signature as the function passed in. - * @example - * - * function sometimesAsync(arg, callback) { - * if (cache[arg]) { - * return callback(null, cache[arg]); // this would be synchronous!! - * } else { - * doSomeIO(arg, callback); // this IO would be asynchronous - * } - * } - * - * // this has a risk of stack overflows if many results are cached in a row - * async.mapSeries(args, sometimesAsync, done); - * - * // this will defer sometimesAsync's callback if necessary, - * // preventing stack overflows - * async.mapSeries(args, async.ensureAsync(sometimesAsync), done); - */ -function ensureAsync(fn) { - if (isAsync(fn)) return fn; - return initialParams(function (args, callback) { - var sync = true; - args.push(function () { - var innerArgs = arguments; - if (sync) { - setImmediate$1(function () { - callback.apply(null, innerArgs); - }); - } else { - callback.apply(null, innerArgs); - } - }); - fn.apply(this, args); - sync = false; - }); -} - -function notId(v) { - return !v; -} - -/** - * Returns `true` if every element in `coll` satisfies an async test. If any - * iteratee call returns `false`, the main `callback` is immediately called. - * - * @name every - * @static - * @memberOf module:Collections - * @method - * @alias all - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - * @example - * - * async.every(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // if result is true then every file exists - * }); - */ -var every = doParallel(_createTester(notId, notId)); - -/** - * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time. - * - * @name everyLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in parallel. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - */ -var everyLimit = doParallelLimit(_createTester(notId, notId)); - -/** - * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time. - * - * @name everySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.every]{@link module:Collections.every} - * @alias allSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collection in series. - * The iteratee must complete with a boolean result value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result will be either `true` or `false` - * depending on the values of the async tests. Invoked with (err, result). - */ -var everySeries = doLimit(everyLimit, 1); - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -function filterArray(eachfn, arr, iteratee, callback) { - var truthValues = new Array(arr.length); - eachfn(arr, function (x, index, callback) { - iteratee(x, function (err, v) { - truthValues[index] = !!v; - callback(err); - }); - }, function (err) { - if (err) return callback(err); - var results = []; - for (var i = 0; i < arr.length; i++) { - if (truthValues[i]) results.push(arr[i]); - } - callback(null, results); - }); -} - -function filterGeneric(eachfn, coll, iteratee, callback) { - var results = []; - eachfn(coll, function (x, index, callback) { - iteratee(x, function (err, v) { - if (err) { - callback(err); - } else { - if (v) { - results.push({index: index, value: x}); - } - callback(); - } - }); - }, function (err) { - if (err) { - callback(err); - } else { - callback(null, arrayMap(results.sort(function (a, b) { - return a.index - b.index; - }), baseProperty('value'))); - } - }); -} - -function _filter(eachfn, coll, iteratee, callback) { - var filter = isArrayLike(coll) ? filterArray : filterGeneric; - filter(eachfn, coll, wrapAsync(iteratee), callback || noop); -} - -/** - * Returns a new array of all the values in `coll` which pass an async truth - * test. This operation is performed in parallel, but the results array will be - * in the same order as the original. - * - * @name filter - * @static - * @memberOf module:Collections - * @method - * @alias select - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @example - * - * async.filter(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, results) { - * // results now equals an array of the existing files - * }); - */ -var filter = doParallel(_filter); - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a - * time. - * - * @name filterLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var filterLimit = doParallelLimit(_filter); - -/** - * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time. - * - * @name filterSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @alias selectSeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - A truth test to apply to each item in `coll`. - * The `iteratee` is passed a `callback(err, truthValue)`, which must be called - * with a boolean argument once it has completed. Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results) - */ -var filterSeries = doLimit(filterLimit, 1); - -/** - * Calls the asynchronous function `fn` with a callback parameter that allows it - * to call itself again, in series, indefinitely. - - * If an error is passed to the callback then `errback` is called with the - * error, and execution stops, otherwise it will never be called. - * - * @name forever - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} fn - an async function to call repeatedly. - * Invoked with (next). - * @param {Function} [errback] - when `fn` passes an error to it's callback, - * this function will be called, and execution stops. Invoked with (err). - * @example - * - * async.forever( - * function(next) { - * // next is suitable for passing to things that need a callback(err [, whatever]); - * // it will result in this function being called again. - * }, - * function(err) { - * // if next is called with a value in its first parameter, it will appear - * // in here as 'err', and execution will stop. - * } - * ); - */ -function forever(fn, errback) { - var done = onlyOnce(errback || noop); - var task = wrapAsync(ensureAsync(fn)); - - function next(err) { - if (err) return done(err); - task(next); - } - next(); -} - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time. - * - * @name groupByLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - */ -var groupByLimit = function(coll, limit, iteratee, callback) { - callback = callback || noop; - var _iteratee = wrapAsync(iteratee); - mapLimit(coll, limit, function(val, callback) { - _iteratee(val, function(err, key) { - if (err) return callback(err); - return callback(null, {key: key, val: val}); - }); - }, function(err, mapResults) { - var result = {}; - // from MDN, handle object having an `hasOwnProperty` prop - var hasOwnProperty = Object.prototype.hasOwnProperty; - - for (var i = 0; i < mapResults.length; i++) { - if (mapResults[i]) { - var key = mapResults[i].key; - var val = mapResults[i].val; - - if (hasOwnProperty.call(result, key)) { - result[key].push(val); - } else { - result[key] = [val]; - } - } - } - - return callback(err, result); - }); -}; - -/** - * Returns a new object, where each value corresponds to an array of items, from - * `coll`, that returned the corresponding key. That is, the keys of the object - * correspond to the values passed to the `iteratee` callback. - * - * Note: Since this function applies the `iteratee` to each item in parallel, - * there is no guarantee that the `iteratee` functions will complete in order. - * However, the values for each key in the `result` will be in the same order as - * the original `coll`. For Objects, the values will roughly be in the order of - * the original Objects' keys (but this can vary across JavaScript engines). - * - * @name groupBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - * @example - * - * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) { - * db.findById(userId, function(err, user) { - * if (err) return callback(err); - * return callback(null, user.age); - * }); - * }, function(err, result) { - * // result is object containing the userIds grouped by age - * // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']}; - * }); - */ -var groupBy = doLimit(groupByLimit, Infinity); - -/** - * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time. - * - * @name groupBySeries - * @static - * @memberOf module:Collections - * @method - * @see [async.groupBy]{@link module:Collections.groupBy} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a `key` to group the value under. - * Invoked with (value, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. Result is an `Object` whoses - * properties are arrays of values which returned the corresponding key. - */ -var groupBySeries = doLimit(groupByLimit, 1); - -/** - * Logs the result of an `async` function to the `console`. Only works in - * Node.js or in browsers that support `console.log` and `console.error` (such - * as FF and Chrome). If multiple arguments are returned from the async - * function, `console.log` is called on each argument in order. - * - * @name log - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} function - The function you want to eventually apply - * all arguments to. - * @param {...*} arguments... - Any number of arguments to apply to the function. - * @example - * - * // in a module - * var hello = function(name, callback) { - * setTimeout(function() { - * callback(null, 'hello ' + name); - * }, 1000); - * }; - * - * // in the node repl - * node> async.log(hello, 'world'); - * 'hello world' - */ -var log = consoleFunc('log'); - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a - * time. - * - * @name mapValuesLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - */ -function mapValuesLimit(obj, limit, iteratee, callback) { - callback = once(callback || noop); - var newObj = {}; - var _iteratee = wrapAsync(iteratee); - eachOfLimit(obj, limit, function(val, key, next) { - _iteratee(val, key, function (err, result) { - if (err) return next(err); - newObj[key] = result; - next(); - }); - }, function (err) { - callback(err, newObj); - }); -} - -/** - * A relative of [`map`]{@link module:Collections.map}, designed for use with objects. - * - * Produces a new Object by mapping each value of `obj` through the `iteratee` - * function. The `iteratee` is called each `value` and `key` from `obj` and a - * callback for when it has finished processing. Each of these callbacks takes - * two arguments: an `error`, and the transformed item from `obj`. If `iteratee` - * passes an error to its callback, the main `callback` (for the `mapValues` - * function) is immediately called with the error. - * - * Note, the order of the keys in the result is not guaranteed. The keys will - * be roughly in the order they complete, (but this is very engine-specific) - * - * @name mapValues - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - * @example - * - * async.mapValues({ - * f1: 'file1', - * f2: 'file2', - * f3: 'file3' - * }, function (file, key, callback) { - * fs.stat(file, callback); - * }, function(err, result) { - * // result is now a map of stats for each file, e.g. - * // { - * // f1: [stats for file1], - * // f2: [stats for file2], - * // f3: [stats for file3] - * // } - * }); - */ - -var mapValues = doLimit(mapValuesLimit, Infinity); - -/** - * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time. - * - * @name mapValuesSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.mapValues]{@link module:Collections.mapValues} - * @category Collection - * @param {Object} obj - A collection to iterate over. - * @param {AsyncFunction} iteratee - A function to apply to each value and key - * in `coll`. - * The iteratee should complete with the transformed value as its result. - * Invoked with (value, key, callback). - * @param {Function} [callback] - A callback which is called when all `iteratee` - * functions have finished, or an error occurs. `result` is a new object consisting - * of each key from `obj`, with each transformed value on the right-hand side. - * Invoked with (err, result). - */ -var mapValuesSeries = doLimit(mapValuesLimit, 1); - -function has(obj, key) { - return key in obj; -} - -/** - * Caches the results of an async function. When creating a hash to store - * function results against, the callback is omitted from the hash and an - * optional hash function can be used. - * - * If no hash function is specified, the first argument is used as a hash key, - * which may work reasonably if it is a string or a data type that converts to a - * distinct string. Note that objects and arrays will not behave reasonably. - * Neither will cases where the other arguments are significant. In such cases, - * specify your own hash function. - * - * The cache of results is exposed as the `memo` property of the function - * returned by `memoize`. - * - * @name memoize - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function to proxy and cache results from. - * @param {Function} hasher - An optional function for generating a custom hash - * for storing results. It has all the arguments applied to it apart from the - * callback, and must be synchronous. - * @returns {AsyncFunction} a memoized version of `fn` - * @example - * - * var slow_fn = function(name, callback) { - * // do something - * callback(null, result); - * }; - * var fn = async.memoize(slow_fn); - * - * // fn can now be used as if it were slow_fn - * fn('some name', function() { - * // callback - * }); - */ -function memoize(fn, hasher) { - var memo = Object.create(null); - var queues = Object.create(null); - hasher = hasher || identity; - var _fn = wrapAsync(fn); - var memoized = initialParams(function memoized(args, callback) { - var key = hasher.apply(null, args); - if (has(memo, key)) { - setImmediate$1(function() { - callback.apply(null, memo[key]); - }); - } else if (has(queues, key)) { - queues[key].push(callback); - } else { - queues[key] = [callback]; - _fn.apply(null, args.concat(function(/*args*/) { - var args = slice(arguments); - memo[key] = args; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, args); - } - })); - } - }); - memoized.memo = memo; - memoized.unmemoized = fn; - return memoized; -} - -/** - * Calls `callback` on a later loop around the event loop. In Node.js this just - * calls `process.nextTicl`. In the browser it will use `setImmediate` if - * available, otherwise `setTimeout(callback, 0)`, which means other higher - * priority events may precede the execution of `callback`. - * - * This is used internally for browser-compatibility purposes. - * - * @name nextTick - * @static - * @memberOf module:Utils - * @method - * @see [async.setImmediate]{@link module:Utils.setImmediate} - * @category Util - * @param {Function} callback - The function to call on a later loop around - * the event loop. Invoked with (args...). - * @param {...*} args... - any number of additional arguments to pass to the - * callback on the next tick. - * @example - * - * var call_order = []; - * async.nextTick(function() { - * call_order.push('two'); - * // call_order now equals ['one','two'] - * }); - * call_order.push('one'); - * - * async.setImmediate(function (a, b, c) { - * // a, b, and c equal 1, 2, and 3 - * }, 1, 2, 3); - */ -var _defer$1; - -if (hasNextTick) { - _defer$1 = process.nextTick; -} else if (hasSetImmediate) { - _defer$1 = setImmediate; -} else { - _defer$1 = fallback; -} - -var nextTick = wrap(_defer$1); - -function _parallel(eachfn, tasks, callback) { - callback = callback || noop; - var results = isArrayLike(tasks) ? [] : {}; - - eachfn(tasks, function (task, key, callback) { - wrapAsync(task)(function (err, result) { - if (arguments.length > 2) { - result = slice(arguments, 1); - } - results[key] = result; - callback(err); - }); - }, function (err) { - callback(err, results); - }); -} - -/** - * Run the `tasks` collection of functions in parallel, without waiting until - * the previous function has completed. If any of the functions pass an error to - * its callback, the main `callback` is immediately called with the value of the - * error. Once the `tasks` have completed, the results are passed to the final - * `callback` as an array. - * - * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about - * parallel execution of code. If your tasks do not use any timers or perform - * any I/O, they will actually be executed in series. Any synchronous setup - * sections for each task will happen one after the other. JavaScript remains - * single-threaded. - * - * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the - * execution of other tasks when a task fails. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.parallel}. - * - * @name parallel - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - * - * @example - * async.parallel([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // optional callback - * function(err, results) { - * // the results array will equal ['one','two'] even though - * // the second function had a shorter timeout. - * }); - * - * // an example using an object instead of an array - * async.parallel({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback) { - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * // results is now equals to: {one: 1, two: 2} - * }); - */ -function parallelLimit(tasks, callback) { - _parallel(eachOf, tasks, callback); -} - -/** - * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a - * time. - * - * @name parallelLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.parallel]{@link module:ControlFlow.parallel} - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection of - * [async functions]{@link AsyncFunction} to run. - * Each async function can complete with any number of optional `result` values. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed successfully. This function gets a results array - * (or object) containing all the result arguments passed to the task callbacks. - * Invoked with (err, results). - */ -function parallelLimit$1(tasks, limit, callback) { - _parallel(_eachOfLimit(limit), tasks, callback); -} - -/** - * A queue of tasks for the worker function to complete. - * @typedef {Object} QueueObject - * @memberOf module:ControlFlow - * @property {Function} length - a function returning the number of items - * waiting to be processed. Invoke with `queue.length()`. - * @property {boolean} started - a boolean indicating whether or not any - * items have been pushed and processed by the queue. - * @property {Function} running - a function returning the number of items - * currently being processed. Invoke with `queue.running()`. - * @property {Function} workersList - a function returning the array of items - * currently being processed. Invoke with `queue.workersList()`. - * @property {Function} idle - a function returning false if there are items - * waiting or being processed, or true if not. Invoke with `queue.idle()`. - * @property {number} concurrency - an integer for determining how many `worker` - * functions should be run in parallel. This property can be changed after a - * `queue` is created to alter the concurrency on-the-fly. - * @property {Function} push - add a new task to the `queue`. Calls `callback` - * once the `worker` has finished processing the task. Instead of a single task, - * a `tasks` array can be submitted. The respective callback is used for every - * task in the list. Invoke with `queue.push(task, [callback])`, - * @property {Function} unshift - add a new task to the front of the `queue`. - * Invoke with `queue.unshift(task, [callback])`. - * @property {Function} remove - remove items from the queue that match a test - * function. The test function will be passed an object with a `data` property, - * and a `priority` property, if this is a - * [priorityQueue]{@link module:ControlFlow.priorityQueue} object. - * Invoked with `queue.remove(testFn)`, where `testFn` is of the form - * `function ({data, priority}) {}` and returns a Boolean. - * @property {Function} saturated - a callback that is called when the number of - * running workers hits the `concurrency` limit, and further tasks will be - * queued. - * @property {Function} unsaturated - a callback that is called when the number - * of running workers is less than the `concurrency` & `buffer` limits, and - * further tasks will not be queued. - * @property {number} buffer - A minimum threshold buffer in order to say that - * the `queue` is `unsaturated`. - * @property {Function} empty - a callback that is called when the last item - * from the `queue` is given to a `worker`. - * @property {Function} drain - a callback that is called when the last item - * from the `queue` has returned from the `worker`. - * @property {Function} error - a callback that is called when a task errors. - * Has the signature `function(error, task)`. - * @property {boolean} paused - a boolean for determining whether the queue is - * in a paused state. - * @property {Function} pause - a function that pauses the processing of tasks - * until `resume()` is called. Invoke with `queue.pause()`. - * @property {Function} resume - a function that resumes the processing of - * queued tasks when the queue is paused. Invoke with `queue.resume()`. - * @property {Function} kill - a function that removes the `drain` callback and - * empties remaining tasks from the queue forcing it to go idle. No more tasks - * should be pushed to the queue after calling this function. Invoke with `queue.kill()`. - */ - -/** - * Creates a `queue` object with the specified `concurrency`. Tasks added to the - * `queue` are processed in parallel (up to the `concurrency` limit). If all - * `worker`s are in progress, the task is queued until one becomes available. - * Once a `worker` completes a `task`, that `task`'s callback is called. - * - * @name queue - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. Invoked with (task, callback). - * @param {number} [concurrency=1] - An `integer` for determining how many - * `worker` functions should be run in parallel. If omitted, the concurrency - * defaults to `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can - * attached as certain properties to listen for specific events during the - * lifecycle of the queue. - * @example - * - * // create a queue object with concurrency 2 - * var q = async.queue(function(task, callback) { - * console.log('hello ' + task.name); - * callback(); - * }, 2); - * - * // assign a callback - * q.drain = function() { - * console.log('all items have been processed'); - * }; - * - * // add some items to the queue - * q.push({name: 'foo'}, function(err) { - * console.log('finished processing foo'); - * }); - * q.push({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - * - * // add some items to the queue (batch-wise) - * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) { - * console.log('finished processing item'); - * }); - * - * // add some items to the front of the queue - * q.unshift({name: 'bar'}, function (err) { - * console.log('finished processing bar'); - * }); - */ -var queue$1 = function (worker, concurrency) { - var _worker = wrapAsync(worker); - return queue(function (items, cb) { - _worker(items[0], cb); - }, concurrency, 1); -}; - -/** - * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and - * completed in ascending priority order. - * - * @name priorityQueue - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.queue]{@link module:ControlFlow.queue} - * @category Control Flow - * @param {AsyncFunction} worker - An async function for processing a queued task. - * If you want to handle errors from an individual task, pass a callback to - * `q.push()`. - * Invoked with (task, callback). - * @param {number} concurrency - An `integer` for determining how many `worker` - * functions should be run in parallel. If omitted, the concurrency defaults to - * `1`. If the concurrency is `0`, an error is thrown. - * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two - * differences between `queue` and `priorityQueue` objects: - * * `push(task, priority, [callback])` - `priority` should be a number. If an - * array of `tasks` is given, all tasks will be assigned the same priority. - * * The `unshift` method was removed. - */ -var priorityQueue = function(worker, concurrency) { - // Start with a normal queue - var q = queue$1(worker, concurrency); - - // Override push to accept second parameter representing priority - q.push = function(data, priority, callback) { - if (callback == null) callback = noop; - if (typeof callback !== 'function') { - throw new Error('task callback must be a function'); - } - q.started = true; - if (!isArray(data)) { - data = [data]; - } - if (data.length === 0) { - // call drain immediately if there are no tasks - return setImmediate$1(function() { - q.drain(); - }); - } - - priority = priority || 0; - var nextNode = q._tasks.head; - while (nextNode && priority >= nextNode.priority) { - nextNode = nextNode.next; - } - - for (var i = 0, l = data.length; i < l; i++) { - var item = { - data: data[i], - priority: priority, - callback: callback - }; - - if (nextNode) { - q._tasks.insertBefore(nextNode, item); - } else { - q._tasks.push(item); - } - } - setImmediate$1(q.process); - }; - - // Remove unshift function - delete q.unshift; - - return q; -}; - -/** - * Runs the `tasks` array of functions in parallel, without waiting until the - * previous function has completed. Once any of the `tasks` complete or pass an - * error to its callback, the main `callback` is immediately called. It's - * equivalent to `Promise.race()`. - * - * @name race - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction} - * to run. Each function can complete with an optional `result` value. - * @param {Function} callback - A callback to run once any of the functions have - * completed. This function gets an error or result from the first function that - * completed. Invoked with (err, result). - * @returns undefined - * @example - * - * async.race([ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ], - * // main callback - * function(err, result) { - * // the result will be equal to 'two' as it finishes earlier - * }); - */ -function race(tasks, callback) { - callback = once(callback || noop); - if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions')); - if (!tasks.length) return callback(); - for (var i = 0, l = tasks.length; i < l; i++) { - wrapAsync(tasks[i])(callback); - } -} - -/** - * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order. - * - * @name reduceRight - * @static - * @memberOf module:Collections - * @method - * @see [async.reduce]{@link module:Collections.reduce} - * @alias foldr - * @category Collection - * @param {Array} array - A collection to iterate over. - * @param {*} memo - The initial state of the reduction. - * @param {AsyncFunction} iteratee - A function applied to each item in the - * array to produce the next step in the reduction. - * The `iteratee` should complete with the next state of the reduction. - * If the iteratee complete with an error, the reduction is stopped and the - * main `callback` is immediately called with the error. - * Invoked with (memo, item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the reduced value. Invoked with - * (err, result). - */ -function reduceRight (array, memo, iteratee, callback) { - var reversed = slice(array).reverse(); - reduce(reversed, memo, iteratee, callback); -} - -/** - * Wraps the async function in another function that always completes with a - * result object, even when it errors. - * - * The result object has either the property `error` or `value`. - * - * @name reflect - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} fn - The async function you want to wrap - * @returns {Function} - A function that always passes null to it's callback as - * the error. The second argument to the callback will be an `object` with - * either an `error` or a `value` property. - * @example - * - * async.parallel([ - * async.reflect(function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }), - * async.reflect(function(callback) { - * // do some more stuff but error ... - * callback('bad stuff happened'); - * }), - * async.reflect(function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * }) - * ], - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = 'bad stuff happened' - * // results[2].value = 'two' - * }); - */ -function reflect(fn) { - var _fn = wrapAsync(fn); - return initialParams(function reflectOn(args, reflectCallback) { - args.push(function callback(error, cbArg) { - if (error) { - reflectCallback(null, { error: error }); - } else { - var value; - if (arguments.length <= 2) { - value = cbArg; - } else { - value = slice(arguments, 1); - } - reflectCallback(null, { value: value }); - } - }); - - return _fn.apply(this, args); - }); -} - -/** - * A helper function that wraps an array or an object of functions with `reflect`. - * - * @name reflectAll - * @static - * @memberOf module:Utils - * @method - * @see [async.reflect]{@link module:Utils.reflect} - * @category Util - * @param {Array|Object|Iterable} tasks - The collection of - * [async functions]{@link AsyncFunction} to wrap in `async.reflect`. - * @returns {Array} Returns an array of async functions, each wrapped in - * `async.reflect` - * @example - * - * let tasks = [ - * function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * function(callback) { - * // do some more stuff but error ... - * callback(new Error('bad stuff happened')); - * }, - * function(callback) { - * setTimeout(function() { - * callback(null, 'two'); - * }, 100); - * } - * ]; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results[0].value = 'one' - * // results[1].error = Error('bad stuff happened') - * // results[2].value = 'two' - * }); - * - * // an example using an object instead of an array - * let tasks = { - * one: function(callback) { - * setTimeout(function() { - * callback(null, 'one'); - * }, 200); - * }, - * two: function(callback) { - * callback('two'); - * }, - * three: function(callback) { - * setTimeout(function() { - * callback(null, 'three'); - * }, 100); - * } - * }; - * - * async.parallel(async.reflectAll(tasks), - * // optional callback - * function(err, results) { - * // values - * // results.one.value = 'one' - * // results.two.error = 'two' - * // results.three.value = 'three' - * }); - */ -function reflectAll(tasks) { - var results; - if (isArray(tasks)) { - results = arrayMap(tasks, reflect); - } else { - results = {}; - baseForOwn(tasks, function(task, key) { - results[key] = reflect.call(this, task); - }); - } - return results; -} - -function reject$1(eachfn, arr, iteratee, callback) { - _filter(eachfn, arr, function(value, cb) { - iteratee(value, function(err, v) { - cb(err, !v); - }); - }, callback); -} - -/** - * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test. - * - * @name reject - * @static - * @memberOf module:Collections - * @method - * @see [async.filter]{@link module:Collections.filter} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - * @example - * - * async.reject(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, results) { - * // results now equals an array of missing files - * createFiles(results); - * }); - */ -var reject = doParallel(reject$1); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a - * time. - * - * @name rejectLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var rejectLimit = doParallelLimit(reject$1); - -/** - * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time. - * - * @name rejectSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.reject]{@link module:Collections.reject} - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {Function} iteratee - An async truth test to apply to each item in - * `coll`. - * The should complete with a boolean value as its `result`. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Invoked with (err, results). - */ -var rejectSeries = doLimit(rejectLimit, 1); - -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @since 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. - * @example - * - * var objects = _.times(2, _.constant({ 'a': 1 })); - * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] - * - * console.log(objects[0] === objects[1]); - * // => true - */ -function constant$1(value) { - return function() { - return value; - }; -} - -/** - * Attempts to get a successful response from `task` no more than `times` times - * before returning an error. If the task is successful, the `callback` will be - * passed the result of the successful task. If all attempts fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name retry - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @see [async.retryable]{@link module:ControlFlow.retryable} - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an - * object with `times` and `interval` or a number. - * * `times` - The number of attempts to make before giving up. The default - * is `5`. - * * `interval` - The time to wait between retries, in milliseconds. The - * default is `0`. The interval may also be specified as a function of the - * retry count (see example). - * * `errorFilter` - An optional synchronous function that is invoked on - * erroneous result. If it returns `true` the retry attempts will continue; - * if the function returns `false` the retry flow is aborted with the current - * attempt's error and result being returned to the final callback. - * Invoked with (err). - * * If `opts` is a number, the number specifies the number of times to retry, - * with the default interval of `0`. - * @param {AsyncFunction} task - An async function to retry. - * Invoked with (callback). - * @param {Function} [callback] - An optional callback which is called when the - * task has succeeded, or after the final failed attempt. It receives the `err` - * and `result` arguments of the last attempt at completing the `task`. Invoked - * with (err, results). - * - * @example - * - * // The `retry` function can be used as a stand-alone control flow by passing - * // a callback, as shown below: - * - * // try calling apiMethod 3 times - * async.retry(3, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 3 times, waiting 200 ms between each retry - * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod 10 times with exponential backoff - * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds) - * async.retry({ - * times: 10, - * interval: function(retryCount) { - * return 50 * Math.pow(2, retryCount); - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod the default 5 times no delay between each retry - * async.retry(apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // try calling apiMethod only when error condition satisfies, all other - * // errors will abort the retry control flow and return to final callback - * async.retry({ - * errorFilter: function(err) { - * return err.message === 'Temporary error'; // only retry on a specific error - * } - * }, apiMethod, function(err, result) { - * // do something with the result - * }); - * - * // to retry individual methods that are not as reliable within other - * // control flow functions, use the `retryable` wrapper: - * async.auto({ - * users: api.getUsers.bind(api), - * payments: async.retryable(3, api.getPayments.bind(api)) - * }, function(err, results) { - * // do something with the results - * }); - * - */ -function retry(opts, task, callback) { - var DEFAULT_TIMES = 5; - var DEFAULT_INTERVAL = 0; - - var options = { - times: DEFAULT_TIMES, - intervalFunc: constant$1(DEFAULT_INTERVAL) - }; - - function parseTimes(acc, t) { - if (typeof t === 'object') { - acc.times = +t.times || DEFAULT_TIMES; - - acc.intervalFunc = typeof t.interval === 'function' ? - t.interval : - constant$1(+t.interval || DEFAULT_INTERVAL); - - acc.errorFilter = t.errorFilter; - } else if (typeof t === 'number' || typeof t === 'string') { - acc.times = +t || DEFAULT_TIMES; - } else { - throw new Error("Invalid arguments for async.retry"); - } - } - - if (arguments.length < 3 && typeof opts === 'function') { - callback = task || noop; - task = opts; - } else { - parseTimes(options, opts); - callback = callback || noop; - } - - if (typeof task !== 'function') { - throw new Error("Invalid arguments for async.retry"); - } - - var _task = wrapAsync(task); - - var attempt = 1; - function retryAttempt() { - _task(function(err) { - if (err && attempt++ < options.times && - (typeof options.errorFilter != 'function' || - options.errorFilter(err))) { - setTimeout(retryAttempt, options.intervalFunc(attempt)); - } else { - callback.apply(null, arguments); - } - }); - } - - retryAttempt(); -} - -/** - * A close relative of [`retry`]{@link module:ControlFlow.retry}. This method - * wraps a task and makes it retryable, rather than immediately calling it - * with retries. - * - * @name retryable - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.retry]{@link module:ControlFlow.retry} - * @category Control Flow - * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional - * options, exactly the same as from `retry` - * @param {AsyncFunction} task - the asynchronous function to wrap. - * This function will be passed any arguments passed to the returned wrapper. - * Invoked with (...args, callback). - * @returns {AsyncFunction} The wrapped function, which when invoked, will - * retry on an error, based on the parameters specified in `opts`. - * This function will accept the same parameters as `task`. - * @example - * - * async.auto({ - * dep1: async.retryable(3, getFromFlakyService), - * process: ["dep1", async.retryable(3, function (results, cb) { - * maybeProcessData(results.dep1, cb); - * })] - * }, callback); - */ -var retryable = function (opts, task) { - if (!task) { - task = opts; - opts = null; - } - var _task = wrapAsync(task); - return initialParams(function (args, callback) { - function taskFn(cb) { - _task.apply(null, args.concat(cb)); - } - - if (opts) retry(opts, taskFn, callback); - else retry(taskFn, callback); - - }); -}; - -/** - * Run the functions in the `tasks` collection in series, each one running once - * the previous function has completed. If any functions in the series pass an - * error to its callback, no more functions are run, and `callback` is - * immediately called with the value of the error. Otherwise, `callback` - * receives an array of results when `tasks` have completed. - * - * It is also possible to use an object instead of an array. Each property will - * be run as a function, and the results will be passed to the final `callback` - * as an object instead of an array. This can be a more readable way of handling - * results from {@link async.series}. - * - * **Note** that while many implementations preserve the order of object - * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) - * explicitly states that - * - * > The mechanics and order of enumerating the properties is not specified. - * - * So if you rely on the order in which your series of functions are executed, - * and want this to work on all platforms, consider using an array. - * - * @name series - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection containing - * [async functions]{@link AsyncFunction} to run in series. - * Each function can complete with any number of optional `result` values. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This function gets a results array (or object) - * containing all the result arguments passed to the `task` callbacks. Invoked - * with (err, result). - * @example - * async.series([ - * function(callback) { - * // do some stuff ... - * callback(null, 'one'); - * }, - * function(callback) { - * // do some more stuff ... - * callback(null, 'two'); - * } - * ], - * // optional callback - * function(err, results) { - * // results is now equal to ['one', 'two'] - * }); - * - * async.series({ - * one: function(callback) { - * setTimeout(function() { - * callback(null, 1); - * }, 200); - * }, - * two: function(callback){ - * setTimeout(function() { - * callback(null, 2); - * }, 100); - * } - * }, function(err, results) { - * // results is now equal to: {one: 1, two: 2} - * }); - */ -function series(tasks, callback) { - _parallel(eachOfSeries, tasks, callback); -} - -/** - * Returns `true` if at least one element in the `coll` satisfies an async test. - * If any iteratee call returns `true`, the main `callback` is immediately - * called. - * - * @name some - * @static - * @memberOf module:Collections - * @method - * @alias any - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - * @example - * - * async.some(['file1','file2','file3'], function(filePath, callback) { - * fs.access(filePath, function(err) { - * callback(null, !err) - * }); - * }, function(err, result) { - * // if result is true then at least one of the files exists - * }); - */ -var some = doParallel(_createTester(Boolean, identity)); - -/** - * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time. - * - * @name someLimit - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anyLimit - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in parallel. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - */ -var someLimit = doParallelLimit(_createTester(Boolean, identity)); - -/** - * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time. - * - * @name someSeries - * @static - * @memberOf module:Collections - * @method - * @see [async.some]{@link module:Collections.some} - * @alias anySeries - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async truth test to apply to each item - * in the collections in series. - * The iteratee should complete with a boolean `result` value. - * Invoked with (item, callback). - * @param {Function} [callback] - A callback which is called as soon as any - * iteratee returns `true`, or after all the iteratee functions have finished. - * Result will be either `true` or `false` depending on the values of the async - * tests. Invoked with (err, result). - */ -var someSeries = doLimit(someLimit, 1); - -/** - * Sorts a list by the results of running each `coll` value through an async - * `iteratee`. - * - * @name sortBy - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {AsyncFunction} iteratee - An async function to apply to each item in - * `coll`. - * The iteratee should complete with a value to use as the sort criteria as - * its `result`. - * Invoked with (item, callback). - * @param {Function} callback - A callback which is called after all the - * `iteratee` functions have finished, or an error occurs. Results is the items - * from the original `coll` sorted by the values returned by the `iteratee` - * calls. Invoked with (err, results). - * @example - * - * async.sortBy(['file1','file2','file3'], function(file, callback) { - * fs.stat(file, function(err, stats) { - * callback(err, stats.mtime); - * }); - * }, function(err, results) { - * // results is now the original array of files sorted by - * // modified date - * }); - * - * // By modifying the callback parameter the - * // sorting order can be influenced: - * - * // ascending order - * async.sortBy([1,9,3,5], function(x, callback) { - * callback(null, x); - * }, function(err,result) { - * // result callback - * }); - * - * // descending order - * async.sortBy([1,9,3,5], function(x, callback) { - * callback(null, x*-1); //<- x*-1 instead of x, turns the order around - * }, function(err,result) { - * // result callback - * }); - */ -function sortBy (coll, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - map(coll, function (x, callback) { - _iteratee(x, function (err, criteria) { - if (err) return callback(err); - callback(null, {value: x, criteria: criteria}); - }); - }, function (err, results) { - if (err) return callback(err); - callback(null, arrayMap(results.sort(comparator), baseProperty('value'))); - }); - - function comparator(left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - } -} - -/** - * Sets a time limit on an asynchronous function. If the function does not call - * its callback within the specified milliseconds, it will be called with a - * timeout error. The code property for the error object will be `'ETIMEDOUT'`. - * - * @name timeout - * @static - * @memberOf module:Utils - * @method - * @category Util - * @param {AsyncFunction} asyncFn - The async function to limit in time. - * @param {number} milliseconds - The specified time limit. - * @param {*} [info] - Any variable you want attached (`string`, `object`, etc) - * to timeout Error for more information.. - * @returns {AsyncFunction} Returns a wrapped function that can be used with any - * of the control flow functions. - * Invoke this function with the same parameters as you would `asyncFunc`. - * @example - * - * function myFunction(foo, callback) { - * doAsyncTask(foo, function(err, data) { - * // handle errors - * if (err) return callback(err); - * - * // do some stuff ... - * - * // return processed data - * return callback(null, data); - * }); - * } - * - * var wrapped = async.timeout(myFunction, 1000); - * - * // call `wrapped` as you would `myFunction` - * wrapped({ bar: 'bar' }, function(err, data) { - * // if `myFunction` takes < 1000 ms to execute, `err` - * // and `data` will have their expected values - * - * // else `err` will be an Error with the code 'ETIMEDOUT' - * }); - */ -function timeout(asyncFn, milliseconds, info) { - var fn = wrapAsync(asyncFn); - - return initialParams(function (args, callback) { - var timedOut = false; - var timer; - - function timeoutCallback() { - var name = asyncFn.name || 'anonymous'; - var error = new Error('Callback function "' + name + '" timed out.'); - error.code = 'ETIMEDOUT'; - if (info) { - error.info = info; - } - timedOut = true; - callback(error); - } - - args.push(function () { - if (!timedOut) { - callback.apply(null, arguments); - clearTimeout(timer); - } - }); - - // setup timer and call original function - timer = setTimeout(timeoutCallback, milliseconds); - fn.apply(null, args); - }); -} - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil; -var nativeMax = Math.max; - -/** - * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments. - * - * @private - * @param {number} start The start of the range. - * @param {number} end The end of the range. - * @param {number} step The value to increment or decrement by. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Array} Returns the range of numbers. - */ -function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; -} - -/** - * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a - * time. - * - * @name timesLimit - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} count - The number of times to run the function. - * @param {number} limit - The maximum number of async operations at a time. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see [async.map]{@link module:Collections.map}. - */ -function timeLimit(count, limit, iteratee, callback) { - var _iteratee = wrapAsync(iteratee); - mapLimit(baseRange(0, count, 1), limit, _iteratee, callback); -} - -/** - * Calls the `iteratee` function `n` times, and accumulates results in the same - * manner you would use with [map]{@link module:Collections.map}. - * - * @name times - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.map]{@link module:Collections.map} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - * @example - * - * // Pretend this is some complicated async factory - * var createUser = function(id, callback) { - * callback(null, { - * id: 'user' + id - * }); - * }; - * - * // generate 5 users - * async.times(5, function(n, next) { - * createUser(n, function(err, user) { - * next(err, user); - * }); - * }, function(err, users) { - * // we should now have 5 users - * }); - */ -var times = doLimit(timeLimit, Infinity); - -/** - * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time. - * - * @name timesSeries - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.times]{@link module:ControlFlow.times} - * @category Control Flow - * @param {number} n - The number of times to run the function. - * @param {AsyncFunction} iteratee - The async function to call `n` times. - * Invoked with the iteration index and a callback: (n, next). - * @param {Function} callback - see {@link module:Collections.map}. - */ -var timesSeries = doLimit(timeLimit, 1); - -/** - * A relative of `reduce`. Takes an Object or Array, and iterates over each - * element in series, each step potentially mutating an `accumulator` value. - * The type of the accumulator defaults to the type of collection passed in. - * - * @name transform - * @static - * @memberOf module:Collections - * @method - * @category Collection - * @param {Array|Iterable|Object} coll - A collection to iterate over. - * @param {*} [accumulator] - The initial state of the transform. If omitted, - * it will default to an empty Object or Array, depending on the type of `coll` - * @param {AsyncFunction} iteratee - A function applied to each item in the - * collection that potentially modifies the accumulator. - * Invoked with (accumulator, item, key, callback). - * @param {Function} [callback] - A callback which is called after all the - * `iteratee` functions have finished. Result is the transformed accumulator. - * Invoked with (err, result). - * @example - * - * async.transform([1,2,3], function(acc, item, index, callback) { - * // pointless async: - * process.nextTick(function() { - * acc.push(item * 2) - * callback(null) - * }); - * }, function(err, result) { - * // result is now equal to [2, 4, 6] - * }); - * - * @example - * - * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) { - * setImmediate(function () { - * obj[key] = val * 2; - * callback(); - * }) - * }, function (err, result) { - * // result is equal to {a: 2, b: 4, c: 6} - * }) - */ -function transform (coll, accumulator, iteratee, callback) { - if (arguments.length <= 3) { - callback = iteratee; - iteratee = accumulator; - accumulator = isArray(coll) ? [] : {}; - } - callback = once(callback || noop); - var _iteratee = wrapAsync(iteratee); - - eachOf(coll, function(v, k, cb) { - _iteratee(accumulator, v, k, cb); - }, function(err) { - callback(err, accumulator); - }); -} - -/** - * It runs each task in series but stops whenever any of the functions were - * successful. If one of the tasks were successful, the `callback` will be - * passed the result of the successful task. If all tasks fail, the callback - * will be passed the error and result (if any) of the final attempt. - * - * @name tryEach - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array|Iterable|Object} tasks - A collection containing functions to - * run, each function is passed a `callback(err, result)` it must call on - * completion with an error `err` (which can be `null`) and an optional `result` - * value. - * @param {Function} [callback] - An optional callback which is called when one - * of the tasks has succeeded, or all have failed. It receives the `err` and - * `result` arguments of the last attempt at completing the `task`. Invoked with - * (err, results). - * @example - * async.tryEach([ - * function getDataFromFirstWebsite(callback) { - * // Try getting the data from the first website - * callback(err, data); - * }, - * function getDataFromSecondWebsite(callback) { - * // First website failed, - * // Try getting the data from the backup website - * callback(err, data); - * } - * ], - * // optional callback - * function(err, results) { - * Now do something with the data. - * }); - * - */ -function tryEach(tasks, callback) { - var error = null; - var result; - callback = callback || noop; - eachSeries(tasks, function(task, callback) { - wrapAsync(task)(function (err, res/*, ...args*/) { - if (arguments.length > 2) { - result = slice(arguments, 1); - } else { - result = res; - } - error = err; - callback(!err); - }); - }, function () { - callback(error, result); - }); -} - -/** - * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original, - * unmemoized form. Handy for testing. - * - * @name unmemoize - * @static - * @memberOf module:Utils - * @method - * @see [async.memoize]{@link module:Utils.memoize} - * @category Util - * @param {AsyncFunction} fn - the memoized function - * @returns {AsyncFunction} a function that calls the original unmemoized function - */ -function unmemoize(fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; -} - -/** - * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. - * - * @name whilst - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Function} test - synchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` passes. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has failed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - * @returns undefined - * @example - * - * var count = 0; - * async.whilst( - * function() { return count < 5; }, - * function(callback) { - * count++; - * setTimeout(function() { - * callback(null, count); - * }, 1000); - * }, - * function (err, n) { - * // 5 seconds have passed, n = 5 - * } - * ); - */ -function whilst(test, iteratee, callback) { - callback = onlyOnce(callback || noop); - var _iteratee = wrapAsync(iteratee); - if (!test()) return callback(null); - var next = function(err/*, ...args*/) { - if (err) return callback(err); - if (test()) return _iteratee(next); - var args = slice(arguments, 1); - callback.apply(null, [null].concat(args)); - }; - _iteratee(next); -} - -/** - * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when - * stopped, or an error occurs. `callback` will be passed an error and any - * arguments passed to the final `iteratee`'s callback. - * - * The inverse of [whilst]{@link module:ControlFlow.whilst}. - * - * @name until - * @static - * @memberOf module:ControlFlow - * @method - * @see [async.whilst]{@link module:ControlFlow.whilst} - * @category Control Flow - * @param {Function} test - synchronous truth test to perform before each - * execution of `iteratee`. Invoked with (). - * @param {AsyncFunction} iteratee - An async function which is called each time - * `test` fails. Invoked with (callback). - * @param {Function} [callback] - A callback which is called after the test - * function has passed and repeated execution of `iteratee` has stopped. `callback` - * will be passed an error and any arguments passed to the final `iteratee`'s - * callback. Invoked with (err, [results]); - */ -function until(test, iteratee, callback) { - whilst(function() { - return !test.apply(this, arguments); - }, iteratee, callback); -} - -/** - * Runs the `tasks` array of functions in series, each passing their results to - * the next in the array. However, if any of the `tasks` pass an error to their - * own callback, the next function is not executed, and the main `callback` is - * immediately called with the error. - * - * @name waterfall - * @static - * @memberOf module:ControlFlow - * @method - * @category Control Flow - * @param {Array} tasks - An array of [async functions]{@link AsyncFunction} - * to run. - * Each function should complete with any number of `result` values. - * The `result` values will be passed as arguments, in order, to the next task. - * @param {Function} [callback] - An optional callback to run once all the - * functions have completed. This will be passed the results of the last task's - * callback. Invoked with (err, [results]). - * @returns undefined - * @example - * - * async.waterfall([ - * function(callback) { - * callback(null, 'one', 'two'); - * }, - * function(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * }, - * function(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - * ], function (err, result) { - * // result now equals 'done' - * }); - * - * // Or, with named functions: - * async.waterfall([ - * myFirstFunction, - * mySecondFunction, - * myLastFunction, - * ], function (err, result) { - * // result now equals 'done' - * }); - * function myFirstFunction(callback) { - * callback(null, 'one', 'two'); - * } - * function mySecondFunction(arg1, arg2, callback) { - * // arg1 now equals 'one' and arg2 now equals 'two' - * callback(null, 'three'); - * } - * function myLastFunction(arg1, callback) { - * // arg1 now equals 'three' - * callback(null, 'done'); - * } - */ -var waterfall = function(tasks, callback) { - callback = once(callback || noop); - if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions')); - if (!tasks.length) return callback(); - var taskIndex = 0; - - function nextTask(args) { - var task = wrapAsync(tasks[taskIndex++]); - args.push(onlyOnce(next)); - task.apply(null, args); - } - - function next(err/*, ...args*/) { - if (err || taskIndex === tasks.length) { - return callback.apply(null, arguments); - } - nextTask(slice(arguments, 1)); - } - - nextTask([]); -}; - -/** - * An "async function" in the context of Async is an asynchronous function with - * a variable number of parameters, with the final parameter being a callback. - * (`function (arg1, arg2, ..., callback) {}`) - * The final callback is of the form `callback(err, results...)`, which must be - * called once the function is completed. The callback should be called with a - * Error as its first argument to signal that an error occurred. - * Otherwise, if no error occurred, it should be called with `null` as the first - * argument, and any additional `result` arguments that may apply, to signal - * successful completion. - * The callback must be called exactly once, ideally on a later tick of the - * JavaScript event loop. - * - * This type of function is also referred to as a "Node-style async function", - * or a "continuation passing-style function" (CPS). Most of the methods of this - * library are themselves CPS/Node-style async functions, or functions that - * return CPS/Node-style async functions. - * - * Wherever we accept a Node-style async function, we also directly accept an - * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}. - * In this case, the `async` function will not be passed a final callback - * argument, and any thrown error will be used as the `err` argument of the - * implicit callback, and the return value will be used as the `result` value. - * (i.e. a `rejected` of the returned Promise becomes the `err` callback - * argument, and a `resolved` value becomes the `result`.) - * - * Note, due to JavaScript limitations, we can only detect native `async` - * functions and not transpilied implementations. - * Your environment must have `async`/`await` support for this to work. - * (e.g. Node > v7.6, or a recent version of a modern browser). - * If you are using `async` functions through a transpiler (e.g. Babel), you - * must still wrap the function with [asyncify]{@link module:Utils.asyncify}, - * because the `async function` will be compiled to an ordinary function that - * returns a promise. - * - * @typedef {Function} AsyncFunction - * @static - */ - -/** - * Async is a utility module which provides straight-forward, powerful functions - * for working with asynchronous JavaScript. Although originally designed for - * use with [Node.js](http://nodejs.org) and installable via - * `npm install --save async`, it can also be used directly in the browser. - * @module async - * @see AsyncFunction - */ - - -/** - * A collection of `async` functions for manipulating collections, such as - * arrays and objects. - * @module Collections - */ - -/** - * A collection of `async` functions for controlling the flow through a script. - * @module ControlFlow - */ - -/** - * A collection of `async` utility functions. - * @module Utils - */ - -var index = { - apply: apply, - applyEach: applyEach, - applyEachSeries: applyEachSeries, - asyncify: asyncify, - auto: auto, - autoInject: autoInject, - cargo: cargo, - compose: compose, - concat: concat, - concatLimit: concatLimit, - concatSeries: concatSeries, - constant: constant, - detect: detect, - detectLimit: detectLimit, - detectSeries: detectSeries, - dir: dir, - doDuring: doDuring, - doUntil: doUntil, - doWhilst: doWhilst, - during: during, - each: eachLimit, - eachLimit: eachLimit$1, - eachOf: eachOf, - eachOfLimit: eachOfLimit, - eachOfSeries: eachOfSeries, - eachSeries: eachSeries, - ensureAsync: ensureAsync, - every: every, - everyLimit: everyLimit, - everySeries: everySeries, - filter: filter, - filterLimit: filterLimit, - filterSeries: filterSeries, - forever: forever, - groupBy: groupBy, - groupByLimit: groupByLimit, - groupBySeries: groupBySeries, - log: log, - map: map, - mapLimit: mapLimit, - mapSeries: mapSeries, - mapValues: mapValues, - mapValuesLimit: mapValuesLimit, - mapValuesSeries: mapValuesSeries, - memoize: memoize, - nextTick: nextTick, - parallel: parallelLimit, - parallelLimit: parallelLimit$1, - priorityQueue: priorityQueue, - queue: queue$1, - race: race, - reduce: reduce, - reduceRight: reduceRight, - reflect: reflect, - reflectAll: reflectAll, - reject: reject, - rejectLimit: rejectLimit, - rejectSeries: rejectSeries, - retry: retry, - retryable: retryable, - seq: seq, - series: series, - setImmediate: setImmediate$1, - some: some, - someLimit: someLimit, - someSeries: someSeries, - sortBy: sortBy, - timeout: timeout, - times: times, - timesLimit: timeLimit, - timesSeries: timesSeries, - transform: transform, - tryEach: tryEach, - unmemoize: unmemoize, - until: until, - waterfall: waterfall, - whilst: whilst, - - // aliases - all: every, - allLimit: everyLimit, - allSeries: everySeries, - any: some, - anyLimit: someLimit, - anySeries: someSeries, - find: detect, - findLimit: detectLimit, - findSeries: detectSeries, - forEach: eachLimit, - forEachSeries: eachSeries, - forEachLimit: eachLimit$1, - forEachOf: eachOf, - forEachOfSeries: eachOfSeries, - forEachOfLimit: eachOfLimit, - inject: reduce, - foldl: reduce, - foldr: reduceRight, - select: filter, - selectLimit: filterLimit, - selectSeries: filterSeries, - wrapSync: asyncify -}; - -exports['default'] = index; -exports.apply = apply; -exports.applyEach = applyEach; -exports.applyEachSeries = applyEachSeries; -exports.asyncify = asyncify; -exports.auto = auto; -exports.autoInject = autoInject; -exports.cargo = cargo; -exports.compose = compose; -exports.concat = concat; -exports.concatLimit = concatLimit; -exports.concatSeries = concatSeries; -exports.constant = constant; -exports.detect = detect; -exports.detectLimit = detectLimit; -exports.detectSeries = detectSeries; -exports.dir = dir; -exports.doDuring = doDuring; -exports.doUntil = doUntil; -exports.doWhilst = doWhilst; -exports.during = during; -exports.each = eachLimit; -exports.eachLimit = eachLimit$1; -exports.eachOf = eachOf; -exports.eachOfLimit = eachOfLimit; -exports.eachOfSeries = eachOfSeries; -exports.eachSeries = eachSeries; -exports.ensureAsync = ensureAsync; -exports.every = every; -exports.everyLimit = everyLimit; -exports.everySeries = everySeries; -exports.filter = filter; -exports.filterLimit = filterLimit; -exports.filterSeries = filterSeries; -exports.forever = forever; -exports.groupBy = groupBy; -exports.groupByLimit = groupByLimit; -exports.groupBySeries = groupBySeries; -exports.log = log; -exports.map = map; -exports.mapLimit = mapLimit; -exports.mapSeries = mapSeries; -exports.mapValues = mapValues; -exports.mapValuesLimit = mapValuesLimit; -exports.mapValuesSeries = mapValuesSeries; -exports.memoize = memoize; -exports.nextTick = nextTick; -exports.parallel = parallelLimit; -exports.parallelLimit = parallelLimit$1; -exports.priorityQueue = priorityQueue; -exports.queue = queue$1; -exports.race = race; -exports.reduce = reduce; -exports.reduceRight = reduceRight; -exports.reflect = reflect; -exports.reflectAll = reflectAll; -exports.reject = reject; -exports.rejectLimit = rejectLimit; -exports.rejectSeries = rejectSeries; -exports.retry = retry; -exports.retryable = retryable; -exports.seq = seq; -exports.series = series; -exports.setImmediate = setImmediate$1; -exports.some = some; -exports.someLimit = someLimit; -exports.someSeries = someSeries; -exports.sortBy = sortBy; -exports.timeout = timeout; -exports.times = times; -exports.timesLimit = timeLimit; -exports.timesSeries = timesSeries; -exports.transform = transform; -exports.tryEach = tryEach; -exports.unmemoize = unmemoize; -exports.until = until; -exports.waterfall = waterfall; -exports.whilst = whilst; -exports.all = every; -exports.allLimit = everyLimit; -exports.allSeries = everySeries; -exports.any = some; -exports.anyLimit = someLimit; -exports.anySeries = someSeries; -exports.find = detect; -exports.findLimit = detectLimit; -exports.findSeries = detectSeries; -exports.forEach = eachLimit; -exports.forEachSeries = eachSeries; -exports.forEachLimit = eachLimit$1; -exports.forEachOf = eachOf; -exports.forEachOfSeries = eachOfSeries; -exports.forEachOfLimit = eachOfLimit; -exports.inject = reduce; -exports.foldl = reduce; -exports.foldr = reduceRight; -exports.select = filter; -exports.selectLimit = filterLimit; -exports.selectSeries = filterSeries; -exports.wrapSync = asyncify; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); - -}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":4}],2:[function(require,module,exports){ -// Copyright (c) 2014 Takuya Asano All Rights Reserved. - -(function () { - - "use strict"; - - var TERM_CHAR = "\u0000", // terminal character - TERM_CODE = 0, // terminal character code - ROOT_ID = 0, // index of root node - NOT_FOUND = -1, // traverse() returns if no nodes found - BASE_SIGNED = true, - CHECK_SIGNED = true, - BASE_BYTES = 4, - CHECK_BYTES = 4, - MEMORY_EXPAND_RATIO = 2; - - - var newBC = function (initial_size) { - - if (initial_size == null) { - initial_size = 1024; - } - - var initBase = function (_base, start, end) { // 'end' index does not include - for (var i = start; i < end; i++) { - _base[i] = - i + 1; // inversed previous empty node index - } - if (0 < check.array[check.array.length - 1]) { - var last_used_id = check.array.length - 2; - while (0 < check.array[last_used_id]) { - last_used_id--; - } - _base[start] = - last_used_id; - } - }; - - var initCheck = function (_check, start, end) { - for (var i = start; i < end; i++) { - _check[i] = - i - 1; // inversed next empty node index - } - }; - - var realloc = function (min_size) { - // expand arrays size by given ratio - var new_size = min_size * MEMORY_EXPAND_RATIO; - // console.log('re-allocate memory to ' + new_size); - - var base_new_array = newArrayBuffer(base.signed, base.bytes, new_size); - initBase(base_new_array, base.array.length, new_size); // init BASE in new range - base_new_array.set(base.array); - base.array = null; // explicit GC - base.array = base_new_array; - - var check_new_array = newArrayBuffer(check.signed, check.bytes, new_size); - initCheck(check_new_array, check.array.length, new_size); // init CHECK in new range - check_new_array.set(check.array); - check.array = null; // explicit GC - check.array = check_new_array; - }; - - var first_unused_node = ROOT_ID + 1; - - var base = { - signed: BASE_SIGNED, - bytes: BASE_BYTES, - array: newArrayBuffer(BASE_SIGNED, BASE_BYTES, initial_size) - }; - - var check = { - signed: CHECK_SIGNED, - bytes: CHECK_BYTES, - array: newArrayBuffer(CHECK_SIGNED, CHECK_BYTES, initial_size) - }; - - // init root node - base.array[ROOT_ID] = 1; - check.array[ROOT_ID] = ROOT_ID; - - // init BASE - initBase(base.array, ROOT_ID + 1, base.array.length); - - // init CHECK - initCheck(check.array, ROOT_ID + 1, check.array.length); - - return { - getBaseBuffer: function () { - return base.array; - }, - getCheckBuffer: function () { - return check.array; - }, - loadBaseBuffer: function (base_buffer) { - base.array = base_buffer; - return this; - }, - loadCheckBuffer: function (check_buffer) { - check.array = check_buffer; - return this; - }, - size: function () { - return Math.max(base.array.length, check.array.length); - }, - getBase: function (index) { - if (base.array.length - 1 < index) { - return - index + 1; - // realloc(index); - } - // if (!Number.isFinite(base.array[index])) { - // console.log('getBase:' + index); - // throw 'getBase' + index; - // } - return base.array[index]; - }, - getCheck: function (index) { - if (check.array.length - 1 < index) { - return - index - 1; - // realloc(index); - } - // if (!Number.isFinite(check.array[index])) { - // console.log('getCheck:' + index); - // throw 'getCheck' + index; - // } - return check.array[index]; - }, - setBase: function (index, base_value) { - if (base.array.length - 1 < index) { - realloc(index); - } - base.array[index] = base_value; - }, - setCheck: function (index, check_value) { - if (check.array.length - 1 < index) { - realloc(index); - } - check.array[index] = check_value; - }, - setFirstUnusedNode: function (index) { - // if (!Number.isFinite(index)) { - // throw 'assertion error: setFirstUnusedNode ' + index + ' is not finite number'; - // } - first_unused_node = index; - }, - getFirstUnusedNode: function () { - // if (!Number.isFinite(first_unused_node)) { - // throw 'assertion error: getFirstUnusedNode ' + first_unused_node + ' is not finite number'; - // } - return first_unused_node; - }, - shrink: function () { - var last_index = this.size() - 1; - while (true) { - if (0 <= check.array[last_index]) { - break; - } - last_index--; - } - base.array = base.array.subarray(0, last_index + 2); // keep last unused node - check.array = check.array.subarray(0, last_index + 2); // keep last unused node - }, - calc: function () { - var unused_count = 0; - var size = check.array.length; - for (var i = 0; i < size; i++) { - if (check.array[i] < 0) { - unused_count++; - } - } - return { - all: size, - unused: unused_count, - efficiency: (size - unused_count) / size - }; - }, - dump: function () { - // for debug - var dump_base = ""; - var dump_check = ""; - - var i; - for (i = 0; i < base.array.length; i++) { - dump_base = dump_base + " " + this.getBase(i); - } - for (i = 0; i < check.array.length; i++) { - dump_check = dump_check + " " + this.getCheck(i); - } - - console.log("base:" + dump_base); - console.log("chck:" + dump_check); - - return "base:" + dump_base + " chck:" + dump_check; - } - }; - }; - - - /** - * Factory method of double array - */ - function DoubleArrayBuilder(initial_size) { - this.bc = newBC(initial_size); // BASE and CHECK - this.keys = []; - } - - - /** - * Append a key to initialize set - * (This method should be called by dictionary ordered key) - * - * @param {String} key - * @param {Number} value Integer value from 0 to max signed integer number - 1 - */ - DoubleArrayBuilder.prototype.append = function (key, record) { - this.keys.push({ k: key, v: record }); - return this; - }; - - /** - * Build double array for given keys - * - * @param {Array} keys Array of keys. A key is a Object which has properties 'k', 'v'. - * 'k' is a key string, 'v' is a record assigned to that key. - * @return {DoubleArray} Compiled double array - */ - DoubleArrayBuilder.prototype.build = function (keys, sorted) { - - if (keys == null) { - keys = this.keys; - } - - if (keys == null) { - return new DoubleArray(this.bc); - } - - if (sorted == null) { - sorted = false; - } - - // Convert key string to ArrayBuffer - var buff_keys = - keys.map(function (k) { - return { - k: stringToUtf8Bytes(k.k + TERM_CHAR), - v: k.v - }; - }); - - // Sort keys by byte order - if (sorted) { - this.keys = buff_keys; - } else { - this.keys = - buff_keys.sort(function (k1, k2) { - var b1 = k1.k; - var b2 = k2.k; - var min_length = Math.min(b1.length, b2.length); - for (var pos = 0; pos < min_length; pos++) { - if (b1[pos] === b2[pos]) { - continue; - } - return b1[pos] - b2[pos]; - } - return b1.length - b2.length; - }); - } - - buff_keys = null; // explicit GC - - this._build(ROOT_ID, 0, 0, this.keys.length); - return new DoubleArray(this.bc); - }; - - /** - * Append nodes to BASE and CHECK array recursively - */ - DoubleArrayBuilder.prototype._build = function (parent_index, position, start, length) { - - var children_info = this.getChildrenInfo(position, start, length); - var _base = this.findAllocatableBase(children_info); - - this.setBC(parent_index, children_info, _base); - - for (var i = 0; i < children_info.length; i = i + 3) { - var child_code = children_info[i]; - if (child_code === TERM_CODE) { - continue; - } - var child_start = children_info[i + 1]; - var child_len = children_info[i + 2]; - var child_index = _base + child_code; - this._build(child_index, position + 1, child_start, child_len); - } - }; - - DoubleArrayBuilder.prototype.getChildrenInfo = function (position, start, length) { - var current_char = this.keys[start].k[position]; - var i = 0; - var children_info = new Int32Array(length * 3); - - children_info[i++] = current_char; // char (current) - children_info[i++] = start; // start index (current) - - var next_pos = start; - var start_pos = start; - for (; next_pos < start + length; next_pos++) { - var next_char = this.keys[next_pos].k[position]; - if (current_char !== next_char) { - children_info[i++] = next_pos - start_pos; // length (current) - - children_info[i++] = next_char; // char (next) - children_info[i++] = next_pos; // start index (next) - current_char = next_char; - start_pos = next_pos; - } - } - children_info[i++] = next_pos - start_pos; - children_info = children_info.subarray(0, i); - - return children_info; - }; - - DoubleArrayBuilder.prototype.setBC = function (parent_id, children_info, _base) { - - var bc = this.bc; - - bc.setBase(parent_id, _base); // Update BASE of parent node - - var i; - for (i = 0; i < children_info.length; i = i + 3) { - var code = children_info[i]; - var child_id = _base + code; - - // Update linked list of unused nodes - - // Assertion - // if (child_id < 0) { - // throw 'assertion error: child_id is negative' - // } - - var prev_unused_id = - bc.getBase(child_id); - var next_unused_id = - bc.getCheck(child_id); - // if (prev_unused_id < 0) { - // throw 'assertion error: setBC' - // } - // if (next_unused_id < 0) { - // throw 'assertion error: setBC' - // } - if (child_id !== bc.getFirstUnusedNode()) { - bc.setCheck(prev_unused_id, - next_unused_id); - } else { - // Update first_unused_node - bc.setFirstUnusedNode(next_unused_id); - } - bc.setBase(next_unused_id, - prev_unused_id); - - var check = parent_id; // CHECK is parent node index - bc.setCheck(child_id, check); // Update CHECK of child node - - // Update record - if (code === TERM_CODE) { - var start_pos = children_info[i + 1]; - // var len = children_info[i + 2]; - // if (len != 1) { - // throw 'assertion error: there are multiple terminal nodes. len:' + len; - // } - var value = this.keys[start_pos].v; - - if (value == null) { - value = 0; - } - - var base = - value - 1; // BASE is inverted record value - bc.setBase(child_id, base); // Update BASE of child(leaf) node - } - } - }; - - - /** - * Find BASE value that all children are allocatable in double array's region - */ - DoubleArrayBuilder.prototype.findAllocatableBase = function (children_info) { - - var bc = this.bc; - - // Assertion: keys are sorted by byte order - // var c = -1; - // for (var i = 0; i < children_info.length; i = i + 3) { - // if (children_info[i] < c) { - // throw 'assertion error: not sort key' - // } - // c = children_info[i]; - // } - - // iterate linked list of unused nodes - var _base; - var curr = bc.getFirstUnusedNode(); // current index - // if (curr < 0) { - // throw 'assertion error: getFirstUnusedNode returns negative value' - // } - - while (true) { - _base = curr - children_info[0]; - - if (_base < 0) { - curr = - bc.getCheck(curr); // next - - // if (curr < 0) { - // throw 'assertion error: getCheck returns negative value' - // } - - continue; - } - - var empty_area_found = true; - for (var i = 0; i < children_info.length; i = i + 3) { - var code = children_info[i]; - var candidate_id = _base + code; - - if (!this.isUnusedNode(candidate_id)) { - // candidate_id is used node - // next - curr = - bc.getCheck(curr); - // if (curr < 0) { - // throw 'assertion error: getCheck returns negative value' - // } - - empty_area_found = false; - break; - } - } - if (empty_area_found) { - // Area is free - return _base; - } - } - }; - - /** - * Check this double array index is unused or not - */ - DoubleArrayBuilder.prototype.isUnusedNode = function (index) { - var bc = this.bc; - var check = bc.getCheck(index); - - // if (index < 0) { - // throw 'assertion error: isUnusedNode index:' + index; - // } - - if (index === ROOT_ID) { - // root node - return false; - } - if (check < 0) { - // unused - return true; - } - - // used node (incl. leaf) - return false; - }; - - - /** - * Factory method of double array - */ - function DoubleArray(bc) { - this.bc = bc; // BASE and CHECK - this.bc.shrink(); - } - - - /** - * Look up a given key in this trie - * - * @param {String} key - * @return {Boolean} True if this trie contains a given key - */ - DoubleArray.prototype.contain = function (key) { - - var bc = this.bc; - - key += TERM_CHAR; - var buffer = stringToUtf8Bytes(key); - - var parent = ROOT_ID; - var child = NOT_FOUND; - - for (var i = 0; i < buffer.length; i++) { - var code = buffer[i]; - - child = this.traverse(parent, code); - if (child === NOT_FOUND) { - return false; - } - - if (bc.getBase(child) <= 0) { - // leaf node - return true; - } else { - // not leaf - parent = child; - continue; - } - } - return false; - }; - - - /** - * Look up a given key in this trie - * - * @param {String} key - * @return {Number} Record value assgned to this key, -1 if this key does not contain - */ - DoubleArray.prototype.lookup = function (key) { - - key += TERM_CHAR; - var buffer = stringToUtf8Bytes(key); - - var parent = ROOT_ID; - var child = NOT_FOUND; - - for (var i = 0; i < buffer.length; i++) { - var code = buffer[i]; - child = this.traverse(parent, code); - if (child === NOT_FOUND) { - return NOT_FOUND; - } - parent = child; - } - - var base = this.bc.getBase(child); - if (base <= 0) { - // leaf node - return - base - 1; - } else { - // not leaf - return NOT_FOUND; - } - }; - - - /** - * Common prefix search - * - * @param {String} key - * @return {Array} Each result object has 'k' and 'v' (key and record, - * respectively) properties assigned to matched string - */ - DoubleArray.prototype.commonPrefixSearch = function (key) { - - var buffer = stringToUtf8Bytes(key); - - var parent = ROOT_ID; - var child = NOT_FOUND; - - var result = []; - - for (var i = 0; i < buffer.length; i++) { - var code = buffer[i]; - - child = this.traverse(parent, code); - - if (child !== NOT_FOUND) { - parent = child; - - // look forward by terminal character code to check this node is a leaf or not - var grand_child = this.traverse(child, TERM_CODE); - - if (grand_child !== NOT_FOUND) { - var base = this.bc.getBase(grand_child); - - var r = {}; - - if (base <= 0) { - // If child is a leaf node, add record to result - r.v = - base - 1; - } - - // If child is a leaf node, add word to result - r.k = utf8BytesToString(arrayCopy(buffer, 0, i + 1)); - - result.push(r); - } - continue; - } else { - break; - } - } - - return result; - }; - - DoubleArray.prototype.traverse = function (parent, code) { - var child = this.bc.getBase(parent) + code; - if (this.bc.getCheck(child) === parent) { - return child; - } else { - return NOT_FOUND; - } - }; - - DoubleArray.prototype.size = function () { - return this.bc.size(); - }; - - DoubleArray.prototype.calc = function () { - return this.bc.calc(); - }; - - DoubleArray.prototype.dump = function () { - return this.bc.dump(); - }; - - - // Array utility functions - - var newArrayBuffer = function (signed, bytes, size) { - if (signed) { - switch(bytes) { - case 1: - return new Int8Array(size); - case 2: - return new Int16Array(size); - case 4: - return new Int32Array(size); - default: - throw new RangeError("Invalid newArray parameter element_bytes:" + bytes); - } - } else { - switch(bytes) { - case 1: - return new Uint8Array(size); - case 2: - return new Uint16Array(size); - case 4: - return new Uint32Array(size); - default: - throw new RangeError("Invalid newArray parameter element_bytes:" + bytes); - } - } - }; - - var arrayCopy = function (src, src_offset, length) { - var buffer = new ArrayBuffer(length); - var dstU8 = new Uint8Array(buffer, 0, length); - var srcU8 = src.subarray(src_offset, length); - dstU8.set(srcU8); - return dstU8; - }; - - - /** - * Convert String (UTF-16) to UTF-8 ArrayBuffer - * - * @param {String} str UTF-16 string to convert - * @return {Uint8Array} Byte sequence encoded by UTF-8 - */ - var stringToUtf8Bytes = function (str) { - - // Max size of 1 character is 4 bytes - var bytes = new Uint8Array(new ArrayBuffer(str.length * 4)); - - var i = 0, j = 0; - - while (i < str.length) { - var unicode_code; - - var utf16_code = str.charCodeAt(i++); - if (utf16_code >= 0xD800 && utf16_code <= 0xDBFF) { - // surrogate pair - var upper = utf16_code; // high surrogate - var lower = str.charCodeAt(i++); // low surrogate - - if (lower >= 0xDC00 && lower <= 0xDFFF) { - unicode_code = - (upper - 0xD800) * (1 << 10) + (1 << 16) + - (lower - 0xDC00); - } else { - // malformed surrogate pair - return null; - } - } else { - // not surrogate code - unicode_code = utf16_code; - } - - if (unicode_code < 0x80) { - // 1-byte - bytes[j++] = unicode_code; - - } else if (unicode_code < (1 << 11)) { - // 2-byte - bytes[j++] = (unicode_code >>> 6) | 0xC0; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else if (unicode_code < (1 << 16)) { - // 3-byte - bytes[j++] = (unicode_code >>> 12) | 0xE0; - bytes[j++] = ((unicode_code >> 6) & 0x3f) | 0x80; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else if (unicode_code < (1 << 21)) { - // 4-byte - bytes[j++] = (unicode_code >>> 18) | 0xF0; - bytes[j++] = ((unicode_code >> 12) & 0x3F) | 0x80; - bytes[j++] = ((unicode_code >> 6) & 0x3F) | 0x80; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else { - // malformed UCS4 code - } - } - - return bytes.subarray(0, j); - }; - - - /** - * Convert UTF-8 ArrayBuffer to String (UTF-16) - * - * @param {Uint8Array} bytes UTF-8 byte sequence to convert - * @return {String} String encoded by UTF-16 - */ - var utf8BytesToString = function (bytes) { - - var str = ""; - var code, b1, b2, b3, b4, upper, lower; - var i = 0; - - while (i < bytes.length) { - - b1 = bytes[i++]; - - if (b1 < 0x80) { - // 1 byte - code = b1; - } else if ((b1 >> 5) === 0x06) { - // 2 bytes - b2 = bytes[i++]; - code = ((b1 & 0x1f) << 6) | (b2 & 0x3f); - } else if ((b1 >> 4) === 0x0e) { - // 3 bytes - b2 = bytes[i++]; - b3 = bytes[i++]; - code = ((b1 & 0x0f) << 12) | ((b2 & 0x3f) << 6) | (b3 & 0x3f); - } else { - // 4 bytes - b2 = bytes[i++]; - b3 = bytes[i++]; - b4 = bytes[i++]; - code = ((b1 & 0x07) << 18) | ((b2 & 0x3f) << 12) | ((b3 & 0x3f) << 6) | (b4 & 0x3f); - } - - if (code < 0x10000) { - str += String.fromCharCode(code); - } else { - // surrogate pair - code -= 0x10000; - upper = (0xD800 | (code >> 10)); - lower = (0xDC00 | (code & 0x3FF)); - str += String.fromCharCode(upper, lower); - } - } - - return str; - }; - - - // public methods - var doublearray = { - builder: function (initial_size) { - return new DoubleArrayBuilder(initial_size); - }, - load: function (base_buffer, check_buffer) { - var bc = newBC(0); - bc.loadBaseBuffer(base_buffer); - bc.loadCheckBuffer(check_buffer); - return new DoubleArray(bc); - } - }; - - if ("undefined" === typeof module) { - // In browser - window.doublearray = doublearray; - } else { - // In node - module.exports = doublearray; - } - -})(); - -},{}],3:[function(require,module,exports){ -(function (process){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -}).call(this,require('_process')) -},{"_process":4}],4:[function(require,module,exports){ -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; - -process.listeners = function (name) { return [] } - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],5:[function(require,module,exports){ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';function n(e){throw e;}var p=void 0,aa=this;function t(e,b){var d=e.split("."),c=aa;!(d[0]in c)&&c.execScript&&c.execScript("var "+d[0]);for(var a;d.length&&(a=d.shift());)!d.length&&b!==p?c[a]=b:c=c[a]?c[a]:c[a]={}};var x="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array&&"undefined"!==typeof DataView;new (x?Uint8Array:Array)(256);var y;for(y=0;256>y;++y)for(var A=y,ba=7,A=A>>>1;A;A>>>=1)--ba;function B(e,b,d){var c,a="number"===typeof b?b:b=0,f="number"===typeof d?d:e.length;c=-1;for(a=f&7;a--;++b)c=c>>>8^C[(c^e[b])&255];for(a=f>>3;a--;b+=8)c=c>>>8^C[(c^e[b])&255],c=c>>>8^C[(c^e[b+1])&255],c=c>>>8^C[(c^e[b+2])&255],c=c>>>8^C[(c^e[b+3])&255],c=c>>>8^C[(c^e[b+4])&255],c=c>>>8^C[(c^e[b+5])&255],c=c>>>8^C[(c^e[b+6])&255],c=c>>>8^C[(c^e[b+7])&255];return(c^4294967295)>>>0} -var D=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759, -2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977, -2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755, -2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956, -3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270, -936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=x?new Uint32Array(D):D;function E(){}E.prototype.getName=function(){return this.name};E.prototype.getData=function(){return this.data};E.prototype.G=function(){return this.H};function G(e){var b=e.length,d=0,c=Number.POSITIVE_INFINITY,a,f,k,l,m,r,q,g,h,v;for(g=0;gd&&(d=e[g]),e[g]>=1;v=k<<16|g;for(h=r;hK;K++)switch(!0){case 143>=K:J.push([K+48,8]);break;case 255>=K:J.push([K-144+400,9]);break;case 279>=K:J.push([K-256+0,7]);break;case 287>=K:J.push([K-280+192,8]);break;default:n("invalid literal: "+K)} -var ca=function(){function e(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272, -a-31,2];case 42>=a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:n("invalid length: "+a)}}var b=[],d,c;for(d=3;258>=d;d++)c=e(d),b[d]=c[2]<<24|c[1]<< -16|c[0];return b}();x&&new Uint32Array(ca);function L(e,b){this.i=[];this.j=32768;this.d=this.f=this.c=this.n=0;this.input=x?new Uint8Array(e):e;this.o=!1;this.k=M;this.w=!1;if(b||!(b={}))b.index&&(this.c=b.index),b.bufferSize&&(this.j=b.bufferSize),b.bufferType&&(this.k=b.bufferType),b.resize&&(this.w=b.resize);switch(this.k){case N:this.a=32768;this.b=new (x?Uint8Array:Array)(32768+this.j+258);break;case M:this.a=0;this.b=new (x?Uint8Array:Array)(this.j);this.e=this.D;this.q=this.A;this.l=this.C;break;default:n(Error("invalid inflate mode"))}} -var N=0,M=1; -L.prototype.g=function(){for(;!this.o;){var e=P(this,3);e&1&&(this.o=!0);e>>>=1;switch(e){case 0:var b=this.input,d=this.c,c=this.b,a=this.a,f=b.length,k=p,l=p,m=c.length,r=p;this.d=this.f=0;d+1>=f&&n(Error("invalid uncompressed block header: LEN"));k=b[d++]|b[d++]<<8;d+1>=f&&n(Error("invalid uncompressed block header: NLEN"));l=b[d++]|b[d++]<<8;k===~l&&n(Error("invalid uncompressed block header: length verify"));d+k>b.length&&n(Error("input buffer is broken"));switch(this.k){case N:for(;a+k>c.length;){r= -m-a;k-=r;if(x)c.set(b.subarray(d,d+r),a),a+=r,d+=r;else for(;r--;)c[a++]=b[d++];this.a=a;c=this.e();a=this.a}break;case M:for(;a+k>c.length;)c=this.e({t:2});break;default:n(Error("invalid inflate mode"))}if(x)c.set(b.subarray(d,d+k),a),a+=k,d+=k;else for(;k--;)c[a++]=b[d++];this.c=d;this.a=a;this.b=c;break;case 1:this.l(da,ea);break;case 2:for(var q=P(this,5)+257,g=P(this,5)+1,h=P(this,4)+4,v=new (x?Uint8Array:Array)(Q.length),s=p,F=p,H=p,w=p,z=p,O=p,I=p,u=p,Z=p,u=0;u=W?8:255>=W?9:279>=W?7:8;var da=G(V),X=new (x?Uint8Array:Array)(30),Y,ma;Y=0;for(ma=X.length;Y=k&&n(Error("input buffer is broken")),d|=a[f++]<>>b;e.d=c-b;e.c=f;return l} -function R(e,b){for(var d=e.f,c=e.d,a=e.input,f=e.c,k=a.length,l=b[0],m=b[1],r,q;c=k);)d|=a[f++]<>>16;q>c&&n(Error("invalid code length: "+q));e.f=d>>q;e.d=c-q;e.c=f;return r&65535} -L.prototype.l=function(e,b){var d=this.b,c=this.a;this.r=e;for(var a=d.length-258,f,k,l,m;256!==(f=R(this,e));)if(256>f)c>=a&&(this.a=c,d=this.e(),c=this.a),d[c++]=f;else{k=f-257;m=ga[k];0=a&&(this.a=c,d=this.e(),c=this.a);for(;m--;)d[c]=d[c++-l]}for(;8<=this.d;)this.d-=8,this.c--;this.a=c}; -L.prototype.C=function(e,b){var d=this.b,c=this.a;this.r=e;for(var a=d.length,f,k,l,m;256!==(f=R(this,e));)if(256>f)c>=a&&(d=this.e(),a=d.length),d[c++]=f;else{k=f-257;m=ga[k];0a&&(d=this.e(),a=d.length);for(;m--;)d[c]=d[c++-l]}for(;8<=this.d;)this.d-=8,this.c--;this.a=c}; -L.prototype.e=function(){var e=new (x?Uint8Array:Array)(this.a-32768),b=this.a-32768,d,c,a=this.b;if(x)e.set(a.subarray(32768,e.length));else{d=0;for(c=e.length;dd;++d)a[d]=a[b+d];this.a=32768;return a}; -L.prototype.D=function(e){var b,d=this.input.length/this.c+1|0,c,a,f,k=this.input,l=this.b;e&&("number"===typeof e.t&&(d=e.t),"number"===typeof e.z&&(d+=e.z));2>d?(c=(k.length-this.c)/this.r[2],f=258*(c/2)|0,a=fb&&(this.b.length=b),e=this.b);return this.buffer=e};function $(e){this.input=e;this.c=0;this.m=[];this.s=!1}$.prototype.F=function(){this.s||this.g();return this.m.slice()}; -$.prototype.g=function(){for(var e=this.input.length;this.c>>0;B(a,p,p)!==q&&n(Error("invalid CRC-32 checksum: 0x"+B(a,p,p).toString(16)+" / 0x"+q.toString(16)));b.L= -d=(g[h++]|g[h++]<<8|g[h++]<<16|g[h++]<<24)>>>0;(a.length&4294967295)!==d&&n(Error("invalid input size: "+(a.length&4294967295)+" / "+d));this.m.push(b);this.c=h}this.s=!0;var v=this.m,s,F,H=0,w=0,z;s=0;for(F=v.length;s} Sentences end with punctuation - */ -Tokenizer.splitByPunctuation = function (input) { - var sentences = []; - var tail = input; - while (true) { - if (tail === "") { - break; - } - var index = tail.search(PUNCTUATION); - if (index < 0) { - sentences.push(tail); - break; - } - sentences.push(tail.substring(0, index + 1)); - tail = tail.substring(index + 1); - } - return sentences; -}; - -/** - * Tokenize text - * @param {string} text Input text to analyze - * @returns {Array} Tokens - */ -Tokenizer.prototype.tokenize = function (text) { - var sentences = Tokenizer.splitByPunctuation(text); - var tokens = []; - for (var i = 0; i < sentences.length; i++) { - var sentence = sentences[i]; - this.tokenizeForSentence(sentence, tokens); - } - return tokens; -}; - -Tokenizer.prototype.tokenizeForSentence = function (sentence, tokens) { - if (tokens == null) { - tokens = []; - } - var lattice = this.getLattice(sentence); - var best_path = this.viterbi_searcher.search(lattice); - var last_pos = 0; - if (tokens.length > 0) { - last_pos = tokens[tokens.length - 1].word_position; - } - - for (var j = 0; j < best_path.length; j++) { - var node = best_path[j]; - - var token, features, features_line; - if (node.type === "KNOWN") { - features_line = this.token_info_dictionary.getFeatures(node.name); - if (features_line == null) { - features = []; - } else { - features = features_line.split(","); - } - token = this.formatter.formatEntry(node.name, last_pos + node.start_pos, node.type, features); - } else if (node.type === "UNKNOWN") { - // Unknown word - features_line = this.unknown_dictionary.getFeatures(node.name); - if (features_line == null) { - features = []; - } else { - features = features_line.split(","); - } - token = this.formatter.formatUnknownEntry(node.name, last_pos + node.start_pos, node.type, features, node.surface_form); - } else { - // TODO User dictionary - token = this.formatter.formatEntry(node.name, last_pos + node.start_pos, node.type, []); - } - - tokens.push(token); - } - - return tokens; -}; - -/** - * Build word lattice - * @param {string} text Input text to analyze - * @returns {ViterbiLattice} Word lattice - */ -Tokenizer.prototype.getLattice = function (text) { - return this.viterbi_builder.build(text); -}; - -module.exports = Tokenizer; - -},{"./util/IpadicFormatter":22,"./viterbi/ViterbiBuilder":24,"./viterbi/ViterbiSearcher":27}],7:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var Tokenizer = require("./Tokenizer"); -var DictionaryLoader = require("./loader/NodeDictionaryLoader"); - -/** - * TokenizerBuilder create Tokenizer instance. - * @param {Object} option JSON object which have key-value pairs settings - * @param {string} option.dicPath Dictionary directory path (or URL using in browser) - * @constructor - */ -function TokenizerBuilder(option) { - if (option.dicPath == null) { - this.dic_path = "dict/"; - } else { - this.dic_path = option.dicPath; - } -} - -/** - * Build Tokenizer instance by asynchronous manner - * @param {TokenizerBuilder~onLoad} callback Callback function - */ -TokenizerBuilder.prototype.build = function (callback) { - var loader = new DictionaryLoader(this.dic_path); - loader.load(function (err, dic) { - callback(err, new Tokenizer(dic)); - }); -}; - -/** - * Callback used by build - * @callback TokenizerBuilder~onLoad - * @param {Object} err Error object - * @param {Tokenizer} tokenizer Prepared Tokenizer - */ - -module.exports = TokenizerBuilder; - -},{"./Tokenizer":6,"./loader/NodeDictionaryLoader":19}],8:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * CharacterClass - * @param {number} class_id - * @param {string} class_name - * @param {boolean} is_always_invoke - * @param {boolean} is_grouping - * @param {number} max_length - * @constructor - */ -function CharacterClass(class_id, class_name, is_always_invoke, is_grouping, max_length) { - this.class_id = class_id; - this.class_name = class_name; - this.is_always_invoke = is_always_invoke; - this.is_grouping = is_grouping; - this.max_length = max_length; -} - -module.exports = CharacterClass; - -},{}],9:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var InvokeDefinitionMap = require("./InvokeDefinitionMap"); -var CharacterClass = require("./CharacterClass"); -var SurrogateAwareString = require("../util/SurrogateAwareString"); - -var DEFAULT_CATEGORY = "DEFAULT"; - -/** - * CharacterDefinition represents char.def file and - * defines behavior of unknown word processing - * @constructor - */ -function CharacterDefinition() { - this.character_category_map = new Uint8Array(65536); // for all UCS2 code points - this.compatible_category_map = new Uint32Array(65536); // for all UCS2 code points - this.invoke_definition_map = null; -} - -/** - * Load CharacterDefinition - * @param {Uint8Array} cat_map_buffer - * @param {Uint32Array} compat_cat_map_buffer - * @param {InvokeDefinitionMap} invoke_def_buffer - * @returns {CharacterDefinition} - */ -CharacterDefinition.load = function (cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer) { - var char_def = new CharacterDefinition(); - char_def.character_category_map = cat_map_buffer; - char_def.compatible_category_map = compat_cat_map_buffer; - char_def.invoke_definition_map = InvokeDefinitionMap.load(invoke_def_buffer); - return char_def; -}; - -CharacterDefinition.parseCharCategory = function (class_id, parsed_category_def) { - var category = parsed_category_def[1]; - var invoke = parseInt(parsed_category_def[2]); - var grouping = parseInt(parsed_category_def[3]); - var max_length = parseInt(parsed_category_def[4]); - if (!isFinite(invoke) || (invoke !== 0 && invoke !== 1)) { - console.log("char.def parse error. INVOKE is 0 or 1 in:" + invoke); - return null; - } - if (!isFinite(grouping) || (grouping !== 0 && grouping !== 1)) { - console.log("char.def parse error. GROUP is 0 or 1 in:" + grouping); - return null; - } - if (!isFinite(max_length) || max_length < 0) { - console.log("char.def parse error. LENGTH is 1 to n:" + max_length); - return null; - } - var is_invoke = (invoke === 1); - var is_grouping = (grouping === 1); - - return new CharacterClass(class_id, category, is_invoke, is_grouping, max_length); -}; - -CharacterDefinition.parseCategoryMapping = function (parsed_category_mapping) { - var start = parseInt(parsed_category_mapping[1]); - var default_category = parsed_category_mapping[2]; - var compatible_category = (3 < parsed_category_mapping.length) ? parsed_category_mapping.slice(3) : []; - if (!isFinite(start) || start < 0 || start > 0xFFFF) { - console.log("char.def parse error. CODE is invalid:" + start); - } - return { start: start, default: default_category, compatible: compatible_category}; -}; - -CharacterDefinition.parseRangeCategoryMapping = function (parsed_category_mapping) { - var start = parseInt(parsed_category_mapping[1]); - var end = parseInt(parsed_category_mapping[2]); - var default_category = parsed_category_mapping[3]; - var compatible_category = (4 < parsed_category_mapping.length) ? parsed_category_mapping.slice(4) : []; - if (!isFinite(start) || start < 0 || start > 0xFFFF) { - console.log("char.def parse error. CODE is invalid:" + start); - } - if (!isFinite(end) || end < 0 || end > 0xFFFF) { - console.log("char.def parse error. CODE is invalid:" + end); - } - return { start: start, end: end, default: default_category, compatible: compatible_category}; -}; - -/** - * Initializing method - * @param {Array} category_mapping Array of category mapping - */ -CharacterDefinition.prototype.initCategoryMappings = function (category_mapping) { - // Initialize map by DEFAULT class - var code_point; - if (category_mapping != null) { - for (var i = 0; i < category_mapping.length; i++) { - var mapping = category_mapping[i]; - var end = mapping.end || mapping.start; - for (code_point = mapping.start; code_point <= end; code_point++) { - - // Default Category class ID - this.character_category_map[code_point] = this.invoke_definition_map.lookup(mapping.default); - - for (var j = 0; j < mapping.compatible.length; j++) { - var bitset = this.compatible_category_map[code_point]; - var compatible_category = mapping.compatible[j]; - if (compatible_category == null) { - continue; - } - var class_id = this.invoke_definition_map.lookup(compatible_category); // Default Category - if (class_id == null) { - continue; - } - var class_id_bit = 1 << class_id; - bitset = bitset | class_id_bit; // Set a bit of class ID 例えば、class_idが3のとき、3ビット目に1を立てる - this.compatible_category_map[code_point] = bitset; - } - } - } - } - var default_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); - if (default_id == null) { - return; - } - for (code_point = 0; code_point < this.character_category_map.length; code_point++) { - // 他に何のクラスも定義されていなかったときだけ DEFAULT - if (this.character_category_map[code_point] === 0) { - // DEFAULT class ID に対応するビットだけ1を立てる - this.character_category_map[code_point] = 1 << default_id; - } - } -}; - -/** - * Lookup compatible categories for a character (not included 1st category) - * @param {string} ch UCS2 character (just 1st character is effective) - * @returns {Array.} character classes - */ -CharacterDefinition.prototype.lookupCompatibleCategory = function (ch) { - var classes = []; - - /* - if (SurrogateAwareString.isSurrogatePair(ch)) { - // Surrogate pair character codes can not be defined by char.def - return classes; - }*/ - var code = ch.charCodeAt(0); - var integer; - if (code < this.compatible_category_map.length) { - integer = this.compatible_category_map[code]; // Bitset - } - - if (integer == null || integer === 0) { - return classes; - } - - for (var bit = 0; bit < 32; bit++) { // Treat "bit" as a class ID - if (((integer << (31 - bit)) >>> 31) === 1) { - var character_class = this.invoke_definition_map.getCharacterClass(bit); - if (character_class == null) { - continue; - } - classes.push(character_class); - } - } - return classes; -}; - - -/** - * Lookup category for a character - * @param {string} ch UCS2 character (just 1st character is effective) - * @returns {CharacterClass} character class - */ -CharacterDefinition.prototype.lookup = function (ch) { - - var class_id; - - var code = ch.charCodeAt(0); - if (SurrogateAwareString.isSurrogatePair(ch)) { - // Surrogate pair character codes can not be defined by char.def, so set DEFAULT category - class_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); - } else if (code < this.character_category_map.length) { - class_id = this.character_category_map[code]; // Read as integer value - } - - if (class_id == null) { - class_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); - } - - return this.invoke_definition_map.getCharacterClass(class_id); -}; - -module.exports = CharacterDefinition; - -},{"../util/SurrogateAwareString":23,"./CharacterClass":8,"./InvokeDefinitionMap":12}],10:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * Connection costs matrix from cc.dat file. - * 2 dimension matrix [forward_id][backward_id] -> cost - * @constructor - * @param {number} forward_dimension - * @param {number} backward_dimension - */ -function ConnectionCosts(forward_dimension, backward_dimension) { - this.forward_dimension = forward_dimension; - this.backward_dimension = backward_dimension; - - // leading 2 integers for forward_dimension, backward_dimension, respectively - this.buffer = new Int16Array(forward_dimension * backward_dimension + 2); - this.buffer[0] = forward_dimension; - this.buffer[1] = backward_dimension; -} - -ConnectionCosts.prototype.put = function (forward_id, backward_id, cost) { - var index = forward_id * this.backward_dimension + backward_id + 2; - if (this.buffer.length < index + 1) { - throw "ConnectionCosts buffer overflow"; - } - this.buffer[index] = cost; -}; - -ConnectionCosts.prototype.get = function (forward_id, backward_id) { - var index = forward_id * this.backward_dimension + backward_id + 2; - if (this.buffer.length < index + 1) { - throw "ConnectionCosts buffer overflow"; - } - return this.buffer[index]; -}; - -ConnectionCosts.prototype.loadConnectionCosts = function (connection_costs_buffer) { - this.forward_dimension = connection_costs_buffer[0]; - this.backward_dimension = connection_costs_buffer[1]; - this.buffer = connection_costs_buffer; -}; - -module.exports = ConnectionCosts; - -},{}],11:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var doublearray = require("doublearray"); -var TokenInfoDictionary = require("./TokenInfoDictionary"); -var ConnectionCosts = require("./ConnectionCosts"); -var UnknownDictionary = require("./UnknownDictionary"); - -/** - * Dictionaries container for Tokenizer - * @param {DoubleArray} trie - * @param {TokenInfoDictionary} token_info_dictionary - * @param {ConnectionCosts} connection_costs - * @param {UnknownDictionary} unknown_dictionary - * @constructor - */ -function DynamicDictionaries(trie, token_info_dictionary, connection_costs, unknown_dictionary) { - if (trie != null) { - this.trie = trie; - } else { - this.trie = doublearray.builder(0).build([ - {k: "", v: 1} - ]); - } - if (token_info_dictionary != null) { - this.token_info_dictionary = token_info_dictionary; - } else { - this.token_info_dictionary = new TokenInfoDictionary(); - } - if (connection_costs != null) { - this.connection_costs = connection_costs; - } else { - // backward_size * backward_size - this.connection_costs = new ConnectionCosts(0, 0); - } - if (unknown_dictionary != null) { - this.unknown_dictionary = unknown_dictionary; - } else { - this.unknown_dictionary = new UnknownDictionary(); - } -} - -// from base.dat & check.dat -DynamicDictionaries.prototype.loadTrie = function (base_buffer, check_buffer) { - this.trie = doublearray.load(base_buffer, check_buffer); - return this; -}; - -DynamicDictionaries.prototype.loadTokenInfoDictionaries = function (token_info_buffer, pos_buffer, target_map_buffer) { - this.token_info_dictionary.loadDictionary(token_info_buffer); - this.token_info_dictionary.loadPosVector(pos_buffer); - this.token_info_dictionary.loadTargetMap(target_map_buffer); - return this; -}; - -DynamicDictionaries.prototype.loadConnectionCosts = function (cc_buffer) { - this.connection_costs.loadConnectionCosts(cc_buffer); - return this; -}; - -DynamicDictionaries.prototype.loadUnknownDictionaries = function (unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer) { - this.unknown_dictionary.loadUnknownDictionaries(unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer); - return this; -}; - -module.exports = DynamicDictionaries; - -},{"./ConnectionCosts":10,"./TokenInfoDictionary":13,"./UnknownDictionary":14,"doublearray":2}],12:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var ByteBuffer = require("../util/ByteBuffer"); -var CharacterClass = require("./CharacterClass"); - -/** - * InvokeDefinitionMap represents invoke definition a part of char.def - * @constructor - */ -function InvokeDefinitionMap() { - this.map = []; - this.lookup_table = {}; // Just for building dictionary -} - -/** - * Load InvokeDefinitionMap from buffer - * @param {Uint8Array} invoke_def_buffer - * @returns {InvokeDefinitionMap} - */ -InvokeDefinitionMap.load = function (invoke_def_buffer) { - var invoke_def = new InvokeDefinitionMap(); - var character_category_definition = []; - - var buffer = new ByteBuffer(invoke_def_buffer); - while (buffer.position + 1 < buffer.size()) { - var class_id = character_category_definition.length; - var is_always_invoke = buffer.get(); - var is_grouping = buffer.get(); - var max_length = buffer.getInt(); - var class_name = buffer.getString(); - character_category_definition.push(new CharacterClass(class_id, class_name, is_always_invoke, is_grouping, max_length)); - } - - invoke_def.init(character_category_definition); - - return invoke_def; -}; - -/** - * Initializing method - * @param {Array.} character_category_definition Array of CharacterClass - */ -InvokeDefinitionMap.prototype.init = function (character_category_definition) { - if (character_category_definition == null) { - return; - } - for (var i = 0; i < character_category_definition.length; i++) { - var character_class = character_category_definition[i]; - this.map[i] = character_class; - this.lookup_table[character_class.class_name] = i; - } -}; - -/** - * Get class information by class ID - * @param {number} class_id - * @returns {CharacterClass} - */ -InvokeDefinitionMap.prototype.getCharacterClass = function (class_id) { - return this.map[class_id]; -}; - -/** - * For building character definition dictionary - * @param {string} class_name character - * @returns {number} class_id - */ -InvokeDefinitionMap.prototype.lookup = function (class_name) { - var class_id = this.lookup_table[class_name]; - if (class_id == null) { - return null; - } - return class_id; -}; - -/** - * Transform from map to binary buffer - * @returns {Uint8Array} - */ -InvokeDefinitionMap.prototype.toBuffer = function () { - var buffer = new ByteBuffer(); - for (var i = 0; i < this.map.length; i++) { - var char_class = this.map[i]; - buffer.put(char_class.is_always_invoke); - buffer.put(char_class.is_grouping); - buffer.putInt(char_class.max_length); - buffer.putString(char_class.class_name); - } - buffer.shrink(); - return buffer.buffer; -}; - -module.exports = InvokeDefinitionMap; - -},{"../util/ByteBuffer":21,"./CharacterClass":8}],13:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var ByteBuffer = require("../util/ByteBuffer"); - -/** - * TokenInfoDictionary - * @constructor - */ -function TokenInfoDictionary() { - this.dictionary = new ByteBuffer(10 * 1024 * 1024); - this.target_map = {}; // trie_id (of surface form) -> token_info_id (of token) - this.pos_buffer = new ByteBuffer(10 * 1024 * 1024); -} - -// left_id right_id word_cost ... -// ^ this position is token_info_id -TokenInfoDictionary.prototype.buildDictionary = function (entries) { - var dictionary_entries = {}; // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - - for (var i = 0; i < entries.length; i++) { - var entry = entries[i]; - - if (entry.length < 4) { - continue; - } - - var surface_form = entry[0]; - var left_id = entry[1]; - var right_id = entry[2]; - var word_cost = entry[3]; - var feature = entry.slice(4).join(","); // TODO Optimize - - // Assertion - if (!isFinite(left_id) || !isFinite(right_id) || !isFinite(word_cost)) { - console.log(entry); - } - - var token_info_id = this.put(left_id, right_id, word_cost, surface_form, feature); - dictionary_entries[token_info_id] = surface_form; - } - - // Remove last unused area - this.dictionary.shrink(); - this.pos_buffer.shrink(); - - return dictionary_entries; -}; - -TokenInfoDictionary.prototype.put = function (left_id, right_id, word_cost, surface_form, feature) { - var token_info_id = this.dictionary.position; - var pos_id = this.pos_buffer.position; - - this.dictionary.putShort(left_id); - this.dictionary.putShort(right_id); - this.dictionary.putShort(word_cost); - this.dictionary.putInt(pos_id); - this.pos_buffer.putString(surface_form + "," + feature); - - return token_info_id; -}; - -TokenInfoDictionary.prototype.addMapping = function (source, target) { - var mapping = this.target_map[source]; - if (mapping == null) { - mapping = []; - } - mapping.push(target); - - this.target_map[source] = mapping; -}; - -TokenInfoDictionary.prototype.targetMapToBuffer = function () { - var buffer = new ByteBuffer(); - var map_keys_size = Object.keys(this.target_map).length; - buffer.putInt(map_keys_size); - for (var key in this.target_map) { - var values = this.target_map[key]; // Array - var map_values_size = values.length; - buffer.putInt(parseInt(key)); - buffer.putInt(map_values_size); - for (var i = 0; i < values.length; i++) { - buffer.putInt(values[i]); - } - } - return buffer.shrink(); // Shrink-ed Typed Array -}; - -// from tid.dat -TokenInfoDictionary.prototype.loadDictionary = function (array_buffer) { - this.dictionary = new ByteBuffer(array_buffer); - return this; -}; - -// from tid_pos.dat -TokenInfoDictionary.prototype.loadPosVector = function (array_buffer) { - this.pos_buffer = new ByteBuffer(array_buffer); - return this; -}; - -// from tid_map.dat -TokenInfoDictionary.prototype.loadTargetMap = function (array_buffer) { - var buffer = new ByteBuffer(array_buffer); - buffer.position = 0; - this.target_map = {}; - buffer.readInt(); // map_keys_size - while (true) { - if (buffer.buffer.length < buffer.position + 1) { - break; - } - var key = buffer.readInt(); - var map_values_size = buffer.readInt(); - for (var i = 0; i < map_values_size; i++) { - var value = buffer.readInt(); - this.addMapping(key, value); - } - } - return this; -}; - -/** - * Look up features in the dictionary - * @param {string} token_info_id_str Word ID to look up - * @returns {string} Features string concatenated by "," - */ -TokenInfoDictionary.prototype.getFeatures = function (token_info_id_str) { - var token_info_id = parseInt(token_info_id_str); - if (isNaN(token_info_id)) { - // TODO throw error - return ""; - } - var pos_id = this.dictionary.getInt(token_info_id + 6); - return this.pos_buffer.getString(pos_id); -}; - -module.exports = TokenInfoDictionary; - -},{"../util/ByteBuffer":21}],14:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var TokenInfoDictionary = require("./TokenInfoDictionary"); -var CharacterDefinition = require("./CharacterDefinition"); -var ByteBuffer = require("../util/ByteBuffer"); - -/** - * UnknownDictionary - * @constructor - */ -function UnknownDictionary() { - this.dictionary = new ByteBuffer(10 * 1024 * 1024); - this.target_map = {}; // class_id (of CharacterClass) -> token_info_id (of unknown class) - this.pos_buffer = new ByteBuffer(10 * 1024 * 1024); - this.character_definition = null; -} - -// Inherit from TokenInfoDictionary as a super class -UnknownDictionary.prototype = Object.create(TokenInfoDictionary.prototype); - -UnknownDictionary.prototype.characterDefinition = function (character_definition) { - this.character_definition = character_definition; - return this; -}; - -UnknownDictionary.prototype.lookup = function (ch) { - return this.character_definition.lookup(ch); -}; - -UnknownDictionary.prototype.lookupCompatibleCategory = function (ch) { - return this.character_definition.lookupCompatibleCategory(ch); -}; - -UnknownDictionary.prototype.loadUnknownDictionaries = function (unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer) { - this.loadDictionary(unk_buffer); - this.loadPosVector(unk_pos_buffer); - this.loadTargetMap(unk_map_buffer); - this.character_definition = CharacterDefinition.load(cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer); -}; - -module.exports = UnknownDictionary; - -},{"../util/ByteBuffer":21,"./CharacterDefinition":9,"./TokenInfoDictionary":13}],15:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var CharacterDefinition = require("../CharacterDefinition"); -var InvokeDefinitionMap = require("../InvokeDefinitionMap"); - -var CATEGORY_DEF_PATTERN = /^(\w+)\s+(\d)\s+(\d)\s+(\d)/; -var CATEGORY_MAPPING_PATTERN = /^(0x[0-9A-F]{4})(?:\s+([^#\s]+))(?:\s+([^#\s]+))*/; -var RANGE_CATEGORY_MAPPING_PATTERN = /^(0x[0-9A-F]{4})\.\.(0x[0-9A-F]{4})(?:\s+([^#\s]+))(?:\s+([^#\s]+))*/; - -/** - * CharacterDefinitionBuilder - * @constructor - */ -function CharacterDefinitionBuilder() { - this.char_def = new CharacterDefinition(); - this.char_def.invoke_definition_map = new InvokeDefinitionMap(); - this.character_category_definition = []; - this.category_mapping = []; -} - -CharacterDefinitionBuilder.prototype.putLine = function (line) { - var parsed_category_def = CATEGORY_DEF_PATTERN.exec(line); - if (parsed_category_def != null) { - var class_id = this.character_category_definition.length; - var char_class = CharacterDefinition.parseCharCategory(class_id, parsed_category_def); - if (char_class == null) { - return; - } - this.character_category_definition.push(char_class); - return; - } - var parsed_category_mapping = CATEGORY_MAPPING_PATTERN.exec(line); - if (parsed_category_mapping != null) { - var mapping = CharacterDefinition.parseCategoryMapping(parsed_category_mapping); - this.category_mapping.push(mapping); - } - var parsed_range_category_mapping = RANGE_CATEGORY_MAPPING_PATTERN.exec(line); - if (parsed_range_category_mapping != null) { - var range_mapping = CharacterDefinition.parseRangeCategoryMapping(parsed_range_category_mapping); - this.category_mapping.push(range_mapping); - } -}; - -CharacterDefinitionBuilder.prototype.build = function () { - // TODO If DEFAULT category does not exist, throw error - this.char_def.invoke_definition_map.init(this.character_category_definition); - this.char_def.initCategoryMappings(this.category_mapping); - return this.char_def; -}; - -module.exports = CharacterDefinitionBuilder; - -},{"../CharacterDefinition":9,"../InvokeDefinitionMap":12}],16:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var ConnectionCosts = require("../ConnectionCosts"); - -/** - * Builder class for constructing ConnectionCosts object - * @constructor - */ -function ConnectionCostsBuilder() { - this.lines = 0; - this.connection_cost = null; -} - -ConnectionCostsBuilder.prototype.putLine = function (line) { - if (this.lines === 0) { - var dimensions = line.split(" "); - var forward_dimension = dimensions[0]; - var backward_dimension = dimensions[1]; - - if (forward_dimension < 0 || backward_dimension < 0) { - throw "Parse error of matrix.def"; - } - - this.connection_cost = new ConnectionCosts(forward_dimension, backward_dimension); - this.lines++; - return this; - } - - var costs = line.split(" "); - - if (costs.length !== 3) { - return this; - } - - var forward_id = parseInt(costs[0]); - var backward_id = parseInt(costs[1]); - var cost = parseInt(costs[2]); - - if (forward_id < 0 || backward_id < 0 || !isFinite(forward_id) || !isFinite(backward_id) || - this.connection_cost.forward_dimension <= forward_id || this.connection_cost.backward_dimension <= backward_id) { - throw "Parse error of matrix.def"; - } - - this.connection_cost.put(forward_id, backward_id, cost); - this.lines++; - return this; -}; - -ConnectionCostsBuilder.prototype.build = function () { - return this.connection_cost; -}; - -module.exports = ConnectionCostsBuilder; - -},{"../ConnectionCosts":10}],17:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var doublearray = require("doublearray"); -var DynamicDictionaries = require("../DynamicDictionaries"); -var TokenInfoDictionary = require("../TokenInfoDictionary"); -var ConnectionCostsBuilder = require("./ConnectionCostsBuilder"); -var CharacterDefinitionBuilder = require("./CharacterDefinitionBuilder"); -var UnknownDictionary = require("../UnknownDictionary"); - -/** - * Build dictionaries (token info, connection costs) - * - * Generates from matrix.def - * cc.dat: Connection costs - * - * Generates from *.csv - * dat.dat: Double array - * tid.dat: Token info dictionary - * tid_map.dat: targetMap - * tid_pos.dat: posList (part of speech) - */ -function DictionaryBuilder() { - // Array of entries, each entry in Mecab form - // (0: surface form, 1: left id, 2: right id, 3: word cost, 4: part of speech id, 5-: other features) - this.tid_entries = []; - this.unk_entries = []; - this.cc_builder = new ConnectionCostsBuilder(); - this.cd_builder = new CharacterDefinitionBuilder(); -} - -DictionaryBuilder.prototype.addTokenInfoDictionary = function (line) { - var new_entry = line.split(","); - this.tid_entries.push(new_entry); - return this; -}; - -/** - * Put one line of "matrix.def" file for building ConnectionCosts object - * @param {string} line is a line of "matrix.def" - */ -DictionaryBuilder.prototype.putCostMatrixLine = function (line) { - this.cc_builder.putLine(line); - return this; -}; - -DictionaryBuilder.prototype.putCharDefLine = function (line) { - this.cd_builder.putLine(line); - return this; -}; - -/** - * Put one line of "unk.def" file for building UnknownDictionary object - * @param {string} line is a line of "unk.def" - */ -DictionaryBuilder.prototype.putUnkDefLine = function (line) { - this.unk_entries.push(line.split(",")); - return this; -}; - -DictionaryBuilder.prototype.build = function () { - var dictionaries = this.buildTokenInfoDictionary(); - var unknown_dictionary = this.buildUnknownDictionary(); - - return new DynamicDictionaries(dictionaries.trie, dictionaries.token_info_dictionary, this.cc_builder.build(), unknown_dictionary); -}; - -/** - * Build TokenInfoDictionary - * - * @returns {{trie: *, token_info_dictionary: *}} - */ -DictionaryBuilder.prototype.buildTokenInfoDictionary = function () { - - var token_info_dictionary = new TokenInfoDictionary(); - - // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - var dictionary_entries = token_info_dictionary.buildDictionary(this.tid_entries); - - var trie = this.buildDoubleArray(); - - for (var token_info_id in dictionary_entries) { - var surface_form = dictionary_entries[token_info_id]; - var trie_id = trie.lookup(surface_form); - - // Assertion - // if (trie_id < 0) { - // console.log("Not Found:" + surface_form); - // } - - token_info_dictionary.addMapping(trie_id, token_info_id); - } - - return { - trie: trie, - token_info_dictionary: token_info_dictionary - }; -}; - -DictionaryBuilder.prototype.buildUnknownDictionary = function () { - - var unk_dictionary = new UnknownDictionary(); - - // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - var dictionary_entries = unk_dictionary.buildDictionary(this.unk_entries); - - var char_def = this.cd_builder.build(); // Create CharacterDefinition - - unk_dictionary.characterDefinition(char_def); - - for (var token_info_id in dictionary_entries) { - var class_name = dictionary_entries[token_info_id]; - var class_id = char_def.invoke_definition_map.lookup(class_name); - - // Assertion - // if (trie_id < 0) { - // console.log("Not Found:" + surface_form); - // } - - unk_dictionary.addMapping(class_id, token_info_id); - } - - return unk_dictionary; -}; - -/** - * Build double array trie - * - * @returns {DoubleArray} Double-Array trie - */ -DictionaryBuilder.prototype.buildDoubleArray = function () { - var trie_id = 0; - var words = this.tid_entries.map(function (entry) { - var surface_form = entry[0]; - return { k: surface_form, v: trie_id++ }; - }); - - var builder = doublearray.builder(1024 * 1024); - return builder.build(words); -}; - -module.exports = DictionaryBuilder; - -},{"../DynamicDictionaries":11,"../TokenInfoDictionary":13,"../UnknownDictionary":14,"./CharacterDefinitionBuilder":15,"./ConnectionCostsBuilder":16,"doublearray":2}],18:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var TokenizerBuilder = require("./TokenizerBuilder"); -var DictionaryBuilder = require("./dict/builder/DictionaryBuilder"); - -// Public methods -var kuromoji = { - builder: function (option) { - return new TokenizerBuilder(option); - }, - dictionaryBuilder: function () { - return new DictionaryBuilder(); - } -}; - -module.exports = kuromoji; - -},{"./TokenizerBuilder":7,"./dict/builder/DictionaryBuilder":17}],19:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var zlib = require("zlibjs/bin/gunzip.min.js"); -var DictionaryLoader = require("./DictionaryLoader"); - -/** - * BrowserDictionaryLoader inherits DictionaryLoader, using jQuery XHR for download - * @param {string} dic_path Dictionary path - * @constructor - */ -function BrowserDictionaryLoader(dic_path) { - DictionaryLoader.apply(this, [dic_path]); -} - -BrowserDictionaryLoader.prototype = Object.create(DictionaryLoader.prototype); - -/** - * Utility function to load gzipped dictionary - * @param {string} url Dictionary URL - * @param {BrowserDictionaryLoader~onLoad} callback Callback function - */ -BrowserDictionaryLoader.prototype.loadArrayBuffer = function (url, callback) { - var xhr = new XMLHttpRequest(); - xhr.open("GET", url, true); - xhr.responseType = "arraybuffer"; - xhr.onload = function () { - if (this.status > 0 && this.status !== 200) { - callback(xhr.statusText, null); - return; - } - var arraybuffer = this.response; - - var gz = new zlib.Zlib.Gunzip(new Uint8Array(arraybuffer)); - var typed_array = gz.decompress(); - callback(null, typed_array.buffer); - }; - xhr.onerror = function (err) { - callback(err, null); - }; - xhr.send(); -}; - -/** - * Callback - * @callback BrowserDictionaryLoader~onLoad - * @param {Object} err Error object - * @param {Uint8Array} buffer Loaded buffer - */ - -module.exports = BrowserDictionaryLoader; - -},{"./DictionaryLoader":20,"zlibjs/bin/gunzip.min.js":5}],20:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var path = require("path"); -var async = require("async"); -var DynamicDictionaries = require("../dict/DynamicDictionaries"); - -/** - * DictionaryLoader base constructor - * @param {string} dic_path Dictionary path - * @constructor - */ -function DictionaryLoader(dic_path) { - this.dic = new DynamicDictionaries(); - this.dic_path = dic_path; -} - -DictionaryLoader.prototype.loadArrayBuffer = function (file, callback) { - throw new Error("DictionaryLoader#loadArrayBuffer should be overwrite"); -}; - -/** - * Load dictionary files - * @param {DictionaryLoader~onLoad} load_callback Callback function called after loaded - */ -DictionaryLoader.prototype.load = function (load_callback) { - var dic = this.dic; - var dic_path = this.dic_path; - var loadArrayBuffer = this.loadArrayBuffer; - - async.parallel([ - // Trie - function (callback) { - async.map([ "base.dat.gz", "check.dat.gz" ], function (filename, _callback) { - loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) { - if(err) { - return _callback(err); - } - _callback(null, buffer); - }); - }, function (err, buffers) { - if(err) { - return callback(err); - } - var base_buffer = new Int32Array(buffers[0]); - var check_buffer = new Int32Array(buffers[1]); - - dic.loadTrie(base_buffer, check_buffer); - callback(null); - }); - }, - // Token info dictionaries - function (callback) { - async.map([ "tid.dat.gz", "tid_pos.dat.gz", "tid_map.dat.gz" ], function (filename, _callback) { - loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) { - if(err) { - return _callback(err); - } - _callback(null, buffer); - }); - }, function (err, buffers) { - if(err) { - return callback(err); - } - var token_info_buffer = new Uint8Array(buffers[0]); - var pos_buffer = new Uint8Array(buffers[1]); - var target_map_buffer = new Uint8Array(buffers[2]); - - dic.loadTokenInfoDictionaries(token_info_buffer, pos_buffer, target_map_buffer); - callback(null); - }); - }, - // Connection cost matrix - function (callback) { - loadArrayBuffer(path.join(dic_path, "cc.dat.gz"), function (err, buffer) { - if(err) { - return callback(err); - } - var cc_buffer = new Int16Array(buffer); - dic.loadConnectionCosts(cc_buffer); - callback(null); - }); - }, - // Unknown dictionaries - function (callback) { - async.map([ "unk.dat.gz", "unk_pos.dat.gz", "unk_map.dat.gz", "unk_char.dat.gz", "unk_compat.dat.gz", "unk_invoke.dat.gz" ], function (filename, _callback) { - loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) { - if(err) { - return _callback(err); - } - _callback(null, buffer); - }); - }, function (err, buffers) { - if(err) { - return callback(err); - } - var unk_buffer = new Uint8Array(buffers[0]); - var unk_pos_buffer = new Uint8Array(buffers[1]); - var unk_map_buffer = new Uint8Array(buffers[2]); - var cat_map_buffer = new Uint8Array(buffers[3]); - var compat_cat_map_buffer = new Uint32Array(buffers[4]); - var invoke_def_buffer = new Uint8Array(buffers[5]); - - dic.loadUnknownDictionaries(unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer); - // dic.loadUnknownDictionaries(char_buffer, unk_buffer); - callback(null); - }); - } - ], function (err) { - load_callback(err, dic); - }); -}; - -/** - * Callback - * @callback DictionaryLoader~onLoad - * @param {Object} err Error object - * @param {DynamicDictionaries} dic Loaded dictionary - */ - -module.exports = DictionaryLoader; - -},{"../dict/DynamicDictionaries":11,"async":1,"path":3}],21:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * Convert String (UTF-16) to UTF-8 ArrayBuffer - * - * @param {String} str UTF-16 string to convert - * @return {Uint8Array} Byte sequence encoded by UTF-8 - */ -var stringToUtf8Bytes = function (str) { - - // Max size of 1 character is 4 bytes - var bytes = new Uint8Array(str.length * 4); - - var i = 0, j = 0; - - while (i < str.length) { - var unicode_code; - - var utf16_code = str.charCodeAt(i++); - if (utf16_code >= 0xD800 && utf16_code <= 0xDBFF) { - // surrogate pair - var upper = utf16_code; // high surrogate - var lower = str.charCodeAt(i++); // low surrogate - - if (lower >= 0xDC00 && lower <= 0xDFFF) { - unicode_code = - (upper - 0xD800) * (1 << 10) + (1 << 16) + - (lower - 0xDC00); - } else { - // malformed surrogate pair - return null; - } - } else { - // not surrogate code - unicode_code = utf16_code; - } - - if (unicode_code < 0x80) { - // 1-byte - bytes[j++] = unicode_code; - - } else if (unicode_code < (1 << 11)) { - // 2-byte - bytes[j++] = (unicode_code >>> 6) | 0xC0; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else if (unicode_code < (1 << 16)) { - // 3-byte - bytes[j++] = (unicode_code >>> 12) | 0xE0; - bytes[j++] = ((unicode_code >> 6) & 0x3f) | 0x80; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else if (unicode_code < (1 << 21)) { - // 4-byte - bytes[j++] = (unicode_code >>> 18) | 0xF0; - bytes[j++] = ((unicode_code >> 12) & 0x3F) | 0x80; - bytes[j++] = ((unicode_code >> 6) & 0x3F) | 0x80; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else { - // malformed UCS4 code - } - } - - return bytes.subarray(0, j); -}; - -/** - * Convert UTF-8 ArrayBuffer to String (UTF-16) - * - * @param {Array} bytes UTF-8 byte sequence to convert - * @return {String} String encoded by UTF-16 - */ -var utf8BytesToString = function (bytes) { - - var str = ""; - var code, b1, b2, b3, b4, upper, lower; - var i = 0; - - while (i < bytes.length) { - - b1 = bytes[i++]; - - if (b1 < 0x80) { - // 1 byte - code = b1; - } else if ((b1 >> 5) === 0x06) { - // 2 bytes - b2 = bytes[i++]; - code = ((b1 & 0x1f) << 6) | (b2 & 0x3f); - } else if ((b1 >> 4) === 0x0e) { - // 3 bytes - b2 = bytes[i++]; - b3 = bytes[i++]; - code = ((b1 & 0x0f) << 12) | ((b2 & 0x3f) << 6) | (b3 & 0x3f); - } else { - // 4 bytes - b2 = bytes[i++]; - b3 = bytes[i++]; - b4 = bytes[i++]; - code = ((b1 & 0x07) << 18) | ((b2 & 0x3f) << 12) | ((b3 & 0x3f) << 6) | (b4 & 0x3f); - } - - if (code < 0x10000) { - str += String.fromCharCode(code); - } else { - // surrogate pair - code -= 0x10000; - upper = (0xD800 | (code >> 10)); - lower = (0xDC00 | (code & 0x3FF)); - str += String.fromCharCode(upper, lower); - } - } - - return str; -}; - -/** - * Utilities to manipulate byte sequence - * @param {(number|Uint8Array)} arg Initial size of this buffer (number), or buffer to set (Uint8Array) - * @constructor - */ -function ByteBuffer(arg) { - var initial_size; - if (arg == null) { - initial_size = 1024 * 1024; - } else if (typeof arg === "number") { - initial_size = arg; - } else if (arg instanceof Uint8Array) { - this.buffer = arg; - this.position = 0; // Overwrite - return; - } else { - // typeof arg -> String - throw typeof arg + " is invalid parameter type for ByteBuffer constructor"; - } - // arg is null or number - this.buffer = new Uint8Array(initial_size); - this.position = 0; -} - -ByteBuffer.prototype.size = function () { - return this.buffer.length; -}; - -ByteBuffer.prototype.reallocate = function () { - var new_array = new Uint8Array(this.buffer.length * 2); - new_array.set(this.buffer); - this.buffer = new_array; -}; - -ByteBuffer.prototype.shrink = function () { - this.buffer = this.buffer.subarray(0, this.position); - return this.buffer; -}; - -ByteBuffer.prototype.put = function (b) { - if (this.buffer.length < this.position + 1) { - this.reallocate(); - } - this.buffer[this.position++] = b; -}; - -ByteBuffer.prototype.get = function (index) { - if (index == null) { - index = this.position; - this.position += 1; - } - if (this.buffer.length < index + 1) { - return 0; - } - return this.buffer[index]; -}; - -// Write short to buffer by little endian -ByteBuffer.prototype.putShort = function (num) { - if (0xFFFF < num) { - throw num + " is over short value"; - } - var lower = (0x00FF & num); - var upper = (0xFF00 & num) >> 8; - this.put(lower); - this.put(upper); -}; - -// Read short from buffer by little endian -ByteBuffer.prototype.getShort = function (index) { - if (index == null) { - index = this.position; - this.position += 2; - } - if (this.buffer.length < index + 2) { - return 0; - } - var lower = this.buffer[index]; - var upper = this.buffer[index + 1]; - var value = (upper << 8) + lower; - if (value & 0x8000) { - value = -((value - 1) ^ 0xFFFF); - } - return value; -}; - -// Write integer to buffer by little endian -ByteBuffer.prototype.putInt = function (num) { - if (0xFFFFFFFF < num) { - throw num + " is over integer value"; - } - var b0 = (0x000000FF & num); - var b1 = (0x0000FF00 & num) >> 8; - var b2 = (0x00FF0000 & num) >> 16; - var b3 = (0xFF000000 & num) >> 24; - this.put(b0); - this.put(b1); - this.put(b2); - this.put(b3); -}; - -// Read integer from buffer by little endian -ByteBuffer.prototype.getInt = function (index) { - if (index == null) { - index = this.position; - this.position += 4; - } - if (this.buffer.length < index + 4) { - return 0; - } - var b0 = this.buffer[index]; - var b1 = this.buffer[index + 1]; - var b2 = this.buffer[index + 2]; - var b3 = this.buffer[index + 3]; - - return (b3 << 24) + (b2 << 16) + (b1 << 8) + b0; -}; - -ByteBuffer.prototype.readInt = function () { - var pos = this.position; - this.position += 4; - return this.getInt(pos); -}; - -ByteBuffer.prototype.putString = function (str) { - var bytes = stringToUtf8Bytes(str); - for (var i = 0; i < bytes.length; i++) { - this.put(bytes[i]); - } - // put null character as terminal character - this.put(0); -}; - -ByteBuffer.prototype.getString = function (index) { - var buf = [], - ch; - if (index == null) { - index = this.position; - } - while (true) { - if (this.buffer.length < index + 1) { - break; - } - ch = this.get(index++); - if (ch === 0) { - break; - } else { - buf.push(ch); - } - } - this.position = index; - return utf8BytesToString(buf); -}; - -module.exports = ByteBuffer; - -},{}],22:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * Mappings between IPADIC dictionary features and tokenized results - * @constructor - */ -function IpadicFormatter() { -} - -IpadicFormatter.prototype.formatEntry = function (word_id, position, type, features) { - var token = {}; - token.word_id = word_id; - token.word_type = type; - token.word_position = position; - - token.surface_form = features[0]; - token.pos = features[1]; - token.pos_detail_1 = features[2]; - token.pos_detail_2 = features[3]; - token.pos_detail_3 = features[4]; - token.conjugated_type = features[5]; - token.conjugated_form = features[6]; - token.basic_form = features[7]; - token.reading = features[8]; - token.pronunciation = features[9]; - - return token; -}; - -IpadicFormatter.prototype.formatUnknownEntry = function (word_id, position, type, features, surface_form) { - var token = {}; - token.word_id = word_id; - token.word_type = type; - token.word_position = position; - - token.surface_form = surface_form; - token.pos = features[1]; - token.pos_detail_1 = features[2]; - token.pos_detail_2 = features[3]; - token.pos_detail_3 = features[4]; - token.conjugated_type = features[5]; - token.conjugated_form = features[6]; - token.basic_form = features[7]; - // token.reading = features[8]; - // token.pronunciation = features[9]; - - return token; -}; - -module.exports = IpadicFormatter; - -},{}],23:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * String wrapper for UTF-16 surrogate pair (4 bytes) - * @param {string} str String to wrap - * @constructor - */ -function SurrogateAwareString(str) { - this.str = str; - this.index_mapping = []; - - for (var pos = 0; pos < str.length; pos++) { - var ch = str.charAt(pos); - this.index_mapping.push(pos); - if (SurrogateAwareString.isSurrogatePair(ch)) { - pos++; - } - } - // Surrogate aware length - this.length = this.index_mapping.length; -} - -SurrogateAwareString.prototype.slice = function (index) { - if (this.index_mapping.length <= index) { - return ""; - } - var surrogate_aware_index = this.index_mapping[index]; - return this.str.slice(surrogate_aware_index); -}; - -SurrogateAwareString.prototype.charAt = function (index) { - if (this.str.length <= index) { - return ""; - } - var surrogate_aware_start_index = this.index_mapping[index]; - var surrogate_aware_end_index = this.index_mapping[index + 1]; - - if (surrogate_aware_end_index == null) { - return this.str.slice(surrogate_aware_start_index); - } - return this.str.slice(surrogate_aware_start_index, surrogate_aware_end_index); -}; - -SurrogateAwareString.prototype.charCodeAt = function (index) { - if (this.index_mapping.length <= index) { - return NaN; - } - var surrogate_aware_index = this.index_mapping[index]; - var upper = this.str.charCodeAt(surrogate_aware_index); - var lower; - if (upper >= 0xD800 && upper <= 0xDBFF && surrogate_aware_index < this.str.length) { - lower = this.str.charCodeAt(surrogate_aware_index + 1); - if (lower >= 0xDC00 && lower <= 0xDFFF) { - return (upper - 0xD800) * 0x400 + lower - 0xDC00 + 0x10000; - } - } - return upper; -}; - -SurrogateAwareString.prototype.toString = function () { - return this.str; -}; - -SurrogateAwareString.isSurrogatePair = function (ch) { - var utf16_code = ch.charCodeAt(0); - if (utf16_code >= 0xD800 && utf16_code <= 0xDBFF) { - // surrogate pair - return true; - } else { - return false; - } -}; - -module.exports = SurrogateAwareString; - -},{}],24:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var ViterbiNode = require("./ViterbiNode"); -var ViterbiLattice = require("./ViterbiLattice"); -var SurrogateAwareString = require("../util/SurrogateAwareString"); - -/** - * ViterbiBuilder builds word lattice (ViterbiLattice) - * @param {DynamicDictionaries} dic dictionary - * @constructor - */ -function ViterbiBuilder(dic) { - this.trie = dic.trie; - this.token_info_dictionary = dic.token_info_dictionary; - this.unknown_dictionary = dic.unknown_dictionary; -} - -/** - * Build word lattice - * @param {string} sentence_str Input text - * @returns {ViterbiLattice} Word lattice - */ -ViterbiBuilder.prototype.build = function (sentence_str) { - var lattice = new ViterbiLattice(); - var sentence = new SurrogateAwareString(sentence_str); - - var key, trie_id, left_id, right_id, word_cost; - for (var pos = 0; pos < sentence.length; pos++) { - var tail = sentence.slice(pos); - var vocabulary = this.trie.commonPrefixSearch(tail); - for (var n = 0; n < vocabulary.length; n++) { // Words in dictionary do not have surrogate pair (only UCS2 set) - trie_id = vocabulary[n].v; - key = vocabulary[n].k; - - var token_info_ids = this.token_info_dictionary.target_map[trie_id]; - for (var i = 0; i < token_info_ids.length; i++) { - var token_info_id = parseInt(token_info_ids[i]); - - left_id = this.token_info_dictionary.dictionary.getShort(token_info_id); - right_id = this.token_info_dictionary.dictionary.getShort(token_info_id + 2); - word_cost = this.token_info_dictionary.dictionary.getShort(token_info_id + 4); - - // node_name, cost, start_index, length, type, left_id, right_id, surface_form - lattice.append(new ViterbiNode(token_info_id, word_cost, pos + 1, key.length, "KNOWN", left_id, right_id, key)); - } - } - - // Unknown word processing - var surrogate_aware_tail = new SurrogateAwareString(tail); - var head_char = new SurrogateAwareString(surrogate_aware_tail.charAt(0)); - var head_char_class = this.unknown_dictionary.lookup(head_char.toString()); - if (vocabulary == null || vocabulary.length === 0 || head_char_class.is_always_invoke === 1) { - // Process unknown word - key = head_char; - if (head_char_class.is_grouping === 1 && 1 < surrogate_aware_tail.length) { - for (var k = 1; k < surrogate_aware_tail.length; k++) { - var next_char = surrogate_aware_tail.charAt(k); - var next_char_class = this.unknown_dictionary.lookup(next_char); - if (head_char_class.class_name !== next_char_class.class_name) { - break; - } - key += next_char; - } - } - - var unk_ids = this.unknown_dictionary.target_map[head_char_class.class_id]; - for (var j = 0; j < unk_ids.length; j++) { - var unk_id = parseInt(unk_ids[j]); - - left_id = this.unknown_dictionary.dictionary.getShort(unk_id); - right_id = this.unknown_dictionary.dictionary.getShort(unk_id + 2); - word_cost = this.unknown_dictionary.dictionary.getShort(unk_id + 4); - - // node_name, cost, start_index, length, type, left_id, right_id, surface_form - lattice.append(new ViterbiNode(unk_id, word_cost, pos + 1, key.length, "UNKNOWN", left_id, right_id, key.toString())); - } - } - } - lattice.appendEos(); - - return lattice; -}; - -module.exports = ViterbiBuilder; - -},{"../util/SurrogateAwareString":23,"./ViterbiLattice":25,"./ViterbiNode":26}],25:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var ViterbiNode = require("./ViterbiNode"); - -/** - * ViterbiLattice is a lattice in Viterbi algorithm - * @constructor - */ -function ViterbiLattice() { - this.nodes_end_at = []; - this.nodes_end_at[0] = [ new ViterbiNode(-1, 0, 0, 0, "BOS", 0, 0, "") ]; - this.eos_pos = 1; -} - -/** - * Append node to ViterbiLattice - * @param {ViterbiNode} node - */ -ViterbiLattice.prototype.append = function (node) { - var last_pos = node.start_pos + node.length - 1; - if (this.eos_pos < last_pos) { - this.eos_pos = last_pos; - } - - var prev_nodes = this.nodes_end_at[last_pos]; - if (prev_nodes == null) { - prev_nodes = []; - } - prev_nodes.push(node); - - this.nodes_end_at[last_pos] = prev_nodes; -}; - -/** - * Set ends with EOS (End of Statement) - */ -ViterbiLattice.prototype.appendEos = function () { - var last_index = this.nodes_end_at.length; - this.eos_pos++; - this.nodes_end_at[last_index] = [ new ViterbiNode(-1, 0, this.eos_pos, 0, "EOS", 0, 0, "") ]; -}; - -module.exports = ViterbiLattice; - -},{"./ViterbiNode":26}],26:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * ViterbiNode is a node of ViterbiLattice - * @param {number} node_name Word ID - * @param {number} node_cost Word cost to generate - * @param {number} start_pos Start position from 1 - * @param {number} length Word length - * @param {string} type Node type (KNOWN, UNKNOWN, BOS, EOS, ...) - * @param {number} left_id Left context ID - * @param {number} right_id Right context ID - * @param {string} surface_form Surface form of this word - * @constructor - */ -function ViterbiNode(node_name, node_cost, start_pos, length, type, left_id, right_id, surface_form) { - this.name = node_name; - this.cost = node_cost; - this.start_pos = start_pos; - this.length = length; - this.left_id = left_id; - this.right_id = right_id; - this.prev = null; - this.surface_form = surface_form; - if (type === "BOS") { - this.shortest_cost = 0; - } else { - this.shortest_cost = Number.MAX_VALUE; - } - this.type = type; -} - -module.exports = ViterbiNode; - -},{}],27:[function(require,module,exports){ -/* - * Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -/** - * ViterbiSearcher is for searching best Viterbi path - * @param {ConnectionCosts} connection_costs Connection costs matrix - * @constructor - */ -function ViterbiSearcher(connection_costs) { - this.connection_costs = connection_costs; -} - -/** - * Search best path by forward-backward algorithm - * @param {ViterbiLattice} lattice Viterbi lattice to search - * @returns {Array} Shortest path - */ -ViterbiSearcher.prototype.search = function (lattice) { - lattice = this.forward(lattice); - return this.backward(lattice); -}; - -ViterbiSearcher.prototype.forward = function (lattice) { - var i, j, k; - for (i = 1; i <= lattice.eos_pos; i++) { - var nodes = lattice.nodes_end_at[i]; - if (nodes == null) { - continue; - } - for (j = 0; j < nodes.length; j++) { - var node = nodes[j]; - var cost = Number.MAX_VALUE; - var shortest_prev_node; - - var prev_nodes = lattice.nodes_end_at[node.start_pos - 1]; - if (prev_nodes == null) { - // TODO process unknown words (repair word lattice) - continue; - } - for (k = 0; k < prev_nodes.length; k++) { - var prev_node = prev_nodes[k]; - - var edge_cost; - if (node.left_id == null || prev_node.right_id == null) { - // TODO assert - console.log("Left or right is null"); - edge_cost = 0; - } else { - edge_cost = this.connection_costs.get(prev_node.right_id, node.left_id); - } - - var _cost = prev_node.shortest_cost + edge_cost + node.cost; - if (_cost < cost) { - shortest_prev_node = prev_node; - cost = _cost; - } - } - - node.prev = shortest_prev_node; - node.shortest_cost = cost; - } - } - return lattice; -}; - -ViterbiSearcher.prototype.backward = function (lattice) { - var shortest_path = []; - var eos = lattice.nodes_end_at[lattice.nodes_end_at.length - 1][0]; - - var node_back = eos.prev; - if (node_back == null) { - return []; - } - while (node_back.type !== "BOS") { - shortest_path.push(node_back); - if (node_back.prev == null) { - // TODO Failed to back. Process unknown words? - return []; - } - node_back = node_back.prev; - } - - return shortest_path.reverse(); -}; - -module.exports = ViterbiSearcher; - -},{}]},{},[18])(18) -}); diff --git a/demo/bower.json b/demo/bower.json deleted file mode 100644 index 756d42d4..00000000 --- a/demo/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "kuromoji-demo", - "homepage": "https://github.com/takuyaa/kuromoji.js", - "authors": [ - "Takuya Asano " - ], - "description": "kuromoji.js demo", - "license": "MIT", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "dependencies": { - "foundation": "~5.4.7", - "vue": "^2.5.16" - } -} diff --git a/demo/js/tokenize.js b/demo/js/tokenize.js deleted file mode 100644 index 4f700683..00000000 --- a/demo/js/tokenize.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// require vue as MVVM framework -// require kuromoji - -var DIC_URL = "kuromoji/dict/"; - -var tokenizer = null; -// var lattice; // Very large object. Unwatch this object from Model. -// var renderer = new dagreD3.Renderer(); - - -var vm = new Vue({ - el: "#demo", - data: { - inputText: "", - tokens: [], - isLoading: true, - message: "Loading dictionaries ...", - svgStyle: "hidden" - }, - methods: { - /* - drawGraph: function () { - if (lattice != null) { - drawLattice(); - vm.svgStyle = "visible"; - } - }, - */ - tokenize: function () { - if (vm.inputText == "" || tokenizer == null) { - vm.tokens = []; - // lattice = null; - return; - } - try { - // lattice = tokenizer.getLattice(vm.inputText); - vm.tokens = tokenizer.tokenize(vm.inputText); - } catch (e) { - console.log(e); - // lattice = null; - vm.tokens = []; - } - } - } -}); - - -// フォームの内容が変化したらtokenizeする -vm.$watch("inputText", function (value) { - // vm.graphEnabled = false; - vm.svgStyle = "hidden"; - vm.tokenize(); -}); - - -// Load and prepare tokenizer -kuromoji.builder({ dicPath: DIC_URL }).build(function (error, _tokenizer) { - if (error != null) { - console.log(error); - } - tokenizer = _tokenizer; - - vm.message = "Ready"; - - vm.inputText = "すもももももももものうち"; - vm.isLoading = false; -}); - - -/* -function drawLattice () { - // Create a new directed graph - var g = new dagreD3.Digraph(); - - // BOS - var bos_node = lattice.nodes_end_at[0][0]; - g.addNode("0:BOS", { label: "BOS " + bos_node.cost }); - - var i, j, k, nodes, node; - - // Draw node - for (i = 1; i <= lattice.eos_pos; i++) { - nodes = lattice.nodes_end_at[i]; - if (nodes == null) { - continue; - } - for (j = 0; j < nodes.length; j++) { - node = nodes[j]; - - // Add nodes to the graph. The first argument is the node id. The second is - // metadata about the node. In this case we're going to add labels to each of - // our nodes. - if (node.name == "EOS") { - g.addNode(i + ":" + node.name, { label: node.name + " " + node.cost }); - } else { - var features = tokenizer.token_info_dictionary.getFeatures(node.name); - g.addNode(i + ":" + node.name, { - label: "
" // + node.left_id + " " + node.name + " " + node.right_id + "
" - + features[0] + "
" + features[1] + "
" + features[2] + "
" + node.cost + "
" - }); - } - } - } - - // Draw edge - for (i = 1; i <= lattice.eos_pos; i++) { - nodes = lattice.nodes_end_at[i]; - if (nodes == null) { - continue; - } - for (j = 0; j < nodes.length; j++) { - node = nodes[j]; - // var cost = Number.MAX_VALUE; - // var shortest_prev_node; - - var prev_nodes = lattice.nodes_end_at[node.start_pos - 1]; - if (prev_nodes == null) { - // TODO process unknown words - continue; - } - for (k = 0; k < prev_nodes.length; k++) { - var prev_node = prev_nodes[k]; - - var edge_cost; - if (node.left_id == null || prev_node.right_id == null) { - console.log("Left or right is null"); - edge_cost = 0; - } else { - edge_cost = tokenizer.viterbi_searcher.connection_costs.get(prev_node.right_id, node.left_id); - } - - // Add edges to the graph. The first argument is the edge id. Here we use null - // to indicate that an arbitrary edge id can be assigned automatically. The - // second argument is the source of the edge. The third argument is the target - // of the edge. The last argument is the edge metadata. - g.addEdge( - (node.start_pos - 1) + ":" + prev_node.name + "-" + i + ":" + node.name, - (node.start_pos - 1) + ":" + prev_node.name, - i + ":" + node.name, - { label: String(edge_cost) }); - - // TODO If best path, strong this edge - // edge_metadata.style = "stroke: #f66; stroke-width: 3px;"; - } - } - } - - var layout = dagreD3.layout() - .nodeSep(20) - .edgeSep(20) - .rankDir("LR"); - renderer.layout(layout).run(g, d3.select("svg g")); -} -*/ \ No newline at end of file diff --git a/demo/tokenize.html b/demo/tokenize.html deleted file mode 100644 index 113fea65..00000000 --- a/demo/tokenize.html +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - kuromoji.js demo - - - - - - - - - - -
-
- -

kuromoji.js demo

- - - - -
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
表層形品詞品詞細分類1品詞細分類2品詞細分類3活用型活用形基本形読み発音
{{token.surface_form}}{{token.pos}}{{token.pos_detail_1}}{{token.pos_detail_2}}{{token.pos_detail_3}}{{token.conjugated_type}}{{token.conjugated_form}}{{token.basic_form}}{{token.reading}}{{token.pronunciation}}
- - - - - - - -
-
-
-
-
- - - - - - - - - - diff --git a/example/load-node.js b/example/load-node.js deleted file mode 100644 index 4174ecb7..00000000 --- a/example/load-node.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright Copyright 2014 Takuya Asano - * Copyright 2010-2014 Atilika Inc. and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -var kuromoji = require("../src/kuromoji"); -var DIC_DIR = "dict/"; - -// Load dictionaries from file, and prepare tokenizer -kuromoji.builder({ dicPath: DIC_DIR }).build(function (error, tokenizer) { - var path = tokenizer.tokenize("すもももももももものうち"); - console.log(path); - module.exports = tokenizer; -}); diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 2cafe4a3..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,249 +0,0 @@ -"use strict"; - -const fs = require("fs"); -const gulp = require("gulp"); -const del = require('del'); -const sequence = require("run-sequence"); -const merge = require('event-stream').merge; -const jshint = require("gulp-jshint"); -const browserify = require("browserify"); -const source = require("vinyl-source-stream"); -const gzip = require("gulp-gzip"); -const mocha = require("gulp-mocha"); -const istanbul = require("gulp-istanbul"); -const webserver = require('gulp-webserver'); -const jsdoc = require("gulp-jsdoc3"); -const bower = require('gulp-bower'); -const ghPages = require('gulp-gh-pages-will'); -const bump = require('gulp-bump'); -const argv = require('minimist')(process.argv.slice(2)); -const git = require('gulp-git'); - -gulp.task("clean", (done) => { - return del([ - ".publish/", - "coverage/", - "build/", - "publish/" - ], done); -}); - -gulp.task("build", [ "clean" ], () => { - return browserify({ - entries: [ "src/kuromoji.js" ], - standalone: "kuromoji" // window.kuromoji - }) - .bundle() - .pipe(source("kuromoji.js")) - .pipe(gulp.dest("build/")); -}); - -gulp.task("watch", () => { - gulp.watch([ "src/**/*.js", "test/**/*.js" ], [ "lint", "build", "jsdoc" ]); -}); - -gulp.task("clean-dict", (done) => { - return del([ "dict/" ], done); -}); - -gulp.task("create-dat-files", (done) => { - const IPADic = require('mecab-ipadic-seed'); - const kuromoji = require("./src/kuromoji.js"); - - if (!fs.existsSync("dict/")) { - fs.mkdirSync("dict/"); - } - - // To node.js Buffer - function toBuffer (typed) { - var ab = typed.buffer; - var buffer = new Buffer(ab.byteLength); - var view = new Uint8Array(ab); - for (var i = 0; i < buffer.length; ++i) { - buffer[i] = view[i]; - } - return buffer; - } - - const dic = new IPADic(); - const builder = kuromoji.dictionaryBuilder(); - - // Build token info dictionary - const tokenInfoPromise = dic.readTokenInfo((line) => { - builder.addTokenInfoDictionary(line); - }).then(() => { - console.log('Finishied to read token info dics'); - }); - - // Build connection costs matrix - const matrixDefPromise = dic.readMatrixDef((line) => { - builder.putCostMatrixLine(line); - }).then(() => { - console.log('Finishied to read matrix.def'); - }); - - // Build unknown dictionary - const unkDefPromise = dic.readUnkDef((line) => { - builder.putUnkDefLine(line); - }).then(() => { - console.log('Finishied to read unk.def'); - }); - - // Build character definition dictionary - const charDefPromise = dic.readCharDef((line) => { - builder.putCharDefLine(line); - }).then(() => { - console.log('Finishied to read char.def'); - }); - - // Build kuromoji.js binary dictionary - Promise.all([ tokenInfoPromise, matrixDefPromise, unkDefPromise, charDefPromise ]).then(() => { - console.log('Finishied to read all seed dictionary files'); - console.log('Building binary dictionary ...'); - return builder.build(); - }).then((dic) => { - const base_buffer = toBuffer(dic.trie.bc.getBaseBuffer()); - const check_buffer = toBuffer(dic.trie.bc.getCheckBuffer()); - const token_info_buffer = toBuffer(dic.token_info_dictionary.dictionary.buffer); - const tid_pos_buffer = toBuffer(dic.token_info_dictionary.pos_buffer.buffer); - const tid_map_buffer = toBuffer(dic.token_info_dictionary.targetMapToBuffer()); - const connection_costs_buffer = toBuffer(dic.connection_costs.buffer); - const unk_buffer = toBuffer(dic.unknown_dictionary.dictionary.buffer); - const unk_pos_buffer = toBuffer(dic.unknown_dictionary.pos_buffer.buffer); - const unk_map_buffer = toBuffer(dic.unknown_dictionary.targetMapToBuffer()); - const char_map_buffer = toBuffer(dic.unknown_dictionary.character_definition.character_category_map); - const char_compat_map_buffer = toBuffer(dic.unknown_dictionary.character_definition.compatible_category_map); - const invoke_definition_map_buffer = toBuffer(dic.unknown_dictionary.character_definition.invoke_definition_map.toBuffer()); - - fs.writeFileSync("dict/base.dat", base_buffer); - fs.writeFileSync("dict/check.dat", check_buffer); - fs.writeFileSync("dict/tid.dat", token_info_buffer); - fs.writeFileSync("dict/tid_pos.dat", tid_pos_buffer); - fs.writeFileSync("dict/tid_map.dat", tid_map_buffer); - fs.writeFileSync("dict/cc.dat", connection_costs_buffer); - fs.writeFileSync("dict/unk.dat", unk_buffer); - fs.writeFileSync("dict/unk_pos.dat", unk_pos_buffer); - fs.writeFileSync("dict/unk_map.dat", unk_map_buffer); - fs.writeFileSync("dict/unk_char.dat", char_map_buffer); - fs.writeFileSync("dict/unk_compat.dat", char_compat_map_buffer); - fs.writeFileSync("dict/unk_invoke.dat", invoke_definition_map_buffer); - - done(); - }); -}); - -gulp.task("compress-dict", () => { - return gulp.src("dict/*.dat") - .pipe(gzip()) - .pipe(gulp.dest("dict/")); -}); - -gulp.task("clean-dat-files", (done) => { - return del([ "dict/*.dat" ], done); -}); - -gulp.task("build-dict", [ "build", "clean-dict" ], () => { - sequence("create-dat-files", "compress-dict", "clean-dat-files"); -}); - -gulp.task("test", [ "build" ], () => { - return gulp.src("test/**/*.js", { read: false }) - .pipe(mocha({ reporter: "list" })); -}); - -gulp.task("coverage", [ "test" ], (done) => { - gulp.src([ "src/**/*.js" ]) - .pipe(istanbul()) - .pipe(istanbul.hookRequire()) - .on("finish", () => { - gulp.src([ "test/**/*.js" ]) - .pipe(mocha({ reporter: "mocha-lcov-reporter" })) - .pipe(istanbul.writeReports()) - .on("end", done); - }); -}); - -gulp.task("lint", () => { - return gulp.src([ "src/**/*.js" ]) - .pipe(jshint()) - .pipe(jshint.reporter("default")); -}); - -gulp.task("clean-jsdoc", (done) => { - return del([ "publish/jsdoc/" ], done); -}); - -gulp.task("jsdoc", [ "clean-jsdoc" ], (cb) => { - var config = require('./jsdoc.json'); - gulp.src([ "src/**/*.js" ], {read: false}) - .pipe(jsdoc(config, cb)); -}); - -gulp.task("clean-demo", (done) => { - return del([ "publish/demo/" ], done); -}); - -gulp.task("copy-demo", [ "clean-demo", "build" ], () => { - return merge( - gulp.src('demo/**/*') - .pipe(gulp.dest('publish/demo/')), - gulp.src('build/**/*') - .pipe(gulp.dest('publish/demo/kuromoji/build/')), - gulp.src('dict/**/*') - .pipe(gulp.dest('publish/demo/kuromoji/dict/'))); -}); - -gulp.task("build-demo", [ "copy-demo" ], () => { - return bower({ cwd: 'publish/demo/' }); -}); - -gulp.task("webserver", [ "build-demo", "jsdoc" ], () => { - gulp.src("publish/") - .pipe(webserver({ - port: 8000, - livereload: true, - directoryListing: true - })); -}); - -gulp.task("deploy", [ "build-demo", "jsdoc" ], () => { - return gulp.src('publish/**/*') - .pipe(ghPages()); -}); - -gulp.task("version", function () { - let type = 'patch'; - if (argv['minor']) { - type = 'minor'; - } - if (argv['major']) { - type = 'major'; - } - if (argv['prerelease']) { - type = 'prerelease'; - } - return gulp.src([ './bower.json', './package.json' ]) - .pipe(bump({ type: type })) - .pipe(gulp.dest('./')); -}); - -gulp.task("release-commit", function () { - var version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version; - return gulp.src('.') - .pipe(git.add()) - .pipe(git.commit(`chore: release ${version}`)); -}); - -gulp.task("release-tag", function (callback) { - var version = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version; - git.tag(version, `${version} release`, function (error) { - if (error) { - return callback(error); - } - callback(); - }); -}); - -gulp.task("release", [ "test" ], () => { - sequence("release-commit", "release-tag"); -}); diff --git a/jsdoc.json b/jsdoc.json deleted file mode 100644 index 46adc343..00000000 --- a/jsdoc.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "tags": { - "allowUnknownTags": true - }, - "opts": { - "destination": "./publish/jsdoc/" - }, - "plugins": [ - "plugins/markdown" - ], - "templates": { - "cleverLinks": false, - "monospaceLinks": false, - "default": { - "outputSourceFiles": true - }, - "path": "ink-docstrap", - "theme": "cerulean", - "navType": "vertical", - "linenums": true, - "dateFormat": "MMMM Do YYYY, h:mm:ss a" - } -} diff --git a/package-lock.json b/package-lock.json index 00d685ca..f29fcdac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8945 +1,133 @@ { "name": "kuromoji", - "version": "0.1.2", - "lockfileVersion": 1, + "version": "0.0.1", + "lockfileVersion": 3, "requires": true, - "dependencies": { - "JSONStream": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", - "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", - "dev": true, - "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" - } - }, - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", - "dev": true - }, - "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "dev": true, - "requires": { - "mime-types": "2.1.18", - "negotiator": "0.6.1" - } - }, - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - }, - "acorn-node": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.3.0.tgz", - "integrity": "sha512-efP54n3d1aLfjL2UMdaXa6DsswwzJeI5rqhbFvXMrKiJ6eJFpf+7R0zN7t8IC+XKn2YOAFAv6xbBNgHUkoHWLw==", - "dev": true, - "requires": { - "acorn": "5.5.3", - "xtend": "4.0.1" - }, - "dependencies": { - "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", - "dev": true - } - } - }, - "add-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz", - "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", - "dev": true - }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", - "dev": true, - "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" - } - }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, - "ansi-colors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", - "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-cyan": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-cyan/-/ansi-cyan-0.1.1.tgz", - "integrity": "sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", - "dev": true - }, - "ansi-gray": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-gray/-/ansi-gray-0.1.1.tgz", - "integrity": "sha1-KWLPVOyXksSFEKPetSRDaGHvclE=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-red": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ansi-red/-/ansi-red-0.1.1.tgz", - "integrity": "sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw=", - "dev": true, - "requires": { - "ansi-wrap": "0.1.0" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "ansi-wrap": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ansi-wrap/-/ansi-wrap-0.1.0.tgz", - "integrity": "sha1-qCJQ3bABXponyoLoLqYDu/pF768=", - "dev": true - }, - "any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=", - "dev": true - }, - "any-shell-escape": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/any-shell-escape/-/any-shell-escape-0.1.1.tgz", - "integrity": "sha1-1Vq5ciRMcaml4asIefML8RCAaVk=", - "dev": true - }, - "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", - "dev": true - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "1.0.3" - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-differ": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", - "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", - "dev": true - }, - "array-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", - "dev": true - }, - "array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true - }, - "array-ify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "dev": true - }, - "array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, - "array-slice": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==", - "dev": true - }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "1.0.3" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true - }, - "asn1.js": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" - } - }, - "assert": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", - "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", - "dev": true, - "requires": { - "util": "0.10.3" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "astw": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", - "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", - "dev": true, - "requires": { - "acorn": "4.0.13" - } - }, - "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", - "requires": { - "lodash": "4.17.5" - } - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "atob": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.0.3.tgz", - "integrity": "sha1-GcenYEc3dEaPILLS0DNyrX1Mv10=", - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true - }, - "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", - "dev": true - }, - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - } - } - }, - "base64-js": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz", - "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==", - "dev": true - }, - "batch": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", - "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "beeper": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", - "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", - "dev": true - }, - "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", - "dev": true - }, - "bn.js": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", - "dev": true - }, - "body-parser": { - "version": "1.8.4", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.8.4.tgz", - "integrity": "sha1-1JfgS8E7P5qL2McLsM3Bby4CiJg=", - "dev": true, - "requires": { - "bytes": "1.0.0", - "depd": "0.4.5", - "iconv-lite": "0.4.4", - "media-typer": "0.3.0", - "on-finished": "2.1.0", - "qs": "2.2.4", - "raw-body": "1.3.0", - "type-is": "1.5.7" - }, - "dependencies": { - "bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", - "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", - "dev": true - }, - "depd": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/depd/-/depd-0.4.5.tgz", - "integrity": "sha1-GmZLUziLSmVz6K5ntfdnxpPKl/E=", - "dev": true - }, - "ee-first": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.0.5.tgz", - "integrity": "sha1-jJshKJjYzZ8alDZlDOe+ICyen/A=", - "dev": true - }, - "on-finished": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.1.0.tgz", - "integrity": "sha1-DFOfCSkej/rd4MiiWFD7LO3HAi0=", - "dev": true, - "requires": { - "ee-first": "1.0.5" - } - }, - "qs": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/qs/-/qs-2.2.4.tgz", - "integrity": "sha1-Lp+800tUDjQhySTs0B6QqpdTGcg=", - "dev": true - } - } - }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - }, - "bower": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/bower/-/bower-1.8.2.tgz", - "integrity": "sha1-rfU1KcjUrwLvJPuNU0HBQZ0z4vc=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.1.tgz", - "integrity": "sha512-SO5lYHA3vO6gz66erVvedSCkp7AKWdv6VcQ2N4ysXfPxdAlxAMMAdwegGGcv1Bqwm7naF1hNdk5d6AAIEHV2nQ==", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "define-property": "1.0.0", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "kind-of": "6.0.2", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", - "dev": true - }, - "browser-pack": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.4.tgz", - "integrity": "sha512-Q4Rvn7P6ObyWfc4stqLWHtG1MJ8vVtjgT24Zbu+8UTzxYuZouqZsmNRRTFVMY/Ux0eIKv1d+JWzsInTX+fdHPQ==", - "dev": true, - "requires": { - "JSONStream": "1.3.2", - "combine-source-map": "0.8.0", - "defined": "1.0.0", - "safe-buffer": "5.1.1", - "through2": "2.0.3", - "umd": "3.0.3" - } - }, - "browser-resolve": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", - "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", - "dev": true, - "requires": { - "resolve": "1.1.7" - }, - "dependencies": { - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - } - } - }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, - "browserify": { - "version": "16.1.1", - "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.1.1.tgz", - "integrity": "sha512-iSH21jK0+IApV8YHOfmGt1qsGd74oflQ1Ko/28JOkWLFNBngAQfKb6WYIJ9CufH8vycqKX1sYU3y7ZrVhwevAg==", - "dev": true, - "requires": { - "JSONStream": "1.3.2", - "assert": "1.4.1", - "browser-pack": "6.0.4", - "browser-resolve": "1.11.2", - "browserify-zlib": "0.2.0", - "buffer": "5.1.0", - "cached-path-relative": "1.0.1", - "concat-stream": "1.6.1", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.2.0", - "duplexer2": "0.1.4", - "events": "2.0.0", - "glob": "7.1.2", - "has": "1.0.1", - "htmlescape": "1.1.1", - "https-browserify": "1.0.0", - "inherits": "2.0.3", - "insert-module-globals": "7.0.2", - "labeled-stream-splicer": "2.0.0", - "mkdirp": "0.5.1", - "module-deps": "6.0.0", - "os-browserify": "0.3.0", - "parents": "1.0.1", - "path-browserify": "0.0.0", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.5", - "resolve": "1.5.0", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.1", - "string_decoder": "1.0.3", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", - "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.3", - "vm-browserify": "0.0.4", - "xtend": "4.0.1" - } - }, - "browserify-aes": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", - "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", - "dev": true, - "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - }, - "browserify-cipher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", - "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", - "dev": true, - "requires": { - "browserify-aes": "1.1.1", - "browserify-des": "1.0.0", - "evp_bytestokey": "1.0.3" - } - }, - "browserify-des": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", - "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.3" - } - }, - "browserify-rsa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", - "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" - } - }, - "browserify-sign": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", - "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "elliptic": "6.4.0", - "inherits": "2.0.3", - "parse-asn1": "5.1.0" - } - }, - "browserify-zlib": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", - "dev": true, - "requires": { - "pako": "1.0.6" - } - }, - "buffer": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.1.0.tgz", - "integrity": "sha512-YkIRgwsZwJWTnyQrsBTWefizHh+8GYj3kbL1BTiAQ/9pwpino0G7B2gp5tx/FUBqUlvtxV85KNR3mwfAtv15Yw==", - "dev": true, - "requires": { - "base64-js": "1.2.3", - "ieee754": "1.1.10" - } - }, - "buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", - "dev": true - }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true - }, - "builtin-status-codes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", - "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", - "dev": true - }, - "bump-regex": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bump-regex/-/bump-regex-3.1.0.tgz", - "integrity": "sha512-pgiPDUHh6bT/MDBU/nA1dU67337qD4MbrpQHmpDMiBChEsPEZwNelO25GenJrRYUXbWZuvsIZGLBChtN8Nxb+g==", - "dev": true, - "requires": { - "semver": "5.5.0", - "xtend": "4.0.1" - }, - "dependencies": { - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - } - } - }, - "bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" - } - }, - "cached-path-relative": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", - "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", - "dev": true - }, - "camelcase": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", - "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", - "dev": true - }, - "camelcase-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", - "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", - "dev": true, - "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true - }, - "catharsis": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", - "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", - "dev": true, - "requires": { - "underscore-contrib": "0.3.0" - } - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "optional": true, - "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } - }, - "chai": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", - "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", - "dev": true, - "requires": { - "assertion-error": "1.1.0", - "check-error": "1.0.2", - "deep-eql": "3.0.1", - "get-func-name": "2.0.0", - "pathval": "1.1.0", - "type-detect": "4.0.8" - } - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true - }, - "cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "cli": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", - "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", - "dev": true, - "requires": { - "exit": "0.1.2", - "glob": "7.1.2" - } - }, - "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", - "dev": true, - "requires": { - "restore-cursor": "1.0.1" - } - }, - "cli-width": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-1.1.1.tgz", - "integrity": "sha1-pNKT72frt7iNSk1CwMzwDE0eNm0=", - "dev": true - }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, - "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true - } - } - }, - "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", - "dev": true - }, - "clone-buffer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", - "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", - "dev": true - }, - "clone-stats": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", - "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", - "dev": true - }, - "cloneable-readable": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.1.2.tgz", - "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "process-nextick-args": "2.0.0", - "readable-stream": "2.3.5" - } - }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" - } - }, - "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "dev": true - }, - "combine-source-map": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz", - "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", - "dev": true, - "requires": { - "convert-source-map": "1.1.3", - "inline-source-map": "0.6.2", - "lodash.memoize": "3.0.4", - "source-map": "0.5.7" - } - }, - "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, - "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", - "dev": true - }, - "compare-func": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", - "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", - "dev": true, - "requires": { - "array-ify": "1.0.0", - "dot-prop": "3.0.0" - } - }, - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "concat-stream": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", - "integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.5", - "typedarray": "0.0.6" - } - }, - "connect": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", - "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", - "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.0", - "parseurl": "1.3.2", - "utils-merge": "1.0.1" - } - }, - "connect-livereload": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/connect-livereload/-/connect-livereload-0.4.1.tgz", - "integrity": "sha1-D4oagWvJuv+uRjfM6pF0Yv41kXo=", - "dev": true - }, - "console-browserify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", - "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", - "dev": true, - "requires": { - "date-now": "0.1.4" - } - }, - "constants-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", - "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", - "dev": true - }, - "conventional-changelog": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-1.1.18.tgz", - "integrity": "sha512-swf5bqhm7PsY2cw6zxuPy6+rZiiGwEpQnrWki+L+z2oZI53QSYwU4brpljmmWss821AsiwmVL+7V6hP+ER+TBA==", - "dev": true, - "requires": { - "conventional-changelog-angular": "1.6.6", - "conventional-changelog-atom": "0.2.4", - "conventional-changelog-codemirror": "0.3.4", - "conventional-changelog-core": "2.0.5", - "conventional-changelog-ember": "0.3.6", - "conventional-changelog-eslint": "1.0.5", - "conventional-changelog-express": "0.3.4", - "conventional-changelog-jquery": "0.1.0", - "conventional-changelog-jscs": "0.1.0", - "conventional-changelog-jshint": "0.3.4", - "conventional-changelog-preset-loader": "1.1.6" - } - }, - "conventional-changelog-angular": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz", - "integrity": "sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==", - "dev": true, - "requires": { - "compare-func": "1.3.2", - "q": "1.5.1" - } - }, - "conventional-changelog-atom": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-0.2.4.tgz", - "integrity": "sha512-4+hmbBwcAwx1XzDZ4aEOxk/ONU0iay10G0u/sld16ksgnRUHN7CxmZollm3FFaptr6VADMq1qxomA+JlpblBlg==", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-codemirror": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.3.4.tgz", - "integrity": "sha512-8M7pGgQVzRU//vG3rFlLYqqBywOLxu9XM0/lc1/1Ll7RuKA79PgK9TDpuPmQDHFnqGS7D1YiZpC3Z0D9AIYExg==", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-core": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-2.0.5.tgz", - "integrity": "sha512-lP1s7Z3NyEFcG78bWy7GG7nXsq9OpAJgo2xbyAlVBDweLSL5ghvyEZlkEamnAQpIUVK0CAVhs8nPvCiQuXT/VA==", - "dev": true, - "requires": { - "conventional-changelog-writer": "3.0.4", - "conventional-commits-parser": "2.1.5", - "dateformat": "3.0.3", - "get-pkg-repo": "1.4.0", - "git-raw-commits": "1.3.4", - "git-remote-origin-url": "2.0.0", - "git-semver-tags": "1.3.4", - "lodash": "4.17.5", - "normalize-package-data": "2.4.0", - "q": "1.5.1", - "read-pkg": "1.1.0", - "read-pkg-up": "1.0.1", - "through2": "2.0.3" - }, - "dependencies": { - "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "dev": true - } - } - }, - "conventional-changelog-ember": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-0.3.6.tgz", - "integrity": "sha512-hBM1xb5IrjNtsjXaGryPF/Wn36cwyjkNeqX/CIDbJv/1kRFBHsWoSPYBiNVEpg8xE5fcK4DbPhGTDN2sVoPeiA==", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-eslint": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.5.tgz", - "integrity": "sha512-7NUv+gMOS8Y49uPFRgF7kuLZqpnrKa2bQMZZsc62NzvaJmjUktnV03PYHuXhTDEHt5guvV9gyEFtUpgHCDkojg==", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-express": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-0.3.4.tgz", - "integrity": "sha512-M+UUb715TXT6l9vyMf4HYvAepnQn0AYTcPi6KHrFsd80E0HErjQnqStBg8i3+Qm7EV9+RyATQEnIhSzHbdQ7+A==", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-jquery": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-0.1.0.tgz", - "integrity": "sha1-Agg5cWLjhGmG5xJztsecW1+A9RA=", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-jscs": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-jscs/-/conventional-changelog-jscs-0.1.0.tgz", - "integrity": "sha1-BHnrRDzH1yxYvwvPDvHURKkvDlw=", - "dev": true, - "requires": { - "q": "1.5.1" - } - }, - "conventional-changelog-jshint": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-0.3.4.tgz", - "integrity": "sha512-CdrqwDgL56b176FVxHmhuOvnO1dRDQvrMaHyuIVjcFlOXukATz2wVT17g8jQU3LvybVbyXvJRbdD5pboo7/1KQ==", - "dev": true, - "requires": { - "compare-func": "1.3.2", - "q": "1.5.1" - } - }, - "conventional-changelog-preset-loader": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.6.tgz", - "integrity": "sha512-yWPIP9wwsCKeUSPYApnApWhKIDjWRIX/uHejGS1tYfEsQR/bwpDFET7LYiHT+ujNbrlf6h1s3NlPGheOd4yJRQ==", - "dev": true - }, - "conventional-changelog-writer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-3.0.4.tgz", - "integrity": "sha512-EUf/hWiEj3IOa5Jk8XDzM6oS0WgijlYGkUfLc+mDnLH9RwpZqhYIBwgJHWHzEB4My013wx2FhmUu45P6tQrucw==", - "dev": true, - "requires": { - "compare-func": "1.3.2", - "conventional-commits-filter": "1.1.5", - "dateformat": "3.0.3", - "handlebars": "4.0.11", - "json-stringify-safe": "5.0.1", - "lodash": "4.17.5", - "meow": "4.0.0", - "semver": "5.5.0", - "split": "1.0.1", - "through2": "2.0.3" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "4.1.0", - "map-obj": "2.0.0", - "quick-lru": "1.1.0" - } - }, - "dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", - "dev": true - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" - } - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.0.tgz", - "integrity": "sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==", - "dev": true, - "requires": { - "camelcase-keys": "4.2.0", - "decamelize-keys": "1.1.0", - "loud-rejection": "1.6.0", - "minimist": "1.2.0", - "minimist-options": "3.0.2", - "normalize-package-data": "2.4.0", - "read-pkg-up": "3.0.0", - "redent": "2.0.0", - "trim-newlines": "2.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "3.0.0" - } - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.4.0", - "path-type": "3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "3.0.0" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "3.2.0", - "strip-indent": "2.0.0" - } - }, - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "conventional-commits-filter": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-1.1.5.tgz", - "integrity": "sha512-mj3+WLj8UZE72zO9jocZjx8+W4Bwnx/KHoIz1vb4F8XUXj0XSjp8Y3MFkpRyIpsRiCBX+DkDjxGKF/nfeu7BGw==", - "dev": true, - "requires": { - "is-subset": "0.1.1", - "modify-values": "1.0.0" - } - }, - "conventional-commits-parser": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.5.tgz", - "integrity": "sha512-jaAP61py+ISMF3/n3yIiIuY5h6mJlucOqawu5mLB1HaQADLvg/y5UB3pT7HSucZJan34lp7+7ylQPfbKEGmxrA==", - "dev": true, - "requires": { - "JSONStream": "1.3.2", - "is-text-path": "1.0.1", - "lodash": "4.17.5", - "meow": "4.0.0", - "split2": "2.2.0", - "through2": "2.0.3", - "trim-off-newlines": "1.0.1" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "4.1.0", - "map-obj": "2.0.0", - "quick-lru": "1.1.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" - } - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.0.tgz", - "integrity": "sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==", - "dev": true, - "requires": { - "camelcase-keys": "4.2.0", - "decamelize-keys": "1.1.0", - "loud-rejection": "1.6.0", - "minimist": "1.2.0", - "minimist-options": "3.0.2", - "normalize-package-data": "2.4.0", - "read-pkg-up": "3.0.0", - "redent": "2.0.0", - "trim-newlines": "2.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "3.0.0" - } - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.4.0", - "path-type": "3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "3.0.0" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "3.2.0", - "strip-indent": "2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "convert-source-map": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", - "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "coveralls": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.0.tgz", - "integrity": "sha512-ZppXR9y5PraUOrf/DzHJY6gzNUhXYE3b9D43xEXs4QYZ7/Oe0Gy0CS+IPKWFfvQFXB3RG9QduaQUFehzSpGAFw==", - "dev": true, - "requires": { - "js-yaml": "3.11.0", - "lcov-parse": "0.0.10", - "log-driver": "1.2.7", - "minimist": "1.2.0", - "request": "2.85.0" - } - }, - "create-ecdh": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", - "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0" - } - }, - "create-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", - "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.3", - "ripemd160": "2.0.1", - "sha.js": "2.4.10" - } - }, - "create-hmac": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", - "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", - "dev": true, - "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.1.3", - "inherits": "2.0.3", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.10" - } - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "4.1.2", - "shebang-command": "1.2.0", - "which": "1.3.0" - }, - "dependencies": { - "lru-cache": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", - "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - } - } - }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "dev": true, - "requires": { - "boom": "5.2.0" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - } - } - }, - "crypto-browserify": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", - "dev": true, - "requires": { - "browserify-cipher": "1.0.0", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.0", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "diffie-hellman": "5.0.2", - "inherits": "2.0.3", - "pbkdf2": "3.0.14", - "public-encrypt": "4.0.0", - "randombytes": "2.0.6", - "randomfill": "1.0.4" - } - }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, - "requires": { - "array-find-index": "1.0.2" - } - }, - "dargs": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", - "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "date-now": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", - "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", - "dev": true - }, - "dateformat": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", - "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", - "dev": true - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true - }, - "decamelize-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", - "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, - "requires": { - "decamelize": "1.2.0", - "map-obj": "1.0.1" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true - }, - "defaults": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", - "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", - "dev": true, - "requires": { - "clone": "1.0.3" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "del": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", - "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", - "dev": true, - "requires": { - "globby": "6.1.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", - "p-map": "1.2.0", - "pify": "3.0.0", - "rimraf": "2.6.2" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, - "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", - "dev": true - }, - "deprecated": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", - "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=", - "dev": true - }, - "deps-sort": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", - "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", - "dev": true, - "requires": { - "JSONStream": "1.3.2", - "shasum": "1.0.2", - "subarg": "1.0.0", - "through2": "2.0.3" - } - }, - "des.js": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", - "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" - } - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true - }, - "detect-file": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", - "dev": true - }, - "detective": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz", - "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", - "dev": true, - "requires": { - "acorn-node": "1.3.0", - "defined": "1.0.0", - "minimist": "1.2.0" - } - }, - "diff": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", - "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", - "dev": true - }, - "diffie-hellman": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", - "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" - } - }, - "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", - "dev": true, - "requires": { - "domelementtype": "1.1.3", - "entities": "1.1.1" - }, - "dependencies": { - "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", - "dev": true - } - } - }, - "domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", - "dev": true - }, - "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", - "dev": true - }, - "domhandler": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", - "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", - "dev": true, - "requires": { - "domelementtype": "1.3.0" - } - }, - "domutils": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", - "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", - "dev": true, - "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" - } - }, - "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, - "requires": { - "is-obj": "1.0.1" - } - }, - "doublearray": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/doublearray/-/doublearray-0.0.2.tgz", - "integrity": "sha1-Yxhv6NNEEydtNiH2qg7F954ifvk=" - }, - "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", - "dev": true - }, - "duplexer2": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", - "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", - "dev": true, - "requires": { - "readable-stream": "2.3.5" - } - }, - "duplexify": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", - "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", - "dev": true, - "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.5", - "stream-shift": "1.0.0" - }, - "dependencies": { - "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", - "dev": true, - "requires": { - "once": "1.4.0" - } - } - } - }, - "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true - }, - "elliptic": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", - "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" - } - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true - }, - "end-of-stream": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", - "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", - "dev": true, - "requires": { - "once": "1.3.3" - }, - "dependencies": { - "once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - } - } - }, - "entities": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", - "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", - "dev": true - }, - "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", - "dev": true, - "requires": { - "is-arrayish": "0.2.1" - } - }, - "es6-promise": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-2.3.0.tgz", - "integrity": "sha1-lu258v2wGZWCKyY92KratnSBgbw=", - "dev": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", - "dev": true, - "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": "1.0.1" - } - } - } - }, - "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", - "dev": true - }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true - }, - "event-stream": { - "version": "3.3.4", - "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, - "requires": { - "duplexer": "0.1.1", - "from": "0.1.7", - "map-stream": "0.1.0", - "pause-stream": "0.0.11", - "split": "0.3.3", - "stream-combiner": "0.0.4", - "through": "2.3.8" - } - }, - "events": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/events/-/events-2.0.0.tgz", - "integrity": "sha512-r/M5YkNg9zwI8QbSf7tsDWWJvO3PGwZXyG7GpFAxtMASnHL2eblFd7iHiGPtyGKKFPZ59S63NeX10Ws6WqGDcg==", - "dev": true - }, - "evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dev": true, - "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.1" - } - }, - "execa": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", - "integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", - "dev": true, - "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" - } - }, - "exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", - "dev": true - }, - "exit-hook": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", - "dev": true, - "requires": { - "fill-range": "2.2.3" - }, - "dependencies": { - "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", - "dev": true, - "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" - } - }, - "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "dev": true, - "requires": { - "homedir-polyfill": "1.0.1" - } - }, - "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", - "dev": true - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, - "fancy-log": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", - "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", - "dev": true, - "requires": { - "ansi-gray": "0.1.1", - "color-support": "1.1.3", - "time-stamp": "1.1.0" - } - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "faye-websocket": { - "version": "0.7.3", - "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.7.3.tgz", - "integrity": "sha1-zEB0x/Sk39A69U3WXDVLE1EyzhE=", - "dev": true, - "requires": { - "websocket-driver": "0.7.0" - } - }, - "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", - "dev": true, - "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" - } - }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" - } - }, - "find-index": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", - "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", - "dev": true - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "dev": true, - "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" - } - }, - "findup-sync": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", - "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", - "dev": true, - "requires": { - "detect-file": "1.0.0", - "is-glob": "3.1.0", - "micromatch": "3.1.9", - "resolve-dir": "1.0.1" - } - }, - "fined": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", - "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", - "dev": true, - "requires": { - "expand-tilde": "2.0.2", - "is-plain-object": "2.0.4", - "object.defaults": "1.1.0", - "object.pick": "1.3.0", - "parse-filepath": "1.0.2" - } - }, - "first-chunk-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", - "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", - "dev": true - }, - "flagged-respawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.0.tgz", - "integrity": "sha1-Tnmumy6zi/hrO7Vr8+ClaqX8q9c=", - "dev": true - }, - "flex-exec": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/flex-exec/-/flex-exec-1.0.0.tgz", - "integrity": "sha1-BpdLaFMoOdKhLDLevNsSN4IA/fA=", - "dev": true - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "for-own": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - }, - "foreachasync": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/foreachasync/-/foreachasync-3.0.0.tgz", - "integrity": "sha1-VQKYfchxS+M5IJfzLgBxyd7gfPY=", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", - "dev": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.6", - "mime-types": "2.1.18" - } - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "0.2.2" - } - }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true - }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gaze": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", - "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", - "dev": true, - "requires": { - "globule": "0.1.0" - } - }, - "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "get-pkg-repo": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", - "integrity": "sha1-xztInAbYDMVTbCyFP54FIyBWly0=", - "dev": true, - "requires": { - "hosted-git-info": "2.6.0", - "meow": "3.7.0", - "normalize-package-data": "2.4.0", - "parse-github-repo-url": "1.4.1", - "through2": "2.0.3" - } - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "1.0.0" - } - }, - "git-raw-commits": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.4.tgz", - "integrity": "sha512-G3O+41xHbscpgL5nA0DUkbFVgaAz5rd57AMSIMew8p7C8SyFwZDyn08MoXHkTl9zcD0LmxsLFPxbqFY4YPbpPA==", - "dev": true, - "requires": { - "dargs": "4.1.0", - "lodash.template": "4.4.0", - "meow": "4.0.0", - "split2": "2.2.0", - "through2": "2.0.3" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "4.1.0", - "map-obj": "2.0.0", - "quick-lru": "1.1.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" - } - }, - "lodash.template": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", - "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.templatesettings": "4.1.0" - } - }, - "lodash.templatesettings": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", - "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0" - } - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.0.tgz", - "integrity": "sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==", - "dev": true, - "requires": { - "camelcase-keys": "4.2.0", - "decamelize-keys": "1.1.0", - "loud-rejection": "1.6.0", - "minimist": "1.2.0", - "minimist-options": "3.0.2", - "normalize-package-data": "2.4.0", - "read-pkg-up": "3.0.0", - "redent": "2.0.0", - "trim-newlines": "2.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "3.0.0" - } - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.4.0", - "path-type": "3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "3.0.0" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "3.2.0", - "strip-indent": "2.0.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "git-remote-origin-url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz", - "integrity": "sha1-UoJlna4hBxRaERJhEq0yFuxfpl8=", - "dev": true, - "requires": { - "gitconfiglocal": "1.0.0", - "pify": "2.3.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "git-semver-tags": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-1.3.4.tgz", - "integrity": "sha512-Xe2Z74MwXZfAezuaO6e6cA4nsgeCiARPzaBp23gma325c/OXdt//PhrknptIaynNeUp2yWtmikV7k5RIicgGIQ==", - "dev": true, - "requires": { - "meow": "4.0.0", - "semver": "5.5.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "4.1.0", - "map-obj": "2.0.0", - "quick-lru": "1.1.0" - } - }, - "find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, - "requires": { - "locate-path": "2.0.0" - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" - } - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.0.tgz", - "integrity": "sha512-Me/kel335m6vMKmEmA6c87Z6DUFW3JqkINRnxkbC+A/PUm0D5Fl2dEBQrPKnqCL9Te/CIa1MUt/0InMJhuC/sw==", - "dev": true, - "requires": { - "camelcase-keys": "4.2.0", - "decamelize-keys": "1.1.0", - "loud-rejection": "1.6.0", - "minimist": "1.2.0", - "minimist-options": "3.0.2", - "normalize-package-data": "2.4.0", - "read-pkg-up": "3.0.0", - "redent": "2.0.0", - "trim-newlines": "2.0.0" - } - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "1.3.1", - "json-parse-better-errors": "1.0.1" - } - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "3.0.0" - } - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.4.0", - "path-type": "3.0.0" - } - }, - "read-pkg-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", - "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "3.0.0" - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "3.2.0", - "strip-indent": "2.0.0" - } - }, - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - } - } - }, - "gitconfiglocal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz", - "integrity": "sha1-QdBF84UaXqiPA/JMocYXgRRGS5s=", - "dev": true, - "requires": { - "ini": "1.3.5" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", - "dev": true, - "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" - }, - "dependencies": { - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" - } - }, - "glob-stream": { - "version": "3.1.18", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", - "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", - "dev": true, - "requires": { - "glob": "4.5.3", - "glob2base": "0.0.12", - "minimatch": "2.0.10", - "ordered-read-streams": "0.1.0", - "through2": "0.6.5", - "unique-stream": "1.0.0" - }, - "dependencies": { - "glob": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "minimatch": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "glob-watcher": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", - "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", - "dev": true, - "requires": { - "gaze": "0.5.2" - } - }, - "glob2base": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", - "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", - "dev": true, - "requires": { - "find-index": "0.1.1" - } - }, - "global-modules": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "dev": true, - "requires": { - "global-prefix": "1.0.2", - "is-windows": "1.0.2", - "resolve-dir": "1.0.1" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "dev": true, - "requires": { - "expand-tilde": "2.0.2", - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "1.0.2", - "which": "1.3.0" - } - }, - "globby": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", - "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", - "dev": true, - "requires": { - "array-union": "1.0.2", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "globule": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", - "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", - "dev": true, - "requires": { - "glob": "3.1.21", - "lodash": "1.0.2", - "minimatch": "0.2.14" - }, - "dependencies": { - "glob": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", - "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", - "dev": true, - "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" - } - }, - "graceful-fs": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", - "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", - "dev": true - }, - "inherits": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", - "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", - "dev": true - }, - "lodash": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", - "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", - "dev": true - }, - "minimatch": { - "version": "0.2.14", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", - "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", - "dev": true, - "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" - } - } - } - }, - "glogg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", - "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "graceful-fs": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", - "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", - "dev": true, - "requires": { - "natives": "1.1.2" - } - }, - "growl": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", - "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", - "dev": true - }, - "gulp": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", - "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", - "dev": true, - "requires": { - "archy": "1.0.0", - "chalk": "1.1.3", - "deprecated": "0.0.1", - "gulp-util": "3.0.8", - "interpret": "1.1.0", - "liftoff": "2.5.0", - "minimist": "1.2.0", - "orchestrator": "0.3.8", - "pretty-hrtime": "1.0.3", - "semver": "4.3.6", - "tildify": "1.2.0", - "v8flags": "2.1.1", - "vinyl-fs": "0.3.14" - } - }, - "gulp-bower": { - "version": "0.0.14", - "resolved": "https://registry.npmjs.org/gulp-bower/-/gulp-bower-0.0.14.tgz", - "integrity": "sha512-UFcx8hzq+zDryzWUhsWfAklNlo57wdzkvnifJtWcIi1stJW0cqfDAE7IXvr7ftswO64yAfzEHdd93AyDq0RB0g==", - "dev": true, - "requires": { - "ansi-colors": "1.1.0", - "bower": "1.8.2", - "fancy-log": "1.3.2", - "inquirer": "0.11.4", - "plugin-error": "0.1.2", - "through2": "0.6.2", - "vinyl": "2.1.0", - "walk": "2.3.3" - }, - "dependencies": { - "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.2.tgz", - "integrity": "sha1-UyZYJMVV5/zcQRHc3FLH3mRjbHU=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", - "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", - "dev": true, - "requires": { - "clone": "2.1.1", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.1.2", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" - } - } - } - }, - "gulp-bump": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/gulp-bump/-/gulp-bump-3.1.0.tgz", - "integrity": "sha512-v5FN3TGstRqkqWTPrp1jcUyCM4YbUIvYzJy/lG2YWFXk5HvFgTucBcVhhpH1nJcnI9Y3skPnpTzYoaBQO1qBzA==", - "dev": true, - "requires": { - "bump-regex": "3.1.0", - "plugin-error": "0.1.2", - "plugin-log": "0.1.0", - "semver": "5.5.0", - "through2": "2.0.3" - }, - "dependencies": { - "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - } - } - }, - "gulp-conventional-changelog": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/gulp-conventional-changelog/-/gulp-conventional-changelog-1.1.18.tgz", - "integrity": "sha512-bkGObiMucy/TqNpB4/NOtNc5aWfEfTcRFyItpQ4inNPC6ZIvFeCT6EPOy4MjbXF47NT6/dubuteln5nJjAmFyA==", - "dev": true, - "requires": { - "add-stream": "1.0.0", - "concat-stream": "1.6.1", - "conventional-changelog": "1.1.18", - "fancy-log": "1.3.2", - "object-assign": "4.1.1", - "plugin-error": "1.0.1", - "through2": "2.0.3" - }, - "dependencies": { - "plugin-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", - "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", - "dev": true, - "requires": { - "ansi-colors": "1.1.0", - "arr-diff": "4.0.0", - "arr-union": "3.1.0", - "extend-shallow": "3.0.2" - } - } - } - }, - "gulp-gh-pages-will": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/gulp-gh-pages-will/-/gulp-gh-pages-will-0.5.5.tgz", - "integrity": "sha512-Aat+vWbqy+xKEbbSp0JOZRGOSLnmh7Nvs8VrfUWxYBqtseu0cOaeOP3ea3UxuA3wu6WM34ljkP1wcOgApfEglQ==", - "dev": true, - "requires": { - "gift": "0.10.2", - "gulp-util": "3.0.8", - "readable-stream": "2.3.5", - "rimraf": "2.6.2", - "vinyl-fs": "2.4.4", - "wrap-promise": "1.0.1" - }, - "dependencies": { - "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } - }, - "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", - "dev": true - }, - "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", - "dev": true, - "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" - } - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", - "dev": true, - "requires": { - "is-posix-bracket": "0.1.1" - } - }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "gift": { - "version": "0.10.2", - "resolved": "https://registry.npmjs.org/gift/-/gift-0.10.2.tgz", - "integrity": "sha512-wC9aKnQpjfOTWX+JG4DPJkS89ux6sl8EN4hXhv/2vBoXCDTEz1JiTeGTSeuKYlCqIgUFM1JwPVym34Sys3hvzw==", - "dev": true, - "requires": { - "flex-exec": "1.0.0", - "underscore": "1.8.3" - } - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "glob-stream": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", - "integrity": "sha1-pVZlqajM3EGRWofHAeMtTgFvrSI=", - "dev": true, - "requires": { - "extend": "3.0.1", - "glob": "5.0.15", - "glob-parent": "3.1.0", - "micromatch": "2.3.11", - "ordered-read-streams": "0.3.0", - "through2": "0.6.5", - "to-absolute-glob": "0.1.1", - "unique-stream": "2.2.1" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - } - } - }, - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "dev": true, - "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" - } - }, - "ordered-read-streams": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", - "integrity": "sha1-cTfmmzKYuzQiR6G77jiByA4v14s=", - "dev": true, - "requires": { - "is-stream": "1.1.0", - "readable-stream": "2.3.5" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "unique-stream": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", - "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", - "dev": true, - "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" - } - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.3", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - }, - "vinyl-fs": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.4.tgz", - "integrity": "sha1-vm/zJwy1Xf19MGNkDegfJddTIjk=", - "dev": true, - "requires": { - "duplexify": "3.5.4", - "glob-stream": "5.3.5", - "graceful-fs": "4.1.11", - "gulp-sourcemaps": "1.6.0", - "is-valid-glob": "0.3.0", - "lazystream": "1.0.0", - "lodash.isequal": "4.5.0", - "merge-stream": "1.0.1", - "mkdirp": "0.5.1", - "object-assign": "4.1.1", - "readable-stream": "2.3.5", - "strip-bom": "2.0.0", - "strip-bom-stream": "1.0.0", - "through2": "2.0.3", - "through2-filter": "2.0.0", - "vali-date": "1.0.0", - "vinyl": "1.2.0" - } - } - } - }, - "gulp-git": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/gulp-git/-/gulp-git-2.5.2.tgz", - "integrity": "sha512-rMbJ7W7ucHEPUkcia3eVrvSvQMB+WF80GfkfWEQMJPh6vUgr6f6AuCzNhj0m3xHS/2aaFzumhlt2RzD5EWFkug==", - "dev": true, - "requires": { - "any-shell-escape": "0.1.1", - "fancy-log": "1.3.2", - "lodash.template": "4.4.0", - "plugin-error": "0.1.2", - "require-dir": "1.0.0", - "strip-bom-stream": "3.0.0", - "through2": "2.0.3", - "vinyl": "2.1.0" - }, - "dependencies": { - "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "first-chunk-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", - "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", - "dev": true, - "requires": { - "readable-stream": "2.3.5" - } - }, - "lodash.template": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", - "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.templatesettings": "4.1.0" - } - }, - "lodash.templatesettings": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", - "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0" - } - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "strip-bom-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-3.0.0.tgz", - "integrity": "sha1-lWvMXYRDD2klapDtgjdlzYWOFZw=", - "dev": true, - "requires": { - "first-chunk-stream": "2.0.0", - "strip-bom-buf": "1.0.0" - } - }, - "vinyl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", - "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", - "dev": true, - "requires": { - "clone": "2.1.1", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.1.2", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" - } - } - } - }, - "gulp-gzip": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/gulp-gzip/-/gulp-gzip-1.4.2.tgz", - "integrity": "sha512-ZIxfkUwk2XmZPTT9pPHrHUQlZMyp9nPhg2sfoeN27mBGpi7OaHnOD+WCN41NXjfJQ69lV1nQ9LLm1hYxx4h3UQ==", - "dev": true, - "requires": { - "ansi-colors": "1.1.0", - "bytes": "3.0.0", - "fancy-log": "1.3.2", - "plugin-error": "1.0.1", - "stream-to-array": "2.3.0", - "through2": "2.0.3" - }, - "dependencies": { - "plugin-error": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-1.0.1.tgz", - "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", - "dev": true, - "requires": { - "ansi-colors": "1.1.0", - "arr-diff": "4.0.0", - "arr-union": "3.1.0", - "extend-shallow": "3.0.2" - } - } - } - }, - "gulp-istanbul": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/gulp-istanbul/-/gulp-istanbul-1.1.3.tgz", - "integrity": "sha512-uMLSdqPDnBAV/B9rNyOgVMgrVC1tPbe+5GH6P13UOyxbRDT/w4sKYHWftPMA8j9om+NFvfeRlqpDXL2fixFWNA==", - "dev": true, - "requires": { - "istanbul": "0.4.5", - "istanbul-threshold-checker": "0.2.1", - "lodash": "4.17.5", - "plugin-error": "0.1.2", - "through2": "2.0.3", - "vinyl-sourcemaps-apply": "0.2.1" - } - }, - "gulp-jsdoc3": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gulp-jsdoc3/-/gulp-jsdoc3-1.0.1.tgz", - "integrity": "sha1-Yek1IS6qlrXC5yvD1n0e3d8VKTo=", - "dev": true, - "requires": { - "bluebird": "3.5.1", - "debug": "2.6.9", - "gulp-util": "3.0.8", - "ink-docstrap": "1.3.2", - "jsdoc": "3.5.5", - "map-stream": "0.0.6", - "tmp": "0.0.28" - }, - "dependencies": { - "map-stream": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.6.tgz", - "integrity": "sha1-0u9OuBGihkTHqJiZhcacL91JaCc=", - "dev": true - } - } - }, - "gulp-jshint": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/gulp-jshint/-/gulp-jshint-2.1.0.tgz", - "integrity": "sha512-sP3NK8Y/1e58O0PH9t6s7DAr/lKDSUbIY207oWSeufM6/VclB7jJrIBcPCsyhrFTCDUl9DauePbt6VqP2vPM5w==", - "dev": true, - "requires": { - "lodash": "4.17.5", - "minimatch": "3.0.4", - "plugin-error": "0.1.2", - "rcloader": "0.2.2", - "through2": "2.0.3" - } - }, - "gulp-mocha": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-5.0.0.tgz", - "integrity": "sha512-NIjXZLqqcw9DXIEBcfm0sP1AUDlUJJeaK9EGCH2s6lSwo5NK/cEat0Vm7XelOkxZnWl0O5Za+aM6E4jyxWxTlw==", - "dev": true, - "requires": { - "dargs": "5.1.0", - "execa": "0.8.0", - "mocha": "4.1.0", - "npm-run-path": "2.0.2", - "plugin-error": "0.1.2", - "through2": "2.0.3" - }, - "dependencies": { - "dargs": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-5.1.0.tgz", - "integrity": "sha1-7H6lDHhWTNNsnV7Bj2Yyn63ieCk=", - "dev": true - } - } - }, - "gulp-sourcemaps": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", - "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", - "dev": true, - "requires": { - "convert-source-map": "1.1.3", - "graceful-fs": "4.1.11", - "strip-bom": "2.0.0", - "through2": "2.0.3", - "vinyl": "1.2.0" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "vinyl": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", - "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", - "dev": true, - "requires": { - "clone": "1.0.3", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } - } - } - }, - "gulp-util": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", - "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", - "dev": true, - "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.2.0", - "fancy-log": "1.3.2", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", - "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" - }, - "dependencies": { - "object-assign": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", - "dev": true - } - } - }, - "gulp-webserver": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/gulp-webserver/-/gulp-webserver-0.9.1.tgz", - "integrity": "sha1-4JmSFl2XxYZWFtZCoWAVKbA2cGQ=", - "dev": true, - "requires": { - "connect": "3.6.6", - "connect-livereload": "0.4.1", - "gulp-util": "2.2.20", - "isarray": "0.0.1", - "node.extend": "1.1.6", - "open": "0.0.5", - "proxy-middleware": "0.5.1", - "serve-index": "1.9.1", - "serve-static": "1.13.2", - "through2": "0.5.1", - "tiny-lr": "0.1.4", - "watch": "0.11.0" - }, - "dependencies": { - "ansi-regex": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", - "dev": true - }, - "ansi-styles": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", - "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", - "dev": true - }, - "chalk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", - "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", - "dev": true, - "requires": { - "ansi-styles": "1.1.0", - "escape-string-regexp": "1.0.5", - "has-ansi": "0.1.0", - "strip-ansi": "0.3.0", - "supports-color": "0.2.0" - } - }, - "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "dev": true, - "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" - } - }, - "gulp-util": { - "version": "2.2.20", - "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz", - "integrity": "sha1-1xRuVyiRC9jwR6awseVJvCLb1kw=", - "dev": true, - "requires": { - "chalk": "0.5.1", - "dateformat": "1.0.12", - "lodash._reinterpolate": "2.4.1", - "lodash.template": "2.4.1", - "minimist": "0.2.0", - "multipipe": "0.1.2", - "through2": "0.5.1", - "vinyl": "0.2.3" - } - }, - "has-ansi": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", - "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", - "dev": true, - "requires": { - "ansi-regex": "0.2.1" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz", - "integrity": "sha1-TxInqlqHEfxjL1sHofRgequLMiI=", - "dev": true - }, - "lodash.escape": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz", - "integrity": "sha1-LOEsXghNsKV92l5dHu659dF1o7Q=", - "dev": true, - "requires": { - "lodash._escapehtmlchar": "2.4.1", - "lodash._reunescapedhtml": "2.4.1", - "lodash.keys": "2.4.1" - } - }, - "lodash.isobject": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", - "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" - } - }, - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - }, - "lodash.template": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz", - "integrity": "sha1-nmEQB+32KRKal0qzxIuBez4c8g0=", - "dev": true, - "requires": { - "lodash._escapestringchar": "2.4.1", - "lodash._reinterpolate": "2.4.1", - "lodash.defaults": "2.4.1", - "lodash.escape": "2.4.1", - "lodash.keys": "2.4.1", - "lodash.templatesettings": "2.4.1", - "lodash.values": "2.4.1" - } - }, - "lodash.templatesettings": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz", - "integrity": "sha1-6nbHXRHrhtTb6JqDiTu4YZKaxpk=", - "dev": true, - "requires": { - "lodash._reinterpolate": "2.4.1", - "lodash.escape": "2.4.1" - } - }, - "minimist": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz", - "integrity": "sha1-Tf/lJdriuGTGbC4jxicdev3s784=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "strip-ansi": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", - "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", - "dev": true, - "requires": { - "ansi-regex": "0.2.1" - } - }, - "supports-color": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", - "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", - "dev": true - }, - "through2": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", - "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "3.0.0" - } - }, - "vinyl": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz", - "integrity": "sha1-vKk4IJWC7FpJrVOKAPofEl5RMlI=", - "dev": true, - "requires": { - "clone-stats": "0.0.1" - } - }, - "xtend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", - "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", - "dev": true - } - } - }, - "gulplog": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", - "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", - "dev": true, - "requires": { - "glogg": "1.0.1" - } - }, - "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", - "dev": true, - "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": "1.0.1" - } - } - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true - }, - "har-validator": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", - "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", - "dev": true, - "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" - } - }, - "has": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", - "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", - "dev": true, - "requires": { - "function-bind": "1.1.1" - } - }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", - "dev": true - }, - "has-gulplog": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", - "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", - "dev": true, - "requires": { - "sparkles": "1.0.0" - } - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "hash-base": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", - "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" - } - }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "dev": true, - "requires": { - "boom": "4.3.1", - "cryptiles": "3.1.2", - "hoek": "4.2.1", - "sntp": "2.1.0" - } - }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, - "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", - "dev": true, - "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.0", - "minimalistic-crypto-utils": "1.0.1" - } - }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", - "dev": true - }, - "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", - "dev": true, - "requires": { - "parse-passwd": "1.0.0" - } - }, - "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", - "dev": true - }, - "htmlescape": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", - "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", - "dev": true - }, - "htmlparser2": { - "version": "3.9.2", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", - "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", - "dev": true, - "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.4.1", - "domutils": "1.7.0", - "entities": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.5" - } - }, - "http-errors": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", - "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "dev": true, - "requires": { - "depd": "1.1.1", - "inherits": "2.0.3", - "setprototypeof": "1.0.3", - "statuses": "1.3.1" - } - }, - "http-parser-js": { - "version": "0.4.11", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.11.tgz", - "integrity": "sha512-QCR5O2AjjMW8Mo4HyI1ctFcv+O99j/0g367V3YoVnrNw5hkDvAWZD0lWGcc+F4yN3V55USPCVix4efb75HxFfA==", - "dev": true - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.14.1" - } - }, - "https-browserify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", - "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", - "dev": true - }, - "iconv-lite": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.4.tgz", - "integrity": "sha1-6V8uQdsHNfwhZS94J6XuMuY8g6g=", - "dev": true - }, - "ieee754": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.10.tgz", - "integrity": "sha512-byWFX8OyW/qeVxcY21r6Ncxl0ZYHgnf0cPup2h34eHXrCJbOp7IuqnJ4Q0omfyWl6Z++BTI6bByf31pZt7iRLg==", - "dev": true - }, - "indent-string": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", - "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", - "dev": true, - "requires": { - "repeating": "2.0.1" - } - }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true - }, - "ink-docstrap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/ink-docstrap/-/ink-docstrap-1.3.2.tgz", - "integrity": "sha512-STx5orGQU1gfrkoI/fMU7lX6CSP7LBGO10gXNgOZhwKhUqbtNjCkYSewJtNnLmWP1tAGN6oyEpG1HFPw5vpa5Q==", - "dev": true, - "requires": { - "moment": "2.21.0", - "sanitize-html": "1.18.2" - } - }, - "inline-source-map": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", - "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", - "dev": true, - "requires": { - "source-map": "0.5.7" - } - }, - "inquirer": { - "version": "0.11.4", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.11.4.tgz", - "integrity": "sha1-geM3ToNhvq/y2XAWIG01nQsy+k0=", - "dev": true, - "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", - "cli-width": "1.1.1", - "figures": "1.7.0", - "lodash": "3.10.1", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "through": "2.3.8" - }, - "dependencies": { - "lodash": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", - "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", - "dev": true - } - } - }, - "insert-module-globals": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.2.tgz", - "integrity": "sha512-p3s7g96Nm62MbHRuj9ZXab0DuJNWD7qcmdUXCOQ/ZZn42DtDXfsLill7bq19lDCx3K3StypqUnuE3H2VmIJFUw==", - "dev": true, - "requires": { - "JSONStream": "1.3.2", - "combine-source-map": "0.7.2", - "concat-stream": "1.5.2", - "is-buffer": "1.1.6", - "lexical-scope": "1.2.0", - "process": "0.11.10", - "through2": "2.0.3", - "xtend": "4.0.1" - }, - "dependencies": { - "combine-source-map": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", - "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=", - "dev": true, - "requires": { - "convert-source-map": "1.1.3", - "inline-source-map": "0.6.2", - "lodash.memoize": "3.0.4", - "source-map": "0.5.7" - } - }, - "concat-stream": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.0.6", - "typedarray": "0.0.6" - } - }, - "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", - "dev": true - }, - "readable-stream": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "0.10.31", - "util-deprecate": "1.0.2" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "interpret": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", - "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", - "dev": true - }, - "is": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is/-/is-3.2.1.tgz", - "integrity": "sha1-0Kwq1V63sL7JJqUmb2xmKqqD3KU=", - "dev": true - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "dev": true, - "requires": { - "is-relative": "1.0.0", - "is-windows": "1.0.2" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "1.1.1" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" - } - }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "2.1.1" - } - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-odd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", - "dev": true, - "requires": { - "is-number": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", - "dev": true, - "requires": { - "is-path-inside": "1.0.1" - } - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "1.0.2" - } - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "3.0.1" - } - }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true - }, - "is-relative": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "dev": true, - "requires": { - "is-unc-path": "1.0.0" - } - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true - }, - "is-subset": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", - "integrity": "sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=", - "dev": true - }, - "is-text-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", - "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", - "dev": true, - "requires": { - "text-extensions": "1.7.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "dev": true, - "requires": { - "unc-path-regex": "0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true - }, - "is-valid-glob": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", - "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", - "dev": true - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true - }, - "istanbul": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", - "dev": true, - "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.11", - "js-yaml": "3.11.0", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.3.0", - "wordwrap": "1.0.0" - }, - "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "1.0.0" - } - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } - } - }, - "istanbul-threshold-checker": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/istanbul-threshold-checker/-/istanbul-threshold-checker-0.2.1.tgz", - "integrity": "sha1-xdyU6PLMXNP/0zVFL4S1U8QkgzE=", - "dev": true, - "requires": { - "istanbul": "0.4.5", - "lodash": "4.17.5" - } - }, - "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "dev": true, - "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" - } - }, - "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", - "dev": true, - "requires": { - "xmlcreate": "1.0.2" - } - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true - }, - "jsdoc": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", - "dev": true, - "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "3.5.1", - "catharsis": "0.8.9", - "escape-string-regexp": "1.0.5", - "js2xmlparser": "3.0.0", - "klaw": "2.0.0", - "marked": "0.3.17", - "mkdirp": "0.5.1", - "requizzle": "0.2.1", - "strip-json-comments": "2.0.1", - "taffydb": "2.6.2", - "underscore": "1.8.3" - } - }, - "jshint": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", - "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", - "dev": true, - "requires": { - "cli": "1.0.1", - "console-browserify": "1.1.0", - "exit": "0.1.2", - "htmlparser2": "3.8.3", - "lodash": "3.7.0", - "minimatch": "3.0.4", - "shelljs": "0.3.0", - "strip-json-comments": "1.0.4" - }, - "dependencies": { - "domhandler": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", - "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", - "dev": true, - "requires": { - "domelementtype": "1.3.0" - } - }, - "domutils": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", - "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", - "dev": true, - "requires": { - "dom-serializer": "0.1.0", - "domelementtype": "1.3.0" - } - }, - "entities": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", - "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", - "dev": true - }, - "htmlparser2": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", - "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", - "dev": true, - "requires": { - "domelementtype": "1.3.0", - "domhandler": "2.3.0", - "domutils": "1.5.1", - "entities": "1.0.0", - "readable-stream": "1.1.14" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "lodash": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", - "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "strip-json-comments": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", - "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", - "dev": true - } - } - }, - "json-parse-better-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz", - "integrity": "sha512-xyQpxeWWMKyJps9CuGJYeng6ssI5bpqS9ltQpdVQ90t4ql6NdnxFKh95JcRt2cun/DjMVNrdjniLPuMA69xmCw==", - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", - "dev": true - }, - "json-stable-stringify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", - "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - } - } - }, - "labeled-stream-splicer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", - "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "isarray": "0.0.1", - "stream-splicer": "2.0.0" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, - "lazystream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", - "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", - "dev": true, - "requires": { - "readable-stream": "2.3.5" - } - }, - "lcov-parse": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" - } - }, - "lexical-scope": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", - "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", - "dev": true, - "requires": { - "astw": "2.2.0" - } - }, - "liftoff": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.5.0.tgz", - "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", - "dev": true, - "requires": { - "extend": "3.0.1", - "findup-sync": "2.0.0", - "fined": "1.1.0", - "flagged-respawn": "1.0.0", - "is-plain-object": "2.0.4", - "object.map": "1.0.1", - "rechoir": "0.6.2", - "resolve": "1.5.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - } - } - }, - "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, - "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" - }, - "dependencies": { - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - } - } - }, - "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" - }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basetostring": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", - "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", - "dev": true - }, - "lodash._basevalues": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", - "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", - "dev": true - }, - "lodash._escapehtmlchar": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz", - "integrity": "sha1-32fDu2t+jh6DGrSL+geVuSr+iZ0=", - "dev": true, - "requires": { - "lodash._htmlescapes": "2.4.1" - } - }, - "lodash._escapestringchar": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz", - "integrity": "sha1-7P4iYYoq3lC/7qQ5N+Ud9m8O23I=", - "dev": true - }, - "lodash._getnative": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", - "dev": true - }, - "lodash._htmlescapes": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz", - "integrity": "sha1-MtFL8IRLbeb4tioFG09nwii2JMs=", - "dev": true - }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, - "lodash._isnative": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", - "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=", - "dev": true - }, - "lodash._objecttypes": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", - "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=", - "dev": true - }, - "lodash._reescape": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", - "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", - "dev": true - }, - "lodash._reevaluate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", - "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", - "dev": true - }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, - "lodash._reunescapedhtml": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz", - "integrity": "sha1-dHxPxAED6zu4oJduVx96JlnpO6c=", - "dev": true, - "requires": { - "lodash._htmlescapes": "2.4.1", - "lodash.keys": "2.4.1" - }, - "dependencies": { - "lodash.isobject": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", - "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" - } - }, - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - } - } - }, - "lodash._root": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", - "dev": true - }, - "lodash._shimkeys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", - "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" - } - }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.defaults": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", - "integrity": "sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1", - "lodash.keys": "2.4.1" - }, - "dependencies": { - "lodash.isobject": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", - "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" - } - }, - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - } - } - }, - "lodash.escape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", - "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", - "dev": true, - "requires": { - "lodash._root": "3.0.1" - } - }, - "lodash.escaperegexp": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz", - "integrity": "sha1-ZHYsSGGAglGKw99Mz11YhtriA0c=", - "dev": true - }, - "lodash.isarguments": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", - "dev": true - }, - "lodash.isarray": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", - "dev": true - }, - "lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", - "dev": true - }, - "lodash.isobject": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", - "integrity": "sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0=", - "dev": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true - }, - "lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", - "dev": true - }, - "lodash.keys": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", - "dev": true, - "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" - } - }, - "lodash.memoize": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", - "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", - "dev": true - }, - "lodash.merge": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", - "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", - "dev": true - }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, - "lodash.restparam": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", - "dev": true - }, - "lodash.template": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", - "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", - "dev": true, - "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" - } - }, - "lodash.templatesettings": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", - "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", - "dev": true, - "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" - } - }, - "lodash.values": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.4.1.tgz", - "integrity": "sha1-q/UUQ2s8twUAFieXjLzzCxKA7qQ=", - "dev": true, - "requires": { - "lodash.keys": "2.4.1" - }, - "dependencies": { - "lodash.isobject": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", - "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", - "dev": true, - "requires": { - "lodash._objecttypes": "2.4.1" - } - }, - "lodash.keys": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", - "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", - "dev": true, - "requires": { - "lodash._isnative": "2.4.1", - "lodash._shimkeys": "2.4.1", - "lodash.isobject": "2.4.1" - } - } - } - }, - "log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", - "dev": true - }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true - }, - "loud-rejection": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", - "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, - "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" - } - }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", - "dev": true - }, - "make-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.0.tgz", - "integrity": "sha1-V7713IXSOSO6I3ZzJNjo+PPZaUs=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true - }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "1.0.1" - } - }, - "marked": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", - "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==", - "dev": true - }, - "md5.js": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", - "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", - "dev": true, - "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" - }, - "dependencies": { - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - } - } - }, - "mecab-ipadic-seed": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/mecab-ipadic-seed/-/mecab-ipadic-seed-0.0.2.tgz", - "integrity": "sha1-AudqWFjNO/M8y9fyeW9js9LpD/g=", - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true - }, - "meow": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", - "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", - "dev": true, - "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" - } - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "2.3.5" - } - }, - "micromatch": { - "version": "3.1.9", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.9.tgz", - "integrity": "sha512-SlIz6sv5UPaAVVFRKodKjCg48EbNoIhgetzfK/Cy0v5U52Z6zB136M8tp0UC9jM53LYbmIRihJszvvqpKkfm9g==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.1", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" - } - }, - "mime": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true - }, - "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", - "dev": true, - "requires": { - "mime-db": "1.33.0" - } - }, - "minimalistic-assert": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", - "dev": true - }, - "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "1.0.1", - "is-plain-obj": "1.1.0" - } - }, - "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", - "dev": true, - "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "2.0.4" - } - } - } - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, - "mocha": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.1.0.tgz", - "integrity": "sha512-0RVnjg1HJsXY2YFDoTNzcc1NKhYuXKRrBAG2gDygmJJA136Cs2QlRliZG1mA0ap7cuaT30mw16luAeln+4RiNA==", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.11.0", - "debug": "3.1.0", - "diff": "3.3.1", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.3", - "he": "1.1.1", - "mkdirp": "0.5.1", - "supports-color": "4.4.0" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", - "dev": true - }, - "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } - } - }, - "mocha-lcov-reporter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mocha-lcov-reporter/-/mocha-lcov-reporter-1.3.0.tgz", - "integrity": "sha1-Rpve9PivyaEWBW8HnfYYLQr7A4Q=", - "dev": true - }, - "modify-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.0.tgz", - "integrity": "sha1-4rbN65zhn5kxelNyLz2/XfXqqrI=", - "dev": true - }, - "module-deps": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.0.0.tgz", - "integrity": "sha512-BKsMhJJENEM4dTgqq2MDTTHXRHcNUFegoAwlG4HO4VMdUyMcJDKgfgI+MOv6tR5Iv8G3MKZFgsSiyP3ZoosRMw==", - "dev": true, - "requires": { - "JSONStream": "1.3.2", - "browser-resolve": "1.11.2", - "cached-path-relative": "1.0.1", - "concat-stream": "1.6.1", - "defined": "1.0.0", - "detective": "5.1.0", - "duplexer2": "0.1.4", - "inherits": "2.0.3", - "parents": "1.0.1", - "readable-stream": "2.3.5", - "resolve": "1.5.0", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" - } - }, - "moment": { - "version": "2.21.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.21.0.tgz", - "integrity": "sha512-TCZ36BjURTeFTM/CwRcViQlfkMvL1/vFISuNLO5GkcVm1+QHfbSiNqZuWeMFjj1/3+uAjXswgRk30j1kkLYJBQ==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "multipipe": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", - "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", - "dev": true, - "requires": { - "duplexer2": "0.0.2" - }, - "dependencies": { - "duplexer2": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", - "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", - "dev": true, - "requires": { - "readable-stream": "1.1.14" - } - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.1.14", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", - "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } - } - }, - "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", - "dev": true - }, - "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", - "dev": true, - "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" - } - }, - "natives": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.2.tgz", - "integrity": "sha512-5bRASydE1gu6zPOenLN043++J8xj1Ob7ArkfdYO3JN4DF5rDmG7bMoiybkTyD+GnXQEMixVeDHMzuqm6kpBmiA==", - "dev": true - }, - "negotiator": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", - "dev": true - }, - "node.extend": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.1.6.tgz", - "integrity": "sha1-p7iCyC1sk6SGOlUEvV3o7IYli5Y=", - "dev": true, - "requires": { - "is": "3.2.1" - } - }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1.0.9" - } - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "2.6.0", - "is-builtin-module": "1.0.0", - "semver": "4.3.6", - "validate-npm-package-license": "3.0.3" - } - }, - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "1.1.0" - } - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, - "requires": { - "path-key": "2.0.1" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "3.0.1" - } - }, - "object.defaults": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "dev": true, - "requires": { - "array-each": "1.0.1", - "array-slice": "1.1.0", - "for-own": "1.0.0", - "isobject": "3.0.1" - } - }, - "object.map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "dev": true, - "requires": { - "for-own": "1.0.0", - "make-iterator": "1.0.0" - } - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", - "dev": true, - "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" - }, - "dependencies": { - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", - "dev": true, - "requires": { - "for-in": "1.0.2" - } - } - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "3.0.1" - } - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "onetime": { - "version": "1.1.0", - "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", - "dev": true - }, - "open": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/open/-/open-0.0.5.tgz", - "integrity": "sha1-QsPhjslUZra/DcQvOilFw/DK2Pw=", - "dev": true - }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, - "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - } - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" - }, - "dependencies": { - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - } - } - }, - "orchestrator": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", - "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", - "dev": true, - "requires": { - "end-of-stream": "0.1.5", - "sequencify": "0.0.7", - "stream-consume": "0.1.1" - } - }, - "ordered-read-streams": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", - "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=", - "dev": true - }, - "os-browserify": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", - "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", - "dev": true - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true - }, - "p-limit": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", - "dev": true, - "requires": { - "p-try": "1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "1.2.0" - } - }, - "p-map": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", - "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", - "dev": true - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "pako": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", - "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", - "dev": true - }, - "parents": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", - "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", - "dev": true, - "requires": { - "path-platform": "0.11.15" - } - }, - "parse-asn1": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", - "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", - "dev": true, - "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.1.1", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.14" - } - }, - "parse-filepath": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", - "dev": true, - "requires": { - "is-absolute": "1.0.0", - "map-cache": "0.2.2", - "path-root": "0.1.1" - } - }, - "parse-github-repo-url": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz", - "integrity": "sha1-nn2LslKmy2ukJZUGC3v23z28H1A=", - "dev": true - }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", - "dev": true, - "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" - }, - "dependencies": { - "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", - "dev": true - }, - "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", - "dev": true, - "requires": { - "is-extglob": "1.0.0" - } - } - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "dev": true, - "requires": { - "error-ex": "1.3.1" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true - }, - "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", - "dev": true - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", - "dev": true - }, - "path-platform": { - "version": "0.11.15", - "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", - "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", - "dev": true - }, - "path-root": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "dev": true, - "requires": { - "path-root-regex": "0.1.2" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", - "dev": true - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" - }, - "dependencies": { - "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, - "pathval": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", - "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", - "dev": true - }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, - "pbkdf2": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", - "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", - "dev": true, - "requires": { - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.10" - } - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "2.0.4" - } - }, - "plugin-error": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/plugin-error/-/plugin-error-0.1.2.tgz", - "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", - "dev": true, - "requires": { - "ansi-cyan": "0.1.1", - "ansi-red": "0.1.1", - "arr-diff": "1.1.0", - "arr-union": "2.1.0", - "extend-shallow": "1.1.4" - }, - "dependencies": { - "arr-diff": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-1.1.0.tgz", - "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0", - "array-slice": "0.2.3" - } - }, - "arr-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-2.1.0.tgz", - "integrity": "sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0=", - "dev": true - }, - "array-slice": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", - "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", - "dev": true - }, - "extend-shallow": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-1.1.4.tgz", - "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", - "dev": true, - "requires": { - "kind-of": "1.1.0" - } - }, - "kind-of": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-1.1.0.tgz", - "integrity": "sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ=", - "dev": true - } - } - }, - "plugin-log": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/plugin-log/-/plugin-log-0.1.0.tgz", - "integrity": "sha1-hgSc9qsQgzOYqTHzaJy67nteEzM=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "dateformat": "1.0.12" - }, - "dependencies": { - "dateformat": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", - "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", - "dev": true, - "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" - } - } - } - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "postcss": { - "version": "6.0.20", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.20.tgz", - "integrity": "sha512-Opr6usW30Iy0xEDrJywDckRxtylfO7gTGs3Kfb2LdLQlGsUg89fTy0R3Vm1Dub2YHO7MK58avr0p70+uFFHb7A==", - "dev": true, - "requires": { - "chalk": "2.3.2", - "source-map": "0.6.1", - "supports-color": "5.3.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", - "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - }, - "supports-color": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", - "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", - "dev": true - }, - "process": { - "version": "0.11.10", - "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "proxy-middleware": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/proxy-middleware/-/proxy-middleware-0.5.1.tgz", - "integrity": "sha1-2iTV1Ywd3xPa0jfH7KUDhJ6uqQM=", - "dev": true - }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true - }, - "public-encrypt": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", - "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", - "dev": true, - "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "parse-asn1": "5.1.0", - "randombytes": "2.0.6" - } - }, - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", - "dev": true - }, - "querystring": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", - "dev": true - }, - "querystring-es3": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", - "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", - "dev": true - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "randombytes": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", - "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "randomfill": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", - "dev": true, - "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.1" - } - }, - "range-parser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", - "dev": true - }, - "raw-body": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.3.0.tgz", - "integrity": "sha1-l4IwoValVI9C7vFN4i0PT2EAg9E=", - "dev": true, - "requires": { - "bytes": "1.0.0", - "iconv-lite": "0.4.4" - }, - "dependencies": { - "bytes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", - "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=", - "dev": true - } - } - }, - "rcfinder": { - "version": "0.1.9", - "resolved": "https://registry.npmjs.org/rcfinder/-/rcfinder-0.1.9.tgz", - "integrity": "sha1-8+gPOH3fmugK4wpBADKWQuroERU=", - "dev": true, - "requires": { - "lodash.clonedeep": "4.5.0" - } - }, - "rcloader": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/rcloader/-/rcloader-0.2.2.tgz", - "integrity": "sha1-WNIpi0YtC5v9ITPSoex0+9cFxxc=", - "dev": true, - "requires": { - "lodash.assign": "4.2.0", - "lodash.isobject": "3.0.2", - "lodash.merge": "4.6.1", - "rcfinder": "0.1.9" - } - }, - "read-only-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", - "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", - "dev": true, - "requires": { - "readable-stream": "2.3.5" - } - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" - } - }, - "readable-stream": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", - "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" - } - }, - "readline2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "mute-stream": "0.0.5" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "1.5.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" - } - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "1.0.2" - } - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "request": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", - "dev": true, - "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.6", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.0.3", - "hawk": "6.0.2", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.18", - "oauth-sign": "0.8.2", - "performance-now": "2.1.0", - "qs": "6.5.1", - "safe-buffer": "5.1.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.4", - "tunnel-agent": "0.6.0", - "uuid": "3.2.1" - } - }, - "require-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/require-dir/-/require-dir-1.0.0.tgz", - "integrity": "sha512-PUJcQVTP4n6F8Un1GEEWhqnmBMfukVsL5gqwBxt7RF+nP+9hSOLJ/vSs5iUoXw1UWDgzqg9B/IIb15kfQKWsAQ==", - "dev": true - }, - "requizzle": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", - "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", - "dev": true, - "requires": { - "path-parse": "1.0.5" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "dev": true, - "requires": { - "expand-tilde": "2.0.2", - "global-modules": "1.0.0" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", - "dev": true, - "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" - } - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "optional": true, - "requires": { - "align-text": "0.1.4" - } - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "7.1.2" - } - }, - "ripemd160": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", - "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", - "dev": true, - "requires": { - "hash-base": "2.0.2", - "inherits": "2.0.3" - } - }, - "run-async": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", - "dev": true, - "requires": { - "once": "1.4.0" - } - }, - "run-sequence": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/run-sequence/-/run-sequence-2.2.1.tgz", - "integrity": "sha512-qkzZnQWMZjcKbh3CNly2srtrkaO/2H/SI5f2eliMCapdRD3UhMrwjfOAZJAnZ2H8Ju4aBzFZkBGXUqFs9V0yxw==", - "dev": true, - "requires": { - "chalk": "1.1.3", - "fancy-log": "1.3.2", - "plugin-error": "0.1.2" - } - }, - "rx-lite": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", - "dev": true - }, - "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "0.1.15" - } - }, - "sanitize-html": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-1.18.2.tgz", - "integrity": "sha512-52ThA+Z7h6BnvpSVbURwChl10XZrps5q7ytjTwWcIe9bmJwnVP6cpEVK2NvDOUhGupoqAvNbUz3cpnJDp4+/pg==", - "dev": true, - "requires": { - "chalk": "2.3.2", - "htmlparser2": "3.9.2", - "lodash.clonedeep": "4.5.0", - "lodash.escaperegexp": "4.1.2", - "lodash.isplainobject": "4.0.6", - "lodash.isstring": "4.0.1", - "lodash.mergewith": "4.6.1", - "postcss": "6.0.20", - "srcset": "1.0.0", - "xtend": "4.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "chalk": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", - "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", - "dev": true, - "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.3.0" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", - "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } - } - }, - "semver": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", - "dev": true - }, - "send": { - "version": "0.16.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", - "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", - "fresh": "0.5.2", - "http-errors": "1.6.2", - "mime": "1.4.1", - "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" - }, - "dependencies": { - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true - }, - "statuses": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true - } - } - }, - "sequencify": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", - "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=", - "dev": true - }, - "serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", - "dev": true, - "requires": { - "accepts": "1.3.5", - "batch": "0.6.1", - "debug": "2.6.9", - "escape-html": "1.0.3", - "http-errors": "1.6.2", - "mime-types": "2.1.18", - "parseurl": "1.3.2" - } - }, - "serve-static": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", - "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "dev": true, - "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", - "send": "0.16.2" - } - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "setprototypeof": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", - "dev": true - }, - "sha.js": { - "version": "2.4.10", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.10.tgz", - "integrity": "sha512-vnwmrFDlOExK4Nm16J2KMWHLrp14lBrjxMxBJpu++EnsuBmpiYaM/MEs46Vxxm/4FvdP5yTwuCTO9it5FSjrqA==", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - }, - "shasum": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", - "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", - "dev": true, - "requires": { - "json-stable-stringify": "0.0.1", - "sha.js": "2.4.10" - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", - "dev": true, - "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" - } - }, - "shelljs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", - "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", - "dev": true - }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", - "dev": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "1.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "dev": true, - "requires": { - "hoek": "4.2.1" - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", - "dev": true, - "requires": { - "atob": "2.0.3", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "sparkles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", - "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", - "dev": true - }, - "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", - "dev": true, - "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "2.1.0", - "spdx-license-ids": "3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", - "dev": true - }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", - "dev": true, - "requires": { - "through": "2.3.8" - } - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "3.0.2" - } - }, - "split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "requires": { - "through2": "2.0.3" - } - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "srcset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-1.0.0.tgz", - "integrity": "sha1-pWad4StC87HV6D7QPHEEb8SPQe8=", - "dev": true, - "requires": { - "array-uniq": "1.0.3", - "number-is-nan": "1.0.1" - } - }, - "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", - "dev": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" - }, + "packages": { + "": { + "name": "kuromoji", + "version": "0.0.1", + "license": "Apache-2.0", "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "0.1.6" - } - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" - } - }, - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true - }, - "stream-browserify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", - "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.5" - } - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "0.1.1" - } - }, - "stream-combiner2": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", - "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", - "dev": true, - "requires": { - "duplexer2": "0.1.4", - "readable-stream": "2.3.5" - } - }, - "stream-consume": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.1.tgz", - "integrity": "sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg==", - "dev": true - }, - "stream-http": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.1.tgz", - "integrity": "sha512-cQ0jo17BLca2r0GfRdZKYAGLU6JRoIWxqSOakUMuKOT6MOK7AAlE856L33QuDmAy/eeOrhLee3dZKX0Uadu93A==", - "dev": true, - "requires": { - "builtin-status-codes": "3.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.5", - "to-arraybuffer": "1.0.1", - "xtend": "4.0.1" - } - }, - "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", - "dev": true - }, - "stream-splicer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", - "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.5" - } - }, - "stream-to-array": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz", - "integrity": "sha1-u/azn19D7DC8cbq8s3VXrOzzQ1M=", - "dev": true, - "requires": { - "any-promise": "1.3.0" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-bom": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", - "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", - "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "is-utf8": "0.2.1" - } - }, - "strip-bom-buf": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz", - "integrity": "sha1-HLRar1dTD0yvhsf3UXnSyaUd1XI=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - }, - "strip-bom-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", - "integrity": "sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4=", - "dev": true, - "requires": { - "first-chunk-stream": "1.0.0", - "strip-bom": "2.0.0" + "async": "^2.0.1", + "doublearray": "0.0.2", + "fflate": "^0.8.2" }, - "dependencies": { - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "0.2.1" - } - } + "devDependencies": { + "@types/doublearray": "^0.0.32", + "chai": "^5.1.2", + "prettier": "^3.4.2" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true - }, - "strip-indent": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", - "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "node_modules/@types/doublearray": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/doublearray/-/doublearray-0.0.32.tgz", + "integrity": "sha512-HloTru3I3a55runIVqZX1YBQi2L5A4peNQPh33yshzB4ttt1qHCnHPkuhy9Djy/cTx7i5xJvxItKRPCmvnfpGw==", "dev": true, - "requires": { - "get-stdin": "4.0.1" - } + "license": "MIT" }, - "strip-json-comments": { + "node_modules/assertion-error": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "subarg": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", - "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", - "dev": true, - "requires": { - "minimist": "1.2.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - }, - "syntax-error": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz", - "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", - "dev": true, - "requires": { - "acorn-node": "1.3.0" - } - }, - "taffydb": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/taffydb/-/taffydb-2.6.2.tgz", - "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", - "dev": true - }, - "text-extensions": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.7.0.tgz", - "integrity": "sha512-AKXZeDq230UaSzaO5s3qQUZOaC7iKbzq0jOFL614R7d9R593HLqAOL0cYoqLdkNrjBSOdmoQI06yigq1TSBXAg==", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, - "requires": { - "readable-stream": "2.3.5", - "xtend": "4.0.1" - } - }, - "through2-filter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", - "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", - "dev": true, - "requires": { - "through2": "2.0.3", - "xtend": "4.0.1" - } - }, - "tildify": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", - "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", - "dev": true, - "requires": { - "os-homedir": "1.0.2" - } - }, - "time-stamp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", - "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", - "dev": true - }, - "timers-browserify": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", - "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, - "requires": { - "process": "0.11.10" + "license": "MIT", + "engines": { + "node": ">=12" } }, - "tiny-lr": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-0.1.4.tgz", - "integrity": "sha1-bkHX5n39CHjl4LN+N6BtZ+MJ/00=", - "dev": true, - "requires": { - "body-parser": "1.8.4", - "debug": "0.8.1", - "faye-websocket": "0.7.3", - "parseurl": "1.3.2", - "qs": "2.2.5" - }, + "node_modules/async": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dependencies": { - "debug": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz", - "integrity": "sha1-IP9NJvXkIstoobrLu2EDmtjBwTA=", - "dev": true - }, - "qs": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/qs/-/qs-2.2.5.tgz", - "integrity": "sha1-EIirr53MCuWuRbcJ5sa1iIsjkjw=", - "dev": true - } - } - }, - "tmp": { - "version": "0.0.28", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.28.tgz", - "integrity": "sha1-Fyc1t/YU6nrzlmT6hM8N5OUV0SA=", - "dev": true, - "requires": { - "os-tmpdir": "1.0.2" + "lodash": "^4.17.14" } }, - "to-absolute-glob": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", - "integrity": "sha1-HN+kcqnvUMI57maZm2YsoOs5k38=", + "node_modules/chai": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", + "integrity": "sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==", "dev": true, - "requires": { - "extend-shallow": "2.0.1" - }, + "license": "MIT", "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - } - } - }, - "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", - "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "3.2.2" + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } + "engines": { + "node": ">=12" } }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" - } - }, - "to-regex-range": { + "node_modules/check-error": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" - } - }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "dev": true, - "requires": { - "punycode": "1.4.1" - } - }, - "trim-newlines": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", - "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", - "dev": true - }, - "trim-off-newlines": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true - }, - "tty-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", - "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==", - "dev": true - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, - "requires": { - "safe-buffer": "5.1.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "1.1.2" - } - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "type-is": { - "version": "1.5.7", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.5.7.tgz", - "integrity": "sha1-uTaKWTzG730GReeLL0xky+zQXpA=", - "dev": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "2.0.14" - }, - "dependencies": { - "mime-db": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", - "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", - "dev": true - }, - "mime-types": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", - "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", - "dev": true, - "requires": { - "mime-db": "1.12.0" - } - } - } - }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "optional": true, - "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" - } - }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, - "umd": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz", - "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==", - "dev": true - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", - "dev": true - }, - "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", - "dev": true - }, - "underscore-contrib": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", - "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "0.1.1" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" - } - } - } - }, - "unique-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", - "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "url": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", - "dev": true, - "requires": { - "punycode": "1.3.2", - "querystring": "0.2.0" - }, - "dependencies": { - "punycode": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", - "dev": true - } - } - }, - "use": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", - "dev": true, - "requires": { - "kind-of": "6.0.2" - } - }, - "user-home": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", - "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", - "dev": true - }, - "util": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", - "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "requires": { - "inherits": "2.0.1" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", - "dev": true - } + "license": "MIT", + "engines": { + "node": ">= 16" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true - }, - "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", - "dev": true - }, - "v8flags": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", - "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "requires": { - "user-home": "1.1.1" + "license": "MIT", + "engines": { + "node": ">=6" } }, - "vali-date": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", - "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", - "dev": true, - "requires": { - "spdx-correct": "3.0.0", - "spdx-expression-parse": "3.0.0" - } + "node_modules/doublearray": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/doublearray/-/doublearray-0.0.2.tgz", + "integrity": "sha512-aw55FtZzT6AmiamEj2kvmR6BuFqvYgKZUkfQ7teqVRNqD5UE0rw8IeW/3gieHNKQ5sPuDKlljWEn4bzv5+1bHw==" }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "1.3.0" - } + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "license": "MIT" }, - "vinyl": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", - "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", - "dev": true, - "requires": { - "clone": "1.0.3", - "clone-stats": "0.0.1", - "replace-ext": "0.0.1" - } + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "vinyl-fs": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", - "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", + "node_modules/loupe": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "requires": { - "defaults": "1.0.3", - "glob-stream": "3.1.18", - "glob-watcher": "0.0.6", - "graceful-fs": "3.0.11", - "mkdirp": "0.5.1", - "strip-bom": "1.0.0", - "through2": "0.6.5", - "vinyl": "0.4.6" - }, - "dependencies": { - "clone": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", - "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "dev": true, - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" - } - }, - "vinyl": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", - "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", - "dev": true, - "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" - } - } - } + "license": "MIT" }, - "vinyl-source-stream": { + "node_modules/pathval": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/vinyl-source-stream/-/vinyl-source-stream-2.0.0.tgz", - "integrity": "sha1-84pa+53R6Ttl1VBGmsYYKsT1S44=", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, - "requires": { - "through2": "2.0.3", - "vinyl": "2.1.0" - }, - "dependencies": { - "clone": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", - "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", - "dev": true - }, - "clone-stats": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", - "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", - "dev": true - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", - "dev": true - }, - "vinyl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", - "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", - "dev": true, - "requires": { - "clone": "2.1.1", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.1.2", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" - } - } - } - }, - "vinyl-sourcemaps-apply": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz", - "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", - "dev": true, - "requires": { - "source-map": "0.5.7" - } - }, - "vm-browserify": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", - "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", - "dev": true, - "requires": { - "indexof": "0.0.1" - } - }, - "walk": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/walk/-/walk-2.3.3.tgz", - "integrity": "sha1-tMDoxCRkwW274dcWZnZerAeBnl8=", - "dev": true, - "requires": { - "foreachasync": "3.0.0" - } - }, - "watch": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.11.0.tgz", - "integrity": "sha1-6NugkbdFZ5mjr1eXi5hud+EyBAY=", - "dev": true - }, - "websocket-driver": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", - "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", - "dev": true, - "requires": { - "http-parser-js": "0.4.11", - "websocket-extensions": "0.1.3" - } - }, - "websocket-extensions": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.3.tgz", - "integrity": "sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==", - "dev": true - }, - "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", - "dev": true, - "requires": { - "isexe": "2.0.0" - } - }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - }, - "wrap-promise": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrap-promise/-/wrap-promise-1.0.1.tgz", - "integrity": "sha1-sBn0I2zL8ftWCSG0tIcLe9ovUlU=", - "dev": true, - "requires": { - "es6-promise": "2.3.0" + "license": "MIT", + "engines": { + "node": ">= 14.16" } }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", - "dev": true - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "node_modules/prettier": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, - "optional": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" + "bin": { + "prettier": "bin/prettier.cjs" }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true - } + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" } - }, - "zlibjs": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/zlibjs/-/zlibjs-0.3.1.tgz", - "integrity": "sha1-UBl+2yihxCymWcyLTmqd3W1ERVQ=" } } } diff --git a/package.json b/package.json index a506d8d4..35a6d8ee 100644 --- a/package.json +++ b/package.json @@ -1,72 +1,29 @@ { "name": "kuromoji", + "type": "module", "description": "JavaScript implementation of Japanese morphological analyzer", - "version": "0.1.2", - "author": "Takuya Asano ", - "browser": { - "./src/loader/NodeDictionaryLoader.js": "./src/loader/BrowserDictionaryLoader.js" + "version": "0.0.1", + "exports": { + ".": { + "import": "./src/kuromoji.js", + "types": "./src/index.d.ts" + } }, - "bugs": { - "url": "https://github.com/takuyaa/kuromoji.js/issues" + "scripts": { + "lint": "prettier --check ./src/", + "fmt": "prettier --write ./src/", + "test": "node --test" }, "dependencies": { "async": "^2.0.1", "doublearray": "0.0.2", - "zlibjs": "^0.3.1" - }, - "devDependencies": { - "browserify": "^16.1.1", - "chai": "^4.1.2", - "coveralls": "^3.0.0", - "del": "^3.0.0", - "event-stream": "^3.3.4", - "gulp": "^3.8.10", - "gulp-bower": "0.0.14", - "gulp-bump": "^3.1.0", - "gulp-conventional-changelog": "^1.1.0", - "gulp-gh-pages-will": "^0.5.5", - "gulp-git": "^2.5.2", - "gulp-gzip": "^1.2.0", - "gulp-istanbul": "^1.0.0", - "gulp-jsdoc3": "^1.0.1", - "gulp-jshint": "^2.1.0", - "gulp-mocha": "^5.0.0", - "gulp-webserver": "^0.9.1", - "jshint": "^2.9.5", - "mecab-ipadic-seed": "0.0.2", - "minimist": "^1.2.0", - "mocha-lcov-reporter": "^1.2.0", - "run-sequence": "^2.2.1", - "vinyl-source-stream": "^2.0.0" + "fflate": "^0.8.2" }, - "homepage": "https://github.com/takuyaa/kuromoji.js", - "keywords": [ - "japanese", - "morphological analyzer", - "nlp", - "pos", - "pos tagger", - "tokenizer" - ], "license": "Apache-2.0", "main": "./src/kuromoji.js", - "repository": { - "type": "git", - "url": "https://github.com/takuyaa/kuromoji.js.git" - }, - "scripts": { - "build": "gulp build", - "build-demo": "gulp build-demo", - "build-dict": "gulp build-dict", - "clean": "gulp clean", - "coverage": "gulp coverage", - "deploy": "gulp deploy", - "jsdoc": "gulp jsdoc", - "lint": "gulp lint", - "release": "gulp release", - "test": "gulp test", - "version": "gulp version", - "watch": "gulp watch", - "webserver": "gulp webserver" + "devDependencies": { + "@types/doublearray": "^0.0.32", + "chai": "^5.1.2", + "prettier": "^3.4.2" } } diff --git a/src/Tokenizer.js b/src/Tokenizer.js index 6c3da9b7..9b67de25 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,13 +16,11 @@ * limitations under the License. */ -"use strict"; +import ViterbiBuilder from "./viterbi/ViterbiBuilder.js"; +import ViterbiSearcher from "./viterbi/ViterbiSearcher.js"; +import IpadicFormatter from "./util/IpadicFormatter.js"; -var ViterbiBuilder = require("./viterbi/ViterbiBuilder"); -var ViterbiSearcher = require("./viterbi/ViterbiSearcher"); -var IpadicFormatter = require("./util/IpadicFormatter"); - -var PUNCTUATION = /、|。/; +const PUNCTUATION = /、|。/; /** * Tokenizer @@ -29,11 +28,11 @@ var PUNCTUATION = /、|。/; * @constructor */ function Tokenizer(dic) { - this.token_info_dictionary = dic.token_info_dictionary; - this.unknown_dictionary = dic.unknown_dictionary; - this.viterbi_builder = new ViterbiBuilder(dic); - this.viterbi_searcher = new ViterbiSearcher(dic.connection_costs); - this.formatter = new IpadicFormatter(); // TODO Other dictionaries + this.token_info_dictionary = dic.token_info_dictionary; + this.unknown_dictionary = dic.unknown_dictionary; + this.viterbi_builder = new ViterbiBuilder(dic); + this.viterbi_searcher = new ViterbiSearcher(dic.connection_costs); + this.formatter = new IpadicFormatter(); // TODO Other dictionaries } /** @@ -42,21 +41,21 @@ function Tokenizer(dic) { * @returns {Array.} Sentences end with punctuation */ Tokenizer.splitByPunctuation = function (input) { - var sentences = []; - var tail = input; - while (true) { - if (tail === "") { - break; - } - var index = tail.search(PUNCTUATION); - if (index < 0) { - sentences.push(tail); - break; - } - sentences.push(tail.substring(0, index + 1)); - tail = tail.substring(index + 1); + var sentences = []; + var tail = input; + while (true) { + if (tail === "") { + break; + } + var index = tail.search(PUNCTUATION); + if (index < 0) { + sentences.push(tail); + break; } - return sentences; + sentences.push(tail.substring(0, index + 1)); + tail = tail.substring(index + 1); + } + return sentences; }; /** @@ -65,56 +64,72 @@ Tokenizer.splitByPunctuation = function (input) { * @returns {Array} Tokens */ Tokenizer.prototype.tokenize = function (text) { - var sentences = Tokenizer.splitByPunctuation(text); - var tokens = []; - for (var i = 0; i < sentences.length; i++) { - var sentence = sentences[i]; - this.tokenizeForSentence(sentence, tokens); - } - return tokens; + var sentences = Tokenizer.splitByPunctuation(text); + var tokens = []; + for (var i = 0; i < sentences.length; i++) { + var sentence = sentences[i]; + this.tokenizeForSentence(sentence, tokens); + } + return tokens; }; Tokenizer.prototype.tokenizeForSentence = function (sentence, tokens) { - if (tokens == null) { - tokens = []; - } - var lattice = this.getLattice(sentence); - var best_path = this.viterbi_searcher.search(lattice); - var last_pos = 0; - if (tokens.length > 0) { - last_pos = tokens[tokens.length - 1].word_position; - } - - for (var j = 0; j < best_path.length; j++) { - var node = best_path[j]; + if (tokens == null) { + tokens = []; + } + var lattice = this.getLattice(sentence); + var best_path = this.viterbi_searcher.search(lattice); + var last_pos = 0; + if (tokens.length > 0) { + last_pos = tokens[tokens.length - 1].word_position; + } - var token, features, features_line; - if (node.type === "KNOWN") { - features_line = this.token_info_dictionary.getFeatures(node.name); - if (features_line == null) { - features = []; - } else { - features = features_line.split(","); - } - token = this.formatter.formatEntry(node.name, last_pos + node.start_pos, node.type, features); - } else if (node.type === "UNKNOWN") { - // Unknown word - features_line = this.unknown_dictionary.getFeatures(node.name); - if (features_line == null) { - features = []; - } else { - features = features_line.split(","); - } - token = this.formatter.formatUnknownEntry(node.name, last_pos + node.start_pos, node.type, features, node.surface_form); - } else { - // TODO User dictionary - token = this.formatter.formatEntry(node.name, last_pos + node.start_pos, node.type, []); - } + for (var j = 0; j < best_path.length; j++) { + var node = best_path[j]; - tokens.push(token); + var token, features, features_line; + if (node.type === "KNOWN") { + features_line = this.token_info_dictionary.getFeatures(node.name); + if (features_line == null) { + features = []; + } else { + features = features_line.split(","); + } + token = this.formatter.formatEntry( + node.name, + last_pos + node.start_pos, + node.type, + features, + ); + } else if (node.type === "UNKNOWN") { + // Unknown word + features_line = this.unknown_dictionary.getFeatures(node.name); + if (features_line == null) { + features = []; + } else { + features = features_line.split(","); + } + token = this.formatter.formatUnknownEntry( + node.name, + last_pos + node.start_pos, + node.type, + features, + node.surface_form, + ); + } else { + // TODO User dictionary + token = this.formatter.formatEntry( + node.name, + last_pos + node.start_pos, + node.type, + [], + ); } - return tokens; + tokens.push(token); + } + + return tokens; }; /** @@ -123,7 +138,7 @@ Tokenizer.prototype.tokenizeForSentence = function (sentence, tokens) { * @returns {ViterbiLattice} Word lattice */ Tokenizer.prototype.getLattice = function (text) { - return this.viterbi_builder.build(text); + return this.viterbi_builder.build(text); }; -module.exports = Tokenizer; +export default Tokenizer; diff --git a/src/TokenizerBuilder.js b/src/TokenizerBuilder.js index 9ef5c6a2..c391416b 100644 --- a/src/TokenizerBuilder.js +++ b/src/TokenizerBuilder.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,10 +16,9 @@ * limitations under the License. */ -"use strict"; - -var Tokenizer = require("./Tokenizer"); -var DictionaryLoader = require("./loader/NodeDictionaryLoader"); +import Tokenizer from "./Tokenizer.js"; +import NodeDictionaryLoader from "./loader/NodeDictionaryLoader.js"; +import BrowserDictionaryLoader from "./loader/BrowserDictionaryLoader.js"; /** * TokenizerBuilder create Tokenizer instance. @@ -27,11 +27,19 @@ var DictionaryLoader = require("./loader/NodeDictionaryLoader"); * @constructor */ function TokenizerBuilder(option) { - if (option.dicPath == null) { - this.dic_path = "dict/"; - } else { - this.dic_path = option.dicPath; - } + const node_or_browser = option.nodeOrBrowser; + if (node_or_browser != "node" && node_or_browser != "browser") { + throw new Error( + `Invalid value for nodeOrBrowser: ${node_or_browser}. Expected 'node' or 'browser'`, + ); + } + this.node_or_browser = node_or_browser; + + if (option.dicPath == null) { + this.dic_path = "dict/"; + } else { + this.dic_path = option.dicPath; + } } /** @@ -39,10 +47,13 @@ function TokenizerBuilder(option) { * @param {TokenizerBuilder~onLoad} callback Callback function */ TokenizerBuilder.prototype.build = function (callback) { - var loader = new DictionaryLoader(this.dic_path); - loader.load(function (err, dic) { - callback(err, new Tokenizer(dic)); - }); + var loader = + this.node_or_browser == "node" + ? new NodeDictionaryLoader(this.dic_path) + : new BrowserDictionaryLoader(this.dic_path); + loader.load(function (err, dic) { + callback(err, new Tokenizer(dic)); + }); }; /** @@ -52,4 +63,4 @@ TokenizerBuilder.prototype.build = function (callback) { * @param {Tokenizer} tokenizer Prepared Tokenizer */ -module.exports = TokenizerBuilder; +export default TokenizerBuilder; diff --git a/src/dict/CharacterClass.js b/src/dict/CharacterClass.js index 2a0e2d5d..ffc658bc 100644 --- a/src/dict/CharacterClass.js +++ b/src/dict/CharacterClass.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,8 +16,6 @@ * limitations under the License. */ -"use strict"; - /** * CharacterClass * @param {number} class_id @@ -26,12 +25,18 @@ * @param {number} max_length * @constructor */ -function CharacterClass(class_id, class_name, is_always_invoke, is_grouping, max_length) { - this.class_id = class_id; - this.class_name = class_name; - this.is_always_invoke = is_always_invoke; - this.is_grouping = is_grouping; - this.max_length = max_length; +function CharacterClass( + class_id, + class_name, + is_always_invoke, + is_grouping, + max_length, +) { + this.class_id = class_id; + this.class_name = class_name; + this.is_always_invoke = is_always_invoke; + this.is_grouping = is_grouping; + this.max_length = max_length; } -module.exports = CharacterClass; +export default CharacterClass; diff --git a/src/dict/CharacterDefinition.js b/src/dict/CharacterDefinition.js index 11bb531e..26997f57 100644 --- a/src/dict/CharacterDefinition.js +++ b/src/dict/CharacterDefinition.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,11 +16,9 @@ * limitations under the License. */ -"use strict"; - -var InvokeDefinitionMap = require("./InvokeDefinitionMap"); -var CharacterClass = require("./CharacterClass"); -var SurrogateAwareString = require("../util/SurrogateAwareString"); +import InvokeDefinitionMap from "./InvokeDefinitionMap.js"; +import CharacterClass from "./CharacterClass.js"; +import SurrogateAwareString from "../util/SurrogateAwareString.js"; var DEFAULT_CATEGORY = "DEFAULT"; @@ -29,9 +28,9 @@ var DEFAULT_CATEGORY = "DEFAULT"; * @constructor */ function CharacterDefinition() { - this.character_category_map = new Uint8Array(65536); // for all UCS2 code points - this.compatible_category_map = new Uint32Array(65536); // for all UCS2 code points - this.invoke_definition_map = null; + this.character_category_map = new Uint8Array(65536); // for all UCS2 code points + this.compatible_category_map = new Uint32Array(65536); // for all UCS2 code points + this.invoke_definition_map = null; } /** @@ -41,105 +40,137 @@ function CharacterDefinition() { * @param {InvokeDefinitionMap} invoke_def_buffer * @returns {CharacterDefinition} */ -CharacterDefinition.load = function (cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer) { - var char_def = new CharacterDefinition(); - char_def.character_category_map = cat_map_buffer; - char_def.compatible_category_map = compat_cat_map_buffer; - char_def.invoke_definition_map = InvokeDefinitionMap.load(invoke_def_buffer); - return char_def; +CharacterDefinition.load = function ( + cat_map_buffer, + compat_cat_map_buffer, + invoke_def_buffer, +) { + var char_def = new CharacterDefinition(); + char_def.character_category_map = cat_map_buffer; + char_def.compatible_category_map = compat_cat_map_buffer; + char_def.invoke_definition_map = InvokeDefinitionMap.load(invoke_def_buffer); + return char_def; }; -CharacterDefinition.parseCharCategory = function (class_id, parsed_category_def) { - var category = parsed_category_def[1]; - var invoke = parseInt(parsed_category_def[2]); - var grouping = parseInt(parsed_category_def[3]); - var max_length = parseInt(parsed_category_def[4]); - if (!isFinite(invoke) || (invoke !== 0 && invoke !== 1)) { - console.log("char.def parse error. INVOKE is 0 or 1 in:" + invoke); - return null; - } - if (!isFinite(grouping) || (grouping !== 0 && grouping !== 1)) { - console.log("char.def parse error. GROUP is 0 or 1 in:" + grouping); - return null; - } - if (!isFinite(max_length) || max_length < 0) { - console.log("char.def parse error. LENGTH is 1 to n:" + max_length); - return null; - } - var is_invoke = (invoke === 1); - var is_grouping = (grouping === 1); - - return new CharacterClass(class_id, category, is_invoke, is_grouping, max_length); +CharacterDefinition.parseCharCategory = function ( + class_id, + parsed_category_def, +) { + var category = parsed_category_def[1]; + var invoke = parseInt(parsed_category_def[2]); + var grouping = parseInt(parsed_category_def[3]); + var max_length = parseInt(parsed_category_def[4]); + if (!isFinite(invoke) || (invoke !== 0 && invoke !== 1)) { + console.log("char.def parse error. INVOKE is 0 or 1 in:" + invoke); + return null; + } + if (!isFinite(grouping) || (grouping !== 0 && grouping !== 1)) { + console.log("char.def parse error. GROUP is 0 or 1 in:" + grouping); + return null; + } + if (!isFinite(max_length) || max_length < 0) { + console.log("char.def parse error. LENGTH is 1 to n:" + max_length); + return null; + } + var is_invoke = invoke === 1; + var is_grouping = grouping === 1; + + return new CharacterClass( + class_id, + category, + is_invoke, + is_grouping, + max_length, + ); }; CharacterDefinition.parseCategoryMapping = function (parsed_category_mapping) { - var start = parseInt(parsed_category_mapping[1]); - var default_category = parsed_category_mapping[2]; - var compatible_category = (3 < parsed_category_mapping.length) ? parsed_category_mapping.slice(3) : []; - if (!isFinite(start) || start < 0 || start > 0xFFFF) { - console.log("char.def parse error. CODE is invalid:" + start); - } - return { start: start, default: default_category, compatible: compatible_category}; + var start = parseInt(parsed_category_mapping[1]); + var default_category = parsed_category_mapping[2]; + var compatible_category = + 3 < parsed_category_mapping.length ? parsed_category_mapping.slice(3) : []; + if (!isFinite(start) || start < 0 || start > 0xffff) { + console.log("char.def parse error. CODE is invalid:" + start); + } + return { + start: start, + default: default_category, + compatible: compatible_category, + }; }; -CharacterDefinition.parseRangeCategoryMapping = function (parsed_category_mapping) { - var start = parseInt(parsed_category_mapping[1]); - var end = parseInt(parsed_category_mapping[2]); - var default_category = parsed_category_mapping[3]; - var compatible_category = (4 < parsed_category_mapping.length) ? parsed_category_mapping.slice(4) : []; - if (!isFinite(start) || start < 0 || start > 0xFFFF) { - console.log("char.def parse error. CODE is invalid:" + start); - } - if (!isFinite(end) || end < 0 || end > 0xFFFF) { - console.log("char.def parse error. CODE is invalid:" + end); - } - return { start: start, end: end, default: default_category, compatible: compatible_category}; +CharacterDefinition.parseRangeCategoryMapping = function ( + parsed_category_mapping, +) { + var start = parseInt(parsed_category_mapping[1]); + var end = parseInt(parsed_category_mapping[2]); + var default_category = parsed_category_mapping[3]; + var compatible_category = + 4 < parsed_category_mapping.length ? parsed_category_mapping.slice(4) : []; + if (!isFinite(start) || start < 0 || start > 0xffff) { + console.log("char.def parse error. CODE is invalid:" + start); + } + if (!isFinite(end) || end < 0 || end > 0xffff) { + console.log("char.def parse error. CODE is invalid:" + end); + } + return { + start: start, + end: end, + default: default_category, + compatible: compatible_category, + }; }; /** * Initializing method * @param {Array} category_mapping Array of category mapping */ -CharacterDefinition.prototype.initCategoryMappings = function (category_mapping) { - // Initialize map by DEFAULT class - var code_point; - if (category_mapping != null) { - for (var i = 0; i < category_mapping.length; i++) { - var mapping = category_mapping[i]; - var end = mapping.end || mapping.start; - for (code_point = mapping.start; code_point <= end; code_point++) { - - // Default Category class ID - this.character_category_map[code_point] = this.invoke_definition_map.lookup(mapping.default); - - for (var j = 0; j < mapping.compatible.length; j++) { - var bitset = this.compatible_category_map[code_point]; - var compatible_category = mapping.compatible[j]; - if (compatible_category == null) { - continue; - } - var class_id = this.invoke_definition_map.lookup(compatible_category); // Default Category - if (class_id == null) { - continue; - } - var class_id_bit = 1 << class_id; - bitset = bitset | class_id_bit; // Set a bit of class ID 例えば、class_idが3のとき、3ビット目に1を立てる - this.compatible_category_map[code_point] = bitset; - } - } +CharacterDefinition.prototype.initCategoryMappings = function ( + category_mapping, +) { + // Initialize map by DEFAULT class + var code_point; + if (category_mapping != null) { + for (var i = 0; i < category_mapping.length; i++) { + var mapping = category_mapping[i]; + var end = mapping.end || mapping.start; + for (code_point = mapping.start; code_point <= end; code_point++) { + // Default Category class ID + this.character_category_map[code_point] = + this.invoke_definition_map.lookup(mapping.default); + + for (var j = 0; j < mapping.compatible.length; j++) { + var bitset = this.compatible_category_map[code_point]; + var compatible_category = mapping.compatible[j]; + if (compatible_category == null) { + continue; + } + var class_id = this.invoke_definition_map.lookup(compatible_category); // Default Category + if (class_id == null) { + continue; + } + var class_id_bit = 1 << class_id; + bitset = bitset | class_id_bit; // Set a bit of class ID 例えば、class_idが3のとき、3ビット目に1を立てる + this.compatible_category_map[code_point] = bitset; } + } } - var default_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); - if (default_id == null) { - return; - } - for (code_point = 0; code_point < this.character_category_map.length; code_point++) { - // 他に何のクラスも定義されていなかったときだけ DEFAULT - if (this.character_category_map[code_point] === 0) { - // DEFAULT class ID に対応するビットだけ1を立てる - this.character_category_map[code_point] = 1 << default_id; - } + } + var default_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); + if (default_id == null) { + return; + } + for ( + code_point = 0; + code_point < this.character_category_map.length; + code_point++ + ) { + // 他に何のクラスも定義されていなかったときだけ DEFAULT + if (this.character_category_map[code_point] === 0) { + // DEFAULT class ID に対応するビットだけ1を立てる + this.character_category_map[code_point] = 1 << default_id; } + } }; /** @@ -148,58 +179,57 @@ CharacterDefinition.prototype.initCategoryMappings = function (category_mapping) * @returns {Array.} character classes */ CharacterDefinition.prototype.lookupCompatibleCategory = function (ch) { - var classes = []; + var classes = []; - /* + /* if (SurrogateAwareString.isSurrogatePair(ch)) { // Surrogate pair character codes can not be defined by char.def return classes; }*/ - var code = ch.charCodeAt(0); - var integer; - if (code < this.compatible_category_map.length) { - integer = this.compatible_category_map[code]; // Bitset - } - - if (integer == null || integer === 0) { - return classes; - } + var code = ch.charCodeAt(0); + var integer; + if (code < this.compatible_category_map.length) { + integer = this.compatible_category_map[code]; // Bitset + } - for (var bit = 0; bit < 32; bit++) { // Treat "bit" as a class ID - if (((integer << (31 - bit)) >>> 31) === 1) { - var character_class = this.invoke_definition_map.getCharacterClass(bit); - if (character_class == null) { - continue; - } - classes.push(character_class); - } - } + if (integer == null || integer === 0) { return classes; + } + + for (var bit = 0; bit < 32; bit++) { + // Treat "bit" as a class ID + if ((integer << (31 - bit)) >>> 31 === 1) { + var character_class = this.invoke_definition_map.getCharacterClass(bit); + if (character_class == null) { + continue; + } + classes.push(character_class); + } + } + return classes; }; - /** * Lookup category for a character * @param {string} ch UCS2 character (just 1st character is effective) * @returns {CharacterClass} character class */ CharacterDefinition.prototype.lookup = function (ch) { + var class_id; - var class_id; + var code = ch.charCodeAt(0); + if (SurrogateAwareString.isSurrogatePair(ch)) { + // Surrogate pair character codes can not be defined by char.def, so set DEFAULT category + class_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); + } else if (code < this.character_category_map.length) { + class_id = this.character_category_map[code]; // Read as integer value + } - var code = ch.charCodeAt(0); - if (SurrogateAwareString.isSurrogatePair(ch)) { - // Surrogate pair character codes can not be defined by char.def, so set DEFAULT category - class_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); - } else if (code < this.character_category_map.length) { - class_id = this.character_category_map[code]; // Read as integer value - } - - if (class_id == null) { - class_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); - } + if (class_id == null) { + class_id = this.invoke_definition_map.lookup(DEFAULT_CATEGORY); + } - return this.invoke_definition_map.getCharacterClass(class_id); + return this.invoke_definition_map.getCharacterClass(class_id); }; -module.exports = CharacterDefinition; +export default CharacterDefinition; diff --git a/src/dict/ConnectionCosts.js b/src/dict/ConnectionCosts.js index ba69170a..5e842633 100644 --- a/src/dict/ConnectionCosts.js +++ b/src/dict/ConnectionCosts.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,8 +16,6 @@ * limitations under the License. */ -"use strict"; - /** * Connection costs matrix from cc.dat file. * 2 dimension matrix [forward_id][backward_id] -> cost @@ -25,35 +24,37 @@ * @param {number} backward_dimension */ function ConnectionCosts(forward_dimension, backward_dimension) { - this.forward_dimension = forward_dimension; - this.backward_dimension = backward_dimension; + this.forward_dimension = forward_dimension; + this.backward_dimension = backward_dimension; - // leading 2 integers for forward_dimension, backward_dimension, respectively - this.buffer = new Int16Array(forward_dimension * backward_dimension + 2); - this.buffer[0] = forward_dimension; - this.buffer[1] = backward_dimension; + // leading 2 integers for forward_dimension, backward_dimension, respectively + this.buffer = new Int16Array(forward_dimension * backward_dimension + 2); + this.buffer[0] = forward_dimension; + this.buffer[1] = backward_dimension; } ConnectionCosts.prototype.put = function (forward_id, backward_id, cost) { - var index = forward_id * this.backward_dimension + backward_id + 2; - if (this.buffer.length < index + 1) { - throw "ConnectionCosts buffer overflow"; - } - this.buffer[index] = cost; + var index = forward_id * this.backward_dimension + backward_id + 2; + if (this.buffer.length < index + 1) { + throw "ConnectionCosts buffer overflow"; + } + this.buffer[index] = cost; }; ConnectionCosts.prototype.get = function (forward_id, backward_id) { - var index = forward_id * this.backward_dimension + backward_id + 2; - if (this.buffer.length < index + 1) { - throw "ConnectionCosts buffer overflow"; - } - return this.buffer[index]; + var index = forward_id * this.backward_dimension + backward_id + 2; + if (this.buffer.length < index + 1) { + throw "ConnectionCosts buffer overflow"; + } + return this.buffer[index]; }; -ConnectionCosts.prototype.loadConnectionCosts = function (connection_costs_buffer) { - this.forward_dimension = connection_costs_buffer[0]; - this.backward_dimension = connection_costs_buffer[1]; - this.buffer = connection_costs_buffer; +ConnectionCosts.prototype.loadConnectionCosts = function ( + connection_costs_buffer, +) { + this.forward_dimension = connection_costs_buffer[0]; + this.backward_dimension = connection_costs_buffer[1]; + this.buffer = connection_costs_buffer; }; -module.exports = ConnectionCosts; +export default ConnectionCosts; diff --git a/src/dict/DynamicDictionaries.js b/src/dict/DynamicDictionaries.js index 452955aa..312a27a1 100644 --- a/src/dict/DynamicDictionaries.js +++ b/src/dict/DynamicDictionaries.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,12 +16,10 @@ * limitations under the License. */ -"use strict"; - -var doublearray = require("doublearray"); -var TokenInfoDictionary = require("./TokenInfoDictionary"); -var ConnectionCosts = require("./ConnectionCosts"); -var UnknownDictionary = require("./UnknownDictionary"); +import doublearray from "doublearray"; +import TokenInfoDictionary from "./TokenInfoDictionary.js"; +import ConnectionCosts from "./ConnectionCosts.js"; +import UnknownDictionary from "./UnknownDictionary.js"; /** * Dictionaries container for Tokenizer @@ -30,53 +29,74 @@ var UnknownDictionary = require("./UnknownDictionary"); * @param {UnknownDictionary} unknown_dictionary * @constructor */ -function DynamicDictionaries(trie, token_info_dictionary, connection_costs, unknown_dictionary) { - if (trie != null) { - this.trie = trie; - } else { - this.trie = doublearray.builder(0).build([ - {k: "", v: 1} - ]); - } - if (token_info_dictionary != null) { - this.token_info_dictionary = token_info_dictionary; - } else { - this.token_info_dictionary = new TokenInfoDictionary(); - } - if (connection_costs != null) { - this.connection_costs = connection_costs; - } else { - // backward_size * backward_size - this.connection_costs = new ConnectionCosts(0, 0); - } - if (unknown_dictionary != null) { - this.unknown_dictionary = unknown_dictionary; - } else { - this.unknown_dictionary = new UnknownDictionary(); - } +function DynamicDictionaries( + trie, + token_info_dictionary, + connection_costs, + unknown_dictionary, +) { + if (trie != null) { + this.trie = trie; + } else { + this.trie = doublearray.builder(0).build([{ k: "", v: 1 }]); + } + if (token_info_dictionary != null) { + this.token_info_dictionary = token_info_dictionary; + } else { + this.token_info_dictionary = new TokenInfoDictionary(); + } + if (connection_costs != null) { + this.connection_costs = connection_costs; + } else { + // backward_size * backward_size + this.connection_costs = new ConnectionCosts(0, 0); + } + if (unknown_dictionary != null) { + this.unknown_dictionary = unknown_dictionary; + } else { + this.unknown_dictionary = new UnknownDictionary(); + } } // from base.dat & check.dat DynamicDictionaries.prototype.loadTrie = function (base_buffer, check_buffer) { - this.trie = doublearray.load(base_buffer, check_buffer); - return this; + this.trie = doublearray.load(base_buffer, check_buffer); + return this; }; -DynamicDictionaries.prototype.loadTokenInfoDictionaries = function (token_info_buffer, pos_buffer, target_map_buffer) { - this.token_info_dictionary.loadDictionary(token_info_buffer); - this.token_info_dictionary.loadPosVector(pos_buffer); - this.token_info_dictionary.loadTargetMap(target_map_buffer); - return this; +DynamicDictionaries.prototype.loadTokenInfoDictionaries = function ( + token_info_buffer, + pos_buffer, + target_map_buffer, +) { + this.token_info_dictionary.loadDictionary(token_info_buffer); + this.token_info_dictionary.loadPosVector(pos_buffer); + this.token_info_dictionary.loadTargetMap(target_map_buffer); + return this; }; DynamicDictionaries.prototype.loadConnectionCosts = function (cc_buffer) { - this.connection_costs.loadConnectionCosts(cc_buffer); - return this; + this.connection_costs.loadConnectionCosts(cc_buffer); + return this; }; -DynamicDictionaries.prototype.loadUnknownDictionaries = function (unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer) { - this.unknown_dictionary.loadUnknownDictionaries(unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer); - return this; +DynamicDictionaries.prototype.loadUnknownDictionaries = function ( + unk_buffer, + unk_pos_buffer, + unk_map_buffer, + cat_map_buffer, + compat_cat_map_buffer, + invoke_def_buffer, +) { + this.unknown_dictionary.loadUnknownDictionaries( + unk_buffer, + unk_pos_buffer, + unk_map_buffer, + cat_map_buffer, + compat_cat_map_buffer, + invoke_def_buffer, + ); + return this; }; -module.exports = DynamicDictionaries; +export default DynamicDictionaries; diff --git a/src/dict/InvokeDefinitionMap.js b/src/dict/InvokeDefinitionMap.js index d97128b7..a4fb6952 100644 --- a/src/dict/InvokeDefinitionMap.js +++ b/src/dict/InvokeDefinitionMap.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,18 +16,16 @@ * limitations under the License. */ -"use strict"; - -var ByteBuffer = require("../util/ByteBuffer"); -var CharacterClass = require("./CharacterClass"); +import ByteBuffer from "../util/ByteBuffer.js"; +import CharacterClass from "./CharacterClass.js"; /** * InvokeDefinitionMap represents invoke definition a part of char.def * @constructor */ function InvokeDefinitionMap() { - this.map = []; - this.lookup_table = {}; // Just for building dictionary + this.map = []; + this.lookup_table = {}; // Just for building dictionary } /** @@ -35,22 +34,30 @@ function InvokeDefinitionMap() { * @returns {InvokeDefinitionMap} */ InvokeDefinitionMap.load = function (invoke_def_buffer) { - var invoke_def = new InvokeDefinitionMap(); - var character_category_definition = []; + var invoke_def = new InvokeDefinitionMap(); + var character_category_definition = []; - var buffer = new ByteBuffer(invoke_def_buffer); - while (buffer.position + 1 < buffer.size()) { - var class_id = character_category_definition.length; - var is_always_invoke = buffer.get(); - var is_grouping = buffer.get(); - var max_length = buffer.getInt(); - var class_name = buffer.getString(); - character_category_definition.push(new CharacterClass(class_id, class_name, is_always_invoke, is_grouping, max_length)); - } + var buffer = new ByteBuffer(invoke_def_buffer); + while (buffer.position + 1 < buffer.size()) { + var class_id = character_category_definition.length; + var is_always_invoke = buffer.get(); + var is_grouping = buffer.get(); + var max_length = buffer.getInt(); + var class_name = buffer.getString(); + character_category_definition.push( + new CharacterClass( + class_id, + class_name, + is_always_invoke, + is_grouping, + max_length, + ), + ); + } - invoke_def.init(character_category_definition); + invoke_def.init(character_category_definition); - return invoke_def; + return invoke_def; }; /** @@ -58,14 +65,14 @@ InvokeDefinitionMap.load = function (invoke_def_buffer) { * @param {Array.} character_category_definition Array of CharacterClass */ InvokeDefinitionMap.prototype.init = function (character_category_definition) { - if (character_category_definition == null) { - return; - } - for (var i = 0; i < character_category_definition.length; i++) { - var character_class = character_category_definition[i]; - this.map[i] = character_class; - this.lookup_table[character_class.class_name] = i; - } + if (character_category_definition == null) { + return; + } + for (var i = 0; i < character_category_definition.length; i++) { + var character_class = character_category_definition[i]; + this.map[i] = character_class; + this.lookup_table[character_class.class_name] = i; + } }; /** @@ -74,7 +81,7 @@ InvokeDefinitionMap.prototype.init = function (character_category_definition) { * @returns {CharacterClass} */ InvokeDefinitionMap.prototype.getCharacterClass = function (class_id) { - return this.map[class_id]; + return this.map[class_id]; }; /** @@ -83,11 +90,11 @@ InvokeDefinitionMap.prototype.getCharacterClass = function (class_id) { * @returns {number} class_id */ InvokeDefinitionMap.prototype.lookup = function (class_name) { - var class_id = this.lookup_table[class_name]; - if (class_id == null) { - return null; - } - return class_id; + var class_id = this.lookup_table[class_name]; + if (class_id == null) { + return null; + } + return class_id; }; /** @@ -95,16 +102,16 @@ InvokeDefinitionMap.prototype.lookup = function (class_name) { * @returns {Uint8Array} */ InvokeDefinitionMap.prototype.toBuffer = function () { - var buffer = new ByteBuffer(); - for (var i = 0; i < this.map.length; i++) { - var char_class = this.map[i]; - buffer.put(char_class.is_always_invoke); - buffer.put(char_class.is_grouping); - buffer.putInt(char_class.max_length); - buffer.putString(char_class.class_name); - } - buffer.shrink(); - return buffer.buffer; + var buffer = new ByteBuffer(); + for (var i = 0; i < this.map.length; i++) { + var char_class = this.map[i]; + buffer.put(char_class.is_always_invoke); + buffer.put(char_class.is_grouping); + buffer.putInt(char_class.max_length); + buffer.putString(char_class.class_name); + } + buffer.shrink(); + return buffer.buffer; }; -module.exports = InvokeDefinitionMap; +export default InvokeDefinitionMap; diff --git a/src/dict/TokenInfoDictionary.js b/src/dict/TokenInfoDictionary.js index 2fccee7b..a705deec 100644 --- a/src/dict/TokenInfoDictionary.js +++ b/src/dict/TokenInfoDictionary.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,123 +16,133 @@ * limitations under the License. */ -"use strict"; - -var ByteBuffer = require("../util/ByteBuffer"); +import ByteBuffer from "../util/ByteBuffer.js"; /** * TokenInfoDictionary * @constructor */ function TokenInfoDictionary() { - this.dictionary = new ByteBuffer(10 * 1024 * 1024); - this.target_map = {}; // trie_id (of surface form) -> token_info_id (of token) - this.pos_buffer = new ByteBuffer(10 * 1024 * 1024); + this.dictionary = new ByteBuffer(10 * 1024 * 1024); + this.target_map = {}; // trie_id (of surface form) -> token_info_id (of token) + this.pos_buffer = new ByteBuffer(10 * 1024 * 1024); } // left_id right_id word_cost ... // ^ this position is token_info_id TokenInfoDictionary.prototype.buildDictionary = function (entries) { - var dictionary_entries = {}; // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - - for (var i = 0; i < entries.length; i++) { - var entry = entries[i]; + var dictionary_entries = {}; // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - if (entry.length < 4) { - continue; - } + for (var i = 0; i < entries.length; i++) { + var entry = entries[i]; - var surface_form = entry[0]; - var left_id = entry[1]; - var right_id = entry[2]; - var word_cost = entry[3]; - var feature = entry.slice(4).join(","); // TODO Optimize + if (entry.length < 4) { + continue; + } - // Assertion - if (!isFinite(left_id) || !isFinite(right_id) || !isFinite(word_cost)) { - console.log(entry); - } + var surface_form = entry[0]; + var left_id = entry[1]; + var right_id = entry[2]; + var word_cost = entry[3]; + var feature = entry.slice(4).join(","); // TODO Optimize - var token_info_id = this.put(left_id, right_id, word_cost, surface_form, feature); - dictionary_entries[token_info_id] = surface_form; + // Assertion + if (!isFinite(left_id) || !isFinite(right_id) || !isFinite(word_cost)) { + console.log(entry); } - // Remove last unused area - this.dictionary.shrink(); - this.pos_buffer.shrink(); - - return dictionary_entries; + var token_info_id = this.put( + left_id, + right_id, + word_cost, + surface_form, + feature, + ); + dictionary_entries[token_info_id] = surface_form; + } + + // Remove last unused area + this.dictionary.shrink(); + this.pos_buffer.shrink(); + + return dictionary_entries; }; -TokenInfoDictionary.prototype.put = function (left_id, right_id, word_cost, surface_form, feature) { - var token_info_id = this.dictionary.position; - var pos_id = this.pos_buffer.position; - - this.dictionary.putShort(left_id); - this.dictionary.putShort(right_id); - this.dictionary.putShort(word_cost); - this.dictionary.putInt(pos_id); - this.pos_buffer.putString(surface_form + "," + feature); - - return token_info_id; +TokenInfoDictionary.prototype.put = function ( + left_id, + right_id, + word_cost, + surface_form, + feature, +) { + var token_info_id = this.dictionary.position; + var pos_id = this.pos_buffer.position; + + this.dictionary.putShort(left_id); + this.dictionary.putShort(right_id); + this.dictionary.putShort(word_cost); + this.dictionary.putInt(pos_id); + this.pos_buffer.putString(surface_form + "," + feature); + + return token_info_id; }; TokenInfoDictionary.prototype.addMapping = function (source, target) { - var mapping = this.target_map[source]; - if (mapping == null) { - mapping = []; - } - mapping.push(target); + var mapping = this.target_map[source]; + if (mapping == null) { + mapping = []; + } + mapping.push(target); - this.target_map[source] = mapping; + this.target_map[source] = mapping; }; TokenInfoDictionary.prototype.targetMapToBuffer = function () { - var buffer = new ByteBuffer(); - var map_keys_size = Object.keys(this.target_map).length; - buffer.putInt(map_keys_size); - for (var key in this.target_map) { - var values = this.target_map[key]; // Array - var map_values_size = values.length; - buffer.putInt(parseInt(key)); - buffer.putInt(map_values_size); - for (var i = 0; i < values.length; i++) { - buffer.putInt(values[i]); - } + var buffer = new ByteBuffer(); + var map_keys_size = Object.keys(this.target_map).length; + buffer.putInt(map_keys_size); + for (var key in this.target_map) { + var values = this.target_map[key]; // Array + var map_values_size = values.length; + buffer.putInt(parseInt(key)); + buffer.putInt(map_values_size); + for (var i = 0; i < values.length; i++) { + buffer.putInt(values[i]); } - return buffer.shrink(); // Shrink-ed Typed Array + } + return buffer.shrink(); // Shrink-ed Typed Array }; // from tid.dat TokenInfoDictionary.prototype.loadDictionary = function (array_buffer) { - this.dictionary = new ByteBuffer(array_buffer); - return this; + this.dictionary = new ByteBuffer(array_buffer); + return this; }; // from tid_pos.dat TokenInfoDictionary.prototype.loadPosVector = function (array_buffer) { - this.pos_buffer = new ByteBuffer(array_buffer); - return this; + this.pos_buffer = new ByteBuffer(array_buffer); + return this; }; // from tid_map.dat TokenInfoDictionary.prototype.loadTargetMap = function (array_buffer) { - var buffer = new ByteBuffer(array_buffer); - buffer.position = 0; - this.target_map = {}; - buffer.readInt(); // map_keys_size - while (true) { - if (buffer.buffer.length < buffer.position + 1) { - break; - } - var key = buffer.readInt(); - var map_values_size = buffer.readInt(); - for (var i = 0; i < map_values_size; i++) { - var value = buffer.readInt(); - this.addMapping(key, value); - } + var buffer = new ByteBuffer(array_buffer); + buffer.position = 0; + this.target_map = {}; + buffer.readInt(); // map_keys_size + while (true) { + if (buffer.buffer.length < buffer.position + 1) { + break; } - return this; + var key = buffer.readInt(); + var map_values_size = buffer.readInt(); + for (var i = 0; i < map_values_size; i++) { + var value = buffer.readInt(); + this.addMapping(key, value); + } + } + return this; }; /** @@ -140,13 +151,13 @@ TokenInfoDictionary.prototype.loadTargetMap = function (array_buffer) { * @returns {string} Features string concatenated by "," */ TokenInfoDictionary.prototype.getFeatures = function (token_info_id_str) { - var token_info_id = parseInt(token_info_id_str); - if (isNaN(token_info_id)) { - // TODO throw error - return ""; - } - var pos_id = this.dictionary.getInt(token_info_id + 6); - return this.pos_buffer.getString(pos_id); + var token_info_id = parseInt(token_info_id_str); + if (isNaN(token_info_id)) { + // TODO throw error + return ""; + } + var pos_id = this.dictionary.getInt(token_info_id + 6); + return this.pos_buffer.getString(pos_id); }; -module.exports = TokenInfoDictionary; +export default TokenInfoDictionary; diff --git a/src/dict/UnknownDictionary.js b/src/dict/UnknownDictionary.js index 9814c77c..a3b719f8 100644 --- a/src/dict/UnknownDictionary.js +++ b/src/dict/UnknownDictionary.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,44 +16,55 @@ * limitations under the License. */ -"use strict"; - -var TokenInfoDictionary = require("./TokenInfoDictionary"); -var CharacterDefinition = require("./CharacterDefinition"); -var ByteBuffer = require("../util/ByteBuffer"); +import TokenInfoDictionary from "./TokenInfoDictionary.js"; +import CharacterDefinition from "./CharacterDefinition.js"; +import ByteBuffer from "../util/ByteBuffer.js"; /** * UnknownDictionary * @constructor */ function UnknownDictionary() { - this.dictionary = new ByteBuffer(10 * 1024 * 1024); - this.target_map = {}; // class_id (of CharacterClass) -> token_info_id (of unknown class) - this.pos_buffer = new ByteBuffer(10 * 1024 * 1024); - this.character_definition = null; + this.dictionary = new ByteBuffer(10 * 1024 * 1024); + this.target_map = {}; // class_id (of CharacterClass) -> token_info_id (of unknown class) + this.pos_buffer = new ByteBuffer(10 * 1024 * 1024); + this.character_definition = null; } // Inherit from TokenInfoDictionary as a super class UnknownDictionary.prototype = Object.create(TokenInfoDictionary.prototype); -UnknownDictionary.prototype.characterDefinition = function (character_definition) { - this.character_definition = character_definition; - return this; +UnknownDictionary.prototype.characterDefinition = function ( + character_definition, +) { + this.character_definition = character_definition; + return this; }; UnknownDictionary.prototype.lookup = function (ch) { - return this.character_definition.lookup(ch); + return this.character_definition.lookup(ch); }; UnknownDictionary.prototype.lookupCompatibleCategory = function (ch) { - return this.character_definition.lookupCompatibleCategory(ch); + return this.character_definition.lookupCompatibleCategory(ch); }; -UnknownDictionary.prototype.loadUnknownDictionaries = function (unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer) { - this.loadDictionary(unk_buffer); - this.loadPosVector(unk_pos_buffer); - this.loadTargetMap(unk_map_buffer); - this.character_definition = CharacterDefinition.load(cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer); +UnknownDictionary.prototype.loadUnknownDictionaries = function ( + unk_buffer, + unk_pos_buffer, + unk_map_buffer, + cat_map_buffer, + compat_cat_map_buffer, + invoke_def_buffer, +) { + this.loadDictionary(unk_buffer); + this.loadPosVector(unk_pos_buffer); + this.loadTargetMap(unk_map_buffer); + this.character_definition = CharacterDefinition.load( + cat_map_buffer, + compat_cat_map_buffer, + invoke_def_buffer, + ); }; -module.exports = UnknownDictionary; +export default UnknownDictionary; diff --git a/src/dict/builder/CharacterDefinitionBuilder.js b/src/dict/builder/CharacterDefinitionBuilder.js index 771e3c73..20533a70 100644 --- a/src/dict/builder/CharacterDefinitionBuilder.js +++ b/src/dict/builder/CharacterDefinitionBuilder.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,54 +16,61 @@ * limitations under the License. */ -"use strict"; - -var CharacterDefinition = require("../CharacterDefinition"); -var InvokeDefinitionMap = require("../InvokeDefinitionMap"); +import CharacterDefinition from "../CharacterDefinition.js"; +import InvokeDefinitionMap from "../InvokeDefinitionMap.js"; var CATEGORY_DEF_PATTERN = /^(\w+)\s+(\d)\s+(\d)\s+(\d)/; -var CATEGORY_MAPPING_PATTERN = /^(0x[0-9A-F]{4})(?:\s+([^#\s]+))(?:\s+([^#\s]+))*/; -var RANGE_CATEGORY_MAPPING_PATTERN = /^(0x[0-9A-F]{4})\.\.(0x[0-9A-F]{4})(?:\s+([^#\s]+))(?:\s+([^#\s]+))*/; +var CATEGORY_MAPPING_PATTERN = + /^(0x[0-9A-F]{4})(?:\s+([^#\s]+))(?:\s+([^#\s]+))*/; +var RANGE_CATEGORY_MAPPING_PATTERN = + /^(0x[0-9A-F]{4})\.\.(0x[0-9A-F]{4})(?:\s+([^#\s]+))(?:\s+([^#\s]+))*/; /** * CharacterDefinitionBuilder * @constructor */ function CharacterDefinitionBuilder() { - this.char_def = new CharacterDefinition(); - this.char_def.invoke_definition_map = new InvokeDefinitionMap(); - this.character_category_definition = []; - this.category_mapping = []; + this.char_def = new CharacterDefinition(); + this.char_def.invoke_definition_map = new InvokeDefinitionMap(); + this.character_category_definition = []; + this.category_mapping = []; } CharacterDefinitionBuilder.prototype.putLine = function (line) { - var parsed_category_def = CATEGORY_DEF_PATTERN.exec(line); - if (parsed_category_def != null) { - var class_id = this.character_category_definition.length; - var char_class = CharacterDefinition.parseCharCategory(class_id, parsed_category_def); - if (char_class == null) { - return; - } - this.character_category_definition.push(char_class); - return; - } - var parsed_category_mapping = CATEGORY_MAPPING_PATTERN.exec(line); - if (parsed_category_mapping != null) { - var mapping = CharacterDefinition.parseCategoryMapping(parsed_category_mapping); - this.category_mapping.push(mapping); - } - var parsed_range_category_mapping = RANGE_CATEGORY_MAPPING_PATTERN.exec(line); - if (parsed_range_category_mapping != null) { - var range_mapping = CharacterDefinition.parseRangeCategoryMapping(parsed_range_category_mapping); - this.category_mapping.push(range_mapping); + var parsed_category_def = CATEGORY_DEF_PATTERN.exec(line); + if (parsed_category_def != null) { + var class_id = this.character_category_definition.length; + var char_class = CharacterDefinition.parseCharCategory( + class_id, + parsed_category_def, + ); + if (char_class == null) { + return; } + this.character_category_definition.push(char_class); + return; + } + var parsed_category_mapping = CATEGORY_MAPPING_PATTERN.exec(line); + if (parsed_category_mapping != null) { + var mapping = CharacterDefinition.parseCategoryMapping( + parsed_category_mapping, + ); + this.category_mapping.push(mapping); + } + var parsed_range_category_mapping = RANGE_CATEGORY_MAPPING_PATTERN.exec(line); + if (parsed_range_category_mapping != null) { + var range_mapping = CharacterDefinition.parseRangeCategoryMapping( + parsed_range_category_mapping, + ); + this.category_mapping.push(range_mapping); + } }; CharacterDefinitionBuilder.prototype.build = function () { - // TODO If DEFAULT category does not exist, throw error - this.char_def.invoke_definition_map.init(this.character_category_definition); - this.char_def.initCategoryMappings(this.category_mapping); - return this.char_def; + // TODO If DEFAULT category does not exist, throw error + this.char_def.invoke_definition_map.init(this.character_category_definition); + this.char_def.initCategoryMappings(this.category_mapping); + return this.char_def; }; -module.exports = CharacterDefinitionBuilder; +export default CharacterDefinitionBuilder; diff --git a/src/dict/builder/ConnectionCostsBuilder.js b/src/dict/builder/ConnectionCostsBuilder.js index c09997a0..3c6697b1 100644 --- a/src/dict/builder/ConnectionCostsBuilder.js +++ b/src/dict/builder/ConnectionCostsBuilder.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,56 +16,63 @@ * limitations under the License. */ -"use strict"; - -var ConnectionCosts = require("../ConnectionCosts"); +import ConnectionCosts from "../ConnectionCosts.js"; /** * Builder class for constructing ConnectionCosts object * @constructor */ function ConnectionCostsBuilder() { - this.lines = 0; - this.connection_cost = null; + this.lines = 0; + this.connection_cost = null; } ConnectionCostsBuilder.prototype.putLine = function (line) { - if (this.lines === 0) { - var dimensions = line.split(" "); - var forward_dimension = dimensions[0]; - var backward_dimension = dimensions[1]; - - if (forward_dimension < 0 || backward_dimension < 0) { - throw "Parse error of matrix.def"; - } + if (this.lines === 0) { + var dimensions = line.split(" "); + var forward_dimension = dimensions[0]; + var backward_dimension = dimensions[1]; - this.connection_cost = new ConnectionCosts(forward_dimension, backward_dimension); - this.lines++; - return this; + if (forward_dimension < 0 || backward_dimension < 0) { + throw "Parse error of matrix.def"; } - var costs = line.split(" "); + this.connection_cost = new ConnectionCosts( + forward_dimension, + backward_dimension, + ); + this.lines++; + return this; + } - if (costs.length !== 3) { - return this; - } + var costs = line.split(" "); - var forward_id = parseInt(costs[0]); - var backward_id = parseInt(costs[1]); - var cost = parseInt(costs[2]); + if (costs.length !== 3) { + return this; + } - if (forward_id < 0 || backward_id < 0 || !isFinite(forward_id) || !isFinite(backward_id) || - this.connection_cost.forward_dimension <= forward_id || this.connection_cost.backward_dimension <= backward_id) { - throw "Parse error of matrix.def"; - } + var forward_id = parseInt(costs[0]); + var backward_id = parseInt(costs[1]); + var cost = parseInt(costs[2]); - this.connection_cost.put(forward_id, backward_id, cost); - this.lines++; - return this; + if ( + forward_id < 0 || + backward_id < 0 || + !isFinite(forward_id) || + !isFinite(backward_id) || + this.connection_cost.forward_dimension <= forward_id || + this.connection_cost.backward_dimension <= backward_id + ) { + throw "Parse error of matrix.def"; + } + + this.connection_cost.put(forward_id, backward_id, cost); + this.lines++; + return this; }; ConnectionCostsBuilder.prototype.build = function () { - return this.connection_cost; + return this.connection_cost; }; -module.exports = ConnectionCostsBuilder; +export default ConnectionCostsBuilder; diff --git a/src/dict/builder/DictionaryBuilder.js b/src/dict/builder/DictionaryBuilder.js index 216c769f..f58c81a5 100644 --- a/src/dict/builder/DictionaryBuilder.js +++ b/src/dict/builder/DictionaryBuilder.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,14 +16,12 @@ * limitations under the License. */ -"use strict"; - -var doublearray = require("doublearray"); -var DynamicDictionaries = require("../DynamicDictionaries"); -var TokenInfoDictionary = require("../TokenInfoDictionary"); -var ConnectionCostsBuilder = require("./ConnectionCostsBuilder"); -var CharacterDefinitionBuilder = require("./CharacterDefinitionBuilder"); -var UnknownDictionary = require("../UnknownDictionary"); +import doublearray from "doublearray"; +import DynamicDictionaries from "../DynamicDictionaries.js"; +import TokenInfoDictionary from "../TokenInfoDictionary.js"; +import ConnectionCostsBuilder from "./ConnectionCostsBuilder.js"; +import CharacterDefinitionBuilder from "./CharacterDefinitionBuilder.js"; +import UnknownDictionary from "../UnknownDictionary.js"; /** * Build dictionaries (token info, connection costs) @@ -37,18 +36,18 @@ var UnknownDictionary = require("../UnknownDictionary"); * tid_pos.dat: posList (part of speech) */ function DictionaryBuilder() { - // Array of entries, each entry in Mecab form - // (0: surface form, 1: left id, 2: right id, 3: word cost, 4: part of speech id, 5-: other features) - this.tid_entries = []; - this.unk_entries = []; - this.cc_builder = new ConnectionCostsBuilder(); - this.cd_builder = new CharacterDefinitionBuilder(); + // Array of entries, each entry in Mecab form + // (0: surface form, 1: left id, 2: right id, 3: word cost, 4: part of speech id, 5-: other features) + this.tid_entries = []; + this.unk_entries = []; + this.cc_builder = new ConnectionCostsBuilder(); + this.cd_builder = new CharacterDefinitionBuilder(); } DictionaryBuilder.prototype.addTokenInfoDictionary = function (line) { - var new_entry = line.split(","); - this.tid_entries.push(new_entry); - return this; + var new_entry = line.split(","); + this.tid_entries.push(new_entry); + return this; }; /** @@ -56,13 +55,13 @@ DictionaryBuilder.prototype.addTokenInfoDictionary = function (line) { * @param {string} line is a line of "matrix.def" */ DictionaryBuilder.prototype.putCostMatrixLine = function (line) { - this.cc_builder.putLine(line); - return this; + this.cc_builder.putLine(line); + return this; }; DictionaryBuilder.prototype.putCharDefLine = function (line) { - this.cd_builder.putLine(line); - return this; + this.cd_builder.putLine(line); + return this; }; /** @@ -70,15 +69,20 @@ DictionaryBuilder.prototype.putCharDefLine = function (line) { * @param {string} line is a line of "unk.def" */ DictionaryBuilder.prototype.putUnkDefLine = function (line) { - this.unk_entries.push(line.split(",")); - return this; + this.unk_entries.push(line.split(",")); + return this; }; DictionaryBuilder.prototype.build = function () { - var dictionaries = this.buildTokenInfoDictionary(); - var unknown_dictionary = this.buildUnknownDictionary(); - - return new DynamicDictionaries(dictionaries.trie, dictionaries.token_info_dictionary, this.cc_builder.build(), unknown_dictionary); + var dictionaries = this.buildTokenInfoDictionary(); + var unknown_dictionary = this.buildUnknownDictionary(); + + return new DynamicDictionaries( + dictionaries.trie, + dictionaries.token_info_dictionary, + this.cc_builder.build(), + unknown_dictionary, + ); }; /** @@ -87,56 +91,56 @@ DictionaryBuilder.prototype.build = function () { * @returns {{trie: *, token_info_dictionary: *}} */ DictionaryBuilder.prototype.buildTokenInfoDictionary = function () { + var token_info_dictionary = new TokenInfoDictionary(); - var token_info_dictionary = new TokenInfoDictionary(); + // using as hashmap, string -> string (word_id -> surface_form) to build dictionary + var dictionary_entries = token_info_dictionary.buildDictionary( + this.tid_entries, + ); - // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - var dictionary_entries = token_info_dictionary.buildDictionary(this.tid_entries); + var trie = this.buildDoubleArray(); - var trie = this.buildDoubleArray(); + for (var token_info_id in dictionary_entries) { + var surface_form = dictionary_entries[token_info_id]; + var trie_id = trie.lookup(surface_form); - for (var token_info_id in dictionary_entries) { - var surface_form = dictionary_entries[token_info_id]; - var trie_id = trie.lookup(surface_form); + // Assertion + // if (trie_id < 0) { + // console.log("Not Found:" + surface_form); + // } - // Assertion - // if (trie_id < 0) { - // console.log("Not Found:" + surface_form); - // } + token_info_dictionary.addMapping(trie_id, token_info_id); + } - token_info_dictionary.addMapping(trie_id, token_info_id); - } - - return { - trie: trie, - token_info_dictionary: token_info_dictionary - }; + return { + trie: trie, + token_info_dictionary: token_info_dictionary, + }; }; DictionaryBuilder.prototype.buildUnknownDictionary = function () { + var unk_dictionary = new UnknownDictionary(); - var unk_dictionary = new UnknownDictionary(); - - // using as hashmap, string -> string (word_id -> surface_form) to build dictionary - var dictionary_entries = unk_dictionary.buildDictionary(this.unk_entries); + // using as hashmap, string -> string (word_id -> surface_form) to build dictionary + var dictionary_entries = unk_dictionary.buildDictionary(this.unk_entries); - var char_def = this.cd_builder.build(); // Create CharacterDefinition + var char_def = this.cd_builder.build(); // Create CharacterDefinition - unk_dictionary.characterDefinition(char_def); + unk_dictionary.characterDefinition(char_def); - for (var token_info_id in dictionary_entries) { - var class_name = dictionary_entries[token_info_id]; - var class_id = char_def.invoke_definition_map.lookup(class_name); + for (var token_info_id in dictionary_entries) { + var class_name = dictionary_entries[token_info_id]; + var class_id = char_def.invoke_definition_map.lookup(class_name); - // Assertion - // if (trie_id < 0) { - // console.log("Not Found:" + surface_form); - // } + // Assertion + // if (trie_id < 0) { + // console.log("Not Found:" + surface_form); + // } - unk_dictionary.addMapping(class_id, token_info_id); - } + unk_dictionary.addMapping(class_id, token_info_id); + } - return unk_dictionary; + return unk_dictionary; }; /** @@ -145,14 +149,14 @@ DictionaryBuilder.prototype.buildUnknownDictionary = function () { * @returns {DoubleArray} Double-Array trie */ DictionaryBuilder.prototype.buildDoubleArray = function () { - var trie_id = 0; - var words = this.tid_entries.map(function (entry) { - var surface_form = entry[0]; - return { k: surface_form, v: trie_id++ }; - }); - - var builder = doublearray.builder(1024 * 1024); - return builder.build(words); + var trie_id = 0; + var words = this.tid_entries.map(function (entry) { + var surface_form = entry[0]; + return { k: surface_form, v: trie_id++ }; + }); + + var builder = doublearray.builder(1024 * 1024); + return builder.build(words); }; -module.exports = DictionaryBuilder; +export default DictionaryBuilder; diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 00000000..afe42d33 --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,181 @@ +/// + +/** + * このファイルには、MITライセンスの下で提供されている @types/kuromoji プロジェクトからのコードが含まれています。 + * 詳細な貢献者情報は各定義ファイルの冒頭にあります。 + */ + +// dict/ConnectionCosts.js +export interface ConnectionCosts { + buffer: Int16Array; + put(forward_id: number, backward_id: number, cost: number): void; + get(forward_id: number, backward_id: number): number; + loadConnectionCosts(connection_costs_buffer: Int16Array): void; +} + +// dict/DynamicDictionaries.js +export interface DynamicDictionaries { + trie: doublearray.DoubleArray; + token_info_dictionary: TokenInfoDictionary; + connection_costs: ConnectionCosts; + unknown_dictionary: UnknownDictionary; + loadTrie( + base_buffer: Int32Array, + check_buffer: Int32Array, + ): DynamicDictionaries; +} + +// dict/TokenInfoDictionary.js +export interface TokenInfoDictionary { + buildDictionary(entries: any[][]): { [word_id: number]: string }; + put( + left_id: number, + right_id: number, + word_cost: number, + surface_form: string, + feature: string, + ): number; + addMapping(source: number, target: number): void; + targetMapToBuffer(): Uint8Array; + loadDictionary(array_buffer: Uint8Array): TokenInfoDictionary; + loadPosVector(array_buffer: Uint8Array): TokenInfoDictionary; + loadTargetMap(array_buffer: Uint8Array): TokenInfoDictionary; + getFeatures(token_info_id_str: string): string; +} + +// dict/UnknownDictionary.js +export type UnknownDictionary = TokenInfoDictionary; + +// util/ByteBuffer.js +export interface ByteBuffer { + buffer: Uint8Array; + position: number; + size(): number; + reallocate(): void; + shrink(): Uint8Array; + put(b: number): void; + get(index: number): number; + putShort(num: number): void; + getShort(index: number): number; + putInt(num: number): void; + getInt(index: number): number; + readInt(): number; + putString(str: string): void; + getString(index: number): string; +} + +// util/DictionaryBuilder.js +export interface DictionaryBuilder { + tid_entries: string[]; + unk_entries: string[]; + addTokenInfoDictionary(text: string): DictionaryBuilder; + costMatrix(matrix_text: string): DictionaryBuilder; + charDef(char_text: string): DictionaryBuilder; + unkDef(text: string): DictionaryBuilder; + build(): DynamicDictionaries; + buildTokenInfoDictionary(): { + trie: doublearray.DoubleArray; + token_info_dictionary: TokenInfoDictionary; + }; + buildUnknownDictionary(): UnknownDictionary; + buildConnectionCosts(): ConnectionCosts; + buildDoubleArray(): doublearray.DoubleArray; +} + +// util/IpadicFormatter.js +export interface Formatter { + formatEntry( + word_id: number, + position: number, + type: string, + features: string[], + ): T; + formatUnknownEntry( + word_id: number, + position: number, + type: string, + features: string[], + ): T; +} +export type IpadicFormatter = Formatter; + +export interface IpadicFeatures { + word_id: number; + word_type: string; + word_position: number; + surface_form: string; + pos: string; + pos_detail_1: string; + pos_detail_2: string; + pos_detail_3: string; + conjugated_type: string; + conjugated_form: string; + basic_form: string; + reading?: string | undefined; + pronunciation?: string | undefined; +} + +// viterbi/ViterbiBuilder.js +export interface ViterbiBuilder { + trie: doublearray.DoubleArray; + token_info_dictionary: TokenInfoDictionary; + unknown_dictionary: UnknownDictionary; + build(sentence_str: string): ViterbiLattice; +} + +// viterbi/ViterbiLattice.js +export interface ViterbiLattice { + append(node: ViterbiNode): void; + appendEos(): void; +} + +// viterbi/ViterbiNode.js +export interface ViterbiNode { + name: string; + cost: number; + start_pos: number; + length: number; + left_id: number; + right_id: number; + prev: ViterbiNode; + surface_form: string; + shortest_cost: number; + type: string; +} + +// viterbi/ViterbiSearcher.js +export interface ViterbiSearcher { + connection_costs: ConnectionCosts; + search(lattice: ViterbiLattice): ViterbiNode[]; + forward(lattice: ViterbiLattice): ViterbiLattice; + backward(lattice: ViterbiLattice): ViterbiNode[]; +} + +// Tokenizer.js +export interface TokenizerStatic { + splitByPunctuation(input: string): string[]; +} +export interface Tokenizer { + token_info_dictionary: TokenInfoDictionary; + unknown_dictionary: UnknownDictionary; + viterbi_builder: ViterbiBuilder; + viterbi_searcher: ViterbiSearcher; + formatter: Formatter; + tokenize(text: string): T[]; + getLattice(text: string): ViterbiLattice; +} + +// TokenizerBuilder.js +export interface TokenizerBuilder { + build(callback: (err: Error, tokenizer: Tokenizer) => void): void; +} +export interface TokenizerBuilderOption { + dicPath?: string | undefined; + nodeOrBrowser: "node" | "browser"; +} + +// kuromoji.js +export function builder( + option: TokenizerBuilderOption, +): TokenizerBuilder; +export function dictionaryBuilder(): DictionaryBuilder; diff --git a/src/kuromoji.js b/src/kuromoji.js index 4820d23e..6e9e82e9 100644 --- a/src/kuromoji.js +++ b/src/kuromoji.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,19 +16,13 @@ * limitations under the License. */ -"use strict"; +import TokenizerBuilder from "./TokenizerBuilder.js"; +import DictionaryBuilder from "./dict/builder/DictionaryBuilder.js"; -var TokenizerBuilder = require("./TokenizerBuilder"); -var DictionaryBuilder = require("./dict/builder/DictionaryBuilder"); +export function builder(option) { + return new TokenizerBuilder(option); +} -// Public methods -var kuromoji = { - builder: function (option) { - return new TokenizerBuilder(option); - }, - dictionaryBuilder: function () { - return new DictionaryBuilder(); - } -}; - -module.exports = kuromoji; +export function dictionaryBuilder() { + return new DictionaryBuilder(); +} diff --git a/src/loader/BrowserDictionaryLoader.js b/src/loader/BrowserDictionaryLoader.js index 04bfdcd1..64997de8 100644 --- a/src/loader/BrowserDictionaryLoader.js +++ b/src/loader/BrowserDictionaryLoader.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,10 +16,8 @@ * limitations under the License. */ -"use strict"; - -var zlib = require("zlibjs/bin/gunzip.min.js"); -var DictionaryLoader = require("./DictionaryLoader"); +import * as fflate from "fflate"; +import DictionaryLoader from "./DictionaryLoader.js"; /** * BrowserDictionaryLoader inherits DictionaryLoader, using jQuery XHR for download @@ -26,7 +25,7 @@ var DictionaryLoader = require("./DictionaryLoader"); * @constructor */ function BrowserDictionaryLoader(dic_path) { - DictionaryLoader.apply(this, [dic_path]); + DictionaryLoader.apply(this, [dic_path]); } BrowserDictionaryLoader.prototype = Object.create(DictionaryLoader.prototype); @@ -37,24 +36,23 @@ BrowserDictionaryLoader.prototype = Object.create(DictionaryLoader.prototype); * @param {BrowserDictionaryLoader~onLoad} callback Callback function */ BrowserDictionaryLoader.prototype.loadArrayBuffer = function (url, callback) { - var xhr = new XMLHttpRequest(); - xhr.open("GET", url, true); - xhr.responseType = "arraybuffer"; - xhr.onload = function () { - if (this.status > 0 && this.status !== 200) { - callback(xhr.statusText, null); - return; - } - var arraybuffer = this.response; + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, true); + xhr.responseType = "arraybuffer"; + xhr.onload = function () { + if (this.status > 0 && this.status !== 200) { + callback(xhr.statusText, null); + return; + } + var arraybuffer = this.response; - var gz = new zlib.Zlib.Gunzip(new Uint8Array(arraybuffer)); - var typed_array = gz.decompress(); - callback(null, typed_array.buffer); - }; - xhr.onerror = function (err) { - callback(err, null); - }; - xhr.send(); + var typed_array = fflate.decompressSync(new Uint8Array(arraybuffer)); + callback(null, typed_array.buffer); + }; + xhr.onerror = function (err) { + callback(err, null); + }; + xhr.send(); }; /** @@ -64,4 +62,4 @@ BrowserDictionaryLoader.prototype.loadArrayBuffer = function (url, callback) { * @param {Uint8Array} buffer Loaded buffer */ -module.exports = BrowserDictionaryLoader; +export default BrowserDictionaryLoader; diff --git a/src/loader/DictionaryLoader.js b/src/loader/DictionaryLoader.js index 5f88c0b7..46db6870 100644 --- a/src/loader/DictionaryLoader.js +++ b/src/loader/DictionaryLoader.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,11 +16,8 @@ * limitations under the License. */ -"use strict"; - -var path = require("path"); -var async = require("async"); -var DynamicDictionaries = require("../dict/DynamicDictionaries"); +import async from "async"; +import DynamicDictionaries from "../dict/DynamicDictionaries.js"; /** * DictionaryLoader base constructor @@ -27,12 +25,12 @@ var DynamicDictionaries = require("../dict/DynamicDictionaries"); * @constructor */ function DictionaryLoader(dic_path) { - this.dic = new DynamicDictionaries(); - this.dic_path = dic_path; + this.dic = new DynamicDictionaries(); + this.dic_path = dic_path; } DictionaryLoader.prototype.loadArrayBuffer = function (file, callback) { - throw new Error("DictionaryLoader#loadArrayBuffer should be overwrite"); + throw new Error("DictionaryLoader#loadArrayBuffer should be overwrite"); }; /** @@ -40,91 +38,140 @@ DictionaryLoader.prototype.loadArrayBuffer = function (file, callback) { * @param {DictionaryLoader~onLoad} load_callback Callback function called after loaded */ DictionaryLoader.prototype.load = function (load_callback) { - var dic = this.dic; - var dic_path = this.dic_path; - var loadArrayBuffer = this.loadArrayBuffer; + var dic = this.dic; + var dic_path = this.dic_path; + var loadArrayBuffer = this.loadArrayBuffer; - async.parallel([ - // Trie - function (callback) { - async.map([ "base.dat.gz", "check.dat.gz" ], function (filename, _callback) { - loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) { - if(err) { - return _callback(err); - } - _callback(null, buffer); - }); - }, function (err, buffers) { - if(err) { - return callback(err); - } - var base_buffer = new Int32Array(buffers[0]); - var check_buffer = new Int32Array(buffers[1]); + function joinPath(...parts) { + return parts.join("/"); + } - dic.loadTrie(base_buffer, check_buffer); - callback(null); - }); - }, - // Token info dictionaries - function (callback) { - async.map([ "tid.dat.gz", "tid_pos.dat.gz", "tid_map.dat.gz" ], function (filename, _callback) { - loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) { - if(err) { - return _callback(err); - } - _callback(null, buffer); - }); - }, function (err, buffers) { - if(err) { - return callback(err); + async.parallel( + [ + // Trie + function (callback) { + async.map( + ["base.dat.gz", "check.dat.gz"], + function (filename, _callback) { + loadArrayBuffer( + joinPath(dic_path, filename), + function (err, buffer) { + if (err) { + return _callback(err); } - var token_info_buffer = new Uint8Array(buffers[0]); - var pos_buffer = new Uint8Array(buffers[1]); - var target_map_buffer = new Uint8Array(buffers[2]); + _callback(null, buffer); + }, + ); + }, + function (err, buffers) { + if (err) { + return callback(err); + } + var base_buffer = new Int32Array(buffers[0]); + var check_buffer = new Int32Array(buffers[1]); - dic.loadTokenInfoDictionaries(token_info_buffer, pos_buffer, target_map_buffer); - callback(null); - }); - }, - // Connection cost matrix - function (callback) { - loadArrayBuffer(path.join(dic_path, "cc.dat.gz"), function (err, buffer) { - if(err) { - return callback(err); + dic.loadTrie(base_buffer, check_buffer); + callback(null); + }, + ); + }, + // Token info dictionaries + function (callback) { + async.map( + ["tid.dat.gz", "tid_pos.dat.gz", "tid_map.dat.gz"], + function (filename, _callback) { + loadArrayBuffer( + joinPath(dic_path, filename), + function (err, buffer) { + if (err) { + return _callback(err); } - var cc_buffer = new Int16Array(buffer); - dic.loadConnectionCosts(cc_buffer); - callback(null); - }); - }, - // Unknown dictionaries - function (callback) { - async.map([ "unk.dat.gz", "unk_pos.dat.gz", "unk_map.dat.gz", "unk_char.dat.gz", "unk_compat.dat.gz", "unk_invoke.dat.gz" ], function (filename, _callback) { - loadArrayBuffer(path.join(dic_path, filename), function (err, buffer) { - if(err) { - return _callback(err); - } - _callback(null, buffer); - }); - }, function (err, buffers) { - if(err) { - return callback(err); + _callback(null, buffer); + }, + ); + }, + function (err, buffers) { + if (err) { + return callback(err); + } + var token_info_buffer = new Uint8Array(buffers[0]); + var pos_buffer = new Uint8Array(buffers[1]); + var target_map_buffer = new Uint8Array(buffers[2]); + + dic.loadTokenInfoDictionaries( + token_info_buffer, + pos_buffer, + target_map_buffer, + ); + callback(null); + }, + ); + }, + // Connection cost matrix + function (callback) { + loadArrayBuffer( + joinPath(dic_path, "cc.dat.gz"), + function (err, buffer) { + if (err) { + return callback(err); + } + var cc_buffer = new Int16Array(buffer); + dic.loadConnectionCosts(cc_buffer); + callback(null); + }, + ); + }, + // Unknown dictionaries + function (callback) { + async.map( + [ + "unk.dat.gz", + "unk_pos.dat.gz", + "unk_map.dat.gz", + "unk_char.dat.gz", + "unk_compat.dat.gz", + "unk_invoke.dat.gz", + ], + function (filename, _callback) { + loadArrayBuffer( + joinPath(dic_path, filename), + function (err, buffer) { + if (err) { + return _callback(err); } - var unk_buffer = new Uint8Array(buffers[0]); - var unk_pos_buffer = new Uint8Array(buffers[1]); - var unk_map_buffer = new Uint8Array(buffers[2]); - var cat_map_buffer = new Uint8Array(buffers[3]); - var compat_cat_map_buffer = new Uint32Array(buffers[4]); - var invoke_def_buffer = new Uint8Array(buffers[5]); + _callback(null, buffer); + }, + ); + }, + function (err, buffers) { + if (err) { + return callback(err); + } + var unk_buffer = new Uint8Array(buffers[0]); + var unk_pos_buffer = new Uint8Array(buffers[1]); + var unk_map_buffer = new Uint8Array(buffers[2]); + var cat_map_buffer = new Uint8Array(buffers[3]); + var compat_cat_map_buffer = new Uint32Array(buffers[4]); + var invoke_def_buffer = new Uint8Array(buffers[5]); - dic.loadUnknownDictionaries(unk_buffer, unk_pos_buffer, unk_map_buffer, cat_map_buffer, compat_cat_map_buffer, invoke_def_buffer); - // dic.loadUnknownDictionaries(char_buffer, unk_buffer); - callback(null); - }); - } - ], function (err) { - load_callback(err, dic); - }); + dic.loadUnknownDictionaries( + unk_buffer, + unk_pos_buffer, + unk_map_buffer, + cat_map_buffer, + compat_cat_map_buffer, + invoke_def_buffer, + ); + // dic.loadUnknownDictionaries(char_buffer, unk_buffer); + callback(null); + }, + ); + }, + ], + function (err) { + load_callback(err, dic); + }, + ); }; /** @@ -134,4 +181,4 @@ DictionaryLoader.prototype.load = function (load_callback) { * @param {DynamicDictionaries} dic Loaded dictionary */ -module.exports = DictionaryLoader; +export default DictionaryLoader; diff --git a/src/loader/NodeDictionaryLoader.js b/src/loader/NodeDictionaryLoader.js index 26eb7924..0cd07088 100644 --- a/src/loader/NodeDictionaryLoader.js +++ b/src/loader/NodeDictionaryLoader.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,11 +16,9 @@ * limitations under the License. */ -"use strict"; - -var fs = require("fs"); -var node_zlib = require("zlib"); -var DictionaryLoader = require("./DictionaryLoader"); +import fs from "fs"; +import node_zlib from "zlib"; +import DictionaryLoader from "./DictionaryLoader.js"; /** * NodeDictionaryLoader inherits DictionaryLoader @@ -27,7 +26,7 @@ var DictionaryLoader = require("./DictionaryLoader"); * @constructor */ function NodeDictionaryLoader(dic_path) { - DictionaryLoader.apply(this, [ dic_path ]); + DictionaryLoader.apply(this, [dic_path]); } NodeDictionaryLoader.prototype = Object.create(DictionaryLoader.prototype); @@ -38,18 +37,18 @@ NodeDictionaryLoader.prototype = Object.create(DictionaryLoader.prototype); * @param {NodeDictionaryLoader~onLoad} callback Callback function */ NodeDictionaryLoader.prototype.loadArrayBuffer = function (file, callback) { - fs.readFile(file, function (err, buffer) { - if(err) { - return callback(err); - } - node_zlib.gunzip(buffer, function (err2, decompressed) { - if(err2) { - return callback(err2); - } - var typed_array = new Uint8Array(decompressed); - callback(null, typed_array.buffer); - }); + fs.readFile(file, function (err, buffer) { + if (err) { + return callback(err); + } + node_zlib.gunzip(buffer, function (err2, decompressed) { + if (err2) { + return callback(err2); + } + var typed_array = new Uint8Array(decompressed); + callback(null, typed_array.buffer); }); + }); }; /** @@ -58,4 +57,4 @@ NodeDictionaryLoader.prototype.loadArrayBuffer = function (file, callback) { * @param {Uint8Array} buffer Loaded buffer */ -module.exports = NodeDictionaryLoader; +export default NodeDictionaryLoader; diff --git a/src/util/ByteBuffer.js b/src/util/ByteBuffer.js index 1efa453a..efecd5f4 100644 --- a/src/util/ByteBuffer.js +++ b/src/util/ByteBuffer.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,8 +16,6 @@ * limitations under the License. */ -"use strict"; - /** * Convert String (UTF-16) to UTF-8 ArrayBuffer * @@ -24,62 +23,57 @@ * @return {Uint8Array} Byte sequence encoded by UTF-8 */ var stringToUtf8Bytes = function (str) { + // Max size of 1 character is 4 bytes + var bytes = new Uint8Array(str.length * 4); + + var i = 0, + j = 0; + + while (i < str.length) { + var unicode_code; + + var utf16_code = str.charCodeAt(i++); + if (utf16_code >= 0xd800 && utf16_code <= 0xdbff) { + // surrogate pair + var upper = utf16_code; // high surrogate + var lower = str.charCodeAt(i++); // low surrogate + + if (lower >= 0xdc00 && lower <= 0xdfff) { + unicode_code = + (upper - 0xd800) * (1 << 10) + (1 << 16) + (lower - 0xdc00); + } else { + // malformed surrogate pair + return null; + } + } else { + // not surrogate code + unicode_code = utf16_code; + } - // Max size of 1 character is 4 bytes - var bytes = new Uint8Array(str.length * 4); - - var i = 0, j = 0; - - while (i < str.length) { - var unicode_code; - - var utf16_code = str.charCodeAt(i++); - if (utf16_code >= 0xD800 && utf16_code <= 0xDBFF) { - // surrogate pair - var upper = utf16_code; // high surrogate - var lower = str.charCodeAt(i++); // low surrogate - - if (lower >= 0xDC00 && lower <= 0xDFFF) { - unicode_code = - (upper - 0xD800) * (1 << 10) + (1 << 16) + - (lower - 0xDC00); - } else { - // malformed surrogate pair - return null; - } - } else { - // not surrogate code - unicode_code = utf16_code; - } - - if (unicode_code < 0x80) { - // 1-byte - bytes[j++] = unicode_code; - - } else if (unicode_code < (1 << 11)) { - // 2-byte - bytes[j++] = (unicode_code >>> 6) | 0xC0; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else if (unicode_code < (1 << 16)) { - // 3-byte - bytes[j++] = (unicode_code >>> 12) | 0xE0; - bytes[j++] = ((unicode_code >> 6) & 0x3f) | 0x80; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else if (unicode_code < (1 << 21)) { - // 4-byte - bytes[j++] = (unicode_code >>> 18) | 0xF0; - bytes[j++] = ((unicode_code >> 12) & 0x3F) | 0x80; - bytes[j++] = ((unicode_code >> 6) & 0x3F) | 0x80; - bytes[j++] = (unicode_code & 0x3F) | 0x80; - - } else { - // malformed UCS4 code - } + if (unicode_code < 0x80) { + // 1-byte + bytes[j++] = unicode_code; + } else if (unicode_code < 1 << 11) { + // 2-byte + bytes[j++] = (unicode_code >>> 6) | 0xc0; + bytes[j++] = (unicode_code & 0x3f) | 0x80; + } else if (unicode_code < 1 << 16) { + // 3-byte + bytes[j++] = (unicode_code >>> 12) | 0xe0; + bytes[j++] = ((unicode_code >> 6) & 0x3f) | 0x80; + bytes[j++] = (unicode_code & 0x3f) | 0x80; + } else if (unicode_code < 1 << 21) { + // 4-byte + bytes[j++] = (unicode_code >>> 18) | 0xf0; + bytes[j++] = ((unicode_code >> 12) & 0x3f) | 0x80; + bytes[j++] = ((unicode_code >> 6) & 0x3f) | 0x80; + bytes[j++] = (unicode_code & 0x3f) | 0x80; + } else { + // malformed UCS4 code } + } - return bytes.subarray(0, j); + return bytes.subarray(0, j); }; /** @@ -89,47 +83,49 @@ var stringToUtf8Bytes = function (str) { * @return {String} String encoded by UTF-16 */ var utf8BytesToString = function (bytes) { + var str = ""; + var code, b1, b2, b3, b4, upper, lower; + var i = 0; + + while (i < bytes.length) { + b1 = bytes[i++]; + + if (b1 < 0x80) { + // 1 byte + code = b1; + } else if (b1 >> 5 === 0x06) { + // 2 bytes + b2 = bytes[i++]; + code = ((b1 & 0x1f) << 6) | (b2 & 0x3f); + } else if (b1 >> 4 === 0x0e) { + // 3 bytes + b2 = bytes[i++]; + b3 = bytes[i++]; + code = ((b1 & 0x0f) << 12) | ((b2 & 0x3f) << 6) | (b3 & 0x3f); + } else { + // 4 bytes + b2 = bytes[i++]; + b3 = bytes[i++]; + b4 = bytes[i++]; + code = + ((b1 & 0x07) << 18) | + ((b2 & 0x3f) << 12) | + ((b3 & 0x3f) << 6) | + (b4 & 0x3f); + } - var str = ""; - var code, b1, b2, b3, b4, upper, lower; - var i = 0; - - while (i < bytes.length) { - - b1 = bytes[i++]; - - if (b1 < 0x80) { - // 1 byte - code = b1; - } else if ((b1 >> 5) === 0x06) { - // 2 bytes - b2 = bytes[i++]; - code = ((b1 & 0x1f) << 6) | (b2 & 0x3f); - } else if ((b1 >> 4) === 0x0e) { - // 3 bytes - b2 = bytes[i++]; - b3 = bytes[i++]; - code = ((b1 & 0x0f) << 12) | ((b2 & 0x3f) << 6) | (b3 & 0x3f); - } else { - // 4 bytes - b2 = bytes[i++]; - b3 = bytes[i++]; - b4 = bytes[i++]; - code = ((b1 & 0x07) << 18) | ((b2 & 0x3f) << 12) | ((b3 & 0x3f) << 6) | (b4 & 0x3f); - } - - if (code < 0x10000) { - str += String.fromCharCode(code); - } else { - // surrogate pair - code -= 0x10000; - upper = (0xD800 | (code >> 10)); - lower = (0xDC00 | (code & 0x3FF)); - str += String.fromCharCode(upper, lower); - } + if (code < 0x10000) { + str += String.fromCharCode(code); + } else { + // surrogate pair + code -= 0x10000; + upper = 0xd800 | (code >> 10); + lower = 0xdc00 | (code & 0x3ff); + str += String.fromCharCode(upper, lower); } + } - return str; + return str; }; /** @@ -138,152 +134,152 @@ var utf8BytesToString = function (bytes) { * @constructor */ function ByteBuffer(arg) { - var initial_size; - if (arg == null) { - initial_size = 1024 * 1024; - } else if (typeof arg === "number") { - initial_size = arg; - } else if (arg instanceof Uint8Array) { - this.buffer = arg; - this.position = 0; // Overwrite - return; - } else { - // typeof arg -> String - throw typeof arg + " is invalid parameter type for ByteBuffer constructor"; - } - // arg is null or number - this.buffer = new Uint8Array(initial_size); - this.position = 0; + var initial_size; + if (arg == null) { + initial_size = 1024 * 1024; + } else if (typeof arg === "number") { + initial_size = arg; + } else if (arg instanceof Uint8Array) { + this.buffer = arg; + this.position = 0; // Overwrite + return; + } else { + // typeof arg -> String + throw typeof arg + " is invalid parameter type for ByteBuffer constructor"; + } + // arg is null or number + this.buffer = new Uint8Array(initial_size); + this.position = 0; } ByteBuffer.prototype.size = function () { - return this.buffer.length; + return this.buffer.length; }; ByteBuffer.prototype.reallocate = function () { - var new_array = new Uint8Array(this.buffer.length * 2); - new_array.set(this.buffer); - this.buffer = new_array; + var new_array = new Uint8Array(this.buffer.length * 2); + new_array.set(this.buffer); + this.buffer = new_array; }; ByteBuffer.prototype.shrink = function () { - this.buffer = this.buffer.subarray(0, this.position); - return this.buffer; + this.buffer = this.buffer.subarray(0, this.position); + return this.buffer; }; ByteBuffer.prototype.put = function (b) { - if (this.buffer.length < this.position + 1) { - this.reallocate(); - } - this.buffer[this.position++] = b; + if (this.buffer.length < this.position + 1) { + this.reallocate(); + } + this.buffer[this.position++] = b; }; ByteBuffer.prototype.get = function (index) { - if (index == null) { - index = this.position; - this.position += 1; - } - if (this.buffer.length < index + 1) { - return 0; - } - return this.buffer[index]; + if (index == null) { + index = this.position; + this.position += 1; + } + if (this.buffer.length < index + 1) { + return 0; + } + return this.buffer[index]; }; // Write short to buffer by little endian ByteBuffer.prototype.putShort = function (num) { - if (0xFFFF < num) { - throw num + " is over short value"; - } - var lower = (0x00FF & num); - var upper = (0xFF00 & num) >> 8; - this.put(lower); - this.put(upper); + if (0xffff < num) { + throw num + " is over short value"; + } + var lower = 0x00ff & num; + var upper = (0xff00 & num) >> 8; + this.put(lower); + this.put(upper); }; // Read short from buffer by little endian ByteBuffer.prototype.getShort = function (index) { - if (index == null) { - index = this.position; - this.position += 2; - } - if (this.buffer.length < index + 2) { - return 0; - } - var lower = this.buffer[index]; - var upper = this.buffer[index + 1]; - var value = (upper << 8) + lower; - if (value & 0x8000) { - value = -((value - 1) ^ 0xFFFF); - } - return value; + if (index == null) { + index = this.position; + this.position += 2; + } + if (this.buffer.length < index + 2) { + return 0; + } + var lower = this.buffer[index]; + var upper = this.buffer[index + 1]; + var value = (upper << 8) + lower; + if (value & 0x8000) { + value = -((value - 1) ^ 0xffff); + } + return value; }; // Write integer to buffer by little endian ByteBuffer.prototype.putInt = function (num) { - if (0xFFFFFFFF < num) { - throw num + " is over integer value"; - } - var b0 = (0x000000FF & num); - var b1 = (0x0000FF00 & num) >> 8; - var b2 = (0x00FF0000 & num) >> 16; - var b3 = (0xFF000000 & num) >> 24; - this.put(b0); - this.put(b1); - this.put(b2); - this.put(b3); + if (0xffffffff < num) { + throw num + " is over integer value"; + } + var b0 = 0x000000ff & num; + var b1 = (0x0000ff00 & num) >> 8; + var b2 = (0x00ff0000 & num) >> 16; + var b3 = (0xff000000 & num) >> 24; + this.put(b0); + this.put(b1); + this.put(b2); + this.put(b3); }; // Read integer from buffer by little endian ByteBuffer.prototype.getInt = function (index) { - if (index == null) { - index = this.position; - this.position += 4; - } - if (this.buffer.length < index + 4) { - return 0; - } - var b0 = this.buffer[index]; - var b1 = this.buffer[index + 1]; - var b2 = this.buffer[index + 2]; - var b3 = this.buffer[index + 3]; - - return (b3 << 24) + (b2 << 16) + (b1 << 8) + b0; + if (index == null) { + index = this.position; + this.position += 4; + } + if (this.buffer.length < index + 4) { + return 0; + } + var b0 = this.buffer[index]; + var b1 = this.buffer[index + 1]; + var b2 = this.buffer[index + 2]; + var b3 = this.buffer[index + 3]; + + return (b3 << 24) + (b2 << 16) + (b1 << 8) + b0; }; ByteBuffer.prototype.readInt = function () { - var pos = this.position; - this.position += 4; - return this.getInt(pos); + var pos = this.position; + this.position += 4; + return this.getInt(pos); }; ByteBuffer.prototype.putString = function (str) { - var bytes = stringToUtf8Bytes(str); - for (var i = 0; i < bytes.length; i++) { - this.put(bytes[i]); - } - // put null character as terminal character - this.put(0); + var bytes = stringToUtf8Bytes(str); + for (var i = 0; i < bytes.length; i++) { + this.put(bytes[i]); + } + // put null character as terminal character + this.put(0); }; ByteBuffer.prototype.getString = function (index) { - var buf = [], - ch; - if (index == null) { - index = this.position; + var buf = [], + ch; + if (index == null) { + index = this.position; + } + while (true) { + if (this.buffer.length < index + 1) { + break; } - while (true) { - if (this.buffer.length < index + 1) { - break; - } - ch = this.get(index++); - if (ch === 0) { - break; - } else { - buf.push(ch); - } + ch = this.get(index++); + if (ch === 0) { + break; + } else { + buf.push(ch); } - this.position = index; - return utf8BytesToString(buf); + } + this.position = index; + return utf8BytesToString(buf); }; -module.exports = ByteBuffer; +export default ByteBuffer; diff --git a/src/util/IpadicFormatter.js b/src/util/IpadicFormatter.js index 285e05c1..386fe6fb 100644 --- a/src/util/IpadicFormatter.js +++ b/src/util/IpadicFormatter.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,53 +16,61 @@ * limitations under the License. */ -"use strict"; - /** * Mappings between IPADIC dictionary features and tokenized results * @constructor */ -function IpadicFormatter() { -} +function IpadicFormatter() {} -IpadicFormatter.prototype.formatEntry = function (word_id, position, type, features) { - var token = {}; - token.word_id = word_id; - token.word_type = type; - token.word_position = position; +IpadicFormatter.prototype.formatEntry = function ( + word_id, + position, + type, + features, +) { + var token = {}; + token.word_id = word_id; + token.word_type = type; + token.word_position = position; - token.surface_form = features[0]; - token.pos = features[1]; - token.pos_detail_1 = features[2]; - token.pos_detail_2 = features[3]; - token.pos_detail_3 = features[4]; - token.conjugated_type = features[5]; - token.conjugated_form = features[6]; - token.basic_form = features[7]; - token.reading = features[8]; - token.pronunciation = features[9]; + token.surface_form = features[0]; + token.pos = features[1]; + token.pos_detail_1 = features[2]; + token.pos_detail_2 = features[3]; + token.pos_detail_3 = features[4]; + token.conjugated_type = features[5]; + token.conjugated_form = features[6]; + token.basic_form = features[7]; + token.reading = features[8]; + token.pronunciation = features[9]; - return token; + return token; }; -IpadicFormatter.prototype.formatUnknownEntry = function (word_id, position, type, features, surface_form) { - var token = {}; - token.word_id = word_id; - token.word_type = type; - token.word_position = position; +IpadicFormatter.prototype.formatUnknownEntry = function ( + word_id, + position, + type, + features, + surface_form, +) { + var token = {}; + token.word_id = word_id; + token.word_type = type; + token.word_position = position; - token.surface_form = surface_form; - token.pos = features[1]; - token.pos_detail_1 = features[2]; - token.pos_detail_2 = features[3]; - token.pos_detail_3 = features[4]; - token.conjugated_type = features[5]; - token.conjugated_form = features[6]; - token.basic_form = features[7]; - // token.reading = features[8]; - // token.pronunciation = features[9]; + token.surface_form = surface_form; + token.pos = features[1]; + token.pos_detail_1 = features[2]; + token.pos_detail_2 = features[3]; + token.pos_detail_3 = features[4]; + token.conjugated_type = features[5]; + token.conjugated_form = features[6]; + token.basic_form = features[7]; + // token.reading = features[8]; + // token.pronunciation = features[9]; - return token; + return token; }; -module.exports = IpadicFormatter; +export default IpadicFormatter; diff --git a/src/util/SurrogateAwareString.js b/src/util/SurrogateAwareString.js index bfd88cea..95543301 100644 --- a/src/util/SurrogateAwareString.js +++ b/src/util/SurrogateAwareString.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,77 +16,79 @@ * limitations under the License. */ -"use strict"; - /** * String wrapper for UTF-16 surrogate pair (4 bytes) * @param {string} str String to wrap * @constructor */ function SurrogateAwareString(str) { - this.str = str; - this.index_mapping = []; + this.str = str; + this.index_mapping = []; - for (var pos = 0; pos < str.length; pos++) { - var ch = str.charAt(pos); - this.index_mapping.push(pos); - if (SurrogateAwareString.isSurrogatePair(ch)) { - pos++; - } + for (var pos = 0; pos < str.length; pos++) { + var ch = str.charAt(pos); + this.index_mapping.push(pos); + if (SurrogateAwareString.isSurrogatePair(ch)) { + pos++; } - // Surrogate aware length - this.length = this.index_mapping.length; + } + // Surrogate aware length + this.length = this.index_mapping.length; } SurrogateAwareString.prototype.slice = function (index) { - if (this.index_mapping.length <= index) { - return ""; - } - var surrogate_aware_index = this.index_mapping[index]; - return this.str.slice(surrogate_aware_index); + if (this.index_mapping.length <= index) { + return ""; + } + var surrogate_aware_index = this.index_mapping[index]; + return this.str.slice(surrogate_aware_index); }; SurrogateAwareString.prototype.charAt = function (index) { - if (this.str.length <= index) { - return ""; - } - var surrogate_aware_start_index = this.index_mapping[index]; - var surrogate_aware_end_index = this.index_mapping[index + 1]; + if (this.str.length <= index) { + return ""; + } + var surrogate_aware_start_index = this.index_mapping[index]; + var surrogate_aware_end_index = this.index_mapping[index + 1]; - if (surrogate_aware_end_index == null) { - return this.str.slice(surrogate_aware_start_index); - } - return this.str.slice(surrogate_aware_start_index, surrogate_aware_end_index); + if (surrogate_aware_end_index == null) { + return this.str.slice(surrogate_aware_start_index); + } + return this.str.slice(surrogate_aware_start_index, surrogate_aware_end_index); }; SurrogateAwareString.prototype.charCodeAt = function (index) { - if (this.index_mapping.length <= index) { - return NaN; - } - var surrogate_aware_index = this.index_mapping[index]; - var upper = this.str.charCodeAt(surrogate_aware_index); - var lower; - if (upper >= 0xD800 && upper <= 0xDBFF && surrogate_aware_index < this.str.length) { - lower = this.str.charCodeAt(surrogate_aware_index + 1); - if (lower >= 0xDC00 && lower <= 0xDFFF) { - return (upper - 0xD800) * 0x400 + lower - 0xDC00 + 0x10000; - } + if (this.index_mapping.length <= index) { + return NaN; + } + var surrogate_aware_index = this.index_mapping[index]; + var upper = this.str.charCodeAt(surrogate_aware_index); + var lower; + if ( + upper >= 0xd800 && + upper <= 0xdbff && + surrogate_aware_index < this.str.length + ) { + lower = this.str.charCodeAt(surrogate_aware_index + 1); + if (lower >= 0xdc00 && lower <= 0xdfff) { + return (upper - 0xd800) * 0x400 + lower - 0xdc00 + 0x10000; } - return upper; + } + return upper; }; SurrogateAwareString.prototype.toString = function () { - return this.str; + return this.str; }; SurrogateAwareString.isSurrogatePair = function (ch) { - var utf16_code = ch.charCodeAt(0); - if (utf16_code >= 0xD800 && utf16_code <= 0xDBFF) { - // surrogate pair - return true; - } else { - return false; - } + var utf16_code = ch.charCodeAt(0); + if (utf16_code >= 0xd800 && utf16_code <= 0xdbff) { + // surrogate pair + return true; + } else { + return false; + } }; -module.exports = SurrogateAwareString; +export default SurrogateAwareString; diff --git a/src/viterbi/ViterbiBuilder.js b/src/viterbi/ViterbiBuilder.js index b5b8a5f4..f20946b1 100644 --- a/src/viterbi/ViterbiBuilder.js +++ b/src/viterbi/ViterbiBuilder.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,11 +16,9 @@ * limitations under the License. */ -"use strict"; - -var ViterbiNode = require("./ViterbiNode"); -var ViterbiLattice = require("./ViterbiLattice"); -var SurrogateAwareString = require("../util/SurrogateAwareString"); +import ViterbiNode from "./ViterbiNode.js"; +import ViterbiLattice from "./ViterbiLattice.js"; +import SurrogateAwareString from "../util/SurrogateAwareString.js"; /** * ViterbiBuilder builds word lattice (ViterbiLattice) @@ -27,9 +26,9 @@ var SurrogateAwareString = require("../util/SurrogateAwareString"); * @constructor */ function ViterbiBuilder(dic) { - this.trie = dic.trie; - this.token_info_dictionary = dic.token_info_dictionary; - this.unknown_dictionary = dic.unknown_dictionary; + this.trie = dic.trie; + this.token_info_dictionary = dic.token_info_dictionary; + this.unknown_dictionary = dic.unknown_dictionary; } /** @@ -38,64 +37,99 @@ function ViterbiBuilder(dic) { * @returns {ViterbiLattice} Word lattice */ ViterbiBuilder.prototype.build = function (sentence_str) { - var lattice = new ViterbiLattice(); - var sentence = new SurrogateAwareString(sentence_str); + var lattice = new ViterbiLattice(); + var sentence = new SurrogateAwareString(sentence_str); - var key, trie_id, left_id, right_id, word_cost; - for (var pos = 0; pos < sentence.length; pos++) { - var tail = sentence.slice(pos); - var vocabulary = this.trie.commonPrefixSearch(tail); - for (var n = 0; n < vocabulary.length; n++) { // Words in dictionary do not have surrogate pair (only UCS2 set) - trie_id = vocabulary[n].v; - key = vocabulary[n].k; + var key, trie_id, left_id, right_id, word_cost; + for (var pos = 0; pos < sentence.length; pos++) { + var tail = sentence.slice(pos); + var vocabulary = this.trie.commonPrefixSearch(tail); + for (var n = 0; n < vocabulary.length; n++) { + // Words in dictionary do not have surrogate pair (only UCS2 set) + trie_id = vocabulary[n].v; + key = vocabulary[n].k; - var token_info_ids = this.token_info_dictionary.target_map[trie_id]; - for (var i = 0; i < token_info_ids.length; i++) { - var token_info_id = parseInt(token_info_ids[i]); + var token_info_ids = this.token_info_dictionary.target_map[trie_id]; + for (var i = 0; i < token_info_ids.length; i++) { + var token_info_id = parseInt(token_info_ids[i]); - left_id = this.token_info_dictionary.dictionary.getShort(token_info_id); - right_id = this.token_info_dictionary.dictionary.getShort(token_info_id + 2); - word_cost = this.token_info_dictionary.dictionary.getShort(token_info_id + 4); + left_id = this.token_info_dictionary.dictionary.getShort(token_info_id); + right_id = this.token_info_dictionary.dictionary.getShort( + token_info_id + 2, + ); + word_cost = this.token_info_dictionary.dictionary.getShort( + token_info_id + 4, + ); - // node_name, cost, start_index, length, type, left_id, right_id, surface_form - lattice.append(new ViterbiNode(token_info_id, word_cost, pos + 1, key.length, "KNOWN", left_id, right_id, key)); - } - } + // node_name, cost, start_index, length, type, left_id, right_id, surface_form + lattice.append( + new ViterbiNode( + token_info_id, + word_cost, + pos + 1, + key.length, + "KNOWN", + left_id, + right_id, + key, + ), + ); + } + } - // Unknown word processing - var surrogate_aware_tail = new SurrogateAwareString(tail); - var head_char = new SurrogateAwareString(surrogate_aware_tail.charAt(0)); - var head_char_class = this.unknown_dictionary.lookup(head_char.toString()); - if (vocabulary == null || vocabulary.length === 0 || head_char_class.is_always_invoke === 1) { - // Process unknown word - key = head_char; - if (head_char_class.is_grouping === 1 && 1 < surrogate_aware_tail.length) { - for (var k = 1; k < surrogate_aware_tail.length; k++) { - var next_char = surrogate_aware_tail.charAt(k); - var next_char_class = this.unknown_dictionary.lookup(next_char); - if (head_char_class.class_name !== next_char_class.class_name) { - break; - } - key += next_char; - } - } + // Unknown word processing + var surrogate_aware_tail = new SurrogateAwareString(tail); + var head_char = new SurrogateAwareString(surrogate_aware_tail.charAt(0)); + var head_char_class = this.unknown_dictionary.lookup(head_char.toString()); + if ( + vocabulary == null || + vocabulary.length === 0 || + head_char_class.is_always_invoke === 1 + ) { + // Process unknown word + key = head_char; + if ( + head_char_class.is_grouping === 1 && + 1 < surrogate_aware_tail.length + ) { + for (var k = 1; k < surrogate_aware_tail.length; k++) { + var next_char = surrogate_aware_tail.charAt(k); + var next_char_class = this.unknown_dictionary.lookup(next_char); + if (head_char_class.class_name !== next_char_class.class_name) { + break; + } + key += next_char; + } + } - var unk_ids = this.unknown_dictionary.target_map[head_char_class.class_id]; - for (var j = 0; j < unk_ids.length; j++) { - var unk_id = parseInt(unk_ids[j]); + var unk_ids = + this.unknown_dictionary.target_map[head_char_class.class_id]; + for (var j = 0; j < unk_ids.length; j++) { + var unk_id = parseInt(unk_ids[j]); - left_id = this.unknown_dictionary.dictionary.getShort(unk_id); - right_id = this.unknown_dictionary.dictionary.getShort(unk_id + 2); - word_cost = this.unknown_dictionary.dictionary.getShort(unk_id + 4); + left_id = this.unknown_dictionary.dictionary.getShort(unk_id); + right_id = this.unknown_dictionary.dictionary.getShort(unk_id + 2); + word_cost = this.unknown_dictionary.dictionary.getShort(unk_id + 4); - // node_name, cost, start_index, length, type, left_id, right_id, surface_form - lattice.append(new ViterbiNode(unk_id, word_cost, pos + 1, key.length, "UNKNOWN", left_id, right_id, key.toString())); - } - } + // node_name, cost, start_index, length, type, left_id, right_id, surface_form + lattice.append( + new ViterbiNode( + unk_id, + word_cost, + pos + 1, + key.length, + "UNKNOWN", + left_id, + right_id, + key.toString(), + ), + ); + } } - lattice.appendEos(); + } + lattice.appendEos(); - return lattice; + return lattice; }; -module.exports = ViterbiBuilder; +export default ViterbiBuilder; diff --git a/src/viterbi/ViterbiLattice.js b/src/viterbi/ViterbiLattice.js index 0ab121d2..f4d7cbe4 100644 --- a/src/viterbi/ViterbiLattice.js +++ b/src/viterbi/ViterbiLattice.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,18 +16,16 @@ * limitations under the License. */ -"use strict"; - -var ViterbiNode = require("./ViterbiNode"); +import ViterbiNode from "./ViterbiNode.js"; /** * ViterbiLattice is a lattice in Viterbi algorithm * @constructor */ function ViterbiLattice() { - this.nodes_end_at = []; - this.nodes_end_at[0] = [ new ViterbiNode(-1, 0, 0, 0, "BOS", 0, 0, "") ]; - this.eos_pos = 1; + this.nodes_end_at = []; + this.nodes_end_at[0] = [new ViterbiNode(-1, 0, 0, 0, "BOS", 0, 0, "")]; + this.eos_pos = 1; } /** @@ -34,27 +33,29 @@ function ViterbiLattice() { * @param {ViterbiNode} node */ ViterbiLattice.prototype.append = function (node) { - var last_pos = node.start_pos + node.length - 1; - if (this.eos_pos < last_pos) { - this.eos_pos = last_pos; - } - - var prev_nodes = this.nodes_end_at[last_pos]; - if (prev_nodes == null) { - prev_nodes = []; - } - prev_nodes.push(node); - - this.nodes_end_at[last_pos] = prev_nodes; + var last_pos = node.start_pos + node.length - 1; + if (this.eos_pos < last_pos) { + this.eos_pos = last_pos; + } + + var prev_nodes = this.nodes_end_at[last_pos]; + if (prev_nodes == null) { + prev_nodes = []; + } + prev_nodes.push(node); + + this.nodes_end_at[last_pos] = prev_nodes; }; /** * Set ends with EOS (End of Statement) */ ViterbiLattice.prototype.appendEos = function () { - var last_index = this.nodes_end_at.length; - this.eos_pos++; - this.nodes_end_at[last_index] = [ new ViterbiNode(-1, 0, this.eos_pos, 0, "EOS", 0, 0, "") ]; + var last_index = this.nodes_end_at.length; + this.eos_pos++; + this.nodes_end_at[last_index] = [ + new ViterbiNode(-1, 0, this.eos_pos, 0, "EOS", 0, 0, ""), + ]; }; -module.exports = ViterbiLattice; +export default ViterbiLattice; diff --git a/src/viterbi/ViterbiNode.js b/src/viterbi/ViterbiNode.js index a35574c5..7b0d3cf6 100644 --- a/src/viterbi/ViterbiNode.js +++ b/src/viterbi/ViterbiNode.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,8 +16,6 @@ * limitations under the License. */ -"use strict"; - /** * ViterbiNode is a node of ViterbiLattice * @param {number} node_name Word ID @@ -29,21 +28,30 @@ * @param {string} surface_form Surface form of this word * @constructor */ -function ViterbiNode(node_name, node_cost, start_pos, length, type, left_id, right_id, surface_form) { - this.name = node_name; - this.cost = node_cost; - this.start_pos = start_pos; - this.length = length; - this.left_id = left_id; - this.right_id = right_id; - this.prev = null; - this.surface_form = surface_form; - if (type === "BOS") { - this.shortest_cost = 0; - } else { - this.shortest_cost = Number.MAX_VALUE; - } - this.type = type; +function ViterbiNode( + node_name, + node_cost, + start_pos, + length, + type, + left_id, + right_id, + surface_form, +) { + this.name = node_name; + this.cost = node_cost; + this.start_pos = start_pos; + this.length = length; + this.left_id = left_id; + this.right_id = right_id; + this.prev = null; + this.surface_form = surface_form; + if (type === "BOS") { + this.shortest_cost = 0; + } else { + this.shortest_cost = Number.MAX_VALUE; + } + this.type = type; } -module.exports = ViterbiNode; +export default ViterbiNode; diff --git a/src/viterbi/ViterbiSearcher.js b/src/viterbi/ViterbiSearcher.js index 832e5543..eca8a7f7 100644 --- a/src/viterbi/ViterbiSearcher.js +++ b/src/viterbi/ViterbiSearcher.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,15 +16,13 @@ * limitations under the License. */ -"use strict"; - /** * ViterbiSearcher is for searching best Viterbi path * @param {ConnectionCosts} connection_costs Connection costs matrix * @constructor */ function ViterbiSearcher(connection_costs) { - this.connection_costs = connection_costs; + this.connection_costs = connection_costs; } /** @@ -32,71 +31,74 @@ function ViterbiSearcher(connection_costs) { * @returns {Array} Shortest path */ ViterbiSearcher.prototype.search = function (lattice) { - lattice = this.forward(lattice); - return this.backward(lattice); + lattice = this.forward(lattice); + return this.backward(lattice); }; ViterbiSearcher.prototype.forward = function (lattice) { - var i, j, k; - for (i = 1; i <= lattice.eos_pos; i++) { - var nodes = lattice.nodes_end_at[i]; - if (nodes == null) { - continue; - } - for (j = 0; j < nodes.length; j++) { - var node = nodes[j]; - var cost = Number.MAX_VALUE; - var shortest_prev_node; - - var prev_nodes = lattice.nodes_end_at[node.start_pos - 1]; - if (prev_nodes == null) { - // TODO process unknown words (repair word lattice) - continue; - } - for (k = 0; k < prev_nodes.length; k++) { - var prev_node = prev_nodes[k]; + var i, j, k; + for (i = 1; i <= lattice.eos_pos; i++) { + var nodes = lattice.nodes_end_at[i]; + if (nodes == null) { + continue; + } + for (j = 0; j < nodes.length; j++) { + var node = nodes[j]; + var cost = Number.MAX_VALUE; + var shortest_prev_node; - var edge_cost; - if (node.left_id == null || prev_node.right_id == null) { - // TODO assert - console.log("Left or right is null"); - edge_cost = 0; - } else { - edge_cost = this.connection_costs.get(prev_node.right_id, node.left_id); - } + var prev_nodes = lattice.nodes_end_at[node.start_pos - 1]; + if (prev_nodes == null) { + // TODO process unknown words (repair word lattice) + continue; + } + for (k = 0; k < prev_nodes.length; k++) { + var prev_node = prev_nodes[k]; - var _cost = prev_node.shortest_cost + edge_cost + node.cost; - if (_cost < cost) { - shortest_prev_node = prev_node; - cost = _cost; - } - } + var edge_cost; + if (node.left_id == null || prev_node.right_id == null) { + // TODO assert + console.log("Left or right is null"); + edge_cost = 0; + } else { + edge_cost = this.connection_costs.get( + prev_node.right_id, + node.left_id, + ); + } - node.prev = shortest_prev_node; - node.shortest_cost = cost; + var _cost = prev_node.shortest_cost + edge_cost + node.cost; + if (_cost < cost) { + shortest_prev_node = prev_node; + cost = _cost; } + } + + node.prev = shortest_prev_node; + node.shortest_cost = cost; } - return lattice; + } + return lattice; }; ViterbiSearcher.prototype.backward = function (lattice) { - var shortest_path = []; - var eos = lattice.nodes_end_at[lattice.nodes_end_at.length - 1][0]; + var shortest_path = []; + var eos = lattice.nodes_end_at[lattice.nodes_end_at.length - 1][0]; - var node_back = eos.prev; - if (node_back == null) { - return []; - } - while (node_back.type !== "BOS") { - shortest_path.push(node_back); - if (node_back.prev == null) { - // TODO Failed to back. Process unknown words? - return []; - } - node_back = node_back.prev; + var node_back = eos.prev; + if (node_back == null) { + return []; + } + while (node_back.type !== "BOS") { + shortest_path.push(node_back); + if (node_back.prev == null) { + // TODO Failed to back. Process unknown words? + return []; } + node_back = node_back.prev; + } - return shortest_path.reverse(); + return shortest_path.reverse(); }; -module.exports = ViterbiSearcher; +export default ViterbiSearcher; diff --git a/test/TokenizerTest.js b/test/TokenizerTest.js index 1118c372..ec7fdb2f 100644 --- a/test/TokenizerTest.js +++ b/test/TokenizerTest.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,188 +16,199 @@ * limitations under the License. */ -var expect = require("chai").expect; -var kuromoji = require("../src/kuromoji.js"); // Not to be browserifiy-ed -var Tokenizer = require("../src/Tokenizer"); +import { expect } from "chai"; +import * as kuromoji from "../src/kuromoji.js"; // Not to be browserifiy-ed +import Tokenizer from "../src/Tokenizer.js"; + +import { describe, it, before } from "node:test"; var DIC_DIR = "dict/"; describe("Tokenizer static method test", function () { - it("splitByPunctuation", function () { - expect(Tokenizer.splitByPunctuation("すもももももももものうち")) - .to.deep.eql(["すもももももももものうち"]); - }); - it("splitByPunctuation", function () { - expect(Tokenizer.splitByPunctuation("、")) - .to.deep.eql(["、"]); - }); - it("splitByPunctuation", function () { - expect(Tokenizer.splitByPunctuation("。")) - .to.deep.eql(["。"]); - }); - it("splitByPunctuation", function () { - expect(Tokenizer.splitByPunctuation("すもも、も、もも。もも、も、もも。")) - .to.deep.eql(["すもも、", "も、", "もも。", "もも、", "も、", "もも。"]); - }); - it("splitByPunctuation", function () { - expect(Tokenizer.splitByPunctuation("、𠮷野屋。漢字。")) - .to.deep.eql(["、", "𠮷野屋。", "漢字。"]); - }); + it("splitByPunctuation", function () { + expect( + Tokenizer.splitByPunctuation("すもももももももものうち"), + ).to.deep.eql(["すもももももももものうち"]); + }); + it("splitByPunctuation", function () { + expect(Tokenizer.splitByPunctuation("、")).to.deep.eql(["、"]); + }); + it("splitByPunctuation", function () { + expect(Tokenizer.splitByPunctuation("。")).to.deep.eql(["。"]); + }); + it("splitByPunctuation", function () { + expect( + Tokenizer.splitByPunctuation("すもも、も、もも。もも、も、もも。"), + ).to.deep.eql(["すもも、", "も、", "もも。", "もも、", "も、", "もも。"]); + }); + it("splitByPunctuation", function () { + expect(Tokenizer.splitByPunctuation("、𠮷野屋。漢字。")).to.deep.eql([ + "、", + "𠮷野屋。", + "漢字。", + ]); + }); }); describe("Tokenizer for IPADic", function () { - var tokenizer = null; // target object + var tokenizer = null; // target object - before(function (done) { - this.timeout(5 * 60 * 1000); // 5 min - kuromoji.builder({ dicPath: DIC_DIR }).build(function (error, _tokenizer) { - tokenizer = _tokenizer; - expect(tokenizer).to.be.a("object"); - done(); + before(async function () { + tokenizer = await new Promise((resolve, reject) => { + kuromoji + .builder({ dicPath: DIC_DIR, nodeOrBrowser: "node" }) + .build((error, _tokenizer) => { + if (error) { + reject(error); + } else { + resolve(_tokenizer); + } }); }); + }); - it("Sentence すもももももももものうち is tokenized properly", function () { - var path = tokenizer.tokenize("すもももももももものうち"); - var expected_tokens = [ - { - word_type: "KNOWN", - word_position: 1, - surface_form: "すもも", - pos: "名詞", - pos_detail_1: "一般", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "すもも", - reading: "スモモ", - pronunciation: "スモモ" - }, - { - word_type: "KNOWN", - word_position: 4, - surface_form: "も", - pos: "助詞", - pos_detail_1: "係助詞", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "も", - reading: "モ", - pronunciation: "モ" - }, - { - word_type: "KNOWN", - word_position: 5, - surface_form: "もも", - pos: "名詞", - pos_detail_1: "一般", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "もも", - reading: "モモ", - pronunciation: "モモ" }, - { - word_type: "KNOWN", - word_position: 7, - surface_form: "も", - pos: "助詞", - pos_detail_1: "係助詞", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "も", - reading: "モ", - pronunciation: "モ" - }, - { - word_type: "KNOWN", - word_position: 8, - surface_form: "もも", - pos: "名詞", - pos_detail_1: "一般", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "もも", - reading: "モモ", - pronunciation: "モモ" - }, - { - word_type: "KNOWN", - word_position: 10, - surface_form: "の", - pos: "助詞", - pos_detail_1: "連体化", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "の", - reading: "ノ", - pronunciation: "ノ" - }, - { - word_type: "KNOWN", - word_position: 11, - surface_form: "うち", - pos: "名詞", - pos_detail_1: "非自立", - pos_detail_2: "副詞可能", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "うち", - reading: "ウチ", - pronunciation: "ウチ" - } - ]; + it("Sentence すもももももももものうち is tokenized properly", function () { + var path = tokenizer.tokenize("すもももももももものうち"); + var expected_tokens = [ + { + word_type: "KNOWN", + word_position: 1, + surface_form: "すもも", + pos: "名詞", + pos_detail_1: "一般", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "すもも", + reading: "スモモ", + pronunciation: "スモモ", + }, + { + word_type: "KNOWN", + word_position: 4, + surface_form: "も", + pos: "助詞", + pos_detail_1: "係助詞", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "も", + reading: "モ", + pronunciation: "モ", + }, + { + word_type: "KNOWN", + word_position: 5, + surface_form: "もも", + pos: "名詞", + pos_detail_1: "一般", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "もも", + reading: "モモ", + pronunciation: "モモ", + }, + { + word_type: "KNOWN", + word_position: 7, + surface_form: "も", + pos: "助詞", + pos_detail_1: "係助詞", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "も", + reading: "モ", + pronunciation: "モ", + }, + { + word_type: "KNOWN", + word_position: 8, + surface_form: "もも", + pos: "名詞", + pos_detail_1: "一般", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "もも", + reading: "モモ", + pronunciation: "モモ", + }, + { + word_type: "KNOWN", + word_position: 10, + surface_form: "の", + pos: "助詞", + pos_detail_1: "連体化", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "の", + reading: "ノ", + pronunciation: "ノ", + }, + { + word_type: "KNOWN", + word_position: 11, + surface_form: "うち", + pos: "名詞", + pos_detail_1: "非自立", + pos_detail_2: "副詞可能", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "うち", + reading: "ウチ", + pronunciation: "ウチ", + }, + ]; - expect(path).to.have.length(7); + expect(path).to.have.length(7); - for (var i = 0; i < expected_tokens.length; i++) { - var expected_token = expected_tokens[i]; - var target_token = path[i]; - for (var key in expected_token) { - expect(target_token).to.have.property(key, expected_token[key]); - } - } - }); - it("Sentence include unknown words となりのトトロ are tokenized properly", function () { - var path = tokenizer.tokenize("となりのトトロ"); - expect(path).to.have.length(3); - }); - it("研究 is not split", function () { - var path = tokenizer.tokenize("研究"); - expect(path).to.have.length(1); - }); - it("Blank input", function () { - var path = tokenizer.tokenize(""); - expect(path).to.have.length(0); - }); - it("Sentence include UTF-16 surrogate pair", function () { - var path = tokenizer.tokenize("𠮷野屋"); - expect(path).to.have.length(3); - expect(path[0].word_position).to.eql(1); - expect(path[1].word_position).to.eql(2); - expect(path[2].word_position).to.eql(3); - }); - it("Sentence include punctuation あ、あ。あ、あ。 returns correct positions", function () { - var path = tokenizer.tokenize("あ、あ。あ、あ。"); - expect(path).to.have.length(8); - expect(path[0].word_position).to.eql(1); - expect(path[1].word_position).to.eql(2); - expect(path[2].word_position).to.eql(3); - expect(path[3].word_position).to.eql(4); - expect(path[4].word_position).to.eql(5); - expect(path[5].word_position).to.eql(6); - expect(path[6].word_position).to.eql(7); - expect(path[7].word_position).to.eql(8); - }); + for (var i = 0; i < expected_tokens.length; i++) { + var expected_token = expected_tokens[i]; + var target_token = path[i]; + for (var key in expected_token) { + expect(target_token).to.have.property(key, expected_token[key]); + } + } + }); + it("Sentence include unknown words となりのトトロ are tokenized properly", function () { + var path = tokenizer.tokenize("となりのトトロ"); + expect(path).to.have.length(3); + }); + it("研究 is not split", function () { + var path = tokenizer.tokenize("研究"); + expect(path).to.have.length(1); + }); + it("Blank input", function () { + var path = tokenizer.tokenize(""); + expect(path).to.have.length(0); + }); + it("Sentence include UTF-16 surrogate pair", function () { + var path = tokenizer.tokenize("𠮷野屋"); + expect(path).to.have.length(3); + expect(path[0].word_position).to.eql(1); + expect(path[1].word_position).to.eql(2); + expect(path[2].word_position).to.eql(3); + }); + it("Sentence include punctuation あ、あ。あ、あ。 returns correct positions", function () { + var path = tokenizer.tokenize("あ、あ。あ、あ。"); + expect(path).to.have.length(8); + expect(path[0].word_position).to.eql(1); + expect(path[1].word_position).to.eql(2); + expect(path[2].word_position).to.eql(3); + expect(path[3].word_position).to.eql(4); + expect(path[4].word_position).to.eql(5); + expect(path[5].word_position).to.eql(6); + expect(path[6].word_position).to.eql(7); + expect(path[7].word_position).to.eql(8); + }); }); diff --git a/test/dict/CharacterDefinitionTest.js b/test/dict/CharacterDefinitionTest.js index 8d386e42..28f3fcd7 100644 --- a/test/dict/CharacterDefinitionTest.js +++ b/test/dict/CharacterDefinitionTest.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,118 +16,126 @@ * limitations under the License. */ -var CharacterDefinition = require("../../src/dict/CharacterDefinition"); -var InvokeDefinitionMap = require("../../src/dict/InvokeDefinitionMap"); -var CharacterDefinitionBuilder = require("../../src/dict/builder/CharacterDefinitionBuilder"); +import CharacterDefinition from "../../src/dict/CharacterDefinition.js"; +import InvokeDefinitionMap from "../../src/dict/InvokeDefinitionMap.js"; +import CharacterDefinitionBuilder from "../../src/dict/builder/CharacterDefinitionBuilder.js"; -var fs = require("fs"); -var expect = require("chai").expect; +import fs from "fs"; +import { expect } from "chai"; + +import { describe, it, before } from "node:test"; var DIC_DIR = "test/resource/minimum-dic/"; describe("CharacterDefinition from char.def", function () { - var char_def; // target object + var char_def; // target object - before("Create CharacterDefinition", function (done) { - var cd_builder = new CharacterDefinitionBuilder(); - fs.readFileSync(DIC_DIR + "char.def", "utf-8").split("\n").map(function (line) { - cd_builder.putLine(line); - }); - char_def = cd_builder.build(); - done(); - }); + before(function () { + var cd_builder = new CharacterDefinitionBuilder(); + fs.readFileSync(DIC_DIR + "char.def", "utf-8") + .split("\n") + .map(function (line) { + cd_builder.putLine(line); + }); + char_def = cd_builder.build(); + }); - it("lookup by space, return SPACE class", function () { - expect(char_def.lookup(" ").class_name).to.equal("SPACE"); - }); - it("lookup by 日, return KANJI class", function () { - expect(char_def.lookup("日").class_name).to.equal("KANJI"); - }); - it("lookup by !, return SYMBOL class", function () { - expect(char_def.lookup("!").class_name).to.equal("SYMBOL"); - }); - it("lookup by 1, return NUMERIC class", function () { - expect(char_def.lookup("1").class_name).to.equal("NUMERIC"); - }); - it("lookup by A, return ALPHA class", function () { - expect(char_def.lookup("A").class_name).to.equal("ALPHA"); - }); - it("lookup by あ, return HIRAGANA class", function () { - expect(char_def.lookup("あ").class_name).to.equal("HIRAGANA"); - }); - it("lookup by ア, return KATAKANA class", function () { - expect(char_def.lookup("ア").class_name).to.equal("KATAKANA"); - }); - it("lookup by 一, return KANJINUMERIC class", function () { - expect(char_def.lookup("一").class_name).to.equal("KANJINUMERIC"); - }); - it("lookup by surrogate pair character, return DEFAULT class", function () { - expect(char_def.lookup("𠮷").class_name).to.equal("DEFAULT"); - }); + it("lookup by space, return SPACE class", function () { + expect(char_def.lookup(" ").class_name).to.equal("SPACE"); + }); + it("lookup by 日, return KANJI class", function () { + expect(char_def.lookup("日").class_name).to.equal("KANJI"); + }); + it("lookup by !, return SYMBOL class", function () { + expect(char_def.lookup("!").class_name).to.equal("SYMBOL"); + }); + it("lookup by 1, return NUMERIC class", function () { + expect(char_def.lookup("1").class_name).to.equal("NUMERIC"); + }); + it("lookup by A, return ALPHA class", function () { + expect(char_def.lookup("A").class_name).to.equal("ALPHA"); + }); + it("lookup by あ, return HIRAGANA class", function () { + expect(char_def.lookup("あ").class_name).to.equal("HIRAGANA"); + }); + it("lookup by ア, return KATAKANA class", function () { + expect(char_def.lookup("ア").class_name).to.equal("KATAKANA"); + }); + it("lookup by 一, return KANJINUMERIC class", function () { + expect(char_def.lookup("一").class_name).to.equal("KANJINUMERIC"); + }); + it("lookup by surrogate pair character, return DEFAULT class", function () { + expect(char_def.lookup("𠮷").class_name).to.equal("DEFAULT"); + }); - it("lookup by 一, return KANJI class as compatible category", function () { - expect(char_def.lookupCompatibleCategory("一")[0].class_name).to.equal("KANJI"); - }); - it("lookup by 0x4E00, return KANJINUMERIC class as compatible category", function () { - expect(char_def.lookupCompatibleCategory(String.fromCharCode(0x3007))[0].class_name).to.equal("KANJINUMERIC"); - }); + it("lookup by 一, return KANJI class as compatible category", function () { + expect(char_def.lookupCompatibleCategory("一")[0].class_name).to.equal( + "KANJI", + ); + }); + it("lookup by 0x4E00, return KANJINUMERIC class as compatible category", function () { + expect( + char_def.lookupCompatibleCategory(String.fromCharCode(0x3007))[0] + .class_name, + ).to.equal("KANJINUMERIC"); + }); - it("SPACE class definition of INVOKE: false, GROUP: true, LENGTH: 0", function () { - expect(char_def.lookup(" ").is_always_invoke).to.be.false; - expect(char_def.lookup(" ").is_grouping).to.be.true; - expect(char_def.lookup(" ").max_length).to.be.equal(0); - }); - it("KANJI class definition of INVOKE: false, GROUP: false, LENGTH: 2", function () { - expect(char_def.lookup("日").is_always_invoke).to.be.false; - expect(char_def.lookup("日").is_grouping).to.be.false; - expect(char_def.lookup("日").max_length).to.be.equal(2); - }); - it("SYMBOL class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { - expect(char_def.lookup("!").is_always_invoke).to.be.true; - expect(char_def.lookup("!").is_grouping).to.be.true; - expect(char_def.lookup("!").max_length).to.be.equal(0); - }); - it("NUMERIC class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { - expect(char_def.lookup("1").is_always_invoke).to.be.true; - expect(char_def.lookup("1").is_grouping).to.be.true; - expect(char_def.lookup("1").max_length).to.be.equal(0); - }); - it("ALPHA class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { - expect(char_def.lookup("A").is_always_invoke).to.be.true; - expect(char_def.lookup("A").is_grouping).to.be.true; - expect(char_def.lookup("A").max_length).to.be.equal(0); - }); - it("HIRAGANA class definition of INVOKE: false, GROUP: true, LENGTH: 2", function () { - expect(char_def.lookup("あ").is_always_invoke).to.be.false; - expect(char_def.lookup("あ").is_grouping).to.be.true; - expect(char_def.lookup("あ").max_length).to.be.equal(2); - }); - it("KATAKANA class definition of INVOKE: true, GROUP: true, LENGTH: 2", function () { - expect(char_def.lookup("ア").is_always_invoke).to.be.true; - expect(char_def.lookup("ア").is_grouping).to.be.true; - expect(char_def.lookup("ア").max_length).to.be.equal(2); - }); - it("KANJINUMERIC class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { - expect(char_def.lookup("一").is_always_invoke).to.be.true; - expect(char_def.lookup("一").is_grouping).to.be.true; - expect(char_def.lookup("一").max_length).to.be.equal(0); - }); - it("Save and load", function () { - var buffer = char_def.invoke_definition_map.toBuffer(); - var invoke_def = InvokeDefinitionMap.load(buffer); - expect(invoke_def.getCharacterClass(0)).to.deep.eql({ - class_id: 0, - class_name: "DEFAULT", - is_always_invoke: 0, - is_grouping: 1, - max_length: 0 - }); - expect(invoke_def.getCharacterClass(10)).to.deep.eql({ - class_id: 10, - class_name: 'CYRILLIC', - is_always_invoke: 1, - is_grouping: 1, - max_length: 0 - }); - }); + it("SPACE class definition of INVOKE: false, GROUP: true, LENGTH: 0", function () { + expect(char_def.lookup(" ").is_always_invoke).to.be.false; + expect(char_def.lookup(" ").is_grouping).to.be.true; + expect(char_def.lookup(" ").max_length).to.be.equal(0); + }); + it("KANJI class definition of INVOKE: false, GROUP: false, LENGTH: 2", function () { + expect(char_def.lookup("日").is_always_invoke).to.be.false; + expect(char_def.lookup("日").is_grouping).to.be.false; + expect(char_def.lookup("日").max_length).to.be.equal(2); + }); + it("SYMBOL class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { + expect(char_def.lookup("!").is_always_invoke).to.be.true; + expect(char_def.lookup("!").is_grouping).to.be.true; + expect(char_def.lookup("!").max_length).to.be.equal(0); + }); + it("NUMERIC class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { + expect(char_def.lookup("1").is_always_invoke).to.be.true; + expect(char_def.lookup("1").is_grouping).to.be.true; + expect(char_def.lookup("1").max_length).to.be.equal(0); + }); + it("ALPHA class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { + expect(char_def.lookup("A").is_always_invoke).to.be.true; + expect(char_def.lookup("A").is_grouping).to.be.true; + expect(char_def.lookup("A").max_length).to.be.equal(0); + }); + it("HIRAGANA class definition of INVOKE: false, GROUP: true, LENGTH: 2", function () { + expect(char_def.lookup("あ").is_always_invoke).to.be.false; + expect(char_def.lookup("あ").is_grouping).to.be.true; + expect(char_def.lookup("あ").max_length).to.be.equal(2); + }); + it("KATAKANA class definition of INVOKE: true, GROUP: true, LENGTH: 2", function () { + expect(char_def.lookup("ア").is_always_invoke).to.be.true; + expect(char_def.lookup("ア").is_grouping).to.be.true; + expect(char_def.lookup("ア").max_length).to.be.equal(2); + }); + it("KANJINUMERIC class definition of INVOKE: true, GROUP: true, LENGTH: 0", function () { + expect(char_def.lookup("一").is_always_invoke).to.be.true; + expect(char_def.lookup("一").is_grouping).to.be.true; + expect(char_def.lookup("一").max_length).to.be.equal(0); + }); + it("Save and load", function () { + var buffer = char_def.invoke_definition_map.toBuffer(); + var invoke_def = InvokeDefinitionMap.load(buffer); + expect(invoke_def.getCharacterClass(0)).to.deep.eql({ + class_id: 0, + class_name: "DEFAULT", + is_always_invoke: 0, + is_grouping: 1, + max_length: 0, + }); + expect(invoke_def.getCharacterClass(10)).to.deep.eql({ + class_id: 10, + class_name: "CYRILLIC", + is_always_invoke: 1, + is_grouping: 1, + max_length: 0, + }); + }); }); diff --git a/test/dict/builder/DictionaryBuilderTest.js b/test/dict/builder/DictionaryBuilderTest.js index 8eee0193..87c6ddea 100644 --- a/test/dict/builder/DictionaryBuilderTest.js +++ b/test/dict/builder/DictionaryBuilderTest.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,11 +16,13 @@ * limitations under the License. */ -var fs = require("fs"); -var expect = require("chai").expect; +import fs from "fs"; +import { expect } from "chai"; -var kuromoji = require("../../../src/kuromoji"); -var Tokenizer = require("../../../src/Tokenizer"); +import * as kuromoji from "../../../src/kuromoji.js"; +import Tokenizer from "../../../src/Tokenizer.js"; + +import { describe, it, before } from "node:test"; var DIC_DIR = "test/resource/minimum-dic/"; var connection_costs_file = DIC_DIR + "matrix.def"; @@ -28,170 +31,169 @@ var unk_def_file = DIC_DIR + "unk.def"; var tid_dic_file = DIC_DIR + "minimum.csv"; describe("DictionaryBuilder", function () { - this.timeout(30000); - - var kuromoji_dic = null; // target object of DynamicDictionaries to build - - before("Build", function (done) { - // Build token info dictionary - var builder = kuromoji.dictionaryBuilder(); - var tokenInfo = fs.readFileSync(tid_dic_file, "utf-8"); - tokenInfo.split("\n").map(function (line) { - builder.addTokenInfoDictionary(line); - }); - - // Build connection costs matrix - var cc_text = fs.readFileSync(connection_costs_file, "ascii"); - var cc_lines = cc_text.split("\n"); - cc_lines.map(function (line) { - builder.putCostMatrixLine(line); - }); - - // Build unknown dictionary - var cd_text = fs.readFileSync(char_def_file, "utf-8"); - var cd_lines = cd_text.split("\n"); - cd_lines.map(function (line) { - builder.putCharDefLine(line); - }); - var unk_text = fs.readFileSync(unk_def_file, "utf-8"); - var unk_lines = unk_text.split("\n"); - unk_lines.map(function (line) { - builder.putUnkDefLine(line); - }); - - kuromoji_dic = builder.build(); + var kuromoji_dic = null; // target object of DynamicDictionaries to build - done(); + before(function () { + // Build token info dictionary + var builder = kuromoji.dictionaryBuilder(); + var tokenInfo = fs.readFileSync(tid_dic_file, "utf-8"); + tokenInfo.split("\n").map(function (line) { + builder.addTokenInfoDictionary(line); }); - it("Dictionary not to be null", function () { - expect(kuromoji_dic).not.to.be.null; + // Build connection costs matrix + var cc_text = fs.readFileSync(connection_costs_file, "ascii"); + var cc_lines = cc_text.split("\n"); + cc_lines.map(function (line) { + builder.putCostMatrixLine(line); }); - it("TokenInfoDictionary not to be null", function () { - expect(kuromoji_dic.token_info_dictionary).not.to.be.null; - }); - it("TokenInfoDictionary", function () { - // expect(kuromoji_dic.token_info_dictionary.getFeatures("1467000")).to.have.length.above(1); - expect(kuromoji_dic.token_info_dictionary.dictionary.buffer).to.have.length.above(1); - }); - it("DoubleArray not to be null", function () { - expect(kuromoji_dic.trie).not.to.be.null; + + // Build unknown dictionary + var cd_text = fs.readFileSync(char_def_file, "utf-8"); + var cd_lines = cd_text.split("\n"); + cd_lines.map(function (line) { + builder.putCharDefLine(line); }); - it("ConnectionCosts not to be null", function () { - expect(kuromoji_dic.connection_costs).not.to.be.null; + var unk_text = fs.readFileSync(unk_def_file, "utf-8"); + var unk_lines = unk_text.split("\n"); + unk_lines.map(function (line) { + builder.putUnkDefLine(line); }); - it("Tokenize simple test", function () { - var tokenizer = new Tokenizer(kuromoji_dic); - var path = tokenizer.tokenize("すもももももももものうち"); - var expected_tokens = [ - { - word_type: "KNOWN", - word_position: 1, - surface_form: "すもも", - pos: "名詞", - pos_detail_1: "一般", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "すもも", - reading: "スモモ", - pronunciation: "スモモ" - }, - { - word_type: "KNOWN", - word_position: 4, - surface_form: "も", - pos: "助詞", - pos_detail_1: "係助詞", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "も", - reading: "モ", - pronunciation: "モ" - }, - { - word_type: "KNOWN", - word_position: 5, - surface_form: "もも", - pos: "名詞", - pos_detail_1: "一般", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "もも", - reading: "モモ", - pronunciation: "モモ" }, - { - word_type: "KNOWN", - word_position: 7, - surface_form: "も", - pos: "助詞", - pos_detail_1: "係助詞", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "も", - reading: "モ", - pronunciation: "モ" - }, - { - word_type: "KNOWN", - word_position: 8, - surface_form: "もも", - pos: "名詞", - pos_detail_1: "一般", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "もも", - reading: "モモ", - pronunciation: "モモ" - }, - { - word_type: "KNOWN", - word_position: 10, - surface_form: "の", - pos: "助詞", - pos_detail_1: "連体化", - pos_detail_2: "*", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "の", - reading: "ノ", - pronunciation: "ノ" - }, - { - word_type: "KNOWN", - word_position: 11, - surface_form: "うち", - pos: "名詞", - pos_detail_1: "非自立", - pos_detail_2: "副詞可能", - pos_detail_3: "*", - conjugated_type: "*", - conjugated_form: "*", - basic_form: "うち", - reading: "ウチ", - pronunciation: "ウチ" - } - ]; + kuromoji_dic = builder.build(); + }); - expect(path).to.have.length(7); + it("Dictionary not to be null", function () { + expect(kuromoji_dic).not.to.be.null; + }); + it("TokenInfoDictionary not to be null", function () { + expect(kuromoji_dic.token_info_dictionary).not.to.be.null; + }); + it("TokenInfoDictionary", function () { + // expect(kuromoji_dic.token_info_dictionary.getFeatures("1467000")).to.have.length.above(1); + expect( + kuromoji_dic.token_info_dictionary.dictionary.buffer, + ).to.have.length.above(1); + }); + it("DoubleArray not to be null", function () { + expect(kuromoji_dic.trie).not.to.be.null; + }); + it("ConnectionCosts not to be null", function () { + expect(kuromoji_dic.connection_costs).not.to.be.null; + }); + it("Tokenize simple test", function () { + var tokenizer = new Tokenizer(kuromoji_dic); + var path = tokenizer.tokenize("すもももももももものうち"); - for (var i = 0; i < expected_tokens.length; i++) { - var expected_token = expected_tokens[i]; - var target_token = path[i]; - for (var key in expected_token) { - expect(target_token).to.have.property(key, expected_token[key]); - } - } - }); + var expected_tokens = [ + { + word_type: "KNOWN", + word_position: 1, + surface_form: "すもも", + pos: "名詞", + pos_detail_1: "一般", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "すもも", + reading: "スモモ", + pronunciation: "スモモ", + }, + { + word_type: "KNOWN", + word_position: 4, + surface_form: "も", + pos: "助詞", + pos_detail_1: "係助詞", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "も", + reading: "モ", + pronunciation: "モ", + }, + { + word_type: "KNOWN", + word_position: 5, + surface_form: "もも", + pos: "名詞", + pos_detail_1: "一般", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "もも", + reading: "モモ", + pronunciation: "モモ", + }, + { + word_type: "KNOWN", + word_position: 7, + surface_form: "も", + pos: "助詞", + pos_detail_1: "係助詞", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "も", + reading: "モ", + pronunciation: "モ", + }, + { + word_type: "KNOWN", + word_position: 8, + surface_form: "もも", + pos: "名詞", + pos_detail_1: "一般", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "もも", + reading: "モモ", + pronunciation: "モモ", + }, + { + word_type: "KNOWN", + word_position: 10, + surface_form: "の", + pos: "助詞", + pos_detail_1: "連体化", + pos_detail_2: "*", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "の", + reading: "ノ", + pronunciation: "ノ", + }, + { + word_type: "KNOWN", + word_position: 11, + surface_form: "うち", + pos: "名詞", + pos_detail_1: "非自立", + pos_detail_2: "副詞可能", + pos_detail_3: "*", + conjugated_type: "*", + conjugated_form: "*", + basic_form: "うち", + reading: "ウチ", + pronunciation: "ウチ", + }, + ]; + + expect(path).to.have.length(7); + + for (var i = 0; i < expected_tokens.length; i++) { + var expected_token = expected_tokens[i]; + var target_token = path[i]; + for (var key in expected_token) { + expect(target_token).to.have.property(key, expected_token[key]); + } + } + }); }); diff --git a/test/loader/DictionaryLoaderTest.js b/test/loader/DictionaryLoaderTest.js index 3264c6e2..3a8ec14a 100644 --- a/test/loader/DictionaryLoaderTest.js +++ b/test/loader/DictionaryLoaderTest.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,55 +16,65 @@ * limitations under the License. */ -var expect = require("chai").expect; -var DictionaryLoader = require("../../src/loader/NodeDictionaryLoader"); +import { expect } from "chai"; +import DictionaryLoader from "../../src/loader/NodeDictionaryLoader.js"; + +import { describe, it, before } from "node:test"; var DIC_DIR = "dict/"; describe("DictionaryLoader", function () { + var dictionaries = null; // target object - var dictionaries = null; // target object - - before(function (done) { - this.timeout(5 * 60 * 1000); // 5 min - - var loader = new DictionaryLoader(DIC_DIR); - loader.load(function (err, dic) { - dictionaries = dic; - done(); - }); + before(async function () { + var loader = new DictionaryLoader(DIC_DIR); + dictionaries = await new Promise((resolve, reject) => { + loader.load((err, dic) => { + if (err) reject(err); + else resolve(dic); + }); }); + }); - it("Unknown dictionaries are loaded properly", function () { - expect(dictionaries.unknown_dictionary.lookup(" ")).to.deep.eql({ - class_id: 1, - class_name: "SPACE", - is_always_invoke: 0, - is_grouping: 1, - max_length: 0 - }); - }); - it("TokenInfoDictionary is loaded properly", function () { - expect(dictionaries.token_info_dictionary.getFeatures("0")).to.have.length.above(1); + it("Unknown dictionaries are loaded properly", function () { + expect(dictionaries.unknown_dictionary.lookup(" ")).to.deep.eql({ + class_id: 1, + class_name: "SPACE", + is_always_invoke: 0, + is_grouping: 1, + max_length: 0, }); + }); + it("TokenInfoDictionary is loaded properly", function () { + expect( + dictionaries.token_info_dictionary.getFeatures("0"), + ).to.have.length.above(1); + }); }); describe("DictionaryLoader about loading", function () { - it("could load directory path without suffix /", function (done) { - this.timeout(5 * 60 * 1000); // 5 min - - var loader = new DictionaryLoader("dict"); // not have suffix / - loader.load(function (err, dic) { - expect(err).to.be.null; - expect(dic).to.not.be.undefined; - done(); - }); + it("could load directory path without suffix /", async function () { + var loader = new DictionaryLoader("dict"); // not have suffix / + const dic = await new Promise((resolve, reject) => { + loader.load((err, dic) => { + if (err) reject(err); + else resolve(dic); + }); }); - it("couldn't load dictionary, then call with error", function (done) { - var loader = new DictionaryLoader("non-exist/dictionaries"); - loader.load(function (err, dic) { - expect(err).to.be.an.instanceof(Error); - done(); + expect(dic).to.not.be.undefined; + }); + + it("couldn't load dictionary, then call with error", async function () { + var loader = new DictionaryLoader("non-exist/dictionaries"); + try { + await new Promise((resolve, reject) => { + loader.load((err, dic) => { + if (err) reject(err); + else resolve(dic); }); - }); + }); + } catch (err) { + expect(err).to.be.an.instanceof(Error); + } + }); }); diff --git a/test/util/ByteBuffer.js b/test/util/ByteBuffer.js index 7ab9ada5..acaf0674 100644 --- a/test/util/ByteBuffer.js +++ b/test/util/ByteBuffer.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,56 +16,57 @@ * limitations under the License. */ -var expect = require("chai").expect; -var ByteBuffer = require("../../src/util/ByteBuffer"); +import { expect } from "chai"; +import ByteBuffer from "../../src/util/ByteBuffer.js"; +import { describe, it, beforeEach } from "node:test"; describe("ByteBuffer static methods", function () { - var byteBuffer; + var byteBuffer; - beforeEach("Build", function () { - byteBuffer = new ByteBuffer(50); - }); + beforeEach(function () { + byteBuffer = new ByteBuffer(50); + }); - it("putShort() and getShort()", function () { - var v = -413; - byteBuffer.putShort(v); - expect(byteBuffer.position).equals(2); - var got = byteBuffer.getShort(0); - expect(got).equals(v); - }); + it("putShort() and getShort()", function () { + var v = -413; + byteBuffer.putShort(v); + expect(byteBuffer.position).equals(2); + var got = byteBuffer.getShort(0); + expect(got).equals(v); + }); - it("putString() and getString() 2 bytes UTF-8", function () { - var str = "âbcde"; - byteBuffer.putString(str); - // 2 bytes x1 + 1 byte x4 + 1 byte (null character) - 1 (this is zero-based index) + 1 (next position) - expect(byteBuffer.position).equals(7); - var got = byteBuffer.getString(0); - expect(got).equals(str); - }); + it("putString() and getString() 2 bytes UTF-8", function () { + var str = "âbcde"; + byteBuffer.putString(str); + // 2 bytes x1 + 1 byte x4 + 1 byte (null character) - 1 (this is zero-based index) + 1 (next position) + expect(byteBuffer.position).equals(7); + var got = byteBuffer.getString(0); + expect(got).equals(str); + }); - it("putString() and getString() 3 bytes UTF-8", function () { - var str = "あいうえお"; - byteBuffer.putString(str); - // 3 bytes x5 + 1 byte (null character) - 1 (this is zero-based index) + 1 (next position) - expect(byteBuffer.position).equals(16); - var got = byteBuffer.getString(0); - expect(got).equals(str); - }); + it("putString() and getString() 3 bytes UTF-8", function () { + var str = "あいうえお"; + byteBuffer.putString(str); + // 3 bytes x5 + 1 byte (null character) - 1 (this is zero-based index) + 1 (next position) + expect(byteBuffer.position).equals(16); + var got = byteBuffer.getString(0); + expect(got).equals(str); + }); - it("putString() and getString() 4 bytes UTF-8", function () { - var str = "𠮷野屋"; - byteBuffer.putString(str); - // 4 bytes x1 + 3 bytes x2 + 1 byte (null character) - 1 (this is zero-based index) + 1 (next position) - expect(byteBuffer.position).equals(11); - var got = byteBuffer.getString(0); - expect(got).equals(str); - }); + it("putString() and getString() 4 bytes UTF-8", function () { + var str = "𠮷野屋"; + byteBuffer.putString(str); + // 4 bytes x1 + 3 bytes x2 + 1 byte (null character) - 1 (this is zero-based index) + 1 (next position) + expect(byteBuffer.position).equals(11); + var got = byteBuffer.getString(0); + expect(got).equals(str); + }); - it("too long string against buffer size", function () { - var str = "あいうえおかきくけこさしすせそたちつてと"; // 60 bytes - byteBuffer.putString(str); - expect(byteBuffer.position).equals(61); - var got = byteBuffer.getString(0); - expect(got).equals(str); - }); + it("too long string against buffer size", function () { + var str = "あいうえおかきくけこさしすせそたちつてと"; // 60 bytes + byteBuffer.putString(str); + expect(byteBuffer.position).equals(61); + var got = byteBuffer.getString(0); + expect(got).equals(str); + }); }); diff --git a/test/util/SurrogateAwareStringTest.js b/test/util/SurrogateAwareStringTest.js index 33fdf3e1..9a00c910 100644 --- a/test/util/SurrogateAwareStringTest.js +++ b/test/util/SurrogateAwareStringTest.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,34 +16,36 @@ * limitations under the License. */ -var expect = require("chai").expect; -var SurrogateAwareString = require("../../src/util/SurrogateAwareString"); +import { expect } from "chai"; +import SurrogateAwareString from "../../src/util/SurrogateAwareString.js"; + +import { describe, it, beforeEach } from "node:test"; describe("SurrogateAwareString", function () { - it("length 1", function () { - var str = new SurrogateAwareString("𠮷"); // target object - expect(str.length).to.eql(1); - }); - it("length 3", function () { - var str = new SurrogateAwareString("𠮷野屋"); // target object - expect(str.length).to.eql(3); - }); - it("slice", function () { - var str = new SurrogateAwareString("𠮷野屋"); // target object - expect(str.slice(0)).to.eql("𠮷野屋"); - expect(str.slice(1)).to.eql("野屋"); - expect(str.slice(2)).to.eql("屋"); - }); - it("charAt", function () { - var str = new SurrogateAwareString("𠮷野屋"); // target object - expect(str.charAt(0)).to.eql("𠮷"); - expect(str.charAt(1)).to.eql("野"); - expect(str.charAt(2)).to.eql("屋"); - }); - it("charCodeAt", function () { - var str = new SurrogateAwareString("𠮷野屋"); // target object - expect(str.charCodeAt(0)).to.eql(0x20bb7); - expect(str.charCodeAt(1)).to.eql("野".charCodeAt(0)); - expect(str.charCodeAt(2)).to.eql("屋".charCodeAt(0)); - }); + it("length 1", function () { + var str = new SurrogateAwareString("𠮷"); // target object + expect(str.length).to.eql(1); + }); + it("length 3", function () { + var str = new SurrogateAwareString("𠮷野屋"); // target object + expect(str.length).to.eql(3); + }); + it("slice", function () { + var str = new SurrogateAwareString("𠮷野屋"); // target object + expect(str.slice(0)).to.eql("𠮷野屋"); + expect(str.slice(1)).to.eql("野屋"); + expect(str.slice(2)).to.eql("屋"); + }); + it("charAt", function () { + var str = new SurrogateAwareString("𠮷野屋"); // target object + expect(str.charAt(0)).to.eql("𠮷"); + expect(str.charAt(1)).to.eql("野"); + expect(str.charAt(2)).to.eql("屋"); + }); + it("charCodeAt", function () { + var str = new SurrogateAwareString("𠮷野屋"); // target object + expect(str.charCodeAt(0)).to.eql(0x20bb7); + expect(str.charCodeAt(1)).to.eql("野".charCodeAt(0)); + expect(str.charCodeAt(2)).to.eql("屋".charCodeAt(0)); + }); }); diff --git a/test/viterbi/ViterbiBuilderTest.js b/test/viterbi/ViterbiBuilderTest.js index b5ed1d3d..9384ec29 100644 --- a/test/viterbi/ViterbiBuilderTest.js +++ b/test/viterbi/ViterbiBuilderTest.js @@ -1,4 +1,5 @@ /* + * Copyright 2024 VOICEVOX * Copyright 2014 Takuya Asano * Copyright 2010-2014 Atilika Inc. and contributors * @@ -15,35 +16,44 @@ * limitations under the License. */ -var expect = require("chai").expect; -var DictionaryLoader = require("../../src/loader/NodeDictionaryLoader"); -var ViterbiBuilder = require("../../src/viterbi/ViterbiBuilder"); +import { expect } from "chai"; +import DictionaryLoader from "../../src/loader/NodeDictionaryLoader.js"; +import ViterbiBuilder from "../../src/viterbi/ViterbiBuilder.js"; + +import { describe, it, before } from "node:test"; var DIC_DIR = "dict/"; describe("ViterbiBuilder", function () { - var viterbi_builder = null; // target object - - before(function (done) { - this.timeout(5 * 60 * 1000); // 5 min - var loader = new DictionaryLoader(DIC_DIR); - loader.load(function (err, dic) { - viterbi_builder = new ViterbiBuilder(dic); - done(); - }); - }); + var viterbi_builder = null; // target object - it("Unknown word", function () { - // lattice to have "ト", "トト", "トトロ" - var lattice = viterbi_builder.build("トトロ"); - for (var i = 1; i < lattice.eos_pos; i++) { - var nodes = lattice.nodes_end_at[i]; - if (nodes == null) { - continue; - } - expect(nodes.map(function (node) { - return node.surface_form; - })).to.include("トトロ".slice(0, i)); + before(async function () { + var loader = new DictionaryLoader(DIC_DIR); + const dic = await new Promise((resolve, reject) => { + loader.load((err, dic) => { + if (err) { + reject(err); + } else { + resolve(dic); } + }); }); + viterbi_builder = new ViterbiBuilder(dic); + }); + + it("Unknown word", function () { + // lattice to have "ト", "トト", "トトロ" + var lattice = viterbi_builder.build("トトロ"); + for (var i = 1; i < lattice.eos_pos; i++) { + var nodes = lattice.nodes_end_at[i]; + if (nodes == null) { + continue; + } + expect( + nodes.map(function (node) { + return node.surface_form; + }), + ).to.include("トトロ".slice(0, i)); + } + }); });