<commit_before>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* 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';

/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-read-only-property' );

// MAIN //

/**
* Top-level namespace.
*
* @namespace ns
*/
var ns = {};

/**
* @name iterAdvance
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/advance}
*/
setReadOnly( ns, 'iterAdvance', require( '@stdlib/iter/advance' ) );

/**
* @name iterAny
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/any}
*/
setReadOnly( ns, 'iterAny', require( '@stdlib/iter/any' ) );

/**
* @name iterAnyBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/any-by}
*/
setReadOnly( ns, 'iterAnyBy', require( '@stdlib/iter/any-by' ) );

/**
* @name iterConcat
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/concat}
*/
setReadOnly( ns, 'iterConcat', require( '@stdlib/iter/concat' ) );

/**
* @name iterConstant
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/constant}
*/
setReadOnly( ns, 'iterConstant', require( '@stdlib/iter/constant' ) );

/**
* @name iterCounter
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/counter}
*/
setReadOnly( ns, 'iterCounter', require( '@stdlib/iter/counter' ) );

/**
* @name iterDedupe
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/dedupe}
*/
setReadOnly( ns, 'iterDedupe', require( '@stdlib/iter/dedupe' ) );

/**
* @name iterDedupeBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/dedupe-by}
*/
setReadOnly( ns, 'iterDedupeBy', require( '@stdlib/iter/dedupe-by' ) );

/**
* @name iterEmpty
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/empty}
*/
setReadOnly( ns, 'iterEmpty', require( '@stdlib/iter/empty' ) );

/**
* @name iterEvery
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/every}
*/
setReadOnly( ns, 'iterEvery', require( '@stdlib/iter/every' ) );

/**
* @name iterEveryBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/every-by}
*/
setReadOnly( ns, 'iterEveryBy', require( '@stdlib/iter/every-by' ) );

/**
* @name iterFill
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/fill}
*/
setReadOnly( ns, 'iterFill', require( '@stdlib/iter/fill' ) );

/**
* @name iterFilter
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/filter}
*/
setReadOnly( ns, 'iterFilter', require( '@stdlib/iter/filter' ) );

/**
* @name iterFilterMap
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/filter-map}
*/
setReadOnly( ns, 'iterFilterMap', require( '@stdlib/iter/filter-map' ) );

/**
* @name iterFirst
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/first}
*/
setReadOnly( ns, 'iterFirst', require( '@stdlib/iter/first' ) );

/**
* @name iterFlow
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/flow}
*/
setReadOnly( ns, 'iterFlow', require( '@stdlib/iter/flow' ) );

/**
* @name iterForEach
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/for-each}
*/
setReadOnly( ns, 'iterForEach', require( '@stdlib/iter/for-each' ) );

/**
* @name iterHead
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/head}
*/
setReadOnly( ns, 'iterHead', require( '@stdlib/iter/head' ) );

/**
* @name iterIntersection
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/intersection}
*/
setReadOnly( ns, 'iterIntersection', require( '@stdlib/iter/intersection' ) );

/**
* @name iterIntersectionByHash
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/intersection-by-hash}
*/
setReadOnly( ns, 'iterIntersectionByHash', require( '@stdlib/iter/intersection-by-hash' ) );

/**
* @name iterLast
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/last}
*/
setReadOnly( ns, 'iterLast', require( '@stdlib/iter/last' ) );

/**
* @name iterLength
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/length}
*/
setReadOnly( ns, 'iterLength', require( '@stdlib/iter/length' ) );

/**
* @name iterLinspace
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/linspace}
*/
setReadOnly( ns, 'iterLinspace', require( '@stdlib/iter/linspace' ) );

/**
* @name iterMap
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/map}
*/
setReadOnly( ns, 'iterMap', require( '@stdlib/iter/map' ) );

/**
* @name iterMapN
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/mapn}
*/
setReadOnly( ns, 'iterMapN', require( '@stdlib/iter/mapn' ) );

/**
* @name iterNone
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/none}
*/
setReadOnly( ns, 'iterNone', require( '@stdlib/iter/none' ) );

/**
* @name iterNoneBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/none-by}
*/
setReadOnly( ns, 'iterNoneBy', require( '@stdlib/iter/none-by' ) );

/**
* @name iterNth
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/nth}
*/
setReadOnly( ns, 'iterNth', require( '@stdlib/iter/nth' ) );

/**
* @name iterPipeline
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/pipeline}
*/
setReadOnly( ns, 'iterPipeline', require( '@stdlib/iter/pipeline' ) );

/**
* @name iterThunk
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/pipeline-thunk}
*/
setReadOnly( ns, 'iterThunk', require( '@stdlib/iter/pipeline-thunk' ) );

/**
* @name iterPop
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/pop}
*/
setReadOnly( ns, 'iterPop', require( '@stdlib/iter/pop' ) );

/**
* @name iterPush
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/push}
*/
setReadOnly( ns, 'iterPush', require( '@stdlib/iter/push' ) );

/**
* @name iterReject
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/reject}
*/
setReadOnly( ns, 'iterReject', require( '@stdlib/iter/reject' ) );

/**
* @name iterReplicate
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/replicate}
*/
setReadOnly( ns, 'iterReplicate', require( '@stdlib/iter/replicate' ) );

/**
* @name iterReplicateBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/replicate-by}
*/
setReadOnly( ns, 'iterReplicateBy', require( '@stdlib/iter/replicate-by' ) );

/**
* @name iterShift
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/shift}
*/
setReadOnly( ns, 'iterShift', require( '@stdlib/iter/shift' ) );

/**
* @name iterSlice
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/slice}
*/
setReadOnly( ns, 'iterSlice', require( '@stdlib/iter/slice' ) );

/**
* @name iterSome
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/some}
*/
setReadOnly( ns, 'iterSome', require( '@stdlib/iter/some' ) );

/**
* @name iterSomeBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/some-by}
*/
setReadOnly( ns, 'iterSomeBy', require( '@stdlib/iter/some-by' ) );

/**
* @name iterStrided
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/strided}
*/
setReadOnly( ns, 'iterStrided', require( '@stdlib/iter/strided' ) );

/**
* @name iterStridedBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/strided-by}
*/
setReadOnly( ns, 'iterStridedBy', require( '@stdlib/iter/strided-by' ) );

/**
* @name iterator2arrayview
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/to-array-view}
*/
setReadOnly( ns, 'iterator2arrayview', require( '@stdlib/iter/to-array-view' ) );

/**
* @name iterator2arrayviewRight
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/to-array-view-right}
*/
setReadOnly( ns, 'iterator2arrayviewRight', require( '@stdlib/iter/to-array-view-right' ) );

/**
* @name iterUnion
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/union}
*/
setReadOnly( ns, 'iterUnion', require( '@stdlib/iter/union' ) );

/**
* @name iterUnique
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unique}
*/
setReadOnly( ns, 'iterUnique', require( '@stdlib/iter/unique' ) );

/**
* @name iterUniqueBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unique-by}
*/
setReadOnly( ns, 'iterUniqueBy', require( '@stdlib/iter/unique-by' ) );

/**
* @name iterUniqueByHash
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unique-by-hash}
*/
setReadOnly( ns, 'iterUniqueByHash', require( '@stdlib/iter/unique-by-hash' ) );

/**
* @name iterUnshift
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unshift}
*/
setReadOnly( ns, 'iterUnshift', require( '@stdlib/iter/unshift' ) );

// EXPORTS //

module.exports = ns;
<commit_msg>Update namespace<commit_after>/**
* @license Apache-2.0
*
* Copyright (c) 2018 The Stdlib Authors.
*
* 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';

/*
* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.
*/

// MODULES //

var setReadOnly = require( '@stdlib/utils/define-read-only-property' );

// MAIN //

/**
* Top-level namespace.
*
* @namespace ns
*/
var ns = {};

/**
* @name iterAdvance
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/advance}
*/
setReadOnly( ns, 'iterAdvance', require( '@stdlib/iter/advance' ) );

/**
* @name iterAny
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/any}
*/
setReadOnly( ns, 'iterAny', require( '@stdlib/iter/any' ) );

/**
* @name iterAnyBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/any-by}
*/
setReadOnly( ns, 'iterAnyBy', require( '@stdlib/iter/any-by' ) );

/**
* @name iterConcat
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/concat}
*/
setReadOnly( ns, 'iterConcat', require( '@stdlib/iter/concat' ) );

/**
* @name iterConstant
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/constant}
*/
setReadOnly( ns, 'iterConstant', require( '@stdlib/iter/constant' ) );

/**
* @name iterCounter
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/counter}
*/
setReadOnly( ns, 'iterCounter', require( '@stdlib/iter/counter' ) );

/**
* @name iterDedupe
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/dedupe}
*/
setReadOnly( ns, 'iterDedupe', require( '@stdlib/iter/dedupe' ) );

/**
* @name iterDedupeBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/dedupe-by}
*/
setReadOnly( ns, 'iterDedupeBy', require( '@stdlib/iter/dedupe-by' ) );

/**
* @name iterEmpty
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/empty}
*/
setReadOnly( ns, 'iterEmpty', require( '@stdlib/iter/empty' ) );

/**
* @name iterEvery
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/every}
*/
setReadOnly( ns, 'iterEvery', require( '@stdlib/iter/every' ) );

/**
* @name iterEveryBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/every-by}
*/
setReadOnly( ns, 'iterEveryBy', require( '@stdlib/iter/every-by' ) );

/**
* @name iterFill
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/fill}
*/
setReadOnly( ns, 'iterFill', require( '@stdlib/iter/fill' ) );

/**
* @name iterFilter
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/filter}
*/
setReadOnly( ns, 'iterFilter', require( '@stdlib/iter/filter' ) );

/**
* @name iterFilterMap
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/filter-map}
*/
setReadOnly( ns, 'iterFilterMap', require( '@stdlib/iter/filter-map' ) );

/**
* @name iterFirst
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/first}
*/
setReadOnly( ns, 'iterFirst', require( '@stdlib/iter/first' ) );

/**
* @name iterFlow
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/flow}
*/
setReadOnly( ns, 'iterFlow', require( '@stdlib/iter/flow' ) );

/**
* @name iterForEach
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/for-each}
*/
setReadOnly( ns, 'iterForEach', require( '@stdlib/iter/for-each' ) );

/**
* @name iterHead
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/head}
*/
setReadOnly( ns, 'iterHead', require( '@stdlib/iter/head' ) );

/**
* @name iterIntersection
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/intersection}
*/
setReadOnly( ns, 'iterIntersection', require( '@stdlib/iter/intersection' ) );

/**
* @name iterIntersectionByHash
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/intersection-by-hash}
*/
setReadOnly( ns, 'iterIntersectionByHash', require( '@stdlib/iter/intersection-by-hash' ) );

/**
* @name iterLast
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/last}
*/
setReadOnly( ns, 'iterLast', require( '@stdlib/iter/last' ) );

/**
* @name iterLength
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/length}
*/
setReadOnly( ns, 'iterLength', require( '@stdlib/iter/length' ) );

/**
* @name iterLinspace
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/linspace}
*/
setReadOnly( ns, 'iterLinspace', require( '@stdlib/iter/linspace' ) );

/**
* @name iterLogspace
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/logspace}
*/
setReadOnly( ns, 'iterLogspace', require( '@stdlib/iter/logspace' ) );

/**
* @name iterMap
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/map}
*/
setReadOnly( ns, 'iterMap', require( '@stdlib/iter/map' ) );

/**
* @name iterMapN
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/mapn}
*/
setReadOnly( ns, 'iterMapN', require( '@stdlib/iter/mapn' ) );

/**
* @name iterNone
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/none}
*/
setReadOnly( ns, 'iterNone', require( '@stdlib/iter/none' ) );

/**
* @name iterNoneBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/none-by}
*/
setReadOnly( ns, 'iterNoneBy', require( '@stdlib/iter/none-by' ) );

/**
* @name iterNth
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/nth}
*/
setReadOnly( ns, 'iterNth', require( '@stdlib/iter/nth' ) );

/**
* @name iterPipeline
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/pipeline}
*/
setReadOnly( ns, 'iterPipeline', require( '@stdlib/iter/pipeline' ) );

/**
* @name iterThunk
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/pipeline-thunk}
*/
setReadOnly( ns, 'iterThunk', require( '@stdlib/iter/pipeline-thunk' ) );

/**
* @name iterPop
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/pop}
*/
setReadOnly( ns, 'iterPop', require( '@stdlib/iter/pop' ) );

/**
* @name iterPush
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/push}
*/
setReadOnly( ns, 'iterPush', require( '@stdlib/iter/push' ) );

/**
* @name iterReject
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/reject}
*/
setReadOnly( ns, 'iterReject', require( '@stdlib/iter/reject' ) );

/**
* @name iterReplicate
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/replicate}
*/
setReadOnly( ns, 'iterReplicate', require( '@stdlib/iter/replicate' ) );

/**
* @name iterReplicateBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/replicate-by}
*/
setReadOnly( ns, 'iterReplicateBy', require( '@stdlib/iter/replicate-by' ) );

/**
* @name iterShift
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/shift}
*/
setReadOnly( ns, 'iterShift', require( '@stdlib/iter/shift' ) );

/**
* @name iterSlice
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/slice}
*/
setReadOnly( ns, 'iterSlice', require( '@stdlib/iter/slice' ) );

/**
* @name iterSome
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/some}
*/
setReadOnly( ns, 'iterSome', require( '@stdlib/iter/some' ) );

/**
* @name iterSomeBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/some-by}
*/
setReadOnly( ns, 'iterSomeBy', require( '@stdlib/iter/some-by' ) );

/**
* @name iterStrided
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/strided}
*/
setReadOnly( ns, 'iterStrided', require( '@stdlib/iter/strided' ) );

/**
* @name iterStridedBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/strided-by}
*/
setReadOnly( ns, 'iterStridedBy', require( '@stdlib/iter/strided-by' ) );

/**
* @name iterator2arrayview
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/to-array-view}
*/
setReadOnly( ns, 'iterator2arrayview', require( '@stdlib/iter/to-array-view' ) );

/**
* @name iterator2arrayviewRight
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/to-array-view-right}
*/
setReadOnly( ns, 'iterator2arrayviewRight', require( '@stdlib/iter/to-array-view-right' ) );

/**
* @name iterUnion
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/union}
*/
setReadOnly( ns, 'iterUnion', require( '@stdlib/iter/union' ) );

/**
* @name iterUnique
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unique}
*/
setReadOnly( ns, 'iterUnique', require( '@stdlib/iter/unique' ) );

/**
* @name iterUniqueBy
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unique-by}
*/
setReadOnly( ns, 'iterUniqueBy', require( '@stdlib/iter/unique-by' ) );

/**
* @name iterUniqueByHash
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unique-by-hash}
*/
setReadOnly( ns, 'iterUniqueByHash', require( '@stdlib/iter/unique-by-hash' ) );

/**
* @name iterUnshift
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/iter/unshift}
*/
setReadOnly( ns, 'iterUnshift', require( '@stdlib/iter/unshift' ) );

// EXPORTS //

module.exports = ns;
<|endoftext|>


<commit_before>var utils = require('../utils')

module.exports = function () {}

module.exports.prototype =
  { name: 'requireLowerCaseAttributes'

  , configure: function (options) {

      utils.validateTrueOptions(this.name, options)

    }

  , lint: function (file, errors) {

      var isXml

      file.iterateTokensByType('doctype', function (token) {
        isXml = token.val === 'xml'
      })

      if (!isXml) {
        file.iterateTokensByType('attrs', function (token) {
          token.attrs.forEach(function (attribute) {
            if (attribute.name !== attribute.name.toLowerCase()) {
              errors.add('All tags must be written in lower case', token.line)
            }
          })
        })
      }

    }
  }
<commit_msg>Refactor `requireLowerCaseAttributes` to handle new token structure<commit_after>var utils = require('../utils')

module.exports = function () {}

module.exports.prototype =
  { name: 'requireLowerCaseAttributes'

  , configure: function (options) {

      utils.validateTrueOptions(this.name, options)

    }

  , lint: function (file, errors) {

      var isXml

      file.iterateTokensByType('doctype', function (token) {
        isXml = token.val === 'xml'
      })

      if (!isXml) {
        file.iterateTokensByType('attribute', function (token) {
          if (token.name !== token.name.toLowerCase()) {
            errors.add('All tags must be written in lower case', token.line)
          }
        })
      }

    }
  }
<|endoftext|>


