was.js

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 33  →  ?path2? @ 32
File deleted
/trunk/package-lock.json
/trunk/package.json
@@ -1,30 +1,29 @@
{
"author": {
"name": "Wizardry and Steamworks",
"email": "office@grimore.org"
"engines": {
"node": ">= 0.10.0"
},
"contributors": [
{
"name": "Wizardry and Steamworks",
"email": "office@grimore.org"
}
],
"description": "Original repo at http://svn.grimore.org/was.js",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-jshint": "~0.11.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify-es": "git+https://github.com/gruntjs/grunt-contrib-uglify.git#harmony",
"grunt-contrib-watch": "~0.6.1"
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-uglify-es": "git+https://github.com/gruntjs/grunt-contrib-uglify.git#harmony"
},
"name": "was.js",
"description": "Original repo at http://svn.grimore.org/was.js",
"version": "1.0.1",
"main": "dist/was.min.js",
"directories": {
"test": "test"
},
"engines": {
"node": ">= 0.10.0"
"scripts": {
"test": "tap test/*.js"
},
"homepage": "http://grimore.org",
"repository": {
"type": "git",
"url": "svn+http://svn.grimore.org/was.js"
},
"keywords": [
"wizardry",
"steamworks",
@@ -34,15 +33,8 @@
"utilities",
"extensions"
],
"author": "Wizardry and Steamworks <office@grimore.org>",
"license": "GPL-3.0",
"main": "dist/was.min.js",
"name": "was.js",
"repository": {
"type": "git",
"url": "svn+http://svn.grimore.org/was.js"
},
"scripts": {
"test": "tap test/*.js"
},
"version": "1.0.0"
"homepage": "http://grimore.org",
"dependencies": {}
}
/trunk/dist/was.js
@@ -1,6 +1,6 @@
/*! was.js - v1.0.0 - 2018-02-11
/*! was.js - v1.0.0 - 2018-01-24
* http://grimore.org
* Copyright (c) 2018 [object Object]; Licensed GPL-3.0 */
* Copyright (c) 2018 Wizardry and Steamworks <office@grimore.org>; Licensed GPL-3.0 */
/* Copyright (C) 2017 Wizardry and Steamworks - License: GNU GPLv3 */
/*************************************************************************/
function wasProduct(a, b) {
/trunk/dist/was.min.js
@@ -1,5 +1,5 @@
/*! was.js - v1.0.0 - 2018-02-11
/*! was.js - v1.0.0 - 2018-01-24
* http://grimore.org
* Copyright (c) 2018 [object Object]; Licensed GPL-3.0 */
* Copyright (c) 2018 Wizardry and Steamworks <office@grimore.org>; Licensed GPL-3.0 */
 
function wasProduct(r,t){for(var e=Math.max(r.length,t.length),n={},a=0;a<e;++a)n[r[a]]=t[a];return n}function wasStride(r,t){return r.filter(function(r,e){return e%t==0})}function wasChunk(r,t){return r.length?[r.slice(0,t)].concat(r.slice(t).wasChunk(t)):[]}function wasEquals(r,t){if(!t)return!1;if(r.length!==t.length)return!1;for(var e=0,n=r.length;e<n;e++)if(r[e]instanceof Array&&t[e]instanceof Array){if(!r[e].equals(t[e]))return!1}else if(r[e]!==t[e])return!1;return!0}function wasCSVToArray(r){var t=[],e=[],n="";do{var a=r.charAt(0);if(r=r.slice(1,r.length),","!==a)if('"'!==a||r.charAt(0)!==a)if('"'!==a)n+=a;else{if(e[e.length-1]!==a){e.push(a);continue}e.pop()}else n+=a,r=r.slice(1,r.length);else{if('"'!==e[e.length-1]){t.push(n),n="";continue}n+=a}}while(""!==r);return t.push(n),t}function wasArrayToCSV(r){for(var t=[],e=0;e<r.length;++e){var n=r[e].toString().replace('"','""');/"\s,\r\n/.test(n)?t[e]='"'+n+'"':t[e]=n}return t.join()}function wasKeyValueToObject(r){var t={};return r.reduce(function(r,t,e){return r[e=Math.floor(e/2)]||(r[e]=[]),r[e].push(t),r},[]).forEach(function(r,e,n){t[r[0]]=r[1]},t),t}function wasSwitch(r,t,...e){if(e.length%2!=0)throw"Pairs of predicates expected for cases";(Array.isArray(r)?r:[r]).forEach(r=>{for(var n=!1,a=0;a<e.length;a+=2)e[a](r)&&e[a+1](r)&&(n=!0);n||t(r)})}function wasMapValueToRange(r,t,e,n,a){return n+(a-n)*(r-t)/(e-t)}function wasHexToRGB(r){r=r.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(r,t,e,n){return t+t+e+e+n+n});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function wasRGBToHex(r,t,e){return"#"+((1<<24)+(r<<16)+(t<<8)+e).toString(16).slice(1)}Array.prototype.product||(Array.prototype.product=function(r){return wasProduct(this,r)}),"function"==typeof jQuery&&$.extend({product:wasProduct}),Array.prototype.stride||(Array.prototype.stride=function(r){return wasStride(this,r)}),"function"==typeof jQuery&&$.extend({stride:wasStride}),Array.prototype.chunk||(Array.prototype.chunk=function(r,t){return wasChunk(this,t)}),"function"==typeof jQuery&&$.extend({chunk:wasChunk}),Array.prototype.equals||(Array.prototype.equals=function(r,t){return wasEquals(this,t)}),"function"==typeof jQuery&&$.extend({equals:wasEquals}),module.exports.collections={product:wasProduct,stride:wasStride,chunk:wasChunk,equals:wasEquals},module.exports.formats={CSVToArray:wasCSVToArray,ArrayToCSV:wasArrayToCSV},module.exports.formats={KeyValueToObject:wasKeyValueToObject},Array.prototype.switch||(Array.prototype.switch=function(r,...t){wasSwitch(this,r,...t)}),"function"==typeof jQuery&&$.extend({switch:wasSwitch}),module.exports.lambda={switch:wasSwitch},module.exports.mathematics={MapValueToRange:wasMapValueToRange},module.exports.physics={HexToRGB:wasHexToRGB,RGBToHex:wasRGBToHex};