Skip to content

Commit ce8f65b

Browse files
committed
Code changed to be Node 4.x compatible.
1 parent cee3447 commit ce8f65b

File tree

7 files changed

+42
-116
lines changed

7 files changed

+42
-116
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ jspm_packages
3535

3636
# Optional REPL history
3737
.node_repl_history
38+
39+
tests/output/*

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
node_js:
3+
- "4"
4+
- "5"
5+
- "6"
6+
- "7"
7+
- "node"
8+
install:
9+
- npm install
10+
script: npm test

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const phpArrayLoader = require('php-array-loader')
2-
const jsonLoader = require('json-loader')
1+
var phpArrayLoader = require('php-array-loader')
2+
var jsonLoader = require('json-loader')
33

44
/**
55
* The Laravel Localization loader.
66
* @param {string} source The source contents.
77
* @return {string} The parsed contents.
88
*/
9-
const laravelLocalizationLoader = function(source) {
10-
const isPHP = ~source.indexOf('<?php')
9+
var laravelLocalizationLoader = function(source) {
10+
var isPHP = ~source.indexOf('<?php')
1111

1212
if (isPHP) {
1313
return phpArrayLoader(source)

tests/fixtures/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const message = require('./resources/lang/en/messages.php')
1+
var message = require('./resources/lang/en/messages.php')
22
console.log(message);

tests/loader.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const path = require('path')
2-
const merge = require('webpack-merge')
3-
const webpack = require('webpack')
1+
var path = require('path')
2+
var merge = require('webpack-merge')
3+
var webpack = require('webpack')
44

55
test('should load PHP Laravel translation file', () => {
66
return runWebpack({
@@ -16,7 +16,7 @@ test('should load PHP Laravel translation file', () => {
1616

1717
function runWebpack(config) {
1818
return new Promise((resolve, reject) => {
19-
const webpackConfig = merge({
19+
var webpackConfig = merge({
2020
output: {
2121
path: path.join(__dirname, 'output'),
2222
filename: 'translation.js',
@@ -38,7 +38,7 @@ function runWebpack(config) {
3838
}, config)
3939

4040
webpack(webpackConfig, (webpackError, stats) => {
41-
const error = webpackError ||
41+
var error = webpackError ||
4242
(stats.hasErrors() && stats.compilation.errors[0]) ||
4343
(stats.hasWarnings() && stats.compilation.warnings[0])
4444
if (error) {

tests/output/translation.js

Lines changed: 0 additions & 87 deletions
This file was deleted.

yarn.lock

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,11 @@ hash-base@^2.0.0:
10391039
inherits "^2.0.1"
10401040

10411041
hash.js@^1.0.0, hash.js@^1.0.3:
1042-
version "1.0.3"
1043-
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573"
1042+
version "1.1.1"
1043+
resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.1.tgz#5cb2e796499224e69fd0b00ed01d2d4a16e7a323"
10441044
dependencies:
1045-
inherits "^2.0.1"
1045+
inherits "^2.0.3"
1046+
minimalistic-assert "^1.0.0"
10461047

10471048
hawk@~3.1.3:
10481049
version "3.1.3"
@@ -1113,7 +1114,7 @@ inflight@^1.0.4:
11131114
once "^1.3.0"
11141115
wrappy "1"
11151116

1116-
inherits@2, inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1:
1117+
inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3:
11171118
version "2.0.3"
11181119
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
11191120

@@ -1850,8 +1851,8 @@ number-is-nan@^1.0.0:
18501851
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
18511852

18521853
"nwmatcher@>= 1.3.9 < 2.0.0":
1853-
version "1.4.0"
1854-
resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.0.tgz#b4389362170e7ef9798c3c7716d80ebc0106fccf"
1854+
version "1.4.1"
1855+
resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.1.tgz#7ae9b07b0ea804db7e25f05cb5fe4097d4e4949f"
18551856

18561857
oauth-sign@~0.8.1:
18571858
version "0.8.2"
@@ -2005,14 +2006,14 @@ performance-now@^0.2.0:
20052006
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
20062007

20072008
php-array-loader@^1.0.0:
2008-
version "1.0.0"
2009-
resolved "https://registry.yarnpkg.com/php-array-loader/-/php-array-loader-1.0.0.tgz#06ab82268285fddd14d74828191b373272557cfb"
2009+
version "1.0.1"
2010+
resolved "https://registry.yarnpkg.com/php-array-loader/-/php-array-loader-1.0.1.tgz#78173cc8aadbda57b8491f5dffe144afb9eadd71"
20102011
dependencies:
20112012
php-array-parser "^1.0.0"
20122013

20132014
php-array-parser@^1.0.0:
2014-
version "1.0.0"
2015-
resolved "https://registry.yarnpkg.com/php-array-parser/-/php-array-parser-1.0.0.tgz#af4060607b9f79c7e14a52bf11eaff660de583cb"
2015+
version "1.0.1"
2016+
resolved "https://registry.yarnpkg.com/php-array-parser/-/php-array-parser-1.0.1.tgz#9da12683c3bebbe228a7e238c716435437631eaa"
20162017
dependencies:
20172018
php-parser "^2.0.3"
20182019

@@ -2132,14 +2133,14 @@ read-pkg@^1.0.0:
21322133
path-type "^1.0.0"
21332134

21342135
readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.6:
2135-
version "2.2.11"
2136-
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.11.tgz#0796b31f8d7688007ff0b93a8088d34aa17c0f72"
2136+
version "2.3.0"
2137+
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.0.tgz#640f5dcda88c91a8dc60787145629170813a1ed2"
21372138
dependencies:
21382139
core-util-is "~1.0.0"
2139-
inherits "~2.0.1"
2140+
inherits "~2.0.3"
21402141
isarray "~1.0.0"
21412142
process-nextick-args "~1.0.6"
2142-
safe-buffer "~5.0.1"
2143+
safe-buffer "~5.1.0"
21432144
string_decoder "~1.0.0"
21442145
util-deprecate "~1.0.1"
21452146

@@ -2245,14 +2246,14 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
22452246
hash-base "^2.0.0"
22462247
inherits "^2.0.1"
22472248

2248-
safe-buffer@^5.0.1, safe-buffer@~5.0.1:
2249-
version "5.0.1"
2250-
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"
2251-
2252-
safe-buffer@^5.1.0:
2249+
safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.1.0:
22532250
version "5.1.0"
22542251
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223"
22552252

2253+
safe-buffer@~5.0.1:
2254+
version "5.0.1"
2255+
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"
2256+
22562257
sane@~1.5.0:
22572258
version "1.5.0"
22582259
resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3"

0 commit comments

Comments
 (0)