mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
15 lines
474 B
JavaScript
15 lines
474 B
JavaScript
import creator from "../creator.js";
|
|
import selector from "../selector.js";
|
|
|
|
function constantNull() {
|
|
return null;
|
|
}
|
|
|
|
export default function(name, before) {
|
|
var create = typeof name === "function" ? name : creator(name),
|
|
select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
|
|
return this.select(function() {
|
|
return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
|
|
});
|
|
}
|