<commit_before>window.SJ.module('qte_game', function (sj) {
    var canvas, scene, currentLocation = 0, canvasWidth = 1.5, speed = 0.02, speed_add = 0, runAnimation, jumpAnimation, slideAnimation, stinkAnimation,
        loadAnimations = function () {
            var guy = scene.getObject('guy'), stink = scene.getObject('stink');
            runAnimation = sj.animation.create(guy);
            jumpAnimation = sj.animation.create(guy);
            slideAnimation = sj.animation.create(guy);
            stinkAnimation = sj.animation.create(stink);
            jumpAnimation.setStep(4);
            jumpAnimation.setLooped(false);
            stinkAnimation.setStep(4);
            slideAnimation.setStep(7);
            slideAnimation.setLooped(false);

            for (var i = 0; i < 6; i++) {
                runAnimation.addFrame(guy.texture, i / 16, 0, (i + 1) / 16, 1);
            }
            for (i = 6; i < 10; i++) {
                jumpAnimation.addFrame(guy.texture, i / 16, 0, (i + 1) / 16, 1);
            }
            for (i = 11; i < 13; i++) {
                slideAnimation.addFrame(guy.texture, i / 16, 0, (i + 1) / 16, 1);
            }
            for (i = 0; i < 2; i++) {
                stinkAnimation.addFrame(stink.texture, i / 2, 0, (i + 1) / 2, 1);
            }
        },
        run = function () {
            var background, obstacle, currentAnimation, guy,
                frame = 0, phase_counter = 0,
                letters, letter, letterObjects = [],
                numbers, numberObjects = [],
                arrows, arrowObject, arrowAnimation,
                listener, blinking = false,
				playerName,
                generator, generated, progress, generateObstacle = true, obstacles = [],
                downObstacles = ['ob_0', 'ob_1', 'ob_2'], upObstacles = ['ob_3', 'ob_4', 'ob_5', 'ob_6'], j = 0, currentObstacle, done = false;
            canvas = sj.canvas;
            canvas.init();

            if (!scene) {
                scene = canvas.createScene('scene_1', sj.config('scenes', 'run'));
            }
            background = scene.getObject('background');

            progress = scene.getObject("progress");
            guy = scene.getObject('guy');

            loadAnimations();

            sj.sound.load('soundtrack');
            sj.sound.get('soundtrack').play();

            for (var n in downObstacles) {
                obstacles[j] = scene.getObject(downObstacles[n]);
                obstacles[j]['animation'] = jumpAnimation;
                j++;
            }

            for (n in upObstacles) {
                obstacles[j] = scene.getObject(upObstacles[n]);
                obstacles[j]['animation'] = slideAnimation;
                j++;
            }

            numbers = sj.numbers;
            numberObjects = numbers.init(scene);

            generator = sj.qte_generator;
            generated = generator.next();

            letters = sj.letters;
            letterObjects = letters.init(scene);

            arrows = sj.arrows;
            arrowObject = arrows.init(scene);

            listener = sj.listener;
            currentAnimation = runAnimation;

            scene.onFrame = function () {
                var leftSeconds = 10 - Math.floor(frame / 25), select;
                frame++;

                progress.setTexture(progress.texture, 0, 0, leftSeconds / 10, 1);
                progress.setPosition(0.02 * leftSeconds + 0.03, 0.03, 10);
                progress.setDimension(0.04 * leftSeconds, 0.04);

				if (playerName === undefined) {
					playerName = prompt ("Confirm your name" + listener.rankingScore());
				}

                if (leftSeconds < 0) {
                    stinkAnimation.play();
                    scene.getObject("stink").setVisible(true);
                    scene.getObject("any_key").setVisible(true);
                    guy.setTexture(guy.texture, 14 / 16, 0, 15 / 16, 1);
                    sj.input.onKeyDown(function () {

						playerName = prompt ("Confirm your name" + listener.rankingScore());
                        frame = 0;
                        scene.getObject("stink").setVisible(false);
                        scene.getObject("any_key").setVisible(false);
                        generateObstacle = true;
                        for (var o in obstacles) {
                            obstacles[o].setVisible(false);
                        }
                        currentObstacle = undefined;
                        blinking = 0;
                        guy.setVisible(true);
                        sj.input.onKeyDown(function (key) {
                            listener.down(String.fromCharCode(key).toLowerCase(), frame);
                        });

                        sj.input.onKeyUp(function (key) {
                            listener.up(String.fromCharCode(key).toLowerCase(), frame);
                        });

                        listener.resetScore();

                        sj.numbers.set(numberObjects.tenth, numberObjects.unit, 0);
                        sj.sound.get('soundtrack').play();
                    });
                    return;
                }

                if (generateObstacle) {
                    select = Math.floor(Math.random() * obstacles.length);
                    while (obstacles[select].visible) {
                        select = Math.floor(Math.random() * obstacles.length);
                    }
                    var o = obstacles[select];
                    o.setPosition(frame < 5 ? -0.7 : -0.4, o.y, o.z);
                    o.setVisible(true);
                    generateObstacle = false;
                }

                if (frame - blinking < 0) {
                    guy.setVisible(frame % 2);
                } else {
                    guy.setVisible(true);
                }

                background.setPosition(currentLocation - Math.floor(currentLocation / 1.5) * 1.5, background.y, background.z);
                currentAnimation.play();
                if (currentAnimation.hasStopped()) {
                    currentAnimation = runAnimation;
                }

                currentLocation += speed;
                if (undefined !== arrowAnimation) {
                    arrowAnimation.play();
                }

                for (select in obstacles) {
                    var ob = obstacles[select];
                    if (ob.visible) {
                        ob.setPosition(ob.x + speed, ob.y, ob.z);
                        if (ob.x > 1.8) {
                            ob.setVisible(false);
                        }
                        if (ob.x > -0.5 && ob.x < 0.50 && !currentObstacle) {
                            currentObstacle = ob;
                            phase_counter = 0;

                            listener.clear();
                            generated = generator.next();

                            arrowAnimation = arrows.set(arrowObject, generated.type);

                            for (var obj in sj.config('keys', 'keys')) {
                                var ind = generated.keys.indexOf(obj), letter = letterObjects[obj];
                                if (ind != -1) {
                                    letters.position(letter, ind);

                                    letter.setVisible(true);
                                } else {
                                    letter.setVisible(false);
                                }
                            }
                            speed = 0.02;
                            done = false;

                        }
                        if (currentObstacle && currentObstacle.x > 0.50) {
                            generateObstacle = true;
                            if (done) {
                                currentAnimation = currentObstacle.animation;
                                currentAnimation.setCurrentFrame(0);
                            } else {
                                blinking = frame + 20;

                                // wyłącz
                            }
                            currentObstacle = undefined;
                            listener.clear();
                        }
                    }

                }

                if (done) {
                    speed = 0.06;
                }

                if (currentObstacle) {
                    for (var obj in generated.keys) {
                        var ident = generated.keys[obj], check = listener.check(generated, ident, numberObjects);

                        letters.state(letterObjects[ident], check);

                        if (sj.letters.STATE_CORRECT === check) {
                            done = true;
                            listener.clear();
                        }
                    }
                }

            };

            sj.input.onKeyDown(function (key) {
                listener.down(String.fromCharCode(key).toLowerCase(), frame);
            });

            sj.input.onKeyUp(function (key) {
                listener.up(String.fromCharCode(key).toLowerCase(), frame);
            });

            canvas.start();
            canvas.loadScene('scene_1');
        };

    return {
        'init': run
    };

});
<commit_msg>rankingi<commit_after>window.SJ.module('qte_game', function (sj) {
    var canvas, scene, currentLocation = 0, canvasWidth = 1.5, speed = 0.02, speed_add = 0, runAnimation, jumpAnimation, slideAnimation, stinkAnimation,
        loadAnimations = function () {
            var guy = scene.getObject('guy'), stink = scene.getObject('stink');
            runAnimation = sj.animation.create(guy);
            jumpAnimation = sj.animation.create(guy);
            slideAnimation = sj.animation.create(guy);
            stinkAnimation = sj.animation.create(stink);
            jumpAnimation.setStep(4);
            jumpAnimation.setLooped(false);
            stinkAnimation.setStep(4);
            slideAnimation.setStep(7);
            slideAnimation.setLooped(false);

            for (var i = 0; i < 6; i++) {
                runAnimation.addFrame(guy.texture, i / 16, 0, (i + 1) / 16, 1);
            }
            for (i = 6; i < 10; i++) {
                jumpAnimation.addFrame(guy.texture, i / 16, 0, (i + 1) / 16, 1);
            }
            for (i = 11; i < 13; i++) {
                slideAnimation.addFrame(guy.texture, i / 16, 0, (i + 1) / 16, 1);
            }
            for (i = 0; i < 2; i++) {
                stinkAnimation.addFrame(stink.texture, i / 2, 0, (i + 1) / 2, 1);
            }
        },
        run = function () {
            var background, obstacle, currentAnimation, guy,
                frame = 0, phase_counter = 0,
                letters, letter, letterObjects = [],
                numbers, numberObjects = [],
                arrows, arrowObject, arrowAnimation,
                listener, blinking = false,
				playerName,
				ranking = "Last Scores: \n\n",
                generator, generated, progress, generateObstacle = true, obstacles = [],
                downObstacles = ['ob_0', 'ob_1', 'ob_2'], upObstacles = ['ob_3', 'ob_4', 'ob_5', 'ob_6'], j = 0, currentObstacle, done = false;
            canvas = sj.canvas;
            canvas.init();

            if (!scene) {
                scene = canvas.createScene('scene_1', sj.config('scenes', 'run'));
            }
            background = scene.getObject('background');

            progress = scene.getObject("progress");
            guy = scene.getObject('guy');

            loadAnimations();

            sj.sound.load('soundtrack');
            sj.sound.get('soundtrack').play();

            for (var n in downObstacles) {
                obstacles[j] = scene.getObject(downObstacles[n]);
                obstacles[j]['animation'] = jumpAnimation;
                j++;
            }

            for (n in upObstacles) {
                obstacles[j] = scene.getObject(upObstacles[n]);
                obstacles[j]['animation'] = slideAnimation;
                j++;
            }

            numbers = sj.numbers;
            numberObjects = numbers.init(scene);

            generator = sj.qte_generator;
            generated = generator.next();

            letters = sj.letters;
            letterObjects = letters.init(scene);

            arrows = sj.arrows;
            arrowObject = arrows.init(scene);

            listener = sj.listener;
            currentAnimation = runAnimation;

            scene.onFrame = function () {
                var leftSeconds = 10 - Math.floor(frame / 25), select;
                frame++;

                progress.setTexture(progress.texture, 0, 0, leftSeconds / 10, 1);
                progress.setPosition(0.02 * leftSeconds + 0.03, 0.03, 10);
                progress.setDimension(0.04 * leftSeconds, 0.04);

				if (playerName === undefined) {
					playerName = prompt ("Confirm your name:");
				}

                if (leftSeconds < 0) {

					if (playerName !== "-1"){
						ranking += playerName + ": " + listener.rankingScore() + ";";
						console.log(ranking);
						playerName = "-1";
					}

                    stinkAnimation.play();
                    scene.getObject("stink").setVisible(true);
                    scene.getObject("any_key").setVisible(true);
                    guy.setTexture(guy.texture, 14 / 16, 0, 15 / 16, 1);
                    sj.input.onKeyDown(function () {

						playerName = prompt (ranking.split(";").join("\n") + "\n\n Confirm your name:");
                        frame = 0;
                        scene.getObject("stink").setVisible(false);
                        scene.getObject("any_key").setVisible(false);
                        generateObstacle = true;
                        for (var o in obstacles) {
                            obstacles[o].setVisible(false);
                        }
                        currentObstacle = undefined;
                        blinking = 0;
                        guy.setVisible(true);
                        sj.input.onKeyDown(function (key) {
                            listener.down(String.fromCharCode(key).toLowerCase(), frame);
                        });

                        sj.input.onKeyUp(function (key) {
                            listener.up(String.fromCharCode(key).toLowerCase(), frame);
                        });

                        listener.resetScore();

                        sj.numbers.set(numberObjects.tenth, numberObjects.unit, 0);
                        sj.sound.get('soundtrack').play();
                    });
                    return;
                }

                if (generateObstacle) {
                    select = Math.floor(Math.random() * obstacles.length);
                    while (obstacles[select].visible) {
                        select = Math.floor(Math.random() * obstacles.length);
                    }
                    var o = obstacles[select];
                    o.setPosition(frame < 5 ? -0.7 : -0.4, o.y, o.z);
                    o.setVisible(true);
                    generateObstacle = false;
                }

                if (frame - blinking < 0) {
                    guy.setVisible(frame % 2);
                } else {
                    guy.setVisible(true);
                }

                background.setPosition(currentLocation - Math.floor(currentLocation / 1.5) * 1.5, background.y, background.z);
                currentAnimation.play();
                if (currentAnimation.hasStopped()) {
                    currentAnimation = runAnimation;
                }

                currentLocation += speed;
                if (undefined !== arrowAnimation) {
                    arrowAnimation.play();
                }

                for (select in obstacles) {
                    var ob = obstacles[select];
                    if (ob.visible) {
                        ob.setPosition(ob.x + speed, ob.y, ob.z);
                        if (ob.x > 1.8) {
                            ob.setVisible(false);
                        }
                        if (ob.x > -0.5 && ob.x < 0.50 && !currentObstacle) {
                            currentObstacle = ob;
                            phase_counter = 0;

                            listener.clear();
                            generated = generator.next();

                            arrowAnimation = arrows.set(arrowObject, generated.type);

                            for (var obj in sj.config('keys', 'keys')) {
                                var ind = generated.keys.indexOf(obj), letter = letterObjects[obj];
                                if (ind != -1) {
                                    letters.position(letter, ind);

                                    letter.setVisible(true);
                                } else {
                                    letter.setVisible(false);
                                }
                            }
                            speed = 0.02;
                            done = false;

                        }
                        if (currentObstacle && currentObstacle.x > 0.50) {
                            generateObstacle = true;
                            if (done) {
                                currentAnimation = currentObstacle.animation;
                                currentAnimation.setCurrentFrame(0);
                            } else {
                                blinking = frame + 20;

                                // wyłącz
                            }
                            currentObstacle = undefined;
                            listener.clear();
                        }
                    }

                }

                if (done) {
                    speed = 0.06;
                }

                if (currentObstacle) {
                    for (var obj in generated.keys) {
                        var ident = generated.keys[obj], check = listener.check(generated, ident, numberObjects);

                        letters.state(letterObjects[ident], check);

                        if (sj.letters.STATE_CORRECT === check) {
                            done = true;
                            listener.clear();
                        }
                    }
                }

            };

            sj.input.onKeyDown(function (key) {
                listener.down(String.fromCharCode(key).toLowerCase(), frame);
            });

            sj.input.onKeyUp(function (key) {
                listener.up(String.fromCharCode(key).toLowerCase(), frame);
            });

            canvas.start();
            canvas.loadScene('scene_1');
        };

    return {
        'init': run
    };

});
<|endoftext|>


<commit_before>import React, { Component } from "react";
import Rect from "./Rect";
import logo from "./logo.svg";
import "./App.css";
import Layer from "./Layer";
import Timeline from "./Timeline";
import Text from "./Text";
import Image from "./Image";
import RandomLayer from "./RandomLayer";
import Countdown from "./Countdown";
import cranky from "./cranky.gif";
import styled from "styled-components";
import "./FiraCode/stylesheet.css";

const Keyframe = Layer;

const Centered = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
`;

class App extends Component {
  render() {
    // return
;
    return (
      <Centered>

        <Countdown
          to={new Date("Tuesday November 14, 2017 16:00:00 GMT-0800")}
        />
      </Centered>
    );
  }
}

export default App;
<commit_msg>better github logo<commit_after>import React, { Component } from "react";
import Rect from "./Rect";
import logo from "./logo.svg";
import "./App.css";
import Layer from "./Layer";
import Timeline from "./Timeline";
import Text from "./Text";
import Image from "./Image";
import RandomLayer from "./RandomLayer";
import Countdown from "./Countdown";
import cranky from "./cranky.gif";
import styled from "styled-components";
import "./FiraCode/stylesheet.css";

const Keyframe = Layer;

const Centered = styled.div`
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
`;

class App extends Component {
  render() {
    // return
;
    return (
      <Centered>

        <Countdown
          to={new Date("Tuesday November 14, 2017 16:00:00 GMT-0800")}
        />
      </Centered>
    );
  }
}

export default App;
<|endoftext|>


<commit_before>/*jshint globalstrict:true */
/*global angular:true */
/*

  ## Derivequeries

  Broadcasts an array of queries based on the results of a terms facet

  ### Parameters
  * label :: The label to stick over the field
  * query :: A string to use as a filter for the terms facet
  * field :: the field to facet on
  * size :: how many queries to generate
  * fields :: a list of fields known to us
  * query_mode :: how to create query

*/

'use strict';

angular.module('kibana.derivequeries', [])
.controller('derivequeries', function($scope, $rootScope, query, fields, dashboard, filterSrv) {

  // Set and populate defaults
  var _d = {
    loading : false,
    status  : "Beta",
    label   : "Search",
    query   : "*",
    ids     : [],
    group   : "default",
    field   : '_type',
    fields  : [],
    spyable : true,
    size    : 5,
    mode    : 'terms only',
    exclude : [],
    history : [],
    remember: 10 // max: 100, angular strap can't take a variable for items param
  };
  _.defaults($scope.panel,_d);

  $scope.init = function() {
    $scope.panel.fields = fields.list;
  };

  $scope.get_data = function() {
    update_history($scope.panel.query);

    // Make sure we have everything for the request to complete
    if(dashboard.indices.length === 0) {
      return;
    }

    $scope.panel.loading = true;
    var request = $scope.ejs.Request().indices(dashboard.indices);

    // Terms mode
    request = request
      .facet($scope.ejs.TermsFacet('query')
        .field($scope.panel.field)
        .size($scope.panel.size)
        .exclude($scope.panel.exclude)
        .facetFilter($scope.ejs.QueryFilter(
          $scope.ejs.FilteredQuery(
            $scope.ejs.QueryStringQuery($scope.panel.query || '*'),
            filterSrv.getBoolFilter(filterSrv.ids)
            )))).size(0);

    $scope.populate_modal(request);

    var results = request.doSearch();

    // Populate scope when we have results
    results.then(function(results) {
      $scope.panel.loading = false;
      var suffix,
          data = [];
      if ($scope.panel.query === '' || $scope.panel.mode === 'terms only') {
        suffix = '';
      } else if ($scope.panel.mode === 'AND') {
        suffix = ' AND (' + $scope.panel.query + ')';
      } else if ($scope.panel.mode === 'OR') {
        suffix = ' OR (' + $scope.panel.query + ')';
      }
      var ids = [];
      _.each(results.facets.query.terms, function(v) {
        var _q = $scope.panel.field+':"'+v.term+'"'+suffix;
        // if it isn't in the list, remove it
        var _iq = query.findQuery(_q);
        if(!_iq) {
          ids.push(query.set({query:_q}));
        } else {
          ids.push(_iq.id);
        }
      });
      _.each(_.difference($scope.panel.ids,ids),function(id){
        query.remove(id);
      });
      $scope.panel.ids = ids;
      dashboard.refresh();
    });
  };

  $scope.set_refresh = function (state) {
    $scope.refresh = state;
  };

  $scope.close_edit = function() {
    if($scope.refresh) {
      $scope.get_data();
    }
    $scope.refresh =  false;
  };

  $scope.populate_modal = function(request) {
    $scope.modal = {
      title: "Inspector",
      body : "
Last Elasticsearch Query

"+
          'curl -XGET '+config.elasticsearch+'/'+dashboard.indices+"/_search?pretty -d'\n"+
          angular.toJson(JSON.parse(request.toString()),true)+
        "'
",
    };
  };

  var update_history = function(query) {
    query = _.isArray(query) ? query : [query];
    if($scope.panel.remember > 0) {
      $scope.panel.history = _.union(query.reverse(),$scope.panel.history);
      var _length = $scope.panel.history.length;
      if(_length > $scope.panel.remember) {
        $scope.panel.history = $scope.panel.history.slice(0,$scope.panel.remember);
      }
    }
  };

});
<commit_msg>Fix derivequeries<commit_after>/*jshint globalstrict:true */
/*global angular:true */
/*

  ## Derivequeries

  Broadcasts an array of queries based on the results of a terms facet

  ### Parameters
  * label :: The label to stick over the field
  * query :: A string to use as a filter for the terms facet
  * field :: the field to facet on
  * size :: how many queries to generate
  * fields :: a list of fields known to us
  * query_mode :: how to create query

*/

'use strict';

angular.module('kibana.derivequeries', [])
.controller('derivequeries', function($scope, $rootScope, querySrv, fields, dashboard, filterSrv) {

  // Set and populate defaults
  var _d = {
    loading : false,
    status  : "Beta",
    label   : "Search",
    query   : "*",
    ids     : [],
    group   : "default",
    field   : '_type',
    fields  : [],
    spyable : true,
    size    : 5,
    mode    : 'terms only',
    exclude : [],
    history : [],
    remember: 10 // max: 100, angular strap can't take a variable for items param
  };
  _.defaults($scope.panel,_d);

  $scope.init = function() {
    $scope.panel.fields = fields.list;
  };

  $scope.get_data = function() {
    update_history($scope.panel.query);

    // Make sure we have everything for the request to complete
    if(dashboard.indices.length === 0) {
      return;
    }

    $scope.panel.loading = true;
    var request = $scope.ejs.Request().indices(dashboard.indices);

    // Terms mode
    request = request
      .facet($scope.ejs.TermsFacet('query')
        .field($scope.panel.field)
        .size($scope.panel.size)
        .exclude($scope.panel.exclude)
        .facetFilter($scope.ejs.QueryFilter(
          $scope.ejs.FilteredQuery(
            $scope.ejs.QueryStringQuery($scope.panel.query || '*'),
            filterSrv.getBoolFilter(filterSrv.ids)
            )))).size(0);

    $scope.populate_modal(request);

    var results = request.doSearch();

    // Populate scope when we have results
    results.then(function(results) {
      $scope.panel.loading = false;
      var suffix,
          data = [];
      if ($scope.panel.query === '' || $scope.panel.mode === 'terms only') {
        suffix = '';
      } else if ($scope.panel.mode === 'AND') {
        suffix = ' AND (' + $scope.panel.query + ')';
      } else if ($scope.panel.mode === 'OR') {
        suffix = ' OR (' + $scope.panel.query + ')';
      }
      var ids = [];
      _.each(results.facets.query.terms, function(v) {
        var _q = $scope.panel.field+':"'+v.term+'"'+suffix;
        // if it isn't in the list, remove it
        var _iq = querySrv.findQuery(_q);
        if(!_iq) {
          ids.push(querySrv.set({query:_q}));
        } else {
          ids.push(_iq.id);
        }
      });
      _.each(_.difference($scope.panel.ids,ids),function(id){
        querySrv.remove(id);
      });
      $scope.panel.ids = ids;
      dashboard.refresh();
    });
  };

  $scope.set_refresh = function (state) {
    $scope.refresh = state;
  };

  $scope.close_edit = function() {
    if($scope.refresh) {
      $scope.get_data();
    }
    $scope.refresh =  false;
  };

  $scope.populate_modal = function(request) {
    $scope.modal = {
      title: "Inspector",
      body : "
Last Elasticsearch Query

"+
          'curl -XGET '+config.elasticsearch+'/'+dashboard.indices+"/_search?pretty -d'\n"+
          angular.toJson(JSON.parse(request.toString()),true)+
        "'
",
    };
  };

  var update_history = function(query) {
    query = _.isArray(query) ? query : [query];
    if($scope.panel.remember > 0) {
      $scope.panel.history = _.union(query.reverse(),$scope.panel.history);
      var _length = $scope.panel.history.length;
      if(_length > $scope.panel.remember) {
        $scope.panel.history = $scope.panel.history.slice(0,$scope.panel.remember);
      }
    }
  };

});
<|endoftext|>


<commit_before>import * as pkg from "./package.json";
import babel from 'rollup-plugin-babel';
import flowEntry from 'rollup-plugin-flow-entry';

export default [{
  input: 'src/index.js',
  output: [
    {
      file: pkg.main,
      name: "seisplotjs",
      format: 'umd',
      sourcemap: true,
    }
  ],
  external: [
    ...Object.keys(pkg.dependencies || {}),
    ...Object.keys(pkg.peerDependencies || {}),
  ],
  plugins: [
    flowEntry(),
    babel({
      exclude: 'node_modules/**',
      runtimeHelpers: true,
    })
  ]
},{
  input: 'src/index.js',
  preserveModules: true,
  output: [
    {
      dir: "dist/module",
      //file: pkg.module,
      format: 'esm',
      sourcemap: true,
    }
  ],
  external: [
    ...Object.keys(pkg.dependencies || {}),
    ...Object.keys(pkg.peerDependencies || {}),
  ],
  plugins: [
    flowEntry(),
    babel({
      exclude: 'node_modules/**',
      runtimeHelpers: true,
    })
  ]
  }
];
<commit_msg>add babel helpers to external to surpress warning<commit_after>import * as pkg from "./package.json";
import babel from 'rollup-plugin-babel';
import flowEntry from 'rollup-plugin-flow-entry';

export default [{
  input: 'src/index.js',
  output: [
    {
      file: pkg.main,
      name: "seisplotjs",
      format: 'umd',
      sourcemap: true,
    }
  ],
  external: [
    ...Object.keys(pkg.dependencies || {}),
    ...Object.keys(pkg.peerDependencies || {}),
    '@babel/runtime/helpers/classCallCheck',
    '@babel/runtime/helpers/createClass',
    '@babel/runtime/helpers/typeof',
    '@babel/runtime/helpers/possibleConstructorReturn',
    '@babel/runtime/helpers/getPrototypeOf',
    '@babel/runtime/helpers/inherits',
    '@babel/runtime/helpers/slicedToArray',
    '@babel/runtime/helpers/wrapNativeSuper',
    '@babel/runtime/regenerator',
  ],
  plugins: [
    flowEntry(),
    babel({
      exclude: 'node_modules/**',
      runtimeHelpers: true,
    })
  ]
},{
  input: 'src/index.js',
  preserveModules: true,
  output: [
    {
      dir: "dist/module",
      //file: pkg.module,
      format: 'esm',
      sourcemap: true,
    }
  ],
  external: [
    ...Object.keys(pkg.dependencies || {}),
    ...Object.keys(pkg.peerDependencies || {}),
    '@babel/runtime/helpers/classCallCheck',
    '@babel/runtime/helpers/createClass',
    '@babel/runtime/helpers/typeof',
    '@babel/runtime/helpers/possibleConstructorReturn',
    '@babel/runtime/helpers/getPrototypeOf',
    '@babel/runtime/helpers/inherits',
    '@babel/runtime/helpers/slicedToArray',
    '@babel/runtime/helpers/wrapNativeSuper',
    '@babel/runtime/regenerator',
  ],
  plugins: [
    flowEntry(),
    babel({
      exclude: 'node_modules/**',
      runtimeHelpers: true,
    })
  ]
  }
];
<|endoftext|>


<commit_before>import babel from 'rollup-plugin-babel';

export default {
  entry: 'dist-es2015/index.js',
  dest: 'dist/dynamic-typed-array.js',
  moduleName: 'DynamicTypedArray',
  format: 'umd',
  sourceMap: true,
  plugins: [
    babel()
  ]
};
<commit_msg>Fix implicitly anonymous AMD export<commit_after>import babel from 'rollup-plugin-babel';

export default {
  entry: 'dist-es2015/index.js',
  dest: 'dist/dynamic-typed-array.js',
  moduleName: 'DynamicTypedArray',
  moduleId: 'dynamic-typed-array',
  format: 'umd',
  sourceMap: true,
  plugins: [
    babel()
  ]
};
<|endoftext|>


<commit_before>import {terser} from 'rollup-plugin-terser';
import json from '@rollup/plugin-json';
import license from 'rollup-plugin-license';

const jsonPlugin = json({include: 'package.json', preferConst: true});
const licensePlugin = license({
    sourcemap: true,
    banner: {
        content: {
            file: 'LICENSE_BANNER'
        }
    }
});

const d3Modules = {
    'd3-array': 'd3',
    'd3-axis': 'd3',
    'd3-brush': 'd3',
    'd3-collection': 'd3',
    'd3-dispatch': 'd3',
    'd3-ease': 'd3',
    'd3-format': 'd3',
    'd3-geo': 'd3',
    'd3-hierarchy': 'd3',
    'd3-interpolate': 'd3',
    'd3-scale-chromatic': 'd3',
    'd3-scale': 'd3',
    'd3-selection': 'd3',
    'd3-shape': 'd3',
    'd3-time': 'd3',
    'd3-time-format': 'd3',
    'd3-timer': 'd3',
    'd3-zoom': 'd3'
};

const umdConf = {
    file: 'dist/dc.js',
    format: 'umd',
    name: 'dc',
    sourcemap: true,
    globals: d3Modules,
    paths: d3Modules
};

const umdMinConf = Object.assign({}, umdConf, {file: 'dist/dc.min.js'});

export default [
    {
        input: 'src/index-with-version.js',
        external: Object.keys(d3Modules),
        plugins: [
            terser(),
            jsonPlugin,
            licensePlugin
        ],
        output: [
            umdConf,
            umdMinConf
        ]
    }
];
<commit_msg>use rollup output plugin to apply terser only to dc.min.js<commit_after>import {terser} from 'rollup-plugin-terser';
import json from '@rollup/plugin-json';
import license from 'rollup-plugin-license';

const jsonPlugin = json({include: 'package.json', preferConst: true});
const licensePlugin = license({
    sourcemap: true,
    banner: {
        content: {
            file: 'LICENSE_BANNER'
        }
    }
});

const d3Modules = {
    'd3-array': 'd3',
    'd3-axis': 'd3',
    'd3-brush': 'd3',
    'd3-collection': 'd3',
    'd3-dispatch': 'd3',
    'd3-ease': 'd3',
    'd3-format': 'd3',
    'd3-geo': 'd3',
    'd3-hierarchy': 'd3',
    'd3-interpolate': 'd3',
    'd3-scale-chromatic': 'd3',
    'd3-scale': 'd3',
    'd3-selection': 'd3',
    'd3-shape': 'd3',
    'd3-time': 'd3',
    'd3-time-format': 'd3',
    'd3-timer': 'd3',
    'd3-zoom': 'd3'
};

const umdConf = {
    file: 'dist/dc.js',
    format: 'umd',
    name: 'dc',
    sourcemap: true,
    globals: d3Modules,
    paths: d3Modules
};

const umdMinConf = Object.assign({}, umdConf, {
    file: 'dist/dc.min.js',
    plugins: [terser()]
});

export default [
    {
        input: 'src/index-with-version.js',
        external: Object.keys(d3Modules),
        plugins: [
            jsonPlugin,
            licensePlugin
        ],
        output: [
            umdConf,
            umdMinConf
        ]
    }
];
<|endoftext|>


<commit_before>import pkg from './package.json';

import filesize from 'rollup-plugin-filesize';
import { terser } from 'rollup-plugin-terser';

const packageName = 'RadioRadio';
const releaseYear = 2016;
const srcFilePath = 'src/radioradio.js';

const filesizePluginOptions = {
  format: {
    exponent: 0,
    fullform: true
  },
  theme: 'light'
};

const preamble = `/*!
 *  ${packageName} v${pkg.version}
 *
 *  ${pkg.description}
 *
 *  Source code available at: ${pkg.homepage}
 *
 *  (c) ${releaseYear}-present ${pkg.author.name} (${pkg.author.url})
 *
 *  ${packageName} may be freely distributed under the ${pkg.license} license.
 */
`;

export default [
  // radioradio.es.js and radioradio.js
  {
    input: srcFilePath,
    output: [
      {
        file: pkg.module,
        format: 'es'
      },
      {
        file: pkg.main,
        format: 'umd',
        name: packageName
      }
    ],
    plugins: [
      filesize(filesizePluginOptions),
      terser({
        compress: false,
        mangle: false,
        output: {
          beautify: true,
          indent_level: 2,
          preamble: preamble
        }
      })
    ]
  },

  // radioradio.min.js
  {
    input: srcFilePath,
    output: {
      file: pkg.main.replace(/\.js$/, '.min.js'),
      format: 'umd',
      name: packageName
    },
    plugins: [
      filesize(filesizePluginOptions),
      terser({
        output: {
          preamble: preamble
        }
      })
    ]
  }
];
<commit_msg>Update Rollup configuration<commit_after>import pkg from './package.json';

import filesize from 'rollup-plugin-filesize';
import { terser } from 'rollup-plugin-terser';

const packageName = 'RadioRadio';
const releaseYear = 2016;
const srcFilePath = 'src/radioradio.js';

const filesizePluginOptions = {
  format: {
    exponent: 0,
    fullform: true
  },
  theme: 'light'
};

const preamble = `/*!
 *  ${packageName} v${pkg.version}
 *
 *  ${pkg.description}
 *
 *  Source code available at: ${pkg.homepage}
 *
 *  (c) ${releaseYear}-present ${pkg.author.name} (${pkg.author.url})
 *
 *  ${packageName} may be freely distributed under the ${pkg.license} license.
 */
`;

export default [
  // radioradio.mjs and radioradio.js
  {
    input: srcFilePath,
    output: [
      {
        file: pkg.module,
        format: 'es'
      },
      {
        file: pkg.main,
        format: 'umd',
        name: packageName
      }
    ],
    plugins: [
      filesize(filesizePluginOptions),
      terser({
        compress: false,
        mangle: false,
        output: {
          beautify: true,
          indent_level: 2,
          preamble: preamble
        }
      })
    ]
  },

  // radioradio.min.js
  {
    input: srcFilePath,
    output: {
      file: pkg.browser,
      format: 'umd',
      name: packageName
    },
    plugins: [
      filesize(filesizePluginOptions),
      terser({
        output: {
          preamble: preamble
        }
      })
    ]
  }
];
<|endoftext|>


<commit_before>const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
const pkg = require('./package');

const now = new Date();
const banner = `/*!
 * Viewer v${pkg.version}
 * https://github.com/${pkg.repository}
 *
 * Copyright (c) 2015-${now.getFullYear()} ${pkg.author.name}
 * Released under the ${pkg.license} license
 *
 * Date: ${now.toISOString()}
 */
`;

module.exports = {
  input: 'src/index.js',
  output: [
    {
      banner,
      file: 'dist/viewer.js',
      format: 'umd',
      name: 'Viewer',
      globals: {
        jquery: 'jQuery',
      },
    },
    {
      banner,
      file: 'dist/viewer.common.js',
      format: 'cjs',
      globals: {
        jquery: 'jQuery',
      },
    },
    {
      banner,
      file: 'dist/viewer.esm.js',
      format: 'es',
      globals: {
        jquery: 'jQuery',
      },
    },
    {
      banner,
      file: 'docs/js/viewer.js',
      format: 'umd',
      name: 'Viewer',
      globals: {
        jquery: 'jQuery',
      },
    },
  ],
  external: ['jquery'],
  plugins: [
    nodeResolve(),
    commonjs(),
    babel({
      plugins: ['external-helpers'],
    }),
  ],
};
<commit_msg>build: simplify<commit_after>const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const nodeResolve = require('rollup-plugin-node-resolve');
const pkg = require('./package');

const now = new Date();
const banner = `/*!
 * Viewer v${pkg.version}
 * https://github.com/${pkg.repository}
 *
 * Copyright (c) 2015-${now.getFullYear()} ${pkg.author.name}
 * Released under the ${pkg.license} license
 *
 * Date: ${now.toISOString()}
 */
`;

module.exports = {
  input: 'src/index.js',
  output: [
    {
      banner,
      file: 'dist/viewer.js',
      format: 'umd',
      name: 'Viewer',
      globals: {
        jquery: 'jQuery',
      },
    },
    {
      banner,
      file: 'dist/viewer.common.js',
      format: 'cjs',
    },
    {
      banner,
      file: 'dist/viewer.esm.js',
      format: 'es',
    },
    {
      banner,
      file: 'docs/js/viewer.js',
      format: 'umd',
      name: 'Viewer',
      globals: {
        jquery: 'jQuery',
      },
    },
  ],
  external: ['jquery'],
  plugins: [
    nodeResolve(),
    commonjs(),
    babel({
      plugins: ['external-helpers'],
    }),
  ],
};
<|endoftext|>


<commit_before>// https://github.com/rollup/rollup-starter-project
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';

let pkg = require('./package.json');
let external = []
  // Mark dependencies and peerDependencies as external
  .concat(
    Object.keys(pkg.dependencies), Object.keys(pkg.peerDependencies)
  )
  // ...But bundle svg-partial-circle into the package
  .filter(pkgName => pkgName !== 'svg-partial-circle');

let plugins = [
  resolve(),
  commonjs({
    // https://github.com/reactjs/react-redux/issues/643#issuecomment-285008041
    namedExports: {
      'node_modules/react/react.js': ['PureComponent'],
    },
  }),
  babel(),
];

export default {
  input: 'src/index.js',
  plugins: plugins,
  external: external,
  output: [
    {
      file: pkg.main,
      format: 'cjs',
      sourcemap: true,
    },
    {
      file: pkg.module,
      format: 'es',
      sourcemap: true,
    },
  ],
};
<commit_msg>Move Rollup.js babel plugin before commonjs<commit_after>// https://github.com/rollup/rollup-starter-project
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';

let pkg = require('./package.json');
let external = []
  // Mark dependencies and peerDependencies as external
  .concat(
    Object.keys(pkg.dependencies), Object.keys(pkg.peerDependencies)
  )
  // ...But bundle svg-partial-circle into the package
  .filter(pkgName => pkgName !== 'svg-partial-circle');

let plugins = [
  resolve(),
  babel(),
  commonjs({
    // https://github.com/reactjs/react-redux/issues/643#issuecomment-285008041
    namedExports: {
      'node_modules/react/react.js': ['PureComponent'],
    },
  }),
];

export default {
  input: 'src/index.js',
  plugins: plugins,
  external: external,
  output: [
    {
      file: pkg.main,
      format: 'cjs',
      sourcemap: true,
    },
    {
      file: pkg.module,
      format: 'es',
      sourcemap: true,
    },
  ],
};
<|endoftext|>


<commit_before>import vue from 'rollup-plugin-vue'
import node from 'rollup-plugin-node-resolve'
import cjs from 'rollup-plugin-commonjs'
import babel from 'rollup-plugin-babel'
import { terser } from 'rollup-plugin-terser'

import fs from 'fs'
import path from 'path'

import pack from './package.json'

const babelConfig = {
    exclude: 'node_modules/**',
    runtimeHelpers: true,
    babelrc: false,
    presets: [['@babel/preset-env', { modules: false }]]
}

const bannerTxt = `/*! Buefy v${pack.version} | MIT License | github.com/buefy/buefy */`

const baseFolder = './src/'
const componentsFolder = 'components/'

const components = fs
    .readdirSync(baseFolder + componentsFolder)
    .filter((f) =>
        fs.statSync(path.join(baseFolder + componentsFolder, f)).isDirectory()
    )

const entries = {
    'index': './src/index.js',
    ...components.reduce((obj, name) => {
        obj[name] = (baseFolder + componentsFolder + name)
        return obj
    }, {})
}

export default () => {
    const mapComponent = (name) => {
        return [
            {
                input: baseFolder + componentsFolder + `${name}/index.js`,
                external: ['vue'],
                output: {
                    format: 'umd',
                    name: name,
                    file: `dist/components/${name}/index.js`,
                    banner: bannerTxt,
                    exports: 'named',
                    globals: {
                        vue: 'Vue'
                    }
                },
                plugins: [
                    node({
                        extensions: ['.vue', '.js']
                    }),
                    cjs(),
                    vue({
                        template: {
                            isProduction: true
                        }
                    }),
                    babel(babelConfig)
                ]
            }
        ]
    }

    let config = [
        {
            input: entries,
            external: ['vue'],
            output: {
                format: 'esm',
                dir: `dist/esm`
            },
            plugins: [
                node({
                    extensions: ['.vue', '.js']
                }),
                vue({
                    template: {
                        isProduction: true
                    }
                }),
                babel(babelConfig),
                cjs()
            ]
        },
        {
            input: entries,
            external: ['vue'],
            output: {
                format: 'cjs',
                dir: 'dist/cjs',
                exports: 'named'
            },
            plugins: [
                node({
                    extensions: ['.vue', '.js']
                }),
                vue({
                    template: {
                        isProduction: true
                    }
                }),
                babel(babelConfig),
                cjs()
            ]
        },
        {
            input: 'src/index.js',
            external: ['vue'],
            output: {
                format: 'umd',
                name: 'buefy',
                file: 'dist/buefy.js',
                exports: 'named',
                banner: bannerTxt,
                globals: {
                    vue: 'Vue'
                }
            },
            plugins: [
                node({
                    extensions: ['.vue', '.js']
                }),
                vue({
                    template: {
                        isProduction: true
                    }
                }),
                babel(babelConfig),
                cjs()
            ]
        },
        // individual components
        ...components.map((f) => mapComponent(f)).reduce((r, a) => r.concat(a), [])
    ]

    if (process.env.MINIFY === 'true') {
        config = config.filter((c) => c.output.format === 'umd')
        config.forEach((c) => {
            c.output.file = c.output.file.replace(/\.js/g, '.min.js')
            c.plugins.push(terser())
        })
    }
    return config
}
<commit_msg>Fix #1625 global var in UMD format<commit_after>import vue from 'rollup-plugin-vue'
import node from 'rollup-plugin-node-resolve'
import cjs from 'rollup-plugin-commonjs'
import babel from 'rollup-plugin-babel'
import { terser } from 'rollup-plugin-terser'

import fs from 'fs'
import path from 'path'

import pack from './package.json'

const babelConfig = {
    exclude: 'node_modules/**',
    runtimeHelpers: true,
    babelrc: false,
    presets: [['@babel/preset-env', { modules: false }]]
}

const bannerTxt = `/*! Buefy v${pack.version} | MIT License | github.com/buefy/buefy */`

const baseFolder = './src/'
const componentsFolder = 'components/'

const components = fs
    .readdirSync(baseFolder + componentsFolder)
    .filter((f) =>
        fs.statSync(path.join(baseFolder + componentsFolder, f)).isDirectory()
    )

const entries = {
    'index': './src/index.js',
    ...components.reduce((obj, name) => {
        obj[name] = (baseFolder + componentsFolder + name)
        return obj
    }, {})
}

const capitalize = (s) => {
    if (typeof s !== 'string') return ''
    return s.charAt(0).toUpperCase() + s.slice(1)
}

export default () => {
    const mapComponent = (name) => {
        return [
            {
                input: baseFolder + componentsFolder + `${name}/index.js`,
                external: ['vue'],
                output: {
                    format: 'umd',
                    name: capitalize(name),
                    file: `dist/components/${name}/index.js`,
                    banner: bannerTxt,
                    exports: 'named',
                    globals: {
                        vue: 'Vue'
                    }
                },
                plugins: [
                    node({
                        extensions: ['.vue', '.js']
                    }),
                    cjs(),
                    vue({
                        template: {
                            isProduction: true
                        }
                    }),
                    babel(babelConfig)
                ]
            }
        ]
    }

    let config = [
        {
            input: entries,
            external: ['vue'],
            output: {
                format: 'esm',
                dir: `dist/esm`
            },
            plugins: [
                node({
                    extensions: ['.vue', '.js']
                }),
                vue({
                    template: {
                        isProduction: true
                    }
                }),
                babel(babelConfig),
                cjs()
            ]
        },
        {
            input: entries,
            external: ['vue'],
            output: {
                format: 'cjs',
                dir: 'dist/cjs',
                exports: 'named'
            },
            plugins: [
                node({
                    extensions: ['.vue', '.js']
                }),
                vue({
                    template: {
                        isProduction: true
                    }
                }),
                babel(babelConfig),
                cjs()
            ]
        },
        {
            input: 'src/index.js',
            external: ['vue'],
            output: {
                format: 'umd',
                name: capitalize('buefy'),
                file: 'dist/buefy.js',
                exports: 'named',
                banner: bannerTxt,
                globals: {
                    vue: 'Vue'
                }
            },
            plugins: [
                node({
                    extensions: ['.vue', '.js']
                }),
                vue({
                    template: {
                        isProduction: true
                    }
                }),
                babel(babelConfig),
                cjs()
            ]
        },
        // individual components
        ...components.map((f) => mapComponent(f)).reduce((r, a) => r.concat(a), [])
    ]

    if (process.env.MINIFY === 'true') {
        config = config.filter((c) => c.output.format === 'umd')
        config.forEach((c) => {
            c.output.file = c.output.file.replace(/\.js/g, '.min.js')
            c.plugins.push(terser({
                output: {
                    comments: '/^!/'
                }
            }))
        })
    }
    return config
}
<|endoftext|>


<commit_before>import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import globals from 'rollup-plugin-node-globals';
import { uglify } from 'rollup-plugin-uglify';
import pkg from './package.json';

export default [
	// browser-friendly UMD build
	{
		input: 'src/strophe.js',
		output: {
			name: 'strophe',
			file: pkg.browser,
			format: 'umd'
		},
		plugins: [
			resolve(),
			commonjs(),
            globals(),
			babel({
				exclude: ['node_modules/**'],
                presets: [
                    ['@babel/preset-env', {
                        targets: {
                            browsers: '>1%'
                        }
                    }]
                ]
			})
		]
	},
	// Minified UMD build
	{
		input: 'src/strophe.js',
		output: {
			name: 'strophe',
			file: 'dist/strophe.umd.min.js',
			format: 'umd'
		},
		plugins: [
			resolve(),
			commonjs(),
            globals(),
			babel({
                exclude: ['node_modules/**'],
                presets: [
                    ['@babel/preset-env', {
                        targets: {
                            browsers: '>1%'
                        }
                    }]
                ]
            }),
            uglify()
		]
	},
	// CommonJS (for Node) and ES module (for bundlers) build.
	{
		input: 'src/strophe.js',
		external: ['window', 'md5'],
		output: [
			{ file: pkg.main, format: 'cjs' },
			{ file: pkg.module, format: 'es' }
		],
		plugins: [
            globals(),
			babel({
				exclude: ['node_modules/**'],
                presets: [
                    ['@babel/preset-env']
                ]
			})
		]
	}
];
<commit_msg>Fix indentation in rollup.config.js<commit_after>import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import globals from 'rollup-plugin-node-globals';
import { uglify } from 'rollup-plugin-uglify';
import pkg from './package.json';

export default [
    // browser-friendly UMD build
    {
        input: 'src/strophe.js',
        output: {
            name: 'strophe',
            file: pkg.browser,
            format: 'umd'
        },
        plugins: [
            resolve(),
            commonjs(),
            globals(),
            babel({
                exclude: ['node_modules/**'],
                presets: [
                    ['@babel/preset-env', {
                        targets: {
                            browsers: '>1%'
                        }
                    }]
                ]
            })
        ]
    },
    // Minified UMD build
    {
        input: 'src/strophe.js',
        output: {
            name: 'strophe',
            file: 'dist/strophe.umd.min.js',
            format: 'umd'
        },
        plugins: [
            resolve(),
            commonjs(),
            globals(),
            babel({
                exclude: ['node_modules/**'],
                presets: [
                    ['@babel/preset-env', {
                        targets: {
                            browsers: '>1%'
                        }
                    }]
                ]
            }),
            uglify()
        ]
    },
    // CommonJS (for Node) and ES module (for bundlers) build.
    {
        input: 'src/strophe.js',
        external: ['window', 'md5'],
        output: [
            { file: pkg.main, format: 'cjs' },
            { file: pkg.module, format: 'es' }
        ],
        plugins: [
            globals(),
            babel({
                exclude: ['node_modules/**'],
                presets: [
                    ['@babel/preset-env']
                ]
            })
        ]
    }
];
<|endoftext|>


<commit_before>const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
const log = console.log; // eslint-disable-line

const multi_entry = require('rollup-plugin-multi-entry');
const commonjs = require('rollup-plugin-commonjs');
const node_resolve = require('rollup-plugin-node-resolve');
const postcss = require('rollup-plugin-postcss');
const buble = require('rollup-plugin-buble');
const { terser } = require('rollup-plugin-terser');
const vue = require('rollup-plugin-vue');
const frappe_html = require('./frappe-html-plugin');

const production = process.env.FRAPPE_ENV === 'production';

const {
	apps_list,
	assets_path,
	bench_path,
	get_public_path,
	get_app_path,
	get_build_json,
	get_options_for_scss
} = require('./rollup.utils');

function get_rollup_options(output_file, input_files) {
	if (output_file.endsWith('.js')) {
		return get_rollup_options_for_js(output_file, input_files);
	} else if(output_file.endsWith('.css')) {
		return get_rollup_options_for_css(output_file, input_files);
	}
}

function get_rollup_options_for_js(output_file, input_files) {

	const node_resolve_paths = [].concat(
		// node_modules of apps directly importable
		apps_list.map(app => path.resolve(get_app_path(app), '../node_modules')).filter(fs.existsSync),
		// import js file of any app if you provide the full path
		apps_list.map(app => path.resolve(get_app_path(app), '..')).filter(fs.existsSync)
	);

	const plugins = [
		// enables array of inputs
		multi_entry(),
		// .html -> .js
		frappe_html(),
		// ignore css imports
		ignore_css(),
		// .vue -> .js
		vue.default(),
		// ES6 -> ES5
		buble({
			objectAssign: 'Object.assign',
			transforms: {
				dangerousForOf: true,
				classes: false
			},
			exclude: [path.resolve(bench_path, '**/*.css'), path.resolve(bench_path, '**/*.less')]
		}),
		commonjs(),
		node_resolve({
			customResolveOptions: {
				paths: node_resolve_paths
			}
		}),
		production && terser()
	];

	return {
		inputOptions: {
			input: input_files,
			plugins: plugins,
			context: 'window',
			external: ['jquery'],
			onwarn({ code, message, loc, frame }) {
				// skip warnings
				if (['EVAL', 'SOURCEMAP_BROKEN', 'NAMESPACE_CONFLICT'].includes(code)) return;

				if ('UNRESOLVED_IMPORT' === code) {
					log(chalk.yellow.underline(code), ':', message);
					const command = chalk.yellow('bench setup requirements');
					log(`Cannot find some dependencies. You may have to run "${command}" to install them.`);
					log();
					return;
				}

				if (loc) {
					log(`${loc.file} (${loc.line}:${loc.column}) ${message}`);
					if (frame) log(frame);
				} else {
					log(chalk.yellow.underline(code), ':', message);
				}
			}
		},
		outputOptions: {
			file: path.resolve(assets_path, output_file),
			format: 'iife',
			name: 'Rollup',
			globals: {
				'jquery': 'window.jQuery'
			},
			sourcemap: true
		}
	};
}

function get_rollup_options_for_css(output_file, input_files) {
	const output_path = path.resolve(assets_path, output_file);
    const minimize_css = output_path.includes('/assets/css/') && production;

	const plugins = [
		// enables array of inputs
		multi_entry(),
		// less -> css
		postcss({
			plugins: [
				require('tailwindcss'),
				require('autoprefixer'),
				minimize_css ? require('cssnano')({ preset: 'default' }) : null
			].filter(Boolean),
			extract: output_path,
			use: [
				[
					'less',
					{
						// import other less/css files starting from these folders
						paths: [path.resolve(get_public_path('frappe'), 'less')]
					}
				],
				['sass', get_options_for_scss()]
			],
			include: [
				path.resolve(bench_path, '**/*.less'),
				path.resolve(bench_path, '**/*.scss'),
				path.resolve(bench_path, '**/*.css')
			]
		})
	];

	return {
		inputOptions: {
			input: input_files,
			plugins: plugins,
			onwarn(warning, warn) {
				// skip warnings
				if (['EMPTY_BUNDLE'].includes(warning.code)) return;

                // console.warn everything else
                log(warning)
				log(chalk.yellow.underline(warning.code), ':', warning.message);
			}
		},
		outputOptions: {
			// this file is always empty, remove it later?
			file: path.resolve(assets_path, `css/rollup.manifest.css`),
			format: 'cjs'
		}
	};
}

function get_options_for(app) {
	const build_json = get_build_json(app);
	if (!build_json) return [];

	return Object.keys(build_json)
		.map(output_file => {
			if (output_file.startsWith('concat:')) return null;

			const input_files = build_json[output_file]
				.map(input_file => {
					let prefix = get_app_path(app);
					if (input_file.startsWith('node_modules/')) {
						prefix = path.resolve(get_app_path(app), '..');
					}
					return path.resolve(prefix, input_file);
				});
			return Object.assign(
				get_rollup_options(output_file, input_files), {
					output_file
				});
		})
		.filter(Boolean);
}

function ignore_css() {
	return {
		name: 'ignore-css',
		transform(code, id) {
			if (!['.css', '.scss', '.sass', '.less'].some(ext => id.endsWith(ext))) {
				return null;
			}

			return `
				// ignored ${id}
			`;
		}
	};
};

module.exports = {
	get_options_for
};
<commit_msg>chore: Log full warning<commit_after>const path = require('path');
const fs = require('fs');
const chalk = require('chalk');
const log = console.log; // eslint-disable-line

const multi_entry = require('rollup-plugin-multi-entry');
const commonjs = require('rollup-plugin-commonjs');
const node_resolve = require('rollup-plugin-node-resolve');
const postcss = require('rollup-plugin-postcss');
const buble = require('rollup-plugin-buble');
const { terser } = require('rollup-plugin-terser');
const vue = require('rollup-plugin-vue');
const frappe_html = require('./frappe-html-plugin');

const production = process.env.FRAPPE_ENV === 'production';

const {
	apps_list,
	assets_path,
	bench_path,
	get_public_path,
	get_app_path,
	get_build_json,
	get_options_for_scss
} = require('./rollup.utils');

function get_rollup_options(output_file, input_files) {
	if (output_file.endsWith('.js')) {
		return get_rollup_options_for_js(output_file, input_files);
	} else if(output_file.endsWith('.css')) {
		return get_rollup_options_for_css(output_file, input_files);
	}
}

function get_rollup_options_for_js(output_file, input_files) {

	const node_resolve_paths = [].concat(
		// node_modules of apps directly importable
		apps_list.map(app => path.resolve(get_app_path(app), '../node_modules')).filter(fs.existsSync),
		// import js file of any app if you provide the full path
		apps_list.map(app => path.resolve(get_app_path(app), '..')).filter(fs.existsSync)
	);

	const plugins = [
		// enables array of inputs
		multi_entry(),
		// .html -> .js
		frappe_html(),
		// ignore css imports
		ignore_css(),
		// .vue -> .js
		vue.default(),
		// ES6 -> ES5
		buble({
			objectAssign: 'Object.assign',
			transforms: {
				dangerousForOf: true,
				classes: false
			},
			exclude: [path.resolve(bench_path, '**/*.css'), path.resolve(bench_path, '**/*.less')]
		}),
		commonjs(),
		node_resolve({
			customResolveOptions: {
				paths: node_resolve_paths
			}
		}),
		production && terser()
	];

	return {
		inputOptions: {
			input: input_files,
			plugins: plugins,
			context: 'window',
			external: ['jquery'],
			onwarn({ code, message, loc, frame }) {
				// skip warnings
				if (['EVAL', 'SOURCEMAP_BROKEN', 'NAMESPACE_CONFLICT'].includes(code)) return;

				if ('UNRESOLVED_IMPORT' === code) {
					log(chalk.yellow.underline(code), ':', message);
					const command = chalk.yellow('bench setup requirements');
					log(`Cannot find some dependencies. You may have to run "${command}" to install them.`);
					log();
					return;
				}

				if (loc) {
					log(`${loc.file} (${loc.line}:${loc.column}) ${message}`);
					if (frame) log(frame);
				} else {
					log(chalk.yellow.underline(code), ':', message);
				}
			}
		},
		outputOptions: {
			file: path.resolve(assets_path, output_file),
			format: 'iife',
			name: 'Rollup',
			globals: {
				'jquery': 'window.jQuery'
			},
			sourcemap: true
		}
	};
}

function get_rollup_options_for_css(output_file, input_files) {
	const output_path = path.resolve(assets_path, output_file);
	const minimize_css = output_path.includes('/assets/css/') && production;

	const plugins = [
		// enables array of inputs
		multi_entry(),
		// less -> css
		postcss({
			plugins: [
				require('tailwindcss'),
				require('autoprefixer'),
				minimize_css ? require('cssnano')({ preset: 'default' }) : null
			].filter(Boolean),
			extract: output_path,
			use: [
				[
					'less',
					{
						// import other less/css files starting from these folders
						paths: [path.resolve(get_public_path('frappe'), 'less')]
					}
				],
				['sass', get_options_for_scss()]
			],
			include: [
				path.resolve(bench_path, '**/*.less'),
				path.resolve(bench_path, '**/*.scss'),
				path.resolve(bench_path, '**/*.css')
			]
		})
	];

	return {
		inputOptions: {
			input: input_files,
			plugins: plugins,
			onwarn(warning, warn) {
				// skip warnings
				if (['EMPTY_BUNDLE'].includes(warning.code)) return;

				// console.warn everything else
				log(chalk.yellow.underline(warning.code), ':', warning.message);
				log(warning);
			}
		},
		outputOptions: {
			// this file is always empty, remove it later?
			file: path.resolve(assets_path, `css/rollup.manifest.css`),
			format: 'cjs'
		}
	};
}

function get_options_for(app) {
	const build_json = get_build_json(app);
	if (!build_json) return [];

	return Object.keys(build_json)
		.map(output_file => {
			if (output_file.startsWith('concat:')) return null;

			const input_files = build_json[output_file]
				.map(input_file => {
					let prefix = get_app_path(app);
					if (input_file.startsWith('node_modules/')) {
						prefix = path.resolve(get_app_path(app), '..');
					}
					return path.resolve(prefix, input_file);
				});
			return Object.assign(
				get_rollup_options(output_file, input_files), {
					output_file
				});
		})
		.filter(Boolean);
}

function ignore_css() {
	return {
		name: 'ignore-css',
		transform(code, id) {
			if (!['.css', '.scss', '.sass', '.less'].some(ext => id.endsWith(ext))) {
				return null;
			}

			return `
				// ignored ${id}
			`;
		}
	};
};

module.exports = {
	get_options_for
};
<|endoftext|>


<commit_before>"use strict"

var buildQueryString = require("../querystring/build")
var parseQueryString = require("../querystring/parse")

module.exports = function($window) {
	var supportsPushState = typeof $window.history.pushState === "function"
	var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout

	var prefix = "#!"
	function setPrefix(value) {prefix = value}

	function normalize(fragment) {
		var data = $window.location[fragment].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)
		if (fragment === "pathname" && data[0] !== "/") data = "/" + data
		return data
	}

	function parsePath(path, queryData, hashData) {
		var queryIndex = path.indexOf("?")
		var hashIndex = path.indexOf("#")
		var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length
		if (queryIndex > -1) {
			var queryEnd = hashIndex > -1 ? hashIndex : path.length
			var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))
			for (var key in queryParams) queryData[key] = queryParams[key]
		}
		if (hashIndex > -1) {
			var hashParams = parseQueryString(path.slice(hashIndex + 1))
			for (var key in hashParams) hashData[key] = hashParams[key]
		}
		return path.slice(0, pathEnd)
	}

	function getPath() {
		var type = prefix.charAt(0)
		switch (type) {
			case "#": return normalize("hash").slice(prefix.length)
			case "?": return normalize("search").slice(prefix.length) + normalize("hash")
			default: return normalize("pathname").slice(prefix.length) + normalize("search") + normalize("hash")
		}
	}

	function setPath(path, data, options) {
		var queryData = {}, hashData = {}
		path = parsePath(path, queryData, hashData)
		if (data != null) {
			for (var key in data) queryData[key] = data[key]
			path = path.replace(/:([^\/]+)/g, function(match, token) {
				delete queryData[token]
				return data[token]
			})
		}

		var query = buildQueryString(queryData)
		if (query) path += "?" + query

		var hash = buildQueryString(hashData)
		if (hash) path += "#" + hash

		if (supportsPushState) {
			if (options && options.replace) $window.history.replaceState(null, null, prefix + path)
			else $window.history.pushState(null, null, prefix + path)
			$window.onpopstate()
		}
		else $window.location.href = prefix + path
	}

	function defineRoutes(routes, resolve, reject) {
		if (supportsPushState) $window.onpopstate = resolveRoute
		else if (prefix.charAt(0) === "#") $window.onhashchange = resolveRoute
		resolveRoute()

		function resolveRoute() {
			var path = getPath()
			var params = {}
			var pathname = parsePath(path, params, params)

			callAsync(function() {
				for (var route in routes) {
					var matcher = new RegExp("^" + route.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")

					if (matcher.test(pathname)) {
						pathname.replace(matcher, function() {
							var keys = route.match(/:[^\/]+/g) || []
							var values = [].slice.call(arguments, 1, -2)
							for (var i = 0; i < keys.length; i++) {
								params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i])
							}
							resolve(routes[route], params, path, route)
						})
						return
					}
				}

				reject(path, params)
			})
		}
		return resolveRoute
	}

	function link(vnode) {
		vnode.dom.setAttribute("href", prefix + vnode.attrs.href)
		vnode.dom.onclick = function(e) {
			e.preventDefault()
			e.redraw = false
			setPath(vnode.attrs.href, undefined, undefined)
		}
	}

	return {setPrefix: setPrefix, getPath: getPath, setPath: setPath, defineRoutes: defineRoutes, link: link}
}
<commit_msg>core router: add `debounceAsync()`, normalize onhashchange and onpopstate timing. Fix ##1269<commit_after>"use strict"

var buildQueryString = require("../querystring/build")
var parseQueryString = require("../querystring/parse")

module.exports = function($window) {
	var supportsPushState = typeof $window.history.pushState === "function"
	var callAsync = typeof setImmediate === "function" ? setImmediate : setTimeout

	var prefix = "#!"
	function setPrefix(value) {prefix = value}

	function normalize(fragment) {
		var data = $window.location[fragment].replace(/(?:%[a-f89][a-f0-9])+/gim, decodeURIComponent)
		if (fragment === "pathname" && data[0] !== "/") data = "/" + data
		return data
	}

	var asyncId
	function debounceAsync(f) {
		return function(){
			if (asyncId != null) return
			asyncId = callAsync(function(){
				asyncId = null
				f()
			})

		}
	}

	function parsePath(path, queryData, hashData) {
		var queryIndex = path.indexOf("?")
		var hashIndex = path.indexOf("#")
		var pathEnd = queryIndex > -1 ? queryIndex : hashIndex > -1 ? hashIndex : path.length
		if (queryIndex > -1) {
			var queryEnd = hashIndex > -1 ? hashIndex : path.length
			var queryParams = parseQueryString(path.slice(queryIndex + 1, queryEnd))
			for (var key in queryParams) queryData[key] = queryParams[key]
		}
		if (hashIndex > -1) {
			var hashParams = parseQueryString(path.slice(hashIndex + 1))
			for (var key in hashParams) hashData[key] = hashParams[key]
		}
		return path.slice(0, pathEnd)
	}

	function getPath() {
		var type = prefix.charAt(0)
		switch (type) {
			case "#": return normalize("hash").slice(prefix.length)
			case "?": return normalize("search").slice(prefix.length) + normalize("hash")
			default: return normalize("pathname").slice(prefix.length) + normalize("search") + normalize("hash")
		}
	}

	function setPath(path, data, options) {
		var queryData = {}, hashData = {}
		path = parsePath(path, queryData, hashData)
		if (data != null) {
			for (var key in data) queryData[key] = data[key]
			path = path.replace(/:([^\/]+)/g, function(match, token) {
				delete queryData[token]
				return data[token]
			})
		}

		var query = buildQueryString(queryData)
		if (query) path += "?" + query

		var hash = buildQueryString(hashData)
		if (hash) path += "#" + hash

		if (supportsPushState) {
			if (options && options.replace) $window.history.replaceState(null, null, prefix + path)
			else $window.history.pushState(null, null, prefix + path)
			$window.onpopstate()
		}
		else $window.location.href = prefix + path
	}

	function defineRoutes(routes, resolve, reject) {
		if (supportsPushState) $window.onpopstate = debounceAsync(resolveRoute)
		else if (prefix.charAt(0) === "#") $window.onhashchange = resolveRoute
		resolveRoute()

		function resolveRoute() {
			var path = getPath()
			var params = {}
			var pathname = parsePath(path, params, params)

			for (var route in routes) {
				var matcher = new RegExp("^" + route.replace(/:[^\/]+?\.{3}/g, "(.*?)").replace(/:[^\/]+/g, "([^\\/]+)") + "\/?$")

				if (matcher.test(pathname)) {
					pathname.replace(matcher, function() {
						var keys = route.match(/:[^\/]+/g) || []
						var values = [].slice.call(arguments, 1, -2)
						for (var i = 0; i < keys.length; i++) {
							params[keys[i].replace(/:|\./g, "")] = decodeURIComponent(values[i])
						}
						resolve(routes[route], params, path, route)
					})
					return
				}
			}

			reject(path, params)
		}
		return resolveRoute
	}

	function link(vnode) {
		vnode.dom.setAttribute("href", prefix + vnode.attrs.href)
		vnode.dom.onclick = function(e) {
			e.preventDefault()
			e.redraw = false
			setPath(vnode.attrs.href, undefined, undefined)
		}
	}

	return {setPrefix: setPrefix, getPath: getPath, setPath: setPath, defineRoutes: defineRoutes, link: link}
}
<|endoftext|>


<commit_before>var express = require('express');
var router = express.Router();
var ObjectID = require('mongodb').ObjectID;

router.get('/', function(req,res) {
  var coll = global.db.collection('artist');
  coll.find().toArray(function(err,artists) {
    if(err) console.log(err);
    res.render('templates/index',
              { artists : artists });
    console.log('req.url:',req.url);
    console.log('artists:',artists);
  });
});

router.post('/', function(req,res) {
  var coll = global.db.collection('artist')
    , artist = req.body;
  coll.save(artist,
    function(err,result) {
      res.redirect('/artists');
    });
});

router.get('/add', function(req,res) {
  res.render('templates/artist-add');
});

router.get('/:_id', function(req,res) {
  var _id = ObjectID(req.params._id)
    , coll = global.db.collection('artist');
  coll.findOne({ _id : _id },
    function(err,artist) {
      res.render('templates/artist',
                { artist : artist });
    });
});

router.get('/:_id/edit', function(req,res) {
  var _id = ObjectID(req.params._id)
    , coll = global.db.collection('artist');
  coll.findOne({ _id : _id },
    function(err,artist) {
      console.log(artist);
      res.render('templates/artist-edit',
                { artist : artist });
    });
});

router.post('/:_id/edit', function(req,res) {
  var _id = ObjectID(req.params._id)
    , artist = res.body
    , coll = global.db.collection('artist');
  coll.update({ _id : _id },
    { $set : {
      "name"  : artist.name ,
      "genre" : artist.genre,
      "wiki"  : artist.wiki
    } },
    function(err,artist) {
      res.render('/artists/'+req.params._id);
    });
});

router.post('/:_id/delete', function(req,res) {
  var coll = global.db.collection('artist')
    , _id = ObjectID(req.params._id);
  coll.remove({ _id : _id },
    function(err,result) {
      if (err) console.log(err);
      console.log(result);
      res.redirect('/artists');
    });
});

module.exports = router;
<commit_msg>Adding API for artist search on album-add page<commit_after>var express = require('express');
var router = express.Router();
var ObjectID = require('mongodb').ObjectID;

router.get('/', function(req,res) {
  var coll = global.db.collection('artist');
  coll.find().toArray(function(err,artists) {
    if(err) console.log(err);
    res.render('templates/index',
              { artists : artists });
    console.log('req.url:',req.url);
    console.log('artists:',artists);
  });
});

router.post('/', function(req,res) {
  var coll = global.db.collection('artist')
    , artist = req.body;
  coll.save(artist,
    function(err,result) {
      res.redirect('/artists');
    });
});

router.get('/add', function(req,res) {
  res.render('templates/artist-add');
});

router.get('/search', function(req,res) {
  var coll = global.db.collection('artist')
    , query = new RegExp(req.query.name,"i");
  coll.find({ name : query })
    .toArray(function(err,matches) {
      res.send(matches);
    });
});

router.get('/:_id', function(req,res) {
  var _id = ObjectID(req.params._id)
    , coll = global.db.collection('artist');
  coll.findOne({ _id : _id },
    function(err,artist) {
      res.render('templates/artist',
                { artist : artist });
    });
});

router.get('/:_id/edit', function(req,res) {
  var _id = ObjectID(req.params._id)
    , coll = global.db.collection('artist');
  coll.findOne({ _id : _id },
    function(err,artist) {
      console.log(artist);
      res.render('templates/artist-edit',
                { artist : artist });
    });
});

router.post('/:_id/edit', function(req,res) {
  var _id = ObjectID(req.params._id)
    , artist = res.body
    , coll = global.db.collection('artist');
  coll.update({ _id : _id },
    { $set : {
      "name"  : artist.name ,
      "genre" : artist.genre,
      "wiki"  : artist.wiki
    } },
    function(err,artist) {
      res.render('/artists/'+req.params._id);
    });
});

router.post('/:_id/delete', function(req,res) {
  var coll = global.db.collection('artist')
    , _id = ObjectID(req.params._id);
  coll.remove({ _id : _id },
    function(err,result) {
      if (err) console.log(err);
      console.log(result);
      res.redirect('/artists');
    });
});

module.exports = router;
<|endoftext|>