<commit_before>var traverse = require("../../traverse");
var util     = require("../../util");
var t        = require("../../types");

exports.ClassDeclaration = function (node, parent, file, scope) {
  var closure = true;
  if (t.isProgram(parent) || t.isBlockStatement(parent)) {
    closure = false;
  }

  var newNode = new Class(node, file, scope, closure).run();
  if (closure || t.isFunctionExpression(newNode)) {
    return t.variableDeclaration("let", [
      t.variableDeclarator(node.id, newNode)
    ]);
  } else {
    return newNode;
  }
};

exports.ClassExpression = function (node, parent, file, scope) {
  return new Class(node, file, scope, true).run();
};

/**
 * Description
 *
 * @param {Node} node
 * @param {File} file
 * @param {Scope} scope
 * @param {Boolean} closure
 */

function Class(node, file, scope, closure) {
  this.closure = closure;
  this.scope   = scope;
  this.node    = node;
  this.file    = file;

  this.hasInstanceMutators = false;
  this.hasStaticMutators   = false;

  this.instanceMutatorMap = {};
  this.staticMutatorMap   = {};
  this.hasConstructor     = false;
  this.className          = node.id || file.generateUidIdentifier("class", scope);
  this.superName          = node.superClass;
}

/**
 * Description
 *
 * @returns {Array}
 */

Class.prototype.run = function () {
  var superName = this.superName;
  var className = this.className;
  var file      = this.file;

  //

  var body = this.body = [];

  var constructor = t.functionExpression(null, [], t.blockStatement([]));
  if (this.node.id) constructor.id = className;
  this.constructor = constructor;

  body.push(t.variableDeclaration("let", [
    t.variableDeclarator(className, constructor)
  ]));

  //

  if (superName && t.isDynamic(superName)) {
    // so we're only evaluating it once
    var superRefName = "super";
    if (className) superRefName = className.name + "Super";

    var superRef = file.generateUidIdentifier(superRefName, this.scope);
    body.unshift(t.variableDeclaration("var", [
      t.variableDeclarator(superRef, superName)
    ]));
    superName = superRef;
  }

  this.superName = superName;

  //

  if (superName) {
    body.push(t.expressionStatement(t.callExpression(file.addDeclaration("inherits"), [className, superName])));
  }

  this.buildBody();

  t.inheritsComments(body[0], this.node);

  if (this.closure) {
    if (body.length === 1) {
      // only a constructor so no need for a closure container
      return constructor;
    } else {
      body.push(t.returnStatement(className));
      return t.callExpression(
        t.functionExpression(null, [], t.blockStatement(body)),
        []
      );
    }
  } else {
    return body;
  }
};

/**
 * Description
 */

Class.prototype.buildBody = function () {
  var constructor = this.constructor;
  var className   = this.className;
  var superName   = this.superName;
  var classBody   = this.node.body.body;
  var body        = this.body;
  var self        = this;

  for (var i in classBody) {
    var node = classBody[i];
    if (t.isMethodDefinition(node)) {
      self.replaceInstanceSuperReferences(node);

      if (node.key.name === "constructor") {
        self.pushConstructor(node);
      } else {
        self.pushMethod(node);
      }
    } else if (t.isPrivateDeclaration(node)) {
      self.closure = true;
      body.unshift(node);
    }
  }

  if (!this.hasConstructor && superName) {
    constructor.body.body.push(util.template("class-super-constructor-call", {
      SUPER_NAME: superName
    }, true));
  }

  var instanceProps;
  var staticProps;

  if (this.hasInstanceMutators) {
    var protoId = util.template("prototype-identifier", {
      CLASS_NAME: className
    });

    instanceProps = util.buildDefineProperties(this.instanceMutatorMap, protoId);
  }

  if (this.hasStaticMutators) {
    staticProps = util.buildDefineProperties(this.staticMutatorMap, className);
  }

  if (instanceProps || staticProps) {
    staticProps = staticProps || t.literal(null);

    var args = [className, staticProps];
    if (instanceProps) args.push(instanceProps);

    body.push(t.expressionStatement(
      t.callExpression(this.file.addDeclaration("prototype-properties"), args)
    ));
  }
};

/**
 * Push a method to it's respective mutatorMap.
 *
 * @param {Node} node MethodDefinition
 */

Class.prototype.pushMethod = function (node) {
  var methodName = node.key;

  var kind = node.kind;

  if (kind === "") {
    // method

    var className = this.className;
    if (!node.static) className = t.memberExpression(className, t.identifier("prototype"));
    methodName = t.memberExpression(className, methodName, node.computed);

    var expr = t.expressionStatement(t.assignmentExpression("=", methodName, node.value));
    t.inheritsComments(expr, node);
    this.body.push(expr);
  } else {
    // mutator
    var mutatorMap = this.instanceMutatorMap;
    if (node.static) {
      this.hasStaticMutators = true;
      mutatorMap = this.staticMutatorMap;
    } else {
      this.hasInstanceMutators = true;
    }
    util.pushMutatorMap(mutatorMap, methodName, kind, node);
  }
};

/**
 * Given a `methodNode`, produce a `MemberExpression` super class reference.
 *
 * @param {Node} methodNode MethodDefinition
 * @param {Node} node Identifier
 * @param {Node} parent
 *
 * @returns {Node}
 */

Class.prototype.superIdentifier = function (methodNode, id, parent) {
  var methodName = methodNode.key;
  var superName  = this.superName || t.identifier("Function");

  if (parent.property === id) {
    return;
  } else if (t.isCallExpression(parent, { callee: id })) {
    // super(); -> ClassName.prototype.MethodName.call(this);
    parent.arguments.unshift(t.thisExpression());

    if (methodName.name === "constructor") {
      // constructor() { super(); }
      return t.memberExpression(superName, t.identifier("call"));
    } else {
      id = superName;

      // foo() { super(); }
      if (!methodNode.static) {
        id = t.memberExpression(id, t.identifier("prototype"));
      }

      id = t.memberExpression(id, methodName, methodNode.computed);
      return t.memberExpression(id, t.identifier("call"));
    }
  } else if (t.isMemberExpression(parent) && !methodNode.static) {
    // super.test -> ClassName.prototype.test
    return t.memberExpression(superName, t.identifier("prototype"));
  } else {
    return superName;
  }
};

/**
 * Replace all `super` references with a reference to our `superClass`.
 *
 * @param {Node} methodNode MethodDefinition
 */

Class.prototype.replaceInstanceSuperReferences = function (methodNode) {
  var method = methodNode.value;
  var self = this;

  traverse(method, {
    enter: function (node, parent) {
      if (t.isIdentifier(node, { name: "super" })) {
        return self.superIdentifier(methodNode, node, parent);
      } else if (t.isCallExpression(node)) {
        var callee = node.callee;
        if (!t.isMemberExpression(callee)) return;
        if (callee.object.name !== "super") return;

        // super.test(); -> ClassName.prototype.MethodName.call(this);
        callee.property = t.memberExpression(callee.property, t.identifier("call"));
        node.arguments.unshift(t.thisExpression());
      }
    }
  });
};

/**
 * Replace the constructor body of our class.
 *
 * @param {Node} method MethodDefinition
 */

Class.prototype.pushConstructor = function (method) {
  if (method.kind !== "") {
    throw this.file.errorWithNode(method, "illegal kind for constructor method");
  }

  var construct = this.constructor;
  var fn        = method.value;

  this.hasConstructor = true;

  t.inherits(construct, fn);
  t.inheritsComments(construct, method);

  construct.defaults = fn.defaults;
  construct.params   = fn.params;
  construct.body     = fn.body;
  construct.rest     = fn.rest;
};
<commit_msg>better ClassDeclarations in expression contexts<commit_after>var traverse = require("../../traverse");
var util     = require("../../util");
var t        = require("../../types");

exports.ClassDeclaration = function (node, parent, file, scope) {
  var closure = true;
  if (t.isProgram(parent) || t.isBlockStatement(parent)) {
    closure = false;
  }

  var newNode = new Class(node, file, scope, closure).run();
  if (closure) {
    // declaration in an expression context...
    // export default class Foo {}
    scope.push({
      kind: "var",
      key: node.id.key,
      id: node.id
    });
    return t.assignmentExpression("=", node.id, newNode);
  } else {
    return newNode;
  }
};

exports.ClassExpression = function (node, parent, file, scope) {
  return new Class(node, file, scope, true).run();
};

/**
 * Description
 *
 * @param {Node} node
 * @param {File} file
 * @param {Scope} scope
 * @param {Boolean} closure
 */

function Class(node, file, scope, closure) {
  this.closure = closure;
  this.scope   = scope;
  this.node    = node;
  this.file    = file;

  this.hasInstanceMutators = false;
  this.hasStaticMutators   = false;

  this.instanceMutatorMap = {};
  this.staticMutatorMap   = {};
  this.hasConstructor     = false;
  this.className          = node.id || file.generateUidIdentifier("class", scope);
  this.superName          = node.superClass;
}

/**
 * Description
 *
 * @returns {Array}
 */

Class.prototype.run = function () {
  var superName = this.superName;
  var className = this.className;
  var file      = this.file;

  //

  var body = this.body = [];

  var constructor = t.functionExpression(null, [], t.blockStatement([]));
  if (this.node.id) constructor.id = className;
  this.constructor = constructor;

  body.push(t.variableDeclaration("let", [
    t.variableDeclarator(className, constructor)
  ]));

  //

  if (superName && t.isDynamic(superName)) {
    // so we're only evaluating it once
    var superRefName = "super";
    if (className) superRefName = className.name + "Super";

    var superRef = file.generateUidIdentifier(superRefName, this.scope);
    body.unshift(t.variableDeclaration("var", [
      t.variableDeclarator(superRef, superName)
    ]));
    superName = superRef;
  }

  this.superName = superName;

  //

  if (superName) {
    body.push(t.expressionStatement(t.callExpression(file.addDeclaration("inherits"), [className, superName])));
  }

  this.buildBody();

  t.inheritsComments(body[0], this.node);

  if (this.closure) {
    if (body.length === 1) {
      // only a constructor so no need for a closure container
      return constructor;
    } else {
      body.push(t.returnStatement(className));
      return t.callExpression(
        t.functionExpression(null, [], t.blockStatement(body)),
        []
      );
    }
  } else {
    return body;
  }
};

