Skip to content

Commit

Permalink
drop util/assign.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kfule authored and dead-claudia committed Oct 31, 2024
1 parent fa0c90d commit 41ef2d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
3 changes: 1 addition & 2 deletions api/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ var m = require("../render/hyperscript")
var buildPathname = require("../pathname/build")
var parsePathname = require("../pathname/parse")
var compileTemplate = require("../pathname/compileTemplate")
var assign = require("../util/assign")
var censor = require("../util/censor")

var sentinel = {}
Expand Down Expand Up @@ -78,7 +77,7 @@ module.exports = function($window, mountRedraw) {
.slice(route.prefix.length)
var data = parsePathname(path)

assign(data.params, $window.history.state)
Object.assign(data.params, $window.history.state)

function reject(e) {
console.error(e)
Expand Down
3 changes: 1 addition & 2 deletions pathname/build.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use strict"

var buildQueryString = require("../querystring/build")
var assign = require("../util/assign")

// Returns `path` from `template` + `params`
module.exports = function(template, params) {
Expand All @@ -16,7 +15,7 @@ module.exports = function(template, params) {
var path = template.slice(0, pathEnd)
var query = {}

assign(query, params)
Object.assign(query, params)

var resolved = path.replace(/:([^\/\.-]+)(\.{3})?/g, function(m, key, variadic) {
delete query[key]
Expand Down
5 changes: 2 additions & 3 deletions render/hyperscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
var Vnode = require("../render/vnode")
var hyperscriptVnode = require("./hyperscriptVnode")
var hasOwn = require("../util/hasOwn")
var assign = require("../util/assign")

var selectorParser = /(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g
var selectorCache = Object.create(null)
Expand Down Expand Up @@ -40,7 +39,7 @@ function execSelector(state, vnode) {
vnode.tag = state.tag

if (state.attrs != null) {
attrs = assign({}, state.attrs, attrs)
attrs = Object.assign({}, state.attrs, attrs)

if (className != null || state.attrs.className != null) attrs.className =
className != null
Expand All @@ -60,7 +59,7 @@ function execSelector(state, vnode) {
// The DOM does things to inputs based on the "type", so it needs set first.
// See: https://github.com/MithrilJS/mithril.js/issues/2622
if (state.tag === "input" && hasOwn.call(attrs, "type")) {
attrs = assign({type: attrs.type}, attrs)
attrs = Object.assign({type: attrs.type}, attrs)
}

vnode.attrs = attrs
Expand Down
4 changes: 0 additions & 4 deletions util/assign.js

This file was deleted.

0 comments on commit 41ef2d1

Please sign in to comment.