New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

roots-netlify

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roots-netlify - npm Package Compare versions

Comparing version
0.0.4
to
0.1.0
+1
-0
.travis.yml

@@ -6,1 +6,2 @@ language: node_js

- npm run coveralls
sudo: false
+6
-24

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.7.1
// Generated by CoffeeScript 1.10.0
(function() {
var RootsUtil, W, path, _;
var RootsUtil, W, _, path;

@@ -14,4 +14,3 @@ RootsUtil = require('roots-util');

module.exports = function(opts) {
var RootsNetlify, codes;
codes = ['200', '301', '302', '404'];
var RootsNetlify;
return RootsNetlify = (function() {

@@ -29,3 +28,2 @@ var write_headers, write_redirects;

redirects: {},
rewrites: {},
headers: {}

@@ -42,3 +40,3 @@ });

var k, v;
str += "" + path + "\n";
str += path + "\n";
for (k in conf) {

@@ -54,20 +52,4 @@ v = conf[k];

write_redirects = function() {
var redirects, res;
redirects = _.pick(this.opts.redirects, codes);
if (redirects['200'] == null) {
redirects['200'] = {};
}
if (redirects['301'] == null) {
redirects['301'] = {};
}
_.merge(redirects['200'], this.opts.rewrites);
_.merge(redirects['301'], _.omit(this.opts.redirects, codes));
res = _.reduce(redirects, function(str, conf, code) {
var k, v;
for (k in conf) {
v = conf[k];
str += "" + k + " " + v + " " + code + "\n";
}
return str;
}, '');
var res;
res = this.opts.redirects.join('\n');
return this.util.write('_redirects', res);

@@ -74,0 +56,0 @@ };

{
"name": "roots-netlify",
"version": "0.0.4",
"version": "0.1.0",
"description": "A roots extension for configuring netlify",

@@ -5,0 +5,0 @@ "main": "lib",

@@ -30,12 +30,10 @@ Roots Netlify

netlify
redirects:
'/news': '/blog'
'/news/:year/:month:/:date/:slug': '/blog/:year/:month/:date/:story_id'
'/news/*': '/blog/:splat'
'302':
'/temp_redirect': '/'
'404':
'/ecommerce': '/closed'
rewrites:
'/*': '/index.html'
redirects: [
'/news /blog 200'
'/news/:year/:month:/:date/:slug /blog/:year/:month/:date/:story_id 200'
'/news/* /blog/:splat 200'
'/redirect / 301'
'/temp_redirect / 302'
'/ecommerce /closed 404'
]
headers:

@@ -53,3 +51,3 @@ '/protected/path':

Redirects added to the `redirects` object return a status code of `301` while those added to the `rewrites` object will return `200` (a rewrite). Netlify also [supports](https://docs.netlify.com/redirects#http-status-codes) two other status codes: `302` and `404`. In order to configure your redirects for these, add a `302` or `404` key to `redirects` and nest your configuration object there (see example above).
The `redirects` property accepts an array of redirects or rewrite rules (in order) with their respective HTTP code appended at the end as described in Netlify's documentation.

@@ -56,0 +54,0 @@ ### Promises

@@ -7,4 +7,2 @@ RootsUtil = require 'roots-util'

module.exports = (opts) ->
codes = ['200', '301', '302', '404']
class RootsNetlify

@@ -17,3 +15,3 @@ constructor: (@roots) ->

.then (opts) ->
@opts = _.defaults(opts, {redirects: {}, rewrites: {}, headers: {}})
@opts = _.defaults(opts, {redirects: {}, headers: {}})
.then ->

@@ -31,13 +29,3 @@ W.all([write_headers.call(@), write_redirects.call(@)])

write_redirects = ->
redirects = _.pick(@opts.redirects, codes)
redirects['200'] ?= {}
redirects['301'] ?= {}
_.merge(redirects['200'], @opts.rewrites)
_.merge(redirects['301'], _.omit(@opts.redirects, codes))
res = _.reduce redirects, (str, conf, code) ->
for k, v of conf
str += "#{k} #{v} #{code}\n"
return str
, ''
res = @opts.redirects.join('\n')
@util.write '_redirects', res

@@ -7,12 +7,10 @@ netlify = require '../../..'

netlify
redirects:
'/news': '/blog'
'/news/:year/:month:/:date/:slug': '/blog/:year/:month/:date/:story_id'
'/news/*': '/blog/:splat'
'302':
'/temp_redirect': '/'
'404':
'/ecommerce': '/closed'
rewrites:
'/*': '/index.html'
redirects: [
'/* /index.html 200'
'/news /blog 301'
'/news/:year/:month:/:date/:slug /blog/:year/:month/:date/:story_id 301'
'/news/* /blog/:splat 301'
'/temp_redirect / 302'
'/ecommerce /closed 404'
]
headers:

@@ -19,0 +17,0 @@ '/protected/path':

@@ -5,12 +5,10 @@ netlify = require '../../..'

config =
redirects:
'/news': '/blog'
'/news/:year/:month:/:date/:slug': '/blog/:year/:month/:date/:story_id'
'/news/*': '/blog/:splat'
'302':
'/temp_redirect': '/'
'404':
'/ecommerce': '/closed'
rewrites:
'/*': '/index.html'
redirects: [
'/ecommerce /closed 404'
'/* /index.html 200'
'/news /blog 301'
'/news/:year/:month:/:date/:slug /blog/:year/:month/:date/:story_id 301'
'/news/* /blog/:splat 301'
'/temp_redirect / 302'
]
headers:

@@ -17,0 +15,0 @@ '/protected/path':

Sorry, the diff of this file is not supported yet