/**
 * Description
 */

Class.prototype.buildBody = function () {
  var constructor = this.constructor;
  var className   = this.className;
  var superName   = this.superName;
  var classBody   = this.node.body.body;
  var body        = this.body;
  var self        = this;

  for (var i in classBody) {
    var node = classBody[i];
    if (t.isMethodDefinition(node)) {
      self.replaceInstanceSuperReferences(node);

      if (node.key.name === "constructor") {
        self.pushConstructor(node);
      } else {
        self.pushMethod(node);
      }
    } else if (t.isPrivateDeclaration(node)) {
      self.closure = true;
      body.unshift(node);
    }
  }

  if (!this.hasConstructor && superName) {
    constructor.body.body.push(util.template("class-super-constructor-call", {
      SUPER_NAME: superName
    }, true));
  }

  var instanceProps;
  var staticProps;

  if (this.hasInstanceMutators) {
    var protoId = util.template("prototype-identifier", {
      CLASS_NAME: className
    });

    instanceProps = util.buildDefineProperties(this.instanceMutatorMap, protoId);
  }

  if (this.hasStaticMutators) {
    staticProps = util.buildDefineProperties(this.staticMutatorMap, className);
  }

  if (instanceProps || staticProps) {
    staticProps = staticProps || t.literal(null);

    var args = [className, staticProps];
    if (instanceProps) args.push(instanceProps);

    body.push(t.expressionStatement(
      t.callExpression(this.file.addDeclaration("prototype-properties"), args)
    ));
  }
};

/**
 * Push a method to it's respective mutatorMap.
 *
 * @param {Node} node MethodDefinition
 */

Class.prototype.pushMethod = function (node) {
  var methodName = node.key;

  var kind = node.kind;

  if (kind === "") {
    // method

    var className = this.className;
    if (!node.static) className = t.memberExpression(className, t.identifier("prototype"));
    methodName = t.memberExpression(className, methodName, node.computed);

    var expr = t.expressionStatement(t.assignmentExpression("=", methodName, node.value));
    t.inheritsComments(expr, node);
    this.body.push(expr);
  } else {
    // mutator
    var mutatorMap = this.instanceMutatorMap;
    if (node.static) {
      this.hasStaticMutators = true;
      mutatorMap = this.staticMutatorMap;
    } else {
      this.hasInstanceMutators = true;
    }
    util.pushMutatorMap(mutatorMap, methodName, kind, node);
  }
};

/**
 * Given a `methodNode`, produce a `MemberExpression` super class reference.
 *
 * @param {Node} methodNode MethodDefinition
 * @param {Node} node Identifier
 * @param {Node} parent
 *
 * @returns {Node}
 */

Class.prototype.superIdentifier = function (methodNode, id, parent) {
  var methodName = methodNode.key;
  var superName  = this.superName || t.identifier("Function");

  if (parent.property === id) {
    return;
  } else if (t.isCallExpression(parent, { callee: id })) {
    // super(); -> ClassName.prototype.MethodName.call(this);
    parent.arguments.unshift(t.thisExpression());

    if (methodName.name === "constructor") {
      // constructor() { super(); }
      return t.memberExpression(superName, t.identifier("call"));
    } else {
      id = superName;

      // foo() { super(); }
      if (!methodNode.static) {
        id = t.memberExpression(id, t.identifier("prototype"));
      }

      id = t.memberExpression(id, methodName, methodNode.computed);
      return t.memberExpression(id, t.identifier("call"));
    }
  } else if (t.isMemberExpression(parent) && !methodNode.static) {
    // super.test -> ClassName.prototype.test
    return t.memberExpression(superName, t.identifier("prototype"));
  } else {
    return superName;
  }
};

/**
 * Replace all `super` references with a reference to our `superClass`.
 *
 * @param {Node} methodNode MethodDefinition
 */

Class.prototype.replaceInstanceSuperReferences = function (methodNode) {
  var method = methodNode.value;
  var self = this;

  traverse(method, {
    enter: function (node, parent) {
      if (t.isIdentifier(node, { name: "super" })) {
        return self.superIdentifier(methodNode, node, parent);
      } else if (t.isCallExpression(node)) {
        var callee = node.callee;
        if (!t.isMemberExpression(callee)) return;
        if (callee.object.name !== "super") return;

        // super.test(); -> ClassName.prototype.MethodName.call(this);
        callee.property = t.memberExpression(callee.property, t.identifier("call"));
        node.arguments.unshift(t.thisExpression());
      }
    }
  });
};

/**
 * Replace the constructor body of our class.
 *
 * @param {Node} method MethodDefinition
 */

Class.prototype.pushConstructor = function (method) {
  if (method.kind !== "") {
    throw this.file.errorWithNode(method, "illegal kind for constructor method");
  }

  var construct = this.constructor;
  var fn        = method.value;

  this.hasConstructor = true;

  t.inherits(construct, fn);
  t.inheritsComments(construct, method);

  construct.defaults = fn.defaults;
  construct.params   = fn.params;
  construct.body     = fn.body;
  construct.rest     = fn.rest;
};
<|endoftext|>


<commit_before>/* @TODO Enable 'use strict', remove all these globals */
/* global describe, xit, it, jsPDF, comparePdf, ComboBox, ListBox, PushButton, CheckBox, TextField, PasswordField, RadioButton, AcroForm */
/**
 * Acroform testing
 */

describe('Acroform', function () {

  it('ComboBox', function () {
    var doc = jsPDF()
    doc.setFontSize(12)
    doc.text(10, 105, 'ComboBox:')

    var d = new ComboBox()
    d.T = 'ChoiceField1'
    d.TI = 1
    d.Rect = [50, 100, 30, 10]
    d.Opt = '[(a)(b)(c)]'
    d.V = '(b)'
    d.DV = '(b)'
    doc.addField(d)

    comparePdf(doc.output(), 'combobox.pdf', 'acroform')
  })

  it('should add a CheckBox', function () {
    var doc = jsPDF()
    doc.text(10, 125, 'CheckBox:')
    var checkBox = new CheckBox()
    checkBox.T = 'CheckBox1'
    checkBox.Rect = [50, 120, 30, 10]
    doc.addField(checkBox)

    comparePdf(doc.output(), 'checkbox.pdf', 'acroform')
  })

  it('should add a ListBox', function () {
    var doc = jsPDF()
    doc.setFontSize(12)
    doc.text(10, 115, 'ListBox:')
    var d2 = new ListBox()
    d2.edit = false
    d2.T = 'ChoiceField2'
    d2.TI = 2
    d2.Rect = [50, 110, 30, 10]
    d2.Opt = '[(c)(a)(d)(f)(b)(s)]'
    d2.V = '(s)'
    d2.BG = [0, 1, 1]
    doc.addField(d2)

    comparePdf(doc.output(), 'listbox.pdf', 'acroform')
  })

  it('should add a PushButton', function () {
    var doc = jsPDF()
    doc.text(10, 135, 'PushButton:')
    var pushButton = new PushButton()
    pushButton.T = 'PushButton1'
    pushButton.Rect = [50, 130, 30, 10]
    pushButton.BG = [1, 0, 0]
    doc.addField(pushButton)

    comparePdf(doc.output(), 'pushbutton.pdf', 'acroform')
  })

  it('should add a TextField', function () {
    var doc = jsPDF()
    doc.text(10, 145, 'TextField:')
    var textField = new TextField()
    textField.Rect = [50, 140, 30, 10]
    textField.multiline = true
    textField.V = 'The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse'//
    textField.T = 'TestTextBox'
     // textField.Q = 2; // Text-Alignment
    doc.addField(textField)

    comparePdf(doc.output(), 'textfield.pdf', 'acroform')
  })

  it('should add a Password', function () {
    var doc = jsPDF()
    doc.text(10, 155, 'Password:')
    var passwordField = new PasswordField()
    passwordField.Rect = [50, 150, 30, 10]
    doc.addField(passwordField)

    comparePdf(doc.output(), 'password.pdf', 'acroform')
  })

  it('should add a RadioGroup', function () {
    var doc = jsPDF()
    doc.text(50, 165, 'RadioGroup:')
    var radioGroup = new RadioButton()
    radioGroup.V = '/Test'
    radioGroup.Subtype = 'Form'

    doc.addField(radioGroup)

    var radioButton1 = radioGroup.createOption('Test')
    radioButton1.Rect = [50, 170, 30, 10]
    radioButton1.AS = '/Test'

    var radioButton2 = radioGroup.createOption('Test2')
    radioButton2.Rect = [50, 180, 30, 10]

    var radioButton3 = radioGroup.createOption('Test3')
    radioButton3.Rect = [50, 190, 20, 10]

    radioGroup.setAppearance(AcroForm.Appearance.RadioButton.Cross)

    comparePdf(doc.output(), 'radiogroup.pdf', 'acroform')
  })
})
<commit_msg>Update standard.spec.js<commit_after>/* @TODO Enable 'use strict', remove all these globals */
/* global describe, xit, it, jsPDF, comparePdf, ComboBox, ListBox, PushButton, CheckBox, TextField, PasswordField, RadioButton, AcroForm */
/**
 * Acroform testing
 */

describe('Acroform', function () {

  it('ComboBox', function () {
    var doc = jsPDF()
    doc.setFontSize(12)
    doc.text(10, 105, 'ComboBox:')

    var d = new ComboBox()
    d.T = 'ChoiceField1'
    d.TI = 1
    d.Rect = [50, 100, 30, 10]
    d.Opt = '[(a)(b)(c)]'
    d.V = '(b)'
    d.DV = '(b)'
    doc.addField(d)

    comparePdf(doc.output(), 'combobox.pdf', 'acroform')
  })

  xit('should add a CheckBox', function () {
    var doc = jsPDF()
    doc.text(10, 125, 'CheckBox:')
    var checkBox = new CheckBox()
    checkBox.T = 'CheckBox1'
    checkBox.Rect = [50, 120, 30, 10]
    doc.addField(checkBox)

    comparePdf(doc.output(), 'checkbox.pdf', 'acroform')
  })

  it('should add a ListBox', function () {
    var doc = jsPDF()
    doc.setFontSize(12)
    doc.text(10, 115, 'ListBox:')
    var d2 = new ListBox()
    d2.edit = false
    d2.T = 'ChoiceField2'
    d2.TI = 2
    d2.Rect = [50, 110, 30, 10]
    d2.Opt = '[(c)(a)(d)(f)(b)(s)]'
    d2.V = '(s)'
    d2.BG = [0, 1, 1]
    doc.addField(d2)

    comparePdf(doc.output(), 'listbox.pdf', 'acroform')
  })

  it('should add a PushButton', function () {
    var doc = jsPDF()
    doc.text(10, 135, 'PushButton:')
    var pushButton = new PushButton()
    pushButton.T = 'PushButton1'
    pushButton.Rect = [50, 130, 30, 10]
    pushButton.BG = [1, 0, 0]
    doc.addField(pushButton)

    comparePdf(doc.output(), 'pushbutton.pdf', 'acroform')
  })

  it('should add a TextField', function () {
    var doc = jsPDF()
    doc.text(10, 145, 'TextField:')
    var textField = new TextField()
    textField.Rect = [50, 140, 30, 10]
    textField.multiline = true
    textField.V = 'The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse'//
    textField.T = 'TestTextBox'
     // textField.Q = 2; // Text-Alignment
    doc.addField(textField)

    comparePdf(doc.output(), 'textfield.pdf', 'acroform')
  })

  it('should add a Password', function () {
    var doc = jsPDF()
    doc.text(10, 155, 'Password:')
    var passwordField = new PasswordField()
    passwordField.Rect = [50, 150, 30, 10]
    doc.addField(passwordField)

    comparePdf(doc.output(), 'password.pdf', 'acroform')
  })

  it('should add a RadioGroup', function () {
    var doc = jsPDF()
    doc.text(50, 165, 'RadioGroup:')
    var radioGroup = new RadioButton()
    radioGroup.V = '/Test'
    radioGroup.Subtype = 'Form'

    doc.addField(radioGroup)

    var radioButton1 = radioGroup.createOption('Test')
    radioButton1.Rect = [50, 170, 30, 10]
    radioButton1.AS = '/Test'

    var radioButton2 = radioGroup.createOption('Test2')
    radioButton2.Rect = [50, 180, 30, 10]

    var radioButton3 = radioGroup.createOption('Test3')
    radioButton3.Rect = [50, 190, 20, 10]

    radioGroup.setAppearance(AcroForm.Appearance.RadioButton.Cross)

    comparePdf(doc.output(), 'radiogroup.pdf', 'acroform')
  })
})
<|endoftext|>


<commit_before>
cdb.admin.GeometryEditor = cdb.core.View.extend({

  className: "editing",
  MAX_VERTEXES: 2000,

  events: {
    'click .done': 'finish',
    'click .discard': 'discard',
    'mousedown': 'killEvent'
  },

  initialize: function() {
    this.add_related_model(this.model);
    this.geomBeingEdited = null;
  },

  /**
   * finish the editing if there is some geometry being edited and save it
   * triggers editFinish
   */
  finish: function() {
    var self = this;
    if(this.geomBeingEdited) {
      this.geomBeingEdited.destroy();
      this.geomBeingEdited = null;
      this.row.save(null, {
        success: function() {
          self.trigger('editFinish');
        }
      });
      this.row = null;
    }
    this.hide();
  },

  /**
   * finish the editing and undo the changes done.
   * triggers 'editDiscard'
   */
  discard: function() {
    if(this.geomBeingEdited) {
      this.geomBeingEdited.destroy();
      this.geomBeingEdited = null;
      this.row.set('the_geom', this.originalGeom);
      this.originalGeom = null;
      this.row = null;
      this.trigger('editDiscard');
    }
    this.hide();
  },

  /**
   * edits the row geometry
   * the row should contain the_geom attribute.
   * When the edit is finish the row is saved
   */
  editGeom: function(row) {
    var self    = this
      , geojson = JSON.parse(row.get('the_geom'));

    if (this._getGeomCount(geojson) > this.MAX_VERTEXES) {
      this.trigger('editStop');
      this._showStopEdit();
      return false;
    }

    this.trigger('editStart');
    this.discard();
    var geo = new cdb.geo.Geometry({
      geojson: JSON.parse(row.get('the_geom')),
      style: {fillColor: "white", fillOpacity: 0.4, weight: 4, color:"#397DBA", opacity: 1}
    });

    self.row = row;
    self.originalGeom = row.get('the_geom');
    self.geomBeingEdited = geo;

    // when model is edited the model changes
    geo.bind('change:geojson', function() {
      row.set({the_geom: JSON.stringify(geo.get('geojson'))});
    });

    this.mapView.map.addGeometry(geo);
    var geoView = this.mapView.geometries[geo.cid];
    geoView.edit(true);
    this.$('.finish_editing').show();
    this.$('.new_geometry').hide();
    this.$el.fadeIn();
  },

  _getGeomCount: function(geojson) {
    var count = 0;

    _.each(geojson.coordinates, function(pol1, i){
      _.each(pol1, function(pol2, j) {
        count = count + pol2.length;
      })
    });

    return count;
  },

  _showStopEdit: function(ev) {
    var stopEdit = new cdb.admin.StopEditDialog();

    this.$el.closest("body").append(stopEdit.render().el);
    stopEdit.open();
  },

  //TODO: done geometry creating
  /**
   * create geometry
   * @param row a row model, normally empty
   * @param type can be 'point' or 'polygon'
   */
  /*
  createGeom: function(row, type) {
    this.discard();
    this.row = row;
    this.geomType = type;
    this.mapView.bind('click', this._mapClick, this);
    this.$('.finish_editing').hide();
    this.$('.new_geometry').show();
    this.$el.fadeIn();
  },

  _mapClick: function(e, latlng) {
    this.mapView.unbind('click', this._mapClick, this);
    // 30 dregrees at top zoom
    var inc = 30/(1<<this.mapView.map.getZoom());
    //create a simple geom and edit it
    var geoms = {
      'point': {
        type: 'Point',
        coordinates: [latlng[1], latlng[0]]
      },
      'polygon': {
        type: 'MultiPolygon',
        coordinates: [[[
          [latlng[1], latlng[0]],
          [latlng[1] + 2*inc, latlng[0]],
          [latlng[1] + 2*inc, latlng[0] + inc],
          [latlng[1], latlng[0] + inc]
          //[latlng[1], latlng[0]]
        ]]]
      }
    };
    var geo = geoms[this.geomType];
    this.row.set('the_geom', JSON.stringify(geo));
    this.editGeom(this.row);
    e && e.preventDefault();
    return false;
  },
  */

  render: function() {
    this.$el.html(this.getTemplate('table/views/geom_edit')());
    return this;
  }
});

<commit_msg>saving & saved messages in point edition<commit_after>
cdb.admin.GeometryEditor = cdb.core.View.extend({

  className: "editing",
  MAX_VERTEXES: 2000,

  events: {
    'click .done': 'finish',
    'click .discard': 'discard',
    'mousedown': 'killEvent'
  },

  initialize: function() {
    this.add_related_model(this.model);
    this.geomBeingEdited = null;
  },

  /**
   * finish the editing if there is some geometry being edited and save it
   * triggers editFinish
   */
  finish: function() {
    var self = this;
    if(this.geomBeingEdited) {
      this.geomBeingEdited.destroy();
      this.geomBeingEdited = null;
      this.model.notice('Saving ... ', 'load');

      $.when(this.row.save(null)).done(function() {
        self.trigger('editFinish');
        self.model.notice('Saved', 'info', 3000);
      }).fail(function() {
        self.model.notice('Something has failed', 'error', 5000);
      });
      this.row = null;
    }
    this.hide();
  },

  /**
   * finish the editing and undo the changes done.
   * triggers 'editDiscard'
   */
  discard: function() {
    if(this.geomBeingEdited) {
      this.geomBeingEdited.destroy();
      this.geomBeingEdited = null;
      this.row.set('the_geom', this.originalGeom);
      this.originalGeom = null;
      this.row = null;
      this.trigger('editDiscard');
    }
    this.hide();
  },

  /**
   * edits the row geometry
   * the row should contain the_geom attribute.
   * When the edit is finish the row is saved
   */
  editGeom: function(row) {
    var self    = this
      , geojson = JSON.parse(row.get('the_geom'));

    if (this._getGeomCount(geojson) > this.MAX_VERTEXES) {
      this.trigger('editStop');
      this._showStopEdit();
      return false;
    }

    this.trigger('editStart');
    this.discard();
    var geo = new cdb.geo.Geometry({
      geojson: JSON.parse(row.get('the_geom')),
      style: {fillColor: "white", fillOpacity: 0.4, weight: 4, color:"#397DBA", opacity: 1}
    });

    self.row = row;
    self.originalGeom = row.get('the_geom');
    self.geomBeingEdited = geo;

    // when model is edited the model changes
    geo.bind('change:geojson', function() {
      row.set({the_geom: JSON.stringify(geo.get('geojson'))});
    });

    this.mapView.map.addGeometry(geo);
    var geoView = this.mapView.geometries[geo.cid];
    geoView.edit(true);
    this.$('.finish_editing').show();
    this.$('.new_geometry').hide();
    this.$el.fadeIn();
  },

  _getGeomCount: function(geojson) {
    var count = 0;

    _.each(geojson.coordinates, function(pol1, i){
      _.each(pol1, function(pol2, j) {
        count = count + pol2.length;
      })
    });

    return count;
  },

  _showStopEdit: function(ev) {
    var stopEdit = new cdb.admin.StopEditDialog();

    this.$el.closest("body").append(stopEdit.render().el);
    stopEdit.open();
  },

  //TODO: done geometry creating
  /**
   * create geometry
   * @param row a row model, normally empty
   * @param type can be 'point' or 'polygon'
   */
  /*
  createGeom: function(row, type) {
    this.discard();
    this.row = row;
    this.geomType = type;
    this.mapView.bind('click', this._mapClick, this);
    this.$('.finish_editing').hide();
    this.$('.new_geometry').show();
    this.$el.fadeIn();
  },

  _mapClick: function(e, latlng) {
    this.mapView.unbind('click', this._mapClick, this);
    // 30 dregrees at top zoom
    var inc = 30/(1<<this.mapView.map.getZoom());
    //create a simple geom and edit it
    var geoms = {
      'point': {
        type: 'Point',
        coordinates: [latlng[1], latlng[0]]
      },
      'polygon': {
        type: 'MultiPolygon',
        coordinates: [[[
          [latlng[1], latlng[0]],
          [latlng[1] + 2*inc, latlng[0]],
          [latlng[1] + 2*inc, latlng[0] + inc],
          [latlng[1], latlng[0] + inc]
          //[latlng[1], latlng[0]]
        ]]]
      }
    };
    var geo = geoms[this.geomType];
    this.row.set('the_geom', JSON.stringify(geo));
    this.editGeom(this.row);
    e && e.preventDefault();
    return false;
  },
  */

  render: function() {
    this.$el.html(this.getTemplate('table/views/geom_edit')());
    return this;
  }
});

<|endoftext|>


<commit_before>var
    esPhinx,
    Iterable;

(function($) {
    "use strict";

    $.prototype.extend({

        autocomplete: function(elementsList, options, callback) {
            var
                nonCharacterKeysPattern = new RegExp($
                    .nonCharacterKeysPattern()),
                inline = false,
                searchTextBox = this,

                resolveArguments = function(options) {
                    if (!options || Object.getPrototypeOf(options) !=
                        Object.getPrototypeOf({})) {
                        options = {};
                    } else {
                        if (!options.caseSensitive ||
                            typeof options.caseSensitive != "boolean") {
                            options.caseSensitive = false;
                        }

                        if (!options.orderlySearch ||
                            typeof options.orderlySearch != "boolean") {
                            options.orderlySearch = false;
                        }
                    }

                },

                resolveAmountChar = function(options) {
                    if (options.afterAmountChar) {
                        return options.afterAmountChar;
                    } else {
                        return 1;
                    }
                },

                inlineSearch = function(elements, options) {
                    var
                        eventListenerMethod,
                        resolvedList,
                        resolvedElementsParent,
                        foundElements,
                        i,
                        currentSearchText = searchTextBox.value(),
                        currentElements = elements.clone(true),
                        elements2Recovery = [];

                    if (typeof eventListenerMethod == "function") {
                        searchTextBox.off("input", eventListenerMethod);
                        searchTextBox.off("focus", eventListenerMethod);
                    }

                    eventListenerMethod = function(e) {
                        if (searchTextBox.value()) {
                            if (searchTextBox.value().length <
                                currentSearchText.length) {
                                i = searchTextBox.value().length - 1;
                                currentElements = elements2Recovery[i];
                            }

                            currentSearchText = searchTextBox.value();
                            resolvedList = resolveList(currentElements,
                                options.order);
                            foundElements = resolvedList.elements;

                            if (foundElements.some()) {
                                elements2Recovery.push(foundElements);
                                resolvedElementsParent = foundElements
                                    .parent().first().clone();
                                currentElements = resolvedElementsParent
                                    .append(foundElements);
                            }

                            callback.call($(this), foundElements, resolvedList
                                          .maps, e);
                        } else {
                            // a clone must be done because a change in one doesn't will be done on other
                            elements2Recovery = [];
                            currentElements = elements.clone(true);
                            callback.call($(this), $(), e);
                        }

                    };

                    searchTextBox.on("input", eventListenerMethod);
                    searchTextBox.on("focus", eventListenerMethod);
                },

                remoteSearch = function(options) {
                    var
                        amountChar = resolveAmountChar(options),
                        word,
                        prevText,
                        nextText,
                        elements,
                        params,
                        resolvedList,
                        clipboardData,

                        request = function(e) {
                            if (options.remote.params) {
                                params = options.remote.params
                                    .call(searchTextBox);
                            }

                            $.Ajax.new(options.remote.url
                                .call(searchTextBox), {
                                params: params,
                                progress: function(xhr) {
                                    if (options.remote.loading) {
                                        options.remote
                                            .loading(xhr, e);
                                    }
                                },
                                complete: function() {
                                    $(e.target).off("keypress");
                                },
                                success: function(r) {
                                    elements = $(r);
                                    // debugger
                                    resolvedList = resolveList(
                                        elements, options.order);
                                    callback.call(searchTextBox,
                                        resolvedList.elements,
                                        resolvedList.maps, e);
                                    if (elements.length) {
                                        inlineSearch(elements, options);
                                    }
                                }
                            });
                        };

                    searchTextBox.on("keyup", function(e) {
                        word = searchTextBox.value();

                        if (word.length > amountChar) {
                            inline = true;
                        } else if (word.length < amountChar) {
                            inline = false;
                        }

                        if (word.length == amountChar &&
                            !nonCharacterKeysPattern.test(e.key) &&
                            !inline &&
                            options.remote) {
                            $(e.target).on("keypress", function(e) {
                                e.preventDefault();
                            });

                            request(e);
                        }

                    });

                    searchTextBox.on("paste", function(e) {
                        word = searchTextBox.value();
                        prevText = word
                            .slice(0, searchTextBox.cursorStart());
                        nextText = word
                            .slice(searchTextBox.cursorEnd(), word.length);

                        clipboardData = e.clipboardData.getData("text");

                        if (word.length >= amountChar) {
                            inline = true;
                        } else {
                            inline = false;
                        }

                        word = prevText + clipboardData + nextText;

                        if (word.length >= amountChar &&
                            !inline &&
                            options.remote) {
                            searchTextBox.value(word);

                            request(e);
                            e.preventDefault();
                        }
                    });

                },

                mapIf = function(searchTextAsArray, textNodeAsArray) {
                    var
                        iterator,
                        sliceIndex,
                        regexp,
                        textNodeHashSet = Object
                            .asCountableLiteralObject(textNodeAsArray),
                        mapped = {},
                        count = 0,
                        index = 0,
                        previousIndex = -1;

                    if (textNodeHashSet.length >= searchTextAsArray.length) {
                        iterator = Iterable.Proxy.new(searchTextAsArray);
                        iterator.each(function(slice) {
                            slice = slice.trim();
                            index = Object.firstFromASlice(textNodeHashSet,
                                                             slice, index,
                                                             options
                                                             .caseSensitive);

                            if (index && ((options.orderlySearch &&
                                index > previousIndex) ||
                                !options.orderlySearch) &&
                                textNodeAsArray.countSlice(slice,
                                    options.caseSensitive) >=
                                    searchTextAsArray.count(slice)) {

                                previousIndex = index;

                                if (options.caseSensitive) {
                                    regexp = new RegExp(slice);
                                } else {
                                    regexp = new RegExp(slice, "i");
                                }

                                sliceIndex = textNodeAsArray[index]
                                    .search(regexp);
                                mapped[index] = textNodeAsArray[index]
                                    .slice(sliceIndex, sliceIndex + slice
                                           .length);
                                Object.delete(textNodeHashSet, index);
                                count += 1;
                            } else {
                                this.finalize();
                            }
                        });

                        if (count == searchTextAsArray.length) {
                            return mapped;
                        }
                    }

                    return false;
                },

                // resolveList = function(list, order = "desc") {
                resolveList = function(list, order) {
                    if (order != "asc") {order = "desc";}
                    var
                        textNode,
                        mapped,
                        textNodeAsArray,
                        sorted,
                        found = {elements: $(), maps: []},
                        textBoxContentArr = searchTextBox.value().split(" ")
                            .compact();

                    if (list.elements().count() == 1 &&
                        list.instanceOf(window.Element)) {
                        list = list.childElements();
                    }

                    if (order == "asc") {
                        sorted = list.ascendingSortTextNode();
                    } else {
                        sorted = list.descendingSortTextNode();
                    }

                    sorted.each(function(element) {
                        textNode = $(element).textContent().trim();
                        textNodeAsArray = textNode.split(" ");
                        mapped = mapIf(textBoxContentArr, textNodeAsArray);
                        if (mapped) {
                            found.elements.push(element);
                            found.maps.push(mapped);
                        }
                    });

                    return found;
                };

            resolveArguments(options);

            // init
            if (Object.getPrototypeOf(elementsList) != Object.prototype) {
                inlineSearch(elementsList, options);
            } else {
                options = elementsList;
                remoteSearch(options);
            }
        }

    });

})(esPhinx);
<commit_msg>improves autocomplete<commit_after>var
    esPhinx,
    Iterable;

(function($) {
    "use strict";

    $.prototype.extend({

        autocomplete: function(elementsList, options, callback) {
            var
                nonCharacterKeysPattern = new RegExp($
                    .nonCharacterKeysPattern()),
                inline = false,
                searchTextBox = this,

                resolveArguments = function(options) {
                    if (Object.getPrototypeOf(options) !=
                        Object.getPrototypeOf({})) {
                        options = {};
                    }

                    if (!options.caseSensitive ||
                        typeof options.caseSensitive != "boolean") {
                        options.caseSensitive = false;
                    }

                    if (!options.orderlySearch ||
                        typeof options.orderlySearch != "boolean") {
                        options.orderlySearch = false;
                    }

                    if (!options.afterAmountChar) {
                        options.afterAmountChar = 1;
                    }

                },

                resolveAmountChar = function(options) {
                    if (options.afterAmountChar) {
                        return options.afterAmountChar;
                    } else {
                        return 1;
                    }
                },

                inlineSearch = function(elements, options) {
                    var
                        eventListenerMethod,
                        resolvedList,
                        resolvedElementsParent,
                        foundElements,
                        i,
                        currentSearchText = searchTextBox.value(),
                        currentElements = elements.clone(true),
                        elements2Recovery = [];

                    if (typeof eventListenerMethod == "function") {
                        searchTextBox.off("input", eventListenerMethod);
                        searchTextBox.off("focus", eventListenerMethod);
                    }

                    eventListenerMethod = function(e) {
                        if (searchTextBox.value()) {
                            if (searchTextBox.value().length <
                                currentSearchText.length) {
                                i = searchTextBox.value().length +
                                    options.afterAmountChar - 2;
                                currentElements = elements2Recovery[i];
                            }

                            currentSearchText = searchTextBox.value();
                            resolvedList = resolveList(currentElements,
                                options.order);
                            foundElements = resolvedList.elements;

                            if (foundElements.some()) {
                                elements2Recovery.push(foundElements);
                                resolvedElementsParent = foundElements
                                    .parent().first().clone();
                                currentElements = resolvedElementsParent
                                    .append(foundElements);
                            }

                            callback.call($(this), foundElements, resolvedList
                                          .maps, e);
                        } else {
                            // a clone must be done because a change in one doesn't will be done on other
                            elements2Recovery = [];
                            currentElements = elements.clone(true);
                            callback.call($(this), $(), e);
                        }

                    };

                    searchTextBox.on("input", eventListenerMethod);
                    searchTextBox.on("focus", eventListenerMethod);
                },

                remoteSearch = function(options) {
                    var
                        word,
                        prevText,
                        nextText,
                        elements,
                        params,
                        resolvedList,
                        clipboardData,
                        amountChar = options.afterAmountChar,

                        request = function(e) {
                            if (options.remote.params) {
                                params = options.remote.params
                                    .call(searchTextBox);
                            }

                            $.Ajax.new(options.remote.url
                                .call(searchTextBox), {
                                params: params,
                                progress: function(xhr) {
                                    if (options.remote.loading) {
                                        options.remote
                                            .loading(xhr, e);
                                    }
                                },
                                complete: function() {
                                    $(e.target).off("keypress");
                                },
                                success: function(r) {
                                    elements = $(r);
                                    // debugger
                                    resolvedList = resolveList(
                                        elements, options.order);
                                    callback.call(searchTextBox,
                                        resolvedList.elements,
                                        resolvedList.maps, e);
                                    if (elements.length) {
                                        inlineSearch(elements, options);
                                    }
                                }
                            });
                        };

                    searchTextBox.on("keyup", function(e) {
                        word = searchTextBox.value();

                        if (word.length > amountChar) {
                            inline = true;
                        } else if (word.length < amountChar) {
                            inline = false;
                        }

                        if (word.length == amountChar &&
                            !nonCharacterKeysPattern.test(e.key) &&
                            !inline &&
                            options.remote) {
                            $(e.target).on("keypress", function(e) {
                                e.preventDefault();
                            });

                            request(e);
                        }

                    });

                    searchTextBox.on("paste", function(e) {
                        word = searchTextBox.value();
                        prevText = word
                            .slice(0, searchTextBox.cursorStart());
                        nextText = word
                            .slice(searchTextBox.cursorEnd(), word.length);

                        clipboardData = e.clipboardData.getData("text");

                        if (word.length >= amountChar) {
                            inline = true;
                        } else {
                            inline = false;
                        }

                        word = prevText + clipboardData + nextText;

                        if (word.length >= amountChar &&
                            !inline &&
                            options.remote) {
                            searchTextBox.value(word);

                            request(e);
                            e.preventDefault();
                        }
                    });

                },

                mapIf = function(searchTextAsArray, textNodeAsArray) {
                    var
                        iterator,
                        sliceIndex,
                        regexp,
                        textNodeHashSet = Object
                            .asCountableLiteralObject(textNodeAsArray),
                        mapped = {},
                        count = 0,
                        index = 0,
                        previousIndex = -1;

                    if (textNodeHashSet.length >= searchTextAsArray.length) {
                        iterator = Iterable.Proxy.new(searchTextAsArray);
                        iterator.each(function(slice) {
                            slice = slice.trim();
                            index = Object.firstFromASlice(textNodeHashSet,
                                                             slice, index,
                                                             options
                                                             .caseSensitive);

                            if (index && ((options.orderlySearch &&
                                index > previousIndex) ||
                                !options.orderlySearch) &&
                                textNodeAsArray.countSlice(slice,
                                    options.caseSensitive) >=
                                    searchTextAsArray.count(slice)) {

                                previousIndex = index;

                                if (options.caseSensitive) {
                                    regexp = new RegExp(slice);
                                } else {
                                    regexp = new RegExp(slice, "i");
                                }

                                sliceIndex = textNodeAsArray[index]
                                    .search(regexp);
                                mapped[index] = textNodeAsArray[index]
                                    .slice(sliceIndex, sliceIndex + slice
                                           .length);
                                Object.delete(textNodeHashSet, index);
                                count += 1;
                            } else {
                                this.finalize();
                            }
                        });

                        if (count == searchTextAsArray.length) {
                            return mapped;
                        }
                    }

                    return false;
                },

                // resolveList = function(list, order = "desc") {
                resolveList = function(list, order) {
                    if (order != "asc") {order = "desc";}
                    var
                        textNode,
                        mapped,
                        textNodeAsArray,
                        sorted,
                        found = {elements: $(), maps: []},
                        textBoxContentArr = searchTextBox.value().split(" ")
                            .compact();

                    if (list.elements().count() == 1 &&
                        list.instanceOf(window.Element)) {
                        list = list.childElements();
                    }

                    if (order == "asc") {
                        sorted = list.ascendingSortTextNode();
                    } else {
                        sorted = list.descendingSortTextNode();
                    }

                    sorted.each(function(element) {
                        textNode = $(element).textContent().trim();
                        textNodeAsArray = textNode.split(" ");
                        mapped = mapIf(textBoxContentArr, textNodeAsArray);
                        if (mapped) {
                            found.elements.push(element);
                            found.maps.push(mapped);
                        }
                    });

                    return found;
                };

            resolveArguments(options);

            // init
            if (Object.getPrototypeOf(elementsList) != Object.prototype) {
                inlineSearch(elementsList, options);
            } else {
                options = elementsList;
                remoteSearch(options);
            }
        }

    });

})(esPhinx);
<|endoftext|>


<commit_before>/* ***** BEGIN LICENSE BLOCK *****
 * Distributed under the BSD license:
 *
 * Copyright (c) 2010, Ajax.org B.V.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Ajax.org B.V. nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ***** END LICENSE BLOCK ***** */

define(function(require, exports, module) {
"use strict";

var propertyMap = {
    "background": {"#$0": 1},
    "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
    "background-image": {"url('/$0')": 1},
    "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
    "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2,},
    "background-attachment": {"scroll": 1, "fixed": 1},
    "background-size": {"cover": 1, "contain": 1},
    "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
    "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
    "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
    "border-top": 1,
    "border-right": 1,
    "border-bottom": 1,
    "border-left": 1,
    "border-color": {"#$0": 1},
    "border-width": 1,
    "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2,},
    "border-spacing": 1,
    "border-collapse": {"collapse": 1, "separate": 1},
    "bottom": {"px": 1, "em": 1, "%": 1},
    "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
    "clip": 1,
    "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
    "content": 1,
    "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
    "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
    "empty-cells": {"show": 1, "hide": 1},
    "float": {"left": 1, "right": 1, "none": 1},
    "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
    "font-size": {"px": 1, "em": 1, "%": 1},
    "font-weight": {"bold": 1, "normal": 1},
    "font-style": {"italic": 1, "normal": 1},
    "font-variant": {"normal": 1, "small-caps": 1},
    "font": 1,
    "height": {"px": 1, "em": 1, "%": 1},
    "left": {"px": 1, "em": 1, "%": 1},
    "letter-spacing": {"normal": 1},
    "line-height": {"normal": 1},
    "list-style": 1,
    "list-style-image": 1,
    "list-style-position": 1,
    "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
    "margin": {"px": 1, "em": 1, "%": 1},
    "margin-right": {"px": 1, "em": 1, "%": 1},
    "margin-left": {"px": 1, "em": 1, "%": 1},
    "margin-top": {"px": 1, "em": 1, "%": 1},
    "margin-bottom": {"px": 1, "em": 1, "%": 1},
    "max-height": {"px": 1, "em": 1, "%": 1},
    "max-width": {"px": 1, "em": 1, "%": 1},
    "min-height": {"px": 1, "em": 1, "%": 1},
    "min-width": {"px": 1, "em": 1, "%": 1},
    "outline": 1,
    "outline-color": 1,
    "outline-style": 1,
    "outline-width": 1,
    "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
    "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
    "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
    "padding": {"px": 1, "em": 1, "%": 1},
    "padding-top": {"px": 1, "em": 1, "%": 1},
    "padding-right": {"px": 1, "em": 1, "%": 1},
    "padding-bottom": {"px": 1, "em": 1, "%": 1},
    "padding-left": {"px": 1, "em": 1, "%": 1},
    "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
    "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
    "page-break-inside": 1,
    "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
    "right": {"px": 1, "em": 1, "%": 1},
    "table-layout": {"fixed": 1, "auto": 1},
    "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
    "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
    "text-indent": 1,
    "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
    "top": {"px": 1, "em": 1, "%": 1},
    "vertical-align": {"top": 1, "bottom": 1},
    "visibility": {"hidden": 1, "visible": 1},
    "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
    "width": {"px": 1, "em": 1, "%": 1},
    "word-spacing": {"normal": 1},
    "z-index": 1,

    // opacity
    "opacity": 1,
    "filter": {"alpha(opacity=$0100)": 1},

    "text-shadow": {"$02px 2px 2px #777": 1},
    "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},

    // border radius
    "border-radius": 1,
    "-moz-border-radius": 1,
    "-moz-border-radius-topright": 1,
    "-moz-border-radius-bottomright": 1,
    "-moz-border-radius-topleft": 1,
    "-moz-border-radius-bottomleft": 1,
    "-webkit-border-radius": 1,
    "-webkit-border-top-right-radius": 1,
    "-webkit-border-top-left-radius": 1,
    "-webkit-border-bottom-right-radius": 1,
    "-webkit-border-bottom-left-radius": 1,

    // dropshadows
    "-moz-box-shadow": 1,
    "-webkit-box-shadow": 1,

    // transformations
    "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
    "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
    "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};

var CssCompletions = function() {

};

(function() {

    this.getCompletions = function(state, session, pos, prefix) {
        var token = session.getTokenAt(pos.row, pos.column);

        if (!token)
            return [];
        if (state==='ruleset'){
            //css attribute value
            var line = session.getLine(pos.row).substr(0, pos.column);
            if (/:[^;]+$/.test(line)) {
                /([\w\-]+):[^:]*$/.test(line);

                return this.getPropertyValueCompletions(state, session, pos, prefix);
            } else {
                return this.getPropertyCompletions(state, session, pos, prefix);
            }
        }

        return [];
    };

    this.getPropertyCompletions = function(state, session, pos, prefix) {
        var properties = Object.keys(propertyMap);
        return properties.map(function(property){
            return {
                caption: property,
                snippet: property + ': $0',
                meta: "property",
                score: Number.MAX_VALUE
            };
        });
    };

    this.getPropertyValueCompletions = function(state, session, pos, prefix) {
        var line = session.getLine(pos.row).substr(0, pos.column);
        /([\w\-]+):[^:]*$/.test(line);
		var property = RegExp.$1;

        if (!property)
            return [];
        var values = [];
        if (property in propertyMap && typeof propertyMap[property] === "object") {
            values = Object.keys(propertyMap[property]);
        }
        return values.map(function(value){
            return {
                caption: value,
                snippet: value,
                meta: "property value",
                score: Number.MAX_VALUE
            };
        });
    };

}).call(CssCompletions.prototype);

exports.CssCompletions = CssCompletions;
});<commit_msg>add missing CSS properties<commit_after>/* ***** BEGIN LICENSE BLOCK *****
 * Distributed under the BSD license:
 *
 * Copyright (c) 2010, Ajax.org B.V.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Ajax.org B.V. nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ***** END LICENSE BLOCK ***** */

define(function(require, exports, module) {
"use strict";

var propertyMap = {
    "background": {"#$0": 1},
    "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
    "background-image": {"url('/$0')": 1},
    "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
    "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2,},
    "background-attachment": {"scroll": 1, "fixed": 1},
    "background-size": {"cover": 1, "contain": 1},
    "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
    "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
    "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
    "border-color": {"#$0": 1},
    "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2,},
    "border-collapse": {"collapse": 1, "separate": 1},
    "bottom": {"px": 1, "em": 1, "%": 1},
    "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
    "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
    "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
    "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
    "empty-cells": {"show": 1, "hide": 1},
    "float": {"left": 1, "right": 1, "none": 1},
    "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
    "font-size": {"px": 1, "em": 1, "%": 1},
    "font-weight": {"bold": 1, "normal": 1},
    "font-style": {"italic": 1, "normal": 1},
    "font-variant": {"normal": 1, "small-caps": 1},
    "height": {"px": 1, "em": 1, "%": 1},
    "left": {"px": 1, "em": 1, "%": 1},
    "letter-spacing": {"normal": 1},
    "line-height": {"normal": 1},
    "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
    "margin": {"px": 1, "em": 1, "%": 1},
    "margin-right": {"px": 1, "em": 1, "%": 1},
    "margin-left": {"px": 1, "em": 1, "%": 1},
    "margin-top": {"px": 1, "em": 1, "%": 1},
    "margin-bottom": {"px": 1, "em": 1, "%": 1},
    "max-height": {"px": 1, "em": 1, "%": 1},
    "max-width": {"px": 1, "em": 1, "%": 1},
    "min-height": {"px": 1, "em": 1, "%": 1},
    "min-width": {"px": 1, "em": 1, "%": 1},
    "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
    "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
    "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
    "padding": {"px": 1, "em": 1, "%": 1},
    "padding-top": {"px": 1, "em": 1, "%": 1},
    "padding-right": {"px": 1, "em": 1, "%": 1},
    "padding-bottom": {"px": 1, "em": 1, "%": 1},
    "padding-left": {"px": 1, "em": 1, "%": 1},
    "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
    "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
    "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
    "right": {"px": 1, "em": 1, "%": 1},
    "table-layout": {"fixed": 1, "auto": 1},
    "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
    "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
    "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
    "top": {"px": 1, "em": 1, "%": 1},
    "vertical-align": {"top": 1, "bottom": 1},
    "visibility": {"hidden": 1, "visible": 1},
    "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
    "width": {"px": 1, "em": 1, "%": 1},
    "word-spacing": {"normal": 1},

    // opacity
    "filter": {"alpha(opacity=$0100)": 1},

    "text-shadow": {"$02px 2px 2px #777": 1},
    "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},

    // border radius
    "-moz-border-radius": 1,
    "-moz-border-radius-topright": 1,
    "-moz-border-radius-bottomright": 1,
    "-moz-border-radius-topleft": 1,
    "-moz-border-radius-bottomleft": 1,
    "-webkit-border-radius": 1,
    "-webkit-border-top-right-radius": 1,
    "-webkit-border-top-left-radius": 1,
    "-webkit-border-bottom-right-radius": 1,
    "-webkit-border-bottom-left-radius": 1,

    // dropshadows
    "-moz-box-shadow": 1,
    "-webkit-box-shadow": 1,

    // transformations
    "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
    "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
    "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
};

//fill in missing properties
var style = document.createElement('c').style;

var name;
for (var i in style) {
    if (typeof style[i] !== 'string')
        continue;

    name = i.replace(/[A-Z]/g, function(x) {
        return '-' + x.toLowerCase();
    });

    if (!propertyMap.hasOwnProperty(name))
        propertyMap[name] = 1;
}

var CssCompletions = function() {

};

(function() {

    this.getCompletions = function(state, session, pos, prefix) {
        var token = session.getTokenAt(pos.row, pos.column);

        if (!token)
            return [];
        if (state==='ruleset'){
            //css attribute value
            var line = session.getLine(pos.row).substr(0, pos.column);
            if (/:[^;]+$/.test(line)) {
                /([\w\-]+):[^:]*$/.test(line);

                return this.getPropertyValueCompletions(state, session, pos, prefix);
            } else {
                return this.getPropertyCompletions(state, session, pos, prefix);
            }
        }

        return [];
    };

    this.getPropertyCompletions = function(state, session, pos, prefix) {
        var properties = Object.keys(propertyMap);
        return properties.map(function(property){
            return {
                caption: property,
                snippet: property + ': $0',
                meta: "property",
                score: Number.MAX_VALUE
            };
        });
    };

    this.getPropertyValueCompletions = function(state, session, pos, prefix) {
        var line = session.getLine(pos.row).substr(0, pos.column);
        /([\w\-]+):[^:]*$/.test(line);
		var property = RegExp.$1;

        if (!property)
            return [];
        var values = [];
        if (property in propertyMap && typeof propertyMap[property] === "object") {
            values = Object.keys(propertyMap[property]);
        }
        return values.map(function(value){
            return {
                caption: value,
                snippet: value,
                meta: "property value",
                score: Number.MAX_VALUE
            };
        });
    };

}).call(CssCompletions.prototype);

exports.CssCompletions = CssCompletions;
});
<|endoftext|>


<commit_before>import * as utils from '../../../src/js/plugins/tts/utils.js';

describe('toISO6391', () => {
    const { toISO6391 } = utils;

    test('ISO 639-1', () => {
        expect(toISO6391('en')).toBe('en');
        expect(toISO6391('fr')).toBe('fr');
        expect(toISO6391('SQ')).toBe('sq');
        expect(toISO6391('aa')).toBe('aa');
    });

    test('ISO 639-2/T', () => {
        expect(toISO6391('amh')).toBe('am');
        expect(toISO6391('BIH')).toBe('bh');
    });

    test('ISO 639-2/B', () => {
        expect(toISO6391('BAQ')).toBe('eu');
        expect(toISO6391('chi')).toBe('zh');
    });

    test('Name', () => {
        expect(toISO6391('english')).toBe('en');
        expect(toISO6391('German')).toBe('de');
    });

    test('Endonym', () => {
        expect(toISO6391('français')).toBe('fr');
        expect(toISO6391('汉语')).toBe('zh');
    });

    test('Mismatch', () => {
        expect(toISO6391('Parseltongue')).toBe(null);
        expect(toISO6391('Pig Latin')).toBe(null);
    });
});
<commit_msg>m: add toISO6391 test for falsey values<commit_after>import * as utils from '../../../src/js/plugins/tts/utils.js';

describe('toISO6391', () => {
    const { toISO6391 } = utils;

    test('ISO 639-1', () => {
        expect(toISO6391('en')).toBe('en');
        expect(toISO6391('fr')).toBe('fr');
        expect(toISO6391('SQ')).toBe('sq');
        expect(toISO6391('aa')).toBe('aa');
    });

    test('ISO 639-2/T', () => {
        expect(toISO6391('amh')).toBe('am');
        expect(toISO6391('BIH')).toBe('bh');
    });

    test('ISO 639-2/B', () => {
        expect(toISO6391('BAQ')).toBe('eu');
        expect(toISO6391('chi')).toBe('zh');
    });

    test('Name', () => {
        expect(toISO6391('english')).toBe('en');
        expect(toISO6391('German')).toBe('de');
    });

    test('Endonym', () => {
        expect(toISO6391('français')).toBe('fr');
        expect(toISO6391('汉语')).toBe('zh');
    });

    test('Mismatch', () => {
        expect(toISO6391('Parseltongue')).toBe(null);
        expect(toISO6391('Pig Latin')).toBe(null);
    });

    test('Falsey inputs', () => {
        expect(toISO6391(null)).toBe(null);
        expect(toISO6391('')).toBe(null);
    });
});
<|endoftext|>


<commit_before>import {helper} from '@ember/component/helper';
import {isArray} from '@ember/array';

export function cleanBasicHtml(html = '') {
    if (isArray(html)) {
        html = html[0];
    }

    let cleanHtml = html
        .replace(/
/g, ' ')
        .replace(/(\s| ){2,}/g, ' ')
        .trim()
        .replace(/^ |&nbsp$/g, '')
        .trim();

    // remove any elements that have a blank textContent
    if (cleanHtml) {
        let doc = new DOMParser().parseFromString(cleanHtml, 'text/html');

        doc.body.querySelectorAll('*').forEach((element) => {
            if (!element.textContent.trim()) {
                element.remove();
            }
        });

        cleanHtml = doc.body.innerHTML;
    }

    return cleanHtml;
}

export default helper(cleanBasicHtml);
<commit_msg>Koenig - Fixed error in `{{clean-basic-html}}` when passed null/undefined<commit_after>import {helper} from '@ember/component/helper';
import {isArray} from '@ember/array';

export function cleanBasicHtml(html = '') {
    if (isArray(html)) {
        html = html[0] || '';
    }

    let cleanHtml = html
        .replace(/
/g, ' ')
        .replace(/(\s| ){2,}/g, ' ')
        .trim()
        .replace(/^ |&nbsp$/g, '')
        .trim();

    // remove any elements that have a blank textContent
    if (cleanHtml) {
        let doc = new DOMParser().parseFromString(cleanHtml, 'text/html');

        doc.body.querySelectorAll('*').forEach((element) => {
            if (!element.textContent.trim()) {
                element.remove();
            }
        });

        cleanHtml = doc.body.innerHTML;
    }

    return cleanHtml;
}

export default helper(cleanBasicHtml);
<|endoftext|>


<commit_before>/**
* @license Apache-2.0
*
* Copyright (c) 2020 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 dapx
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dapx}
*/
setReadOnly( ns, 'dapx', require( '@stdlib/blas/ext/base/dapx' ) );

/**
* @name dapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dapxsum}
*/
setReadOnly( ns, 'dapxsum', require( '@stdlib/blas/ext/base/dapxsum' ) );

/**
* @name dapxsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dapxsumpw}
*/
setReadOnly( ns, 'dapxsumpw', require( '@stdlib/blas/ext/base/dapxsumpw' ) );

/**
* @name dasumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dasumpw}
*/
setReadOnly( ns, 'dasumpw', require( '@stdlib/blas/ext/base/dasumpw' ) );

/**
* @name dnanasum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnanasum}
*/
setReadOnly( ns, 'dnanasum', require( '@stdlib/blas/ext/base/dnanasum' ) );

/**
* @name dnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansum}
*/
setReadOnly( ns, 'dnansum', require( '@stdlib/blas/ext/base/dnansum' ) );

/**
* @name dnansumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansumkbn2}
*/
setReadOnly( ns, 'dnansumkbn2', require( '@stdlib/blas/ext/base/dnansumkbn2' ) );

/**
* @name dnansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansumors}
*/
setReadOnly( ns, 'dnansumors', require( '@stdlib/blas/ext/base/dnansumors' ) );

/**
* @name dnansumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansumpw}
*/
setReadOnly( ns, 'dnansumpw', require( '@stdlib/blas/ext/base/dnansumpw' ) );

/**
* @name dsapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsapxsum}
*/
setReadOnly( ns, 'dsapxsum', require( '@stdlib/blas/ext/base/dsapxsum' ) );

/**
* @name dsnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsnansum}
*/
setReadOnly( ns, 'dsnansum', require( '@stdlib/blas/ext/base/dsnansum' ) );

/**
* @name dsnansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsnansumors}
*/
setReadOnly( ns, 'dsnansumors', require( '@stdlib/blas/ext/base/dsnansumors' ) );

/**
* @name dssum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dssum}
*/
setReadOnly( ns, 'dssum', require( '@stdlib/blas/ext/base/dssum' ) );

/**
* @name dssumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dssumors}
*/
setReadOnly( ns, 'dssumors', require( '@stdlib/blas/ext/base/dssumors' ) );

/**
* @name dsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsum}
*/
setReadOnly( ns, 'dsum', require( '@stdlib/blas/ext/base/dsum' ) );

/**
* @name dsumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsumkbn2}
*/
setReadOnly( ns, 'dsumkbn2', require( '@stdlib/blas/ext/base/dsumkbn2' ) );

/**
* @name dsumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsumors}
*/
setReadOnly( ns, 'dsumors', require( '@stdlib/blas/ext/base/dsumors' ) );

/**
* @name dsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsumpw}
*/
setReadOnly( ns, 'dsumpw', require( '@stdlib/blas/ext/base/dsumpw' ) );

/**
* @name gapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gapxsum}
*/
setReadOnly( ns, 'gapxsum', require( '@stdlib/blas/ext/base/gapxsum' ) );

/**
* @name gapxsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gapxsumpw}
*/
setReadOnly( ns, 'gapxsumpw', require( '@stdlib/blas/ext/base/gapxsumpw' ) );

/**
* @name gnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansum}
*/
setReadOnly( ns, 'gnansum', require( '@stdlib/blas/ext/base/gnansum' ) );

/**
* @name gnansumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansumkbn2}
*/
setReadOnly( ns, 'gnansumkbn2', require( '@stdlib/blas/ext/base/gnansumkbn2' ) );

/**
* @name gnansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansumors}
*/
setReadOnly( ns, 'gnansumors', require( '@stdlib/blas/ext/base/gnansumors' ) );

/**
* @name gnansumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansumpw}
*/
setReadOnly( ns, 'gnansumpw', require( '@stdlib/blas/ext/base/gnansumpw' ) );

/**
* @name gsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsum}
*/
setReadOnly( ns, 'gsum', require( '@stdlib/blas/ext/base/gsum' ) );

/**
* @name gsumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsumkbn2}
*/
setReadOnly( ns, 'gsumkbn2', require( '@stdlib/blas/ext/base/gsumkbn2' ) );

/**
* @name gsumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsumors}
*/
setReadOnly( ns, 'gsumors', require( '@stdlib/blas/ext/base/gsumors' ) );

/**
* @name gsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsumpw}
*/
setReadOnly( ns, 'gsumpw', require( '@stdlib/blas/ext/base/gsumpw' ) );

/**
* @name sapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sapxsum}
*/
setReadOnly( ns, 'sapxsum', require( '@stdlib/blas/ext/base/sapxsum' ) );

/**
* @name sapxsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sapxsumpw}
*/
setReadOnly( ns, 'sapxsumpw', require( '@stdlib/blas/ext/base/sapxsumpw' ) );

/**
* @name sdsapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sdsapxsum}
*/
setReadOnly( ns, 'sdsapxsum', require( '@stdlib/blas/ext/base/sdsapxsum' ) );

/**
* @name sdsnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sdsnansum}
*/
setReadOnly( ns, 'sdsnansum', require( '@stdlib/blas/ext/base/sdsnansum' ) );

/**
* @name sdssum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sdssum}
*/
setReadOnly( ns, 'sdssum', require( '@stdlib/blas/ext/base/sdssum' ) );

/**
* @name snansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansum}
*/
setReadOnly( ns, 'snansum', require( '@stdlib/blas/ext/base/snansum' ) );

/**
* @name snansumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansumkbn2}
*/
setReadOnly( ns, 'snansumkbn2', require( '@stdlib/blas/ext/base/snansumkbn2' ) );

/**
* @name snansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansumors}
*/
setReadOnly( ns, 'snansumors', require( '@stdlib/blas/ext/base/snansumors' ) );

/**
* @name snansumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansumpw}
*/
setReadOnly( ns, 'snansumpw', require( '@stdlib/blas/ext/base/snansumpw' ) );

/**
* @name ssum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssum}
*/
setReadOnly( ns, 'ssum', require( '@stdlib/blas/ext/base/ssum' ) );

/**
* @name ssumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssumkbn2}
*/
setReadOnly( ns, 'ssumkbn2', require( '@stdlib/blas/ext/base/ssumkbn2' ) );

/**
* @name ssumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssumors}
*/
setReadOnly( ns, 'ssumors', require( '@stdlib/blas/ext/base/ssumors' ) );

/**
* @name ssumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssumpw}
*/
setReadOnly( ns, 'ssumpw', require( '@stdlib/blas/ext/base/ssumpw' ) );

// EXPORTS //

module.exports = ns;
<commit_msg>Update namespace<commit_after>/**
* @license Apache-2.0
*
* Copyright (c) 2020 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 dapx
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dapx}
*/
setReadOnly( ns, 'dapx', require( '@stdlib/blas/ext/base/dapx' ) );

/**
* @name dapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dapxsum}
*/
setReadOnly( ns, 'dapxsum', require( '@stdlib/blas/ext/base/dapxsum' ) );

/**
* @name dapxsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dapxsumpw}
*/
setReadOnly( ns, 'dapxsumpw', require( '@stdlib/blas/ext/base/dapxsumpw' ) );

/**
* @name dasumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dasumpw}
*/
setReadOnly( ns, 'dasumpw', require( '@stdlib/blas/ext/base/dasumpw' ) );

/**
* @name dnanasum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnanasum}
*/
setReadOnly( ns, 'dnanasum', require( '@stdlib/blas/ext/base/dnanasum' ) );

/**
* @name dnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansum}
*/
setReadOnly( ns, 'dnansum', require( '@stdlib/blas/ext/base/dnansum' ) );

/**
* @name dnansumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansumkbn2}
*/
setReadOnly( ns, 'dnansumkbn2', require( '@stdlib/blas/ext/base/dnansumkbn2' ) );

/**
* @name dnansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansumors}
*/
setReadOnly( ns, 'dnansumors', require( '@stdlib/blas/ext/base/dnansumors' ) );

/**
* @name dnansumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dnansumpw}
*/
setReadOnly( ns, 'dnansumpw', require( '@stdlib/blas/ext/base/dnansumpw' ) );

/**
* @name dsapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsapxsum}
*/
setReadOnly( ns, 'dsapxsum', require( '@stdlib/blas/ext/base/dsapxsum' ) );

/**
* @name dsnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsnansum}
*/
setReadOnly( ns, 'dsnansum', require( '@stdlib/blas/ext/base/dsnansum' ) );

/**
* @name dsnansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsnansumors}
*/
setReadOnly( ns, 'dsnansumors', require( '@stdlib/blas/ext/base/dsnansumors' ) );

/**
* @name dssum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dssum}
*/
setReadOnly( ns, 'dssum', require( '@stdlib/blas/ext/base/dssum' ) );

/**
* @name dssumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dssumors}
*/
setReadOnly( ns, 'dssumors', require( '@stdlib/blas/ext/base/dssumors' ) );

/**
* @name dsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsum}
*/
setReadOnly( ns, 'dsum', require( '@stdlib/blas/ext/base/dsum' ) );

/**
* @name dsumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsumkbn2}
*/
setReadOnly( ns, 'dsumkbn2', require( '@stdlib/blas/ext/base/dsumkbn2' ) );

/**
* @name dsumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsumors}
*/
setReadOnly( ns, 'dsumors', require( '@stdlib/blas/ext/base/dsumors' ) );

/**
* @name dsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/dsumpw}
*/
setReadOnly( ns, 'dsumpw', require( '@stdlib/blas/ext/base/dsumpw' ) );

/**
* @name gapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gapxsum}
*/
setReadOnly( ns, 'gapxsum', require( '@stdlib/blas/ext/base/gapxsum' ) );

/**
* @name gapxsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gapxsumpw}
*/
setReadOnly( ns, 'gapxsumpw', require( '@stdlib/blas/ext/base/gapxsumpw' ) );

/**
* @name gnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansum}
*/
setReadOnly( ns, 'gnansum', require( '@stdlib/blas/ext/base/gnansum' ) );

/**
* @name gnansumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansumkbn2}
*/
setReadOnly( ns, 'gnansumkbn2', require( '@stdlib/blas/ext/base/gnansumkbn2' ) );

/**
* @name gnansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansumors}
*/
setReadOnly( ns, 'gnansumors', require( '@stdlib/blas/ext/base/gnansumors' ) );

/**
* @name gnansumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gnansumpw}
*/
setReadOnly( ns, 'gnansumpw', require( '@stdlib/blas/ext/base/gnansumpw' ) );

/**
* @name gsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsum}
*/
setReadOnly( ns, 'gsum', require( '@stdlib/blas/ext/base/gsum' ) );

/**
* @name gsumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsumkbn2}
*/
setReadOnly( ns, 'gsumkbn2', require( '@stdlib/blas/ext/base/gsumkbn2' ) );

/**
* @name gsumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsumors}
*/
setReadOnly( ns, 'gsumors', require( '@stdlib/blas/ext/base/gsumors' ) );

/**
* @name gsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/gsumpw}
*/
setReadOnly( ns, 'gsumpw', require( '@stdlib/blas/ext/base/gsumpw' ) );

/**
* @name sapx
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sapx}
*/
setReadOnly( ns, 'sapx', require( '@stdlib/blas/ext/base/sapx' ) );

/**
* @name sapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sapxsum}
*/
setReadOnly( ns, 'sapxsum', require( '@stdlib/blas/ext/base/sapxsum' ) );

/**
* @name sapxsumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sapxsumpw}
*/
setReadOnly( ns, 'sapxsumpw', require( '@stdlib/blas/ext/base/sapxsumpw' ) );

/**
* @name sdsapxsum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sdsapxsum}
*/
setReadOnly( ns, 'sdsapxsum', require( '@stdlib/blas/ext/base/sdsapxsum' ) );

/**
* @name sdsnansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sdsnansum}
*/
setReadOnly( ns, 'sdsnansum', require( '@stdlib/blas/ext/base/sdsnansum' ) );

/**
* @name sdssum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/sdssum}
*/
setReadOnly( ns, 'sdssum', require( '@stdlib/blas/ext/base/sdssum' ) );

/**
* @name snansum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansum}
*/
setReadOnly( ns, 'snansum', require( '@stdlib/blas/ext/base/snansum' ) );

/**
* @name snansumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansumkbn2}
*/
setReadOnly( ns, 'snansumkbn2', require( '@stdlib/blas/ext/base/snansumkbn2' ) );

/**
* @name snansumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansumors}
*/
setReadOnly( ns, 'snansumors', require( '@stdlib/blas/ext/base/snansumors' ) );

/**
* @name snansumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/snansumpw}
*/
setReadOnly( ns, 'snansumpw', require( '@stdlib/blas/ext/base/snansumpw' ) );

/**
* @name ssum
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssum}
*/
setReadOnly( ns, 'ssum', require( '@stdlib/blas/ext/base/ssum' ) );

/**
* @name ssumkbn2
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssumkbn2}
*/
setReadOnly( ns, 'ssumkbn2', require( '@stdlib/blas/ext/base/ssumkbn2' ) );

/**
* @name ssumors
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssumors}
*/
setReadOnly( ns, 'ssumors', require( '@stdlib/blas/ext/base/ssumors' ) );

/**
* @name ssumpw
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/blas/ext/base/ssumpw}
*/
setReadOnly( ns, 'ssumpw', require( '@stdlib/blas/ext/base/ssumpw' ) );

// EXPORTS //

module.exports = ns;
<|endoftext|>


<commit_before>/**
* @license Apache-2.0
*
* Copyright (c) 2019 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 iterPulseWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/pulse-wave}
*/
setReadOnly( ns, 'iterPulseWave', require( '@stdlib/simulate/iter/pulse-wave' ) );

/**
* @name iterSawtoothWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/sawtooth-wave}
*/
setReadOnly( ns, 'iterSawtoothWave', require( '@stdlib/simulate/iter/sawtooth-wave' ) );

/**
* @name iterSineWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/sine-wave}
*/
setReadOnly( ns, 'iterSineWave', require( '@stdlib/simulate/iter/sine-wave' ) );

/**
* @name iterSquareWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/square-wave}
*/
setReadOnly( ns, 'iterSquareWave', require( '@stdlib/simulate/iter/square-wave' ) );

/**
* @name iterTriangleWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/triangle-wave}
*/
setReadOnly( ns, 'iterTriangleWave', require( '@stdlib/simulate/iter/triangle-wave' ) );

// EXPORTS //

module.exports = ns;
<commit_msg>Update namespace<commit_after>/**
* @license Apache-2.0
*
* Copyright (c) 2019 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 iterDiracComb
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/dirac-comb}
*/
setReadOnly( ns, 'iterDiracComb', require( '@stdlib/simulate/iter/dirac-comb' ) );

/**
* @name iterPulseWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/pulse-wave}
*/
setReadOnly( ns, 'iterPulseWave', require( '@stdlib/simulate/iter/pulse-wave' ) );

/**
* @name iterSawtoothWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/sawtooth-wave}
*/
setReadOnly( ns, 'iterSawtoothWave', require( '@stdlib/simulate/iter/sawtooth-wave' ) );

/**
* @name iterSineWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/sine-wave}
*/
setReadOnly( ns, 'iterSineWave', require( '@stdlib/simulate/iter/sine-wave' ) );

/**
* @name iterSquareWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/square-wave}
*/
setReadOnly( ns, 'iterSquareWave', require( '@stdlib/simulate/iter/square-wave' ) );

/**
* @name iterTriangleWave
* @memberof ns
* @readonly
* @type {Function}
* @see {@link module:@stdlib/simulate/iter/triangle-wave}
*/
setReadOnly( ns, 'iterTriangleWave', require( '@stdlib/simulate/iter/triangle-wave' ) );

// EXPORTS //

module.exports = ns;
<|endoftext|>