-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from rdfjs-base/ci-update
chore: switched to github ci, switched to stricter-standard, updated deps
- Loading branch information
Showing
19 changed files
with
564 additions
and
540 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: CI | ||
on: push | ||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
node: | ||
- '12' | ||
- '14' | ||
- '16' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: npm install | ||
- run: npm test | ||
- run: npm run coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.idea | ||
coverage | ||
node_modules | ||
package-lock.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,165 +1,201 @@ | ||
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.rdf = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
var DataFactory = require('./lib/data-factory') | ||
|
||
module.exports = DataFactory | ||
|
||
},{"./lib/data-factory":3}],2:[function(require,module,exports){ | ||
function BlankNode (id) { | ||
this.value = id || ('b' + (++BlankNode.nextId)) | ||
} | ||
|
||
BlankNode.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value | ||
} | ||
|
||
BlankNode.prototype.termType = 'BlankNode' | ||
|
||
BlankNode.nextId = 0 | ||
|
||
module.exports = BlankNode | ||
|
||
},{}],3:[function(require,module,exports){ | ||
var BlankNode = require('./blank-node') | ||
var DefaultGraph = require('./default-graph') | ||
var Literal = require('./literal') | ||
var NamedNode = require('./named-node') | ||
var Quad = require('./quad') | ||
var Variable = require('./variable') | ||
|
||
function DataFactory () {} | ||
|
||
DataFactory.namedNode = function (value) { | ||
return new NamedNode(value) | ||
} | ||
|
||
DataFactory.blankNode = function (value) { | ||
return new BlankNode(value) | ||
} | ||
|
||
DataFactory.literal = function (value, languageOrDatatype) { | ||
if (typeof languageOrDatatype === 'string') { | ||
if (languageOrDatatype.indexOf(':') === -1) { | ||
return new Literal(value, languageOrDatatype) | ||
} | ||
|
||
return new Literal(value, null, DataFactory.namedNode(languageOrDatatype)) | ||
} | ||
|
||
return new Literal(value, null, languageOrDatatype) | ||
} | ||
|
||
DataFactory.defaultGraph = function () { | ||
return DataFactory.defaultGraphInstance | ||
} | ||
|
||
DataFactory.variable = function (value) { | ||
return new Variable(value) | ||
} | ||
|
||
DataFactory.triple = function (subject, predicate, object) { | ||
return DataFactory.quad(subject, predicate, object) | ||
} | ||
|
||
DataFactory.quad = function (subject, predicate, object, graph) { | ||
return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance) | ||
} | ||
|
||
DataFactory.defaultGraphInstance = new DefaultGraph() | ||
|
||
module.exports = DataFactory | ||
|
||
},{"./blank-node":2,"./default-graph":4,"./literal":5,"./named-node":6,"./quad":7,"./variable":8}],4:[function(require,module,exports){ | ||
function DefaultGraph () { | ||
this.value = '' | ||
} | ||
|
||
DefaultGraph.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType | ||
} | ||
|
||
DefaultGraph.prototype.termType = 'DefaultGraph' | ||
|
||
module.exports = DefaultGraph | ||
|
||
},{}],5:[function(require,module,exports){ | ||
var NamedNode = require('./named-node') | ||
|
||
function Literal (value, language, datatype) { | ||
this.value = value | ||
this.datatype = Literal.stringDatatype | ||
this.language = '' | ||
|
||
if (language) { | ||
this.language = language | ||
this.datatype = Literal.langStringDatatype | ||
} else if (datatype) { | ||
this.datatype = datatype | ||
} | ||
} | ||
|
||
Literal.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value && | ||
other.language === this.language && other.datatype.equals(this.datatype) | ||
} | ||
|
||
Literal.prototype.termType = 'Literal' | ||
Literal.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString') | ||
Literal.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string') | ||
|
||
module.exports = Literal | ||
|
||
},{"./named-node":6}],6:[function(require,module,exports){ | ||
function NamedNode (iri) { | ||
this.value = iri | ||
} | ||
|
||
NamedNode.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value | ||
} | ||
|
||
NamedNode.prototype.termType = 'NamedNode' | ||
|
||
module.exports = NamedNode | ||
|
||
},{}],7:[function(require,module,exports){ | ||
var DefaultGraph = require('./default-graph') | ||
|
||
function Quad (subject, predicate, object, graph) { | ||
this.subject = subject | ||
this.predicate = predicate | ||
this.object = object | ||
|
||
if (graph) { | ||
this.graph = graph | ||
(function (f) { | ||
if (typeof exports === 'object' && typeof module !== 'undefined') { | ||
module.exports = f() | ||
} else if (typeof define === 'function' && define.amd) { | ||
define([], f) | ||
} else { | ||
this.graph = new DefaultGraph() | ||
let g; if (typeof window !== 'undefined') { | ||
g = window | ||
} else if (typeof global !== 'undefined') { | ||
g = global | ||
} else if (typeof self !== 'undefined') { | ||
g = self | ||
} else { | ||
g = this | ||
}g.rdf = f() | ||
} | ||
} | ||
|
||
Quad.prototype.equals = function (other) { | ||
// `|| !other.termType` is for backwards-compatibility with old factories without RDF* support. | ||
return !!other && (other.termType === 'Quad' || !other.termType) && | ||
})(function () { | ||
let define, module, exports; return (function () { | ||
function r (e, n, t) { | ||
function o (i, f) { | ||
if (!n[i]) { | ||
if (!e[i]) { | ||
const c = typeof require === 'function' && require; if (!f && c) { | ||
return c(i, !0) | ||
} if (u) { | ||
return u(i, !0) | ||
} const a = new Error("Cannot find module '" + i + "'"); throw a.code = 'MODULE_NOT_FOUND', a | ||
} const p = n[i] = { exports: {} }; e[i][0].call(p.exports, function (r) { | ||
const n = e[i][1][r]; return o(n || r) | ||
}, p, p.exports, r, e, n, t) | ||
} return n[i].exports | ||
} for (var u = typeof require === 'function' && require, i = 0; i < t.length; i++) { | ||
o(t[i]) | ||
} return o | ||
} return r | ||
})()({ | ||
1: [function (require, module, exports) { | ||
const DataFactory = require('./lib/data-factory') | ||
|
||
module.exports = DataFactory | ||
}, { './lib/data-factory': 3 }], | ||
2: [function (require, module, exports) { | ||
function BlankNode (id) { | ||
this.value = id || ('b' + (++BlankNode.nextId)) | ||
} | ||
|
||
BlankNode.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value | ||
} | ||
|
||
BlankNode.prototype.termType = 'BlankNode' | ||
|
||
BlankNode.nextId = 0 | ||
|
||
module.exports = BlankNode | ||
}, {}], | ||
3: [function (require, module, exports) { | ||
const BlankNode = require('./blank-node') | ||
const DefaultGraph = require('./default-graph') | ||
const Literal = require('./literal') | ||
const NamedNode = require('./named-node') | ||
const Quad = require('./quad') | ||
const Variable = require('./variable') | ||
|
||
function DataFactory () {} | ||
|
||
DataFactory.namedNode = function (value) { | ||
return new NamedNode(value) | ||
} | ||
|
||
DataFactory.blankNode = function (value) { | ||
return new BlankNode(value) | ||
} | ||
|
||
DataFactory.literal = function (value, languageOrDatatype) { | ||
if (typeof languageOrDatatype === 'string') { | ||
if (languageOrDatatype.indexOf(':') === -1) { | ||
return new Literal(value, languageOrDatatype) | ||
} | ||
|
||
return new Literal(value, null, DataFactory.namedNode(languageOrDatatype)) | ||
} | ||
|
||
return new Literal(value, null, languageOrDatatype) | ||
} | ||
|
||
DataFactory.defaultGraph = function () { | ||
return DataFactory.defaultGraphInstance | ||
} | ||
|
||
DataFactory.variable = function (value) { | ||
return new Variable(value) | ||
} | ||
|
||
DataFactory.triple = function (subject, predicate, object) { | ||
return DataFactory.quad(subject, predicate, object) | ||
} | ||
|
||
DataFactory.quad = function (subject, predicate, object, graph) { | ||
return new Quad(subject, predicate, object, graph || DataFactory.defaultGraphInstance) | ||
} | ||
|
||
DataFactory.defaultGraphInstance = new DefaultGraph() | ||
|
||
module.exports = DataFactory | ||
}, { './blank-node': 2, './default-graph': 4, './literal': 5, './named-node': 6, './quad': 7, './variable': 8 }], | ||
4: [function (require, module, exports) { | ||
function DefaultGraph () { | ||
this.value = '' | ||
} | ||
|
||
DefaultGraph.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType | ||
} | ||
|
||
DefaultGraph.prototype.termType = 'DefaultGraph' | ||
|
||
module.exports = DefaultGraph | ||
}, {}], | ||
5: [function (require, module, exports) { | ||
const NamedNode = require('./named-node') | ||
|
||
function Literal (value, language, datatype) { | ||
this.value = value | ||
this.datatype = Literal.stringDatatype | ||
this.language = '' | ||
|
||
if (language) { | ||
this.language = language | ||
this.datatype = Literal.langStringDatatype | ||
} else if (datatype) { | ||
this.datatype = datatype | ||
} | ||
} | ||
|
||
Literal.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value && | ||
other.language === this.language && other.datatype.equals(this.datatype) | ||
} | ||
|
||
Literal.prototype.termType = 'Literal' | ||
Literal.langStringDatatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString') | ||
Literal.stringDatatype = new NamedNode('http://www.w3.org/2001/XMLSchema#string') | ||
|
||
module.exports = Literal | ||
}, { './named-node': 6 }], | ||
6: [function (require, module, exports) { | ||
function NamedNode (iri) { | ||
this.value = iri | ||
} | ||
|
||
NamedNode.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value | ||
} | ||
|
||
NamedNode.prototype.termType = 'NamedNode' | ||
|
||
module.exports = NamedNode | ||
}, {}], | ||
7: [function (require, module, exports) { | ||
const DefaultGraph = require('./default-graph') | ||
|
||
function Quad (subject, predicate, object, graph) { | ||
this.subject = subject | ||
this.predicate = predicate | ||
this.object = object | ||
|
||
if (graph) { | ||
this.graph = graph | ||
} else { | ||
this.graph = new DefaultGraph() | ||
} | ||
} | ||
|
||
Quad.prototype.equals = function (other) { | ||
// `|| !other.termType` is for backwards-compatibility with old factories without RDF* support. | ||
return !!other && (other.termType === 'Quad' || !other.termType) && | ||
other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && | ||
other.object.equals(this.object) && other.graph.equals(this.graph) | ||
} | ||
|
||
Quad.prototype.termType = 'Quad' | ||
Quad.prototype.value = '' | ||
|
||
module.exports = Quad | ||
} | ||
|
||
},{"./default-graph":4}],8:[function(require,module,exports){ | ||
function Variable (name) { | ||
this.value = name | ||
} | ||
Quad.prototype.termType = 'Quad' | ||
Quad.prototype.value = '' | ||
|
||
Variable.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value | ||
} | ||
module.exports = Quad | ||
}, { './default-graph': 4 }], | ||
8: [function (require, module, exports) { | ||
function Variable (name) { | ||
this.value = name | ||
} | ||
|
||
Variable.prototype.termType = 'Variable' | ||
Variable.prototype.equals = function (other) { | ||
return !!other && other.termType === this.termType && other.value === this.value | ||
} | ||
|
||
module.exports = Variable | ||
Variable.prototype.termType = 'Variable' | ||
|
||
},{}]},{},[1])(1) | ||
}); | ||
module.exports = Variable | ||
}, {}] | ||
}, {}, [1])(1) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
var DataFactory = require('./lib/data-factory') | ||
const DataFactory = require('./lib/data-factory') | ||
|
||
module.exports = DataFactory |
Oops, something went wrong.