-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrrdfj.min.js
10 lines (10 loc) · 1.68 KB
/
rrdfj.min.js
1
2
3
4
5
6
7
8
9
10
/*
rRDFj.js - Reduced RDF as JSON library
Copyright (c) 2012 WIllow Systems Corporation (www.willow-systems.com)
"MIT" License
https://github.com/willowsystems/rRDFj.js
*/
(function(){var e=function(b){var c={},e=function(a,d){var c=[],f;b.each(this,function(d,b){f=this[b][a];null!==f&&c.push(f)},this);return 0===c.length?d:b(c).chain().flatten().uniq().value()},g=function(a){b.each(this,a,this);return this},h=function(a){return b.map(this,a,this)},j=function(a){var d={},c;if(null==a)return d;if("function"===typeof a)c=a;else if(b.isArray(a))c=function(c,d){return-1!==b.indexOf(a,d)};else if("object"===typeof a){var f=b.keys(null!=a.data?a.data:a).sort();c=function(a,
c){return-1!==b.indexOf(f,c,!0)}}else{var e=this[a];if(null===e)return{};d[a]=e;return d}b.each(this,function(a,b,e){c.call(this,a,b,e)&&(d[b]=this[b])},this);return d},k=function(a){var c=b.keys(this);return 0===c.length?null==a?{}:a:this[c[0]]};c.filter=function(a){return new this.constructor(j.call(this.data,a))};c.each=c.forEach=function(a){g.call(this.data,a);return this};c.single=function(a){return k.call(this.data,a)};c.valuesfor=function(a){return e.call(this.data,a)};c.map=function(a){return h.call(this.data,
a)};var l=function(a){var b;this.data=a===b?{}:a;for(b in c)c.hasOwnProperty(b)&&(this[b]=c[b])};return function(a){return new l(a)}};if("function"===typeof define&&null!=define.amd)define(["underscore"],function(b){return e(b)});else{if(null==this._||null==this._.each||null==this._.map||null==this._.filter)throw Error("rRDFj requires Underscore.js for some of its functionality. Underscore is not detected. rRDFj Failing to initialize...");this.rRDFj=e(this._)}}).call("undefined"!==typeof window?window:
this);