Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

normalize-walker

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

normalize-walker - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

2

package.json
{
"name": "normalize-walker",
"description": "Walk down dependencies of JS, CSS, HTML, etc. and create a tree. ",
"version": "0.1.5",
"version": "0.2.0",
"author": {

@@ -6,0 +6,0 @@ "name": "Jonathan Ong",

@@ -14,4 +14,2 @@

options = options || {}
walker.use(Walker.plugins.text(options))
walker.use(Walker.plugins.json(options))
walker.use(Walker.plugins.js(options))

@@ -18,0 +16,0 @@ walker.use(Walker.plugins.css(options))

@@ -14,4 +14,2 @@

options = options || {}
walker.use(Walker.plugins.text(options))
walker.use(Walker.plugins.json(options))
walker.use(Walker.plugins.js(options))

@@ -49,56 +47,2 @@ walker.use(Walker.plugins.css(options))

describe('js-html', function () {
var entrypoint = fixture('js-html')
var walker
var tree
var file
it('should walk', co(function* () {
walker = defaults(Walker().add(entrypoint))
tree = yield* walker.tree()
}))
it('should return the correct tree', co(function* () {
tree = tree[entrypoint]
assert(tree)
assert.equal(tree.uri, entrypoint)
file = tree.file.dependencies['./thing.html.js'].file
}))
it('should transform the string', co(function* () {
var string = yield* file.getString()
string = string.replace(/export default\s*/, '')
string = JSON.parse(string)
assert.deepEqual(string.trim(), '<body></body>')
}))
})
describe('js-json', function () {
var entrypoint = fixture('js-json')
var walker
var tree
var file
it('should walk', co(function* () {
walker = defaults(Walker().add(entrypoint))
tree = yield* walker.tree()
}))
it('should return the correct tree', co(function* () {
tree = tree[entrypoint]
assert(tree)
assert.equal(tree.uri, entrypoint)
file = tree.file.dependencies['./stuff.json.js'].file
}))
it('should transform the string', co(function* () {
var string = yield* file.getString()
string = string.replace(/export default\s*/, '')
string = JSON.parse(string)
assert.deepEqual(string, {
message: 'LOL'
})
}))
})
describe('js-circular', function () {

@@ -105,0 +49,0 @@ var entrypoint = fixture('js-circular')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc