ac-bundle-module-utils-hosting

utils/hosting.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: contentTypes, static

contentTypes

[object Object]
static

function(request, response) {
  if (app.has(app.hosting)) {
    var fs = require('fs');
    var path = require('path');
    var http = require('http');
    var resolvedBase = path.resolve(__dirname + "/hosting/");

ac-bundle-module-api-modernmt

api/modernmt.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: languagesCallback, translateWordCallback, translateHTMLCallback, translateCallback

languagesCallback

async function(callback, errorCallback) {
  var headers = {
    "Accept": "application/json",
    "Content-type": "application/json",
    "MMT-ApiKey": config.modernmt.key,
  };
  var result = await fetch(config.modernmt.link + "/languages", {headers: headers});
  if

ac-bundle-module-utils-text

utils/text.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: encodeEntities, decodeEntities, document, numeral, parse, strip, clean

encodeEntities

function encode(text, _a) {
    var _b = _a === void 0 ? defaultEncodeOptions : _a, _c = _b.mode, mode = _c ===

ac-bundle-module-utils-request

utils/request.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: data

data

async function(request, prop) {
  if (!app.has(prop)) prop = "";
  var data = await request.text();
  try { var json = JSON.parse(data); } catch (error) {}
  if (app.has(json)) {
    if

ac-bundle-module-utils-promise

utils/promise.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: wrap

wrap

function(value, p) {
  if (typeof value === "object") {
    p = value;
    value = "data";
  }
  return new Promise(function(resolve, reject) {
    p.then(function(d) {
      var data = {error: undefined};

ac-bundle-module-utils-username

utils/username.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: valid, exists

valid

function(value) {
  var re = /^\w+$/;
  return re.test(value) && value.length = 5;
}

exists

async function(username) {
  var {users, error} = await app.api.mysql.request("users", function(data) {}, `
    SELECT

ac-bundle-module-utils-user

utils/user.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: getByKey, getByKeyAndToken, getByEmail, list, save

getByKey

async function(key) {
  var {user, error} = await app.api.mysql.request("user", function(data) {}, `
    SELECT
      *
    FROM \`user\`
    WHERE
      \`key\`=` + app.api.mysql.escape(key) + `
  `);
  return

ac-bundle-module-utils-string

utils/string.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: toProperCase

toProperCase

function(str) {
  return str.replace(
    /\w\S*/g,
    function(txt) {
      return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    }
  );
}

Happy Coding!…

ac-bundle-module-utils-password

utils/password.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: test, medium, strong

test

function(password, level) {
  if (typeof level === "undefined") level = "medium";
  return mod[level]().test(password);
}

medium

function() {
  return new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");
}

strong

function() {
  return new

ac-bundle-module-storage-kv

storage/kv.js

A module for ac-bundle-app, published by ac-bundle-module.

Available Methods: namespace

namespace

function(namespaceKey) {
  var namespace = {
    get link() { return "getter"; return "getter";
      var link = "https://api.cloudflare.com/client/v4/accounts/" + appConfig.cloudflare.account + "/storage/kv/namespaces/" + namespaceKey;
      return link;
    },
    get